[问题] wioio 在non-administrator下执行

楼主: drunknmunky   2016-01-20 01:03:01
开发平台(Platform): (Ex: VC++, GCC, Linux, ...)
VS2013
额外使用到的函数库(Library Used): (Ex: OpenGL, ...)
winio
可在下列网址下载:
http://www.internals.com/
问题(Question):
正常使用WINIO需要有administrator权限
但其HELP有提到如何在"非使用者权限"下使用
大致就是先在administrator下呼叫 InstallWinIoDriver->
重开机->登入一般使用者帐号->开开心心使用winio...
我想法很单纯
所以我写了个程式只呼叫 InstallWinIoDriver() 让其在admin下执行(检查return是TRUE)
但重开机后登入regular user帐号, 想要直接使用WINIO内提供API却都失败?
如:GetPortVal(), SetPortVal() 等...
喂入的资料(Input):
Return = GetPortVal(PortAddr, &PortVal);
预期的正确结果(Expected Output):
Return 应该是True, 且能正确得到PortValue
错误结果(Wrong Output):
Return 是False, 且获得的PortVal与使用TOOL读出的值不一致
程式码(Code):(请善用置底文网页, 记得排版)
程式码不在身边 暂略
补充说明(Supplement):
补上HELP内所说内容
Using WinIo from a non-administrative account
WinIo can be used by regular users (non-administrators). In order to support
this configuration, the WinIo driver (WinIo32.sys or WinIo64.sys) must be
first installed on the system from an administrative account using
InstallWinIoDriver. Following installation, the driver will load
automatically whenever Windows starts. An application will then be able to
use the library's functions to access I/O ports and physical memory.
You should take the following steps in order to use WinIo from a
non-administrative account:
1. Place the distributable files in the directory where your application
resides.
2. Call InstallWinIoDriver from a process that has administrative privileges
with the first parameter set to the path of the driver file (e.g.
c:\myapp\WinIo32.sys).
3. Reboot the system.
4. Log on as a regular user.
5. You should now be able to use WinIo in the same way as when using the library
from an administrative account.
6. When WinIo is no longer required, call RemoveWinIoDriver to remove the WinIo
driver from the system. This must be performed from an administrative
account.
作者: stupid0319 (征女友)   2016-01-20 08:28:00
Install driver后看一下系统服务有没有出现winIO?
楼主: drunknmunky   2016-01-20 10:06:00
你是指regedit内吗? 有喔

Links booklink

Contact Us: admin [ a t ] ucptt.com