Global Const $error_invalid_function = 1
DllCall("Kernel32.dll", "dword", "GetFirmwareEnvironmentVariableW", "wstr", "", "wstr", "{00000000-0000-0000-0000-000000000000}", "wstr", Null, "dword", 0)
If _WinAPI_GetLastError() = $error_invalid_function Then
$PartitionTable = "MBR"
Else
$PartitionTable = "GPT"
EndIf
MsgBox(0,"磁盘分区表",$PartitionTable)
Func _WinAPI_GetLastError(Const $_icurrenterror = @error, Const $_icurrentextended = @extended)
Local $aresult = DllCall("kernel32.dll", "dword", "GetLastError")
Return SetError($_icurrenterror, $_icurrentextended, $aresult[0])
EndFunc
|