System::Runtime::InteropServices::Marshal class

Marshal class

Provides marshalling implementation. For compatibility with translated code only, as no managed code is supported on C++ side. This is a static type with no instance services. You should never create instances of it by any means.

class Marshal

Methods

MethodDescription
static AllocHGlobal(int32_t)Allocates unmanaged memory.
static AllocHGlobal(IntPtr)Allocates unmanaged memory.
static Copy(const IntPtr, container&&, int, int)Implements public static void Copy(IntPtr source, byte[] destination, int startIndex, int length) semantics.
static Copy(const void *, container&&, int, int)Implements public static void Copy(IntPtr source, byte[] destination, int startIndex, int length) semantics.
static Copy(const container&, int, void *, int)Implements public static void Copy(char[] source, int startIndex, IntPtr destination, int length).
static Copy(const container&, int, IntPtr, int)Implements public static void Copy(char[] source, int startIndex, IntPtr destination, int length).
static FreeHGlobal(IntPtr)Frees unmanaged memory.
static GetDelegateForFunctionPointer(IntPtr)Converts an unmanaged function pointer to a delegate of a specified type.
static GetHRForException(const System::Exception&)Gets HResult from exception.
static PtrToStringAnsi(IntPtr)Creates a managed String from an unmanaged zero-terminated UTF8-string.
static PtrToStringAnsi(IntPtr, int)Creates a managed String from an unmanaged UTF8-string.
static PtrToStringAuto(IntPtr)Creates a managed String from an unmanaged zero-terminated string.
static PtrToStringAuto(IntPtr, int)Creates a managed String from an unmanaged string.
static PtrToStringUni(IntPtr)Creates a managed String from an unmanaged zero-terminated unicode string.
static PtrToStringUni(IntPtr, int)Creates a managed String from an unmanaged unicode string.
static PtrToStringUTF8(IntPtr)Creates a managed String from an unmanaged zero-terminated UTF8-string.
static PtrToStringUTF8(IntPtr, int)Creates a managed String from an unmanaged UTF8-string.
static ReadByte(IntPtr, int)Reads byte from memory.
static ReadInt16(IntPtr, int)Reads short from memory.
static ReadInt32(IntPtr, int)Reads int from memory.
static ReadIntPtr(IntPtr, int)Reads IntPtr from memory.
static SecureStringToGlobalAllocAnsi(const SharedPtr<Security::SecureString>&)Copies contents of specified secure string into unmanaged memory, converting into ANSI format.
static SecureStringToGlobalAllocUnicode(const SharedPtr<Security::SecureString>&)Copies contents of specified secure string into unmanaged memory.
static StringToHGlobalAnsi(const String&)Copies the contents of a specified string into unmanaged memory.
static StringToHGlobalAuto(const String&)Copies the contents of a specified string into unmanaged memory, converting to ANSI format if required.
static StringToHGlobalUni(const String&)Copies the contents of a specified string into unmanaged memory.
static WriteByte(IntPtr, int, uint8_t)Writes byte to memory.
static WriteByte(IntPtr, uint8_t)Writes byte to memory.
static WriteInt16(IntPtr, int, int16_t)Writes short to memory.
static WriteInt32(IntPtr, int, int32_t)Writes int to memory.
static WriteInt64(IntPtr, int, int64_t)Writes long to memory.
static WriteIntPtr(IntPtr, int, IntPtr)Writes IntPtr to memory.
static ZeroFreeGlobalAllocAnsi(IntPtr)Frees unmanaged string pointer that was allocated using the SecureStringToGlobalAllocAnsi method.
static ZeroFreeGlobalAllocUnicode(IntPtr)Frees unmanaged string pointer that was allocated using the SecureStringToGlobalAllocUnicode method.

See Also