Do not assume pointers are 32-bit in several Windows device calls.

This commit is contained in:
2018-06-20 18:52:54 +01:00
parent e92b6c6715
commit dc1884f5d8
3 changed files with 17 additions and 17 deletions

View File

@@ -737,7 +737,7 @@ namespace DiscImageChef.Devices.Windows
commandData.deviceDataBufferSize];
IntPtr hBuf = Marshal.AllocHGlobal(commandB.Length);
Marshal.StructureToPtr(commandData, hBuf, true);
IntPtr descriptorOffset = new IntPtr(hBuf.ToInt32() + commandData.size);
IntPtr descriptorOffset = IntPtr.Add(hBuf, commandData.size);
Marshal.StructureToPtr(commandDescriptor, descriptorOffset, true);
Marshal.Copy(hBuf, commandB, 0, commandB.Length);
Marshal.FreeHGlobal(hBuf);