3

我有一台联想 ThinkPad 笔记本电脑,它内置了一个名为 Active Protection System 的加速度计。我的操作系统是 Windows 7,我安装了 python 2.7。我正在尝试编译一个 python 脚本,该脚本假设从加速度计读取数据,但它给出了error: (87, 'DeviceIoControl', 'The parameter is incorrect.')错误。

import win32file

hDevice = win32file.CreateFile(r'//./ShockMgr', GENERIC_READ, FILE_SHARE_READ, None, OPEN_EXISTING, 0, 0)

if hDevice:
    data = win32file.DeviceIoControl(hDevice, 0x733FC, '', 0x24, None)
state = struct.unpack('i16h', data)

我在设备管理器中找不到加速度计,但我知道它已正确安装,因为其他应用程序可以使用它,但我想我无法访问它?

什么可能导致这个问题?我该如何解决?提前致谢。

4

0 回答 0