Python win32file 模块 DeviceIoControl 参数不正确
我有一台联想 ThinkPad 笔记本电脑,内置加速计,称为主动保护系统。我的操作系统是Windows 7,安装了python 2.7。我正在尝试编译一个 python 脚本,该脚本假设从加速度计读取数据,但它给出了错误:(87,'DeviceIoControl','参数不正确。') 错误。
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)
我在设备管理器中找不到加速计,但我知道它安装正确,因为其他应用程序可以使用它,但我想我无法访问它?
什么可能导致这个问题?我该如何解决? 提前致谢。
I have a Lenovo ThinkPad Laptop which has a build in accelerometer called Active Protection System. My operating system is Windows 7 and I have python 2.7 installed. I am trying to compile a python script that suppose to read data from accelerometer but it is giving error: (87, 'DeviceIoControl', 'The parameter is incorrect.')
error.
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)
I couldn't find accelerometer in device manager but I know it is installed properly as other applications can use it but I guess I can't reach it?
What may cause this problem? How can I resolve it?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论