我的是win2000 pro, 下面的代码请你帮助看一下,运行老是不对。
hVxD := CreateFile('//./PHYSICALDRIVE0',
GENERIC_READ,
FILE_SHARE_READ ,
nil,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
0);
if (hVxD = INVALID_HANDLE_VALUE) then
begin
dwErrorCode := GetLastError();
if (dwErrorCode = ERROR_NOT_SUPPORTED) then
showmessage('Unable to open , devicedo
es not support DeviceIOCTL')
else
showmessage('Unable to open, Error code' + inttohex(dwErrorCode, 4))
end;
if DeviceIoControl(
hVxD, // handle to device of interest
$4D008,//IOCTL_SCSI_MINIPORT, // control code of operation to perform
nil, // pointer to buffer to supply input data
0, // size of input buffer
@buffer, // pointer to buffer to receive output data
sizeof(buffer), // size of output buffer
ReturnLen, // pointer to variable to receive output byte count
nil // pointer to overlapped structure for asynchronous operation
) then
showmessage('succeed')
else
showmessage('failed');