Marshal Methods
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Include Protected Members
Include Inherited Members
Include Silverlight Members
Include Silverlight for Windows Phone Members
Include XNA Framework Members
This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
The Marshal type exposes the following members.
Methods
Name | Description | |
---|---|---|
Copy(array<Byte[], Int32, IntPtr, Int32) | Security Critical. Copies data from a one-dimensional, managed 8-bit unsigned integer array to an unmanaged memory pointer. | |
Copy(array<Char[], Int32, IntPtr, Int32) | Security Critical. Copies data from a one-dimensional, managed character array to an unmanaged memory pointer. | |
Copy(array<Double[], Int32, IntPtr, Int32) | Security Critical. Copies data from a one-dimensional, managed double-precision floating-point number array to an unmanaged memory pointer. | |
Copy(array<Int16[], Int32, IntPtr, Int32) | Security Critical. Copies data from a one-dimensional, managed 16-bit signed integer array to an unmanaged memory pointer. | |
Copy(array<Int32[], Int32, IntPtr, Int32) | Security Critical. Copies data from a one-dimensional, managed 32-bit signed integer array to an unmanaged memory pointer. | |
Copy(array<Int64[], Int32, IntPtr, Int32) | Security Critical. Copies data from a one-dimensional, managed 64-bit signed integer array to an unmanaged memory pointer. | |
Copy(IntPtr, array<Byte[], Int32, Int32) | Security Critical. Copies data from an unmanaged memory pointer to a managed 8-bit unsigned integer array. | |
Copy(IntPtr, array<Char[], Int32, Int32) | Security Critical. Copies data from an unmanaged memory pointer to a managed character array. | |
Copy(IntPtr, array<Double[], Int32, Int32) | Security Critical. Copies data from an unmanaged memory pointer to a managed double-precision floating-point number array. | |
Copy(IntPtr, array<Int16[], Int32, Int32) | Security Critical. Copies data from an unmanaged memory pointer to a managed 16-bit signed integer array. | |
Copy(IntPtr, array<Int32[], Int32, Int32) | Security Critical. Copies data from an unmanaged memory pointer to a managed 32-bit signed integer array. | |
Copy(IntPtr, array<Int64[], Int32, Int32) | Security Critical. Copies data from an unmanaged memory pointer to a managed 64-bit signed integer array. | |
Copy(IntPtr, array<Single[], Int32, Int32) | Security Critical. Copies data from an unmanaged memory pointer to a managed single-precision floating-point number array. | |
Copy(array<Single[], Int32, IntPtr, Int32) | Security Critical. Copies data from a one-dimensional, managed single-precision floating-point number array to an unmanaged memory pointer. | |
GetDelegateForFunctionPointer | Security Critical. Converts an unmanaged function pointer to a delegate. | |
GetExceptionForHR | Security Critical. Converts the specified HRESULT error code to a corresponding Exception object. | |
GetFunctionPointerForDelegate | Security Critical. Converts a delegate into a function pointer callable from unmanaged code. | |
GetHRForException | Security Critical. Converts the specified exception to an HRESULT. | |
GetLastWin32Error | Security Critical. Returns the error code returned by the last unmanaged function called using platform invoke that has the DllImportAttribute.SetLastError flag set. | |
Prelink | Security Critical. Executes one-time method setup tasks without calling the method. | |
PrelinkAll | Security Critical. Performs a pre-link check for all methods on a class. | |
PtrToStringAnsi(IntPtr) | Security Critical. Copies all characters up to the first null from an unmanaged ANSI string to a managed String. Widens each ANSI character to Unicode. | |
PtrToStringAnsi(IntPtr, Int32) | Security Critical. Allocates a managed String, copies a specified number of characters from an unmanaged ANSI string into it, and widens each ANSI character to Unicode. | |
PtrToStringUni(IntPtr) | Security Critical. Allocates a managed String and copies all characters up to the first null character from an unmanaged Unicode string into it. | |
PtrToStringUni(IntPtr, Int32) | Security Critical. Copies a specified number of characters from a Unicode string stored in native heap to a managed String. | |
PtrToStructure(IntPtr, Object) | Security Critical. Marshals data from an unmanaged block of memory to a managed object. | |
PtrToStructure(IntPtr, Type) | Security Critical. Marshals data from an unmanaged block of memory to a newly allocated managed object of the specified type. | |
ReadByte(IntPtr) | Security Critical. Reads a single byte from an unmanaged pointer. | |
ReadByte(IntPtr, Int32) | Security Critical. Reads a single byte at a given offset (or index) from an unmanaged pointer. | |
ReadInt16(IntPtr) | Security Critical. Reads a 16-bit signed integer from the unmanaged memory. | |
ReadInt16(IntPtr, Int32) | Security Critical. Reads a 16-bit signed integer from unmanaged memory. | |
ReadInt32(IntPtr) | Security Critical. Reads a 32-bit signed integer from unmanaged memory. | |
ReadInt32(IntPtr, Int32) | Security Critical. Reads a 32-bit signed integer from unmanaged memory. | |
ReadInt64(IntPtr) | Security Critical. Reads a 64-bit signed integer from unmanaged memory. | |
ReadInt64(IntPtr, Int32) | Security Critical. Reads a 64-bit signed integer from unmanaged memory. | |
ReadIntPtr | Security Critical. Reads a processor native sized integer from unmanaged memory. | |
SizeOf(Object) | Returns the unmanaged size of an object in bytes. | |
SizeOf(Type) | Returns the size of an unmanaged type in bytes. | |
StructureToPtr | Security Critical. Marshals data from a managed object to an unmanaged block of memory. | |
ThrowExceptionForHR(Int32) | Security Critical. Throws an exception with a specific failure HRESULT value. | |
ThrowExceptionForHR(Int32, IntPtr) | Security Critical. Throws an exception with a specific failure HRESULT. | |
WriteByte(IntPtr, Byte) | Security Critical. Writes a single byte value to unmanaged memory. | |
WriteByte(IntPtr, Int32, Byte) | Security Critical. Writes a single byte value to unmanaged memory. | |
WriteInt16(IntPtr, Int16) | Security Critical. Writes a 16-bit integer value to unmanaged memory. | |
WriteInt16(IntPtr, Int32, Int16) | Security Critical. Writes a 16-bit signed integer value into unmanaged memory. | |
WriteInt32(IntPtr, Int32) | Security Critical. Writes a 32-bit signed integer value to unmanaged memory. | |
WriteInt32(IntPtr, Int32, Int32) | Security Critical. Writes a 32-bit signed integer value into unmanaged memory. | |
WriteInt64(IntPtr, Int64) | Security Critical. Writes a 64-bit signed integer value to unmanaged memory. | |
WriteInt64(IntPtr, Int32, Int64) | Security Critical. Writes a 64-bit signed integer value to unmanaged memory. | |
WriteIntPtr | Security Critical. Writes a processor native sized integer value into unmanaged memory. |
Top