This method of the DllLib class maps a raw pointer onto a structure. This method simulates a C-style cast of an arbitrary pointer to a structure.
public static native Object ptrToStruct(Class structClass, int ptr, boolean fFreeIndirectNativeMemory);
Returns an instance of structClass.
structClass | The structure to map the raw pointer to. This class must have been declared using @dll.struct. |
ptr | The raw pointer to be mapped. |
fFreeIndirectNativeMemory | If true, the native memory used for any reference fields (strings, interfaces, and so on) are released appropriately. |
Note The ptrToStruct method was added as of versions 2925 through 3167 of the Microsoft virtual machine.