Unsupported Scenarios and Other Special Cases

Windows SigGen

Unsupported Scenarios and Other Special Cases

In the current version, the tool doesn’t support converting unmanaged signatures in the following scenarios:

  • Const value types, such as const int a = 1
  • Explicit cast macro definition, such as #define A (char)1
  • Macro functions, such as #define Min(a,b)?a:b
  • Macros involving expressions, such as #define A (1+2-0.1)
  • Nested macros such as #define A TEXT("AA")
  • Typedefs that are equivalent to primitive types, such as typedef int A
  • Functions with a variable number of arguments
  • C++ language features, such as classes, templates, and namespaces
  • The DLL name in DllImportAttribute might be unknown if the functions are implemented in .lib file, the functions are user defined, or in other cases that the DLL name cannot be determined.

Check MSDN for help in manually generating signatures for the above scenarios. Some other special cases are:

  • The built-in types and APIs are from Visual Studio 2005 with Service Pack 1. For the types and APIs from other versions, you may need to copy the necessary declarations from the corresponding header files, and paste it into the SigImp Translate Snippet tool to see the results.
  • When no calling convention is specified in unmanaged code, it’s recommended that you review the generated code and make sure that the calling convention is correct.