1
0

Style fix

This commit is contained in:
Benjamin Höglinger-Stelzer 2023-06-25 20:11:31 +02:00
parent e994f3f04d
commit fd46e60681

View File

@ -118,6 +118,49 @@ int wmain(int argc, wchar_t* argv[])
std::wcout << L"Successfully opened device " << deviceName << std::endl; std::wcout << L"Successfully opened device " << deviceName << std::endl;
ULONG length = 0, returned = 0;
SCSI_PASS_THROUGH_WITH_BUFFERS sptwb;
ZeroMemory(&sptwb, sizeof(SCSI_PASS_THROUGH_WITH_BUFFERS));
sptwb.spt.Length = sizeof(SCSI_PASS_THROUGH);
sptwb.spt.PathId = 0;
sptwb.spt.TargetId = 0;
sptwb.spt.Lun = 0;
sptwb.spt.CdbLength = CDB6GENERIC_LENGTH;
sptwb.spt.SenseInfoLength = SPT_SENSE_LENGTH;
sptwb.spt.DataIn = SCSI_IOCTL_DATA_IN;
sptwb.spt.DataTransferLength = 192;
sptwb.spt.TimeOutValue = 2;
sptwb.spt.DataBufferOffset = offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS, ucDataBuf);
sptwb.spt.SenseInfoOffset = offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS, ucSenseBuf);
sptwb.spt.Cdb[0] = SCSIOP_MODE_SENSE;
sptwb.spt.Cdb[2] = MODE_SENSE_RETURN_ALL;
sptwb.spt.Cdb[4] = 192;
length = offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS, ucDataBuf) + sptwb.spt.DataTransferLength;
BOOL ret = DeviceIoControl(
handle,
IOCTL_SCSI_PASS_THROUGH,
&sptwb,
sizeof(SCSI_PASS_THROUGH),
&sptwb,
length,
&returned,
NULL
);
if (ret)
{
std::wcout << L"Request succeeded" << std::endl;
std::wcout << std::endl;
}
else
{
std::wcerr << L"Failed to send request, error: 0x" << std::hex << GetLastError() << std::endl;
}
#ifdef ACU_REPLAY
UCHAR request01[] = UCHAR request01[] =
{ {
#include "request01.bin" #include "request01.bin"
@ -196,6 +239,7 @@ int wmain(int argc, wchar_t* argv[])
SendScsiMiniportRequest(handle, request11, ARRAYSIZE(request11)); SendScsiMiniportRequest(handle, request11, ARRAYSIZE(request11));
SendScsiMiniportRequest(handle, request12, ARRAYSIZE(request12)); SendScsiMiniportRequest(handle, request12, ARRAYSIZE(request12));
SendScsiMiniportRequest(handle, request13, ARRAYSIZE(request13)); SendScsiMiniportRequest(handle, request13, ARRAYSIZE(request13));
#endif
CloseHandle(handle); CloseHandle(handle);
} }