Marshal

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

See Also