Func _NtSetInformationFile($hFile, $iInfoClass, $vBuffer, $iBuffer, $sBufferType = "ptr")
Local $iResult, $tStatus, $pStatus
$tStatus = DllStructCreate("ubyte Status[32]")
$pStatus = DllStructGetPtr($tStatus)
$iResult = DllCall("Ntdll.dll", "dword", "NtSetInformationFile", "handle", $hFile, _
"ptr", $pStatus, $sBufferType, $vBuffer, "ulong", $iBuffer, _
"dword", $iInfoClass)
Return SetError($iResult[0], 0, $iResult[0] = 0)
EndFunc ;==>_NtSetInformationFile
#include <SetupAPI.au3>
$hFile = _CM_Create_File("\\.\PhysicalDrive0", 0xC0000000, 3, 0, 3, 0)
_NtSetInformationFile($hFile, 14, 1024 * 1024 * 1024 * 7, 8, "int64*")
$pBuffer = _CM_Heap_Alloc(512)
_CM_Read_Device($hFile, $pBuffer, 512)
_CM_Close_Handle($hFile)
$tBuffer = DllStructCreate("byte Binary[512]", $pBuffer)
MsgBox(0, @Extended, DllStructGetData($tBuffer, "Binary"))
偏移7G。 |