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;
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[] =
{
#include "request01.bin"
@ -137,47 +180,47 @@ int wmain(int argc, wchar_t* argv[])
{
#include "request04.bin"
};
UCHAR request05[] =
{
#include "request05.bin"
};
UCHAR request06[] =
{
#include "request06.bin"
};
UCHAR request07[] =
{
#include "request07.bin"
};
UCHAR request08[] =
{
#include "request08.bin"
};
UCHAR request09[] =
{
#include "request09.bin"
};
UCHAR request10[] =
{
#include "request10.bin"
};
UCHAR request11[] =
{
#include "request11.bin"
};
UCHAR request12[] =
{
#include "request12.bin"
};
UCHAR request13[] =
{
#include "request13.bin"
@ -196,6 +239,7 @@ int wmain(int argc, wchar_t* argv[])
SendScsiMiniportRequest(handle, request11, ARRAYSIZE(request11));
SendScsiMiniportRequest(handle, request12, ARRAYSIZE(request12));
SendScsiMiniportRequest(handle, request13, ARRAYSIZE(request13));
#endif
CloseHandle(handle);
}