From 793d29683c2dc1d4f57f4d852bd12a6a9dcfd35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20H=C3=B6glinger-Stelzer?= Date: Sun, 25 Jun 2023 20:36:13 +0200 Subject: [PATCH] Getting closer --- .../SmartArrayControllerTool.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/SmartArrayControllerTool/SmartArrayControllerTool.cpp b/SmartArrayControllerTool/SmartArrayControllerTool.cpp index 982ac92..446ae8e 100644 --- a/SmartArrayControllerTool/SmartArrayControllerTool.cpp +++ b/SmartArrayControllerTool/SmartArrayControllerTool.cpp @@ -3,6 +3,7 @@ // #define WIN32_LEAN_AND_MEAN #include +#include #include #include #include @@ -13,6 +14,8 @@ #include #include "ScsiStuff.h" +#pragma comment(lib, "ws2_32") + // // STL // @@ -120,22 +123,24 @@ int wmain(int argc, wchar_t* argv[]) 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.CdbLength = 10; sptwb.spt.SenseInfoLength = SPT_SENSE_LENGTH; sptwb.spt.DataIn = SCSI_IOCTL_DATA_IN; sptwb.spt.DataTransferLength = 192; - sptwb.spt.TimeOutValue = 2; + sptwb.spt.TimeOutValue = 120; 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; + sptwb.spt.Cdb[0] = 0x26; + sptwb.spt.Cdb[6] = 0x11; + + 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;