CorPinvokeMap Enumeration


Specifies options for a PInvoke call.

typedef enum  CorPinvokeMap {  
    pmNoMangle          = 0x0001,  
    pmCharSetMask       = 0x0006,  
    pmCharSetNotSpec    = 0x0000,  
    pmCharSetAnsi       = 0x0002,  
    pmCharSetUnicode    = 0x0004,  
    pmCharSetAuto       = 0x0006,  
    pmBestFitUseAssem   = 0x0000,  
    pmBestFitEnabled    = 0x0010,  
    pmBestFitDisabled   = 0x0020,  
    pmBestFitMask       = 0x0030,  
    pmThrowOnUnmappableCharUseAssem   = 0x0000,  
    pmThrowOnUnmappableCharEnabled    = 0x1000,  
    pmThrowOnUnmappableCharDisabled   = 0x2000,  
    pmThrowOnUnmappableCharMask       = 0x3000,  
    pmSupportsLastError = 0x0040,   
    pmCallConvMask      = 0x0700,  
    pmCallConvWinapi    = 0x0100,  
    pmCallConvCdecl     = 0x0200,  
    pmCallConvStdcall   = 0x0300,  
    pmCallConvThiscall  = 0x0400,  
    pmCallConvFastcall  = 0x0500,  
    pmMaxValue          = 0xFFFF  
} CorPinvokeMap;  

pmNoMangleUse each member name as specified.
pmCharSetAnsiMarshal strings as multiple-byte character strings.
pmCharSetUnicodeMarshal strings as Unicode 2-byte characters.
pmCharSetAutoAutomatically marshal strings appropriately for the target operating system. The default is Unicode on Windows NT, Windows 2000, Windows XP, and the Windows Server 2003 family; the default is ANSI on Windows 98 and Windows Me.
pmBestFitEnabledPerform best-fit mapping of Unicode characters that lack an exact match in the ANSI character set.
pmBestFitDisabledDo not perform best-fit mapping of Unicode characters. In this case, all unmappable characters will be replaced by a ‘?’.
pmThrowOnUnmappableCharEnabledThrow an exception when the interop marshaler encounters an unmappable character.
pmThrowOnUnmappableCharDisabledDo not throw an exception when the interop marshaler encounters an unmappable character.
pmSupportsLastErrorAllow the callee to call the Win32 SetLastError function before returning from the attributed method.
pmCallConvWinapiUse the default platform calling convention. For example, on Windows the default is StdCall and on Windows CE .NET it is Cdecl.
pmCallConvCdeclUse the Cdecl calling convention. In this case, the caller cleans the stack. This enables calling functions with varargs (that is, functions that accept a variable number of parameters).
pmCallConvStdcallUse the StdCall calling convention. In this case, the callee cleans the stack. This is the default convention for calling unmanaged functions with platform invoke.
pmCallConvThiscallUse the ThisCall calling convention. In this case, the first parameter is the this pointer and is stored in register ECX. Other parameters are pushed on the stack. The ThisCall calling convention is used to call methods on classes exported from an unmanaged DLL.

Platforms: See System Requirements.

Header: CorHdr.h

.NET Framework Versions: Available since 1.0

Metadata Enumerations