Code:
idxDrv := 0 ; 1, 2, 3. In SCSI case, may have to use 1 instead of 0.
;sDrive := "\\.\PhysicalDrive" . idxDrv
sDrive := "\\.\Scsi" . 0 . ":" ; 1, ..., 15
If Not 1 + hDrive:=DllCall("CreateFile", "Uint", &sDrive, "Uint", 0xC0000000, "Uint", 3, "Uint", 0, "Uint", 3, "Uint", 0, "Uint", 0)
ExitApp
VarSetCapacity(in,28+32,0), VarSetCapacity(out,557)
NumPut(28, in, 0), DllCall("RtlMoveMemory", "Uint", &in+4, "str", "SCSIDISK", "Uint", 8)
NumPut(0x001B0501, in, 16), NumPut(0xEC<<48, in, 32, "int64"), NumPut(idxDrv, in, 40)
If DllCall("DeviceIoControl", "Uint", hDrive, "Uint", 0x0004D008, "Uint", &in, "Uint", VarSetCapacity(in), "Uint", &out, "Uint", VarSetCapacity(out), "UintP", nReturn, "Uint", 0) ; IOCTL_SCSI_MINIPORT
Loop, % StrLen(str:=DllCall("msvcrt\abs", "int", &out+64, "Cdecl Str"))//2
SN .= SubStr(str,2*A_Index,1) . SubStr(str,2*A_Index-1,1)
DllCall("CloseHandle", "Uint", hDrive)
MsgBox, % """" . SN . """"
after running this i get an error:
error: call to non existent function.
specifically: NumPut(28, in, 0), DllCall("RtlMoveMemory", "Uint", &in+4, "str", "SCSIDISK", "Uint", 8)
can anyone tell me what im missing?
thanks