Marshal.PtrToStructure Method (IntPtr, Type)
For apps that target Windows Phone OS 7.0 and 7.1, do not use any members of this type in your app. If you do, your code will throw a MethodAccessException. This type is security-critical, which restricts it to internal use by the .NET Framework for Windows Phone class library.
Assembly: mscorlib (in mscorlib.dll)
A managed object containing the data pointed to by the ptr parameter.
[SECURITY CRITICAL]
Namespace:
System.Runtime.InteropServices[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Marshals data from an unmanaged block of memory to a newly allocated managed object of the specified type.
Assembly: mscorlib (in mscorlib.dll)
[SecurityCriticalAttribute] public static Object PtrToStructure( IntPtr ptr, Type structureType )
Parameters
- ptr
- Type: System.IntPtr
A pointer to an unmanaged block of memory.
- structureType
- Type: System.Type
The Type of object to be created. This type object must represent a formatted class or a structure.
Return Value
Type: System.ObjectA managed object containing the data pointed to by the ptr parameter.
Show: