本帖最后由 gyp2000 于 2023-5-10 11:14 编辑 #include <Array.au3>
Local $aTables = GetSystemFirmwareTable("ACPI", "PCAF")
_ArrayDisplay($aTables)
Func GetSystemFirmwareTable($sSignature, $sTableID)
Local $MSDM_FirmwareTable = "struct;CHAR Signature[4];UINT Length;BYTE Revision;BYTE Checksum;CHAR OemId[6];CHAR OemTableId[8];UINT OemRevision;CHAR CreatorId[4];UINT CreatorRevision;CHAR ProductKey[49];endstruct"
Local $bRet = 0
$bRet = DllCall("Kernel32.dll", "uint", "GetSystemFirmwareTable", "dword", _Signature($sSignature), "dword", _Signature($sTableID), "ptr", Null, "dword", 0)
If @error Or Not $bRet[0] Then Return SetError(@error, @extended, $aTables)
Local $jsize = $bRet[0]
Local $jBound = $jsize / 4
Local $tFirmwareTable = DllStructCreate($MSDM_FirmwareTable)
$bTables = DllCall("Kernel32.dll", "uint", "GetSystemFirmwareTable", "dword", _Signature($sSignature), "dword", _Signature($sTableID), "ptr", DllStructGetPtr($tFirmwareTable), "dword", $jBound)
$tFirmwareTable = 0
Return $bTables
EndFunc ;==>GetSystemFirmwareTable
Func _Signature($sString)
Return "0x" & Hex(Binary($sString))
EndFunc ;==>_Signature
|