本文介绍了在OpenService(hSCM,"RPCSS",GENERIC_READ)方法中获取ERROR_ACCESS_DENIED错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们在OpenService(hSCM,"RPCSS",GENERIC_READ)方法中收到ERROR_ACCESS_DENIED错误.
Sudocode:
SC_HANDLE hSCM;
hSCM = OpenSCManager(NULL,NULL,SC_MANAGER_CONNECT);
hSVC = OpenService(hSCM,"RPCSS",GENERIC_READ);
SERVICE_STATUS状态; int bResult = QueryServiceStatus(hSVC,& Status);
CloseServiceHandle(hSCM);
CloseServiceHandle(hSVC);
以上sudocode在Windows XP和内置于Admin用户中的Windows Vista中都可以正常工作. 但不适用于用户创建的管理员用户.
Above sudocode is working fine in windows XP and also Windows Vista built in Admin user. But not for user created Admin user.
请尽快告诉我解决方案.
谢谢
Soma
推荐答案
这篇关于在OpenService(hSCM,"RPCSS",GENERIC_READ)方法中获取ERROR_ACCESS_DENIED错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!