Mono Class Library: System.Runtime.InteropServices Namespace

System.Runtime.InteropServices.UnmanagedType Enumeration

Identifies how parameters or fields are to be marshaled to unmanaged code.
[System.Runtime.InteropServices.ComVisible(true)]
public enum UnmanagedType

Remarks

This type provides a set of values that identify the native types that are supported by the CLI. Each native type is encoded by a different value. All encoding values in the range 0-63, inclusive, are reserved for backward compatibility with existing implementations of the CLI. Values in the range 64-127 are reserved for future use in this and related Standards.

Members

Member NameDescription
AnsiBStrDocumentation for this section has not yet been entered.
AsAnyDocumentation for this section has not yet been entered.
Bool Specifies a 4-byte Boolean value where true is denoted by all non-zero values and false is denoted by zero.
BStrDocumentation for this section has not yet been entered.
ByValArray

Specifies an array of fixed size. This unmanaged type is valid only for an array in a structure.

When MarshalAsAttribute.Value is set to ByValArray, the MarshalAsAttribute.SizeConst field is required to contain the number of elements in the array.

ByValTStrDocumentation for this section has not yet been entered.
CurrencyDocumentation for this section has not yet been entered.
CustomMarshaler Specifies the custom marshaler class when used with MarshalAsAttribute.MarshalType or MarshalAsAttribute.MarshalTypeRef .
ErrorDocumentation for this section has not yet been entered.
FunctionPtr Specifies a function pointer.
I1 Specifies a 1-byte signed integer.
I2 Specifies a 2-byte signed integer.
I4 Specifies a 4-byte signed integer.
I8 Specifies an 8-byte signed integer.
IDispatchDocumentation for this section has not yet been entered.
InterfaceDocumentation for this section has not yet been entered.
IUnknownDocumentation for this section has not yet been entered.
LPArraySpecifies a C-style array. When marshaling from managed to unmanaged, the length of the array is determined by the length of the managed array. When marshaling from unmanaged to managed, the length of the array is determined from the MarshalAsAttribute.SizeConst and MarshalAsAttribute.SizeParamIndex fields.
LPStr Specifies a pointer to an ANSI character string.
LPStructDocumentation for this section has not yet been entered.
LPTStr

Specifies a pointer to the preferred character string representation for the current platform.

Note: A type library exported with an LPTStr on an ANSI platform will have a different size than one exported on a Unicode platform.

LPWStr Specifies a pointer to a Unicode character string.
R4 Specifies a 4-byte floating-point number.
R8 Specifies an 8-byte floating-point number.
SafeArrayDocumentation for this section has not yet been entered.
Struct A C-style structure, used to marshal managed formatted classes and value types.
SysInt Specifies an implementation-specific sized signed integer.
SysUIntSpecifies an implementation-specific sized unsigned integer.
TBStrSpecifies a pointer to the preferred BSTR representation for the current platform - Unicode or SBCS.
U1

Specifies a 1-byte unsigned integer.

Note: UnmanagedType.U1 can be used to marshal a char parameter as an ANSI character.

U2

Specifies a 2-byte unsigned integer.

Note: UnmanagedType.U2 can be used to marshal a char parameter as a Unicode character.

U4 Specifies a 4-byte unsigned integer.
U8 Specifies an 8-byte unsigned integer.
VariantBoolDocumentation for this section has not yet been entered.
VBByRefStrDocumentation for this section has not yet been entered.

Requirements

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0