diff --git a/Dalamud/SafeMemory.cs b/Dalamud/SafeMemory.cs index d4f79714e..fb61453f3 100644 --- a/Dalamud/SafeMemory.cs +++ b/Dalamud/SafeMemory.cs @@ -190,8 +190,20 @@ namespace Dalamud return WriteBytes(address, encoding.GetBytes(str + "\0")); } + /// + /// Marshals data from an unmanaged block of memory to a managed object. + /// + /// The type to create. + /// The address to read from. + /// The read object, or null, if it could not be read. public static T? PtrToStructure(IntPtr addr) where T : struct => (T?)PtrToStructure(addr, typeof(T)); + /// + /// Marshals data from an unmanaged block of memory to a managed object. + /// + /// The address to read from. + /// The type to create. + /// The read object, or null, if it could not be read. public static object? PtrToStructure(IntPtr addr, Type type) { var size = Marshal.SizeOf(type);