Getting closer
This commit is contained in:
parent
fd46e60681
commit
793d29683c
@ -3,6 +3,7 @@
|
|||||||
//
|
//
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
#include <WinSock2.h>
|
||||||
#include <winioctl.h>
|
#include <winioctl.h>
|
||||||
#include <ntddscsi.h>
|
#include <ntddscsi.h>
|
||||||
#include <devioctl.h>
|
#include <devioctl.h>
|
||||||
@ -13,6 +14,8 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "ScsiStuff.h"
|
#include "ScsiStuff.h"
|
||||||
|
|
||||||
|
#pragma comment(lib, "ws2_32")
|
||||||
|
|
||||||
//
|
//
|
||||||
// STL
|
// STL
|
||||||
//
|
//
|
||||||
@ -126,16 +129,18 @@ int wmain(int argc, wchar_t* argv[])
|
|||||||
sptwb.spt.PathId = 0;
|
sptwb.spt.PathId = 0;
|
||||||
sptwb.spt.TargetId = 0;
|
sptwb.spt.TargetId = 0;
|
||||||
sptwb.spt.Lun = 0;
|
sptwb.spt.Lun = 0;
|
||||||
sptwb.spt.CdbLength = CDB6GENERIC_LENGTH;
|
sptwb.spt.CdbLength = 10;
|
||||||
sptwb.spt.SenseInfoLength = SPT_SENSE_LENGTH;
|
sptwb.spt.SenseInfoLength = SPT_SENSE_LENGTH;
|
||||||
sptwb.spt.DataIn = SCSI_IOCTL_DATA_IN;
|
sptwb.spt.DataIn = SCSI_IOCTL_DATA_IN;
|
||||||
sptwb.spt.DataTransferLength = 192;
|
sptwb.spt.DataTransferLength = 192;
|
||||||
sptwb.spt.TimeOutValue = 2;
|
sptwb.spt.TimeOutValue = 120;
|
||||||
sptwb.spt.DataBufferOffset = offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS, ucDataBuf);
|
sptwb.spt.DataBufferOffset = offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS, ucDataBuf);
|
||||||
sptwb.spt.SenseInfoOffset = offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS, ucSenseBuf);
|
sptwb.spt.SenseInfoOffset = offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS, ucSenseBuf);
|
||||||
sptwb.spt.Cdb[0] = SCSIOP_MODE_SENSE;
|
sptwb.spt.Cdb[0] = 0x26;
|
||||||
sptwb.spt.Cdb[2] = MODE_SENSE_RETURN_ALL;
|
sptwb.spt.Cdb[6] = 0x11;
|
||||||
sptwb.spt.Cdb[4] = 192;
|
|
||||||
|
unsigned short bebufsize = htons(sizeof(id_ctlr));
|
||||||
|
memcpy(&sptwb.spt.Cdb[7], &bebufsize, 2);
|
||||||
|
|
||||||
length = offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS, ucDataBuf) + sptwb.spt.DataTransferLength;
|
length = offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS, ucDataBuf) + sptwb.spt.DataTransferLength;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user