1
0

Update SmartArrayControllerTool.cpp

This commit is contained in:
Benjamin Höglinger-Stelzer 2023-06-26 10:15:41 +02:00
parent be117c279a
commit 3df30bbd04

View File

@ -139,18 +139,24 @@ int wmain(int argc, wchar_t* argv[])
sptwb.spt.Cdb[0] = 0x26;
sptwb.spt.Cdb[6] = 0x11;
unsigned short bebufsize = htons(sizeof(id_ctlr));
memcpy(&sptwb.spt.Cdb[7], &bebufsize, 2);
const unsigned short reqSize = htons(sizeof(id_ctlr));
memcpy(&sptwb.spt.Cdb[7], &reqSize, 2);
length = offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS, ucDataBuf) + sptwb.spt.DataTransferLength;
std::wcout << std::dec
<< L"Total struct size: " << sizeof(SCSI_PASS_THROUGH_WITH_BUFFERS)
<< L", Calculated length: " << length
<< L", Header length: " << sptwb.spt.Length
<< std::endl;
BOOL ret = DeviceIoControl(
handle,
IOCTL_SCSI_PASS_THROUGH,
&sptwb,
sizeof(SCSI_PASS_THROUGH) + sptwb.spt.SenseInfoLength,
&sptwb,
sizeof(SCSI_PASS_THROUGH_WITH_BUFFERS),
length,
&returned,
NULL
);
@ -261,4 +267,4 @@ int wmain(int argc, wchar_t* argv[])
#endif
CloseHandle(handle);
}
}