找回密码
 加入
搜索
查看: 5241|回复: 6

[系统综合] [已解决]如何用API调用GetSystemFirmwareTable返回ACPI table

  [复制链接]
发表于 2010-11-3 19:23:23 | 显示全部楼层 |阅读模式
本帖最后由 xdcysten 于 2010-11-3 20:47 编辑

如何使用用API调用GetSystemFirmwareTable返回ACPI table

使用DLLCALL调用Kernel32.dll里面的GetSystemFirmwareTable函数
返回Value 为'ACPI' 的二进制数据

好像如下:
DllCall("Kernel32.dll", "int", "GetSystemFirmwareTable", "hwnd", 0, "str", "若干文字", "str", "若干标题", "int", 0)
Kernel32.dll,系统可能需要VISTA以上才可以正常动作

微软官方帮助文件
http://msdn.microsoft.com/en-us/library/ms724379(VS.85).aspx

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-11-3 20:07:12 | 显示全部楼层


$iTableId = Number(Binary("FCAP"))
$iProvSigner = Number("0x" & Hex((Binary("ACPI"))))

$tBuffer = DllStructCreate("ubyte Data[4096]")
$pBuffer = DllStructGetPtr($tBuffer)

$iLength = DllCall("Kernel32.dll", "int", "GetSystemFirmwareTable", "dword", $iProvSigner, _
                "dword", $iTableId, "ptr", $pBuffer, "dword", 4096)

$tBinary = DllStructCreate("ubyte Data[" & $iLength[0] & "]", $pBuffer)
MsgBox(0, "", DllStructGetData($tBinary, "Data"))

$tBinary = 0
$tBuffer = 0
 楼主| 发表于 2010-11-3 20:15:55 | 显示全部楼层
回复 2# pusofalse

麻烦了版主
但 版主这个好像只返回 0 而不是数据不知为什么
发表于 2010-11-3 20:23:29 | 显示全部楼层
$iTableId = Number(Binary("FCAP"))
$iProvSigner = Number("0x" & Hex((Binary("ACPI"))))
 
$tBuffer = DllStructCreate("ubyte Data[4096]")
$pBuffer = DllStructGetPtr($tBuffer)
 
$iLength = DllCall("Kernel32.dll", "int", "GetSystemFirmwareTable", "dword", $iProvSigner, _
                "dword", $iTableId, "ptr", $pBuffer, "dword", 4096)
If ($iLength[0] = 0) Then
     $iError = DllCall("Kernel32.dll", "dword", "GetLastError")
     MsgBox(48, "Error code:", $iError[0])
     Exit
EndIf
 
$tBinary = DllStructCreate("ubyte Data[" & $iLength[0] & "]", $pBuffer)
MsgBox(0, "", DllStructGetData($tBinary, "Data"))
 
$tBinary = 0
$tBuffer = 0


再测试一下,看下是什么错误。

评分

参与人数 1金钱 +50 收起 理由
afan + 50

查看全部评分

 楼主| 发表于 2010-11-3 20:30:51 | 显示全部楼层
回复 4# pusofalse


错误代码 1168
发表于 2010-11-3 20:37:37 | 显示全部楼层
回复 5# xdcysten

FCAP是Frimware Table ID (硬件表ID?),把"FCAP"改成你自己的值,再次测试,再看下error code是多少。
 楼主| 发表于 2010-11-3 20:45:46 | 显示全部楼层
回复 6# pusofalse

版主真不知对你说什么好,你实在太NB了。。。。

版主的API的学问到达了人类的极限,挥一挥手不知有多少电脑死在你面前呢

谢谢了,没错误
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-2 06:08 , Processed in 0.086452 second(s), 29 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表