neity Posted January 14, 2010 Share Posted January 14, 2010 have a fuction: Func _WinAPI_GetVOLUMEDISKEXTENTS($iDrive) Local $hDevice = "\\.\PhysicalDrive" & $iDrive Local $hFile, $Ret $hFile = DllCall("kernel32.dll", "hwnd", "CreateFile", _ "str", $hDevice, _; 要处理的驱动器 "dword", 0, _ "dword", 0, _ "ptr", 0, _ "dword", 3, _; OPEN_EXISTING "dword", 128, _; FILE_ATTRIBUTE_NORMAL "ptr", 0) $hDevice = $hFile[0] If $hFile = 0 Then Return SetError(1, 0, -1) EndIf Local $tagVOLUME_DISK_EXTENTS = 'dword NumberOfDiskExtents;dword DiskNumber;int64 StartingOffset;int64 ExtentLength;' Local $tVOLUME_DISK_EXTENTS = DllStructCreate($tagVOLUME_DISK_EXTENTS) $Ret = DllCall("kernel32.dll", "int", "DeviceIoControl", _ "hwnd", $hDevice, _ "dword", 0x560000, _; IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS "ptr", 0, _ "dword", 0, _ "ptr", DllStructGetPtr($tVOLUME_DISK_EXTENTS), _ "dword", DllStructGetSize($tVOLUME_DISK_EXTENTS), _ "dword*", 0, _ "ptr", 0) If (@error) Or ($Ret[0] = 0) Then $Ret = 0 EndIf DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hFile) ; _WinAPI_FreeHandle($hFile) If Not IsArray($Ret) Then Return SetError(2, 0, 0) EndIf Return SetError(0, 0, $tVOLUME_DISK_EXTENTS) EndFunc ;==>_WinAPI_GetVOLUMEDISKEXTENTS Why is not working?????????????????????? Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 14, 2010 Share Posted January 14, 2010 I don't understand the basic operation. You want volume information from a physical disk device? Shouldn't you be passing a handle to the Volume? There are minor quibbles like closing the handle with the $hFile array instead of the $hDevice handle, but it's still the wrong operation, I think. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now