Marshal.PtrToStructure<T> Method (IntPtr, T)
[Supported in the .NET Framework 4.5.1 and later versions]
Marshals data from an unmanaged block of memory to a managed object of the specified type.
Assembly: mscorlib (in mscorlib.dll)
[SecurityCriticalAttribute] public static void PtrToStructure<T>( IntPtr ptr, T structure )
A pointer to an unmanaged block of memory.
The object to which the data is to be copied.
The type of structure. This must be a formatted class.
IntPtr values. You cannot use this method overload with value types.is often necessary in COM interop and platform invoke when structure parameters are represented as
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
Available since 8
Available since 4.5.1
Portable Class Library
Supported in: portable .NET platforms
Available since 8.1