How do I call ACPI control methods from C++ or C# on Windows?

醉酒当歌 提交于 2019-12-05 18:04:02

问题


I'm getting tired of waiting for HP to fix the switchable graphics driver for my laptop, but I think I can switch GPUs myself by calling ACPI methods. The switching works using vga_switcheroo in Linux, which is open source, so I know what methods I need to call, but not how to call them.

The two methods I need to call are in the SSDT namespace, if that matters, and I also need to pass integer arguments.


回答1:


Some links on similar problems (For example) say that this is possible only from kernel-mode driver under Windows. So to accomplish this I can think only of the following options:

  1. Writing entire videodriver by yourself - I doubt you will go this way...

  2. Finding documentation on or reverse-engineering existing videodriver for your GPU and issuing necessary commands via IOCTLs using function DeviceIoControl (MSDN). Also not very reliable - existing driver might not contain necessary functions/IOCTLs - but I think it will be much easier than the first option.



来源:https://stackoverflow.com/questions/7781625/how-do-i-call-acpi-control-methods-from-c-or-c-sharp-on-windows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!