如何查找 Windows 计算机上某些访问被拒绝错误的根本原因?
我想知道是否有一种方法可以发现 Windows 盒子上拒绝访问错误的确切原因。
例如,我的这段代码在 Win2008R2 上运行时未提升权限时会因访问被拒绝而崩溃。我希望 ProcMon 能够准确地告诉我哪个资源被拒绝访问 - 它没有,尽管我没有过滤事件。
所以,我有点迷失了——我到底应该如何解决这个问题呢?
作为参考,我尝试运行的代码是 ICertAdmin2.ResubmitRequest
。它在提升时运行正常,但在未提升时运行时失败,并显示访问被拒绝:
System.UnauthorizedAccessException: CCertAdmin::ResubmitRequest: Access is denied. 0x80070005 (WIN32: 5)
at CERTADMINLib.ICertAdmin2.ResubmitRequest(String strConfig, Int32 RequestId)
提前感谢所有好心人。
I was wondering if there is a way to discover the exact reasons for an Access Denied error on a windows box.
For instance, I have this code that crashes with Access Denied on Win2008R2 when it runs unelevated. I was hoping that ProcMon will tell me exactly which resource denied access - it did not, although I did not filter the events.
So, I am a bit lost - how on earth am I supposed to troubleshoot it?
For the reference, the code I am trying to run is ICertAdmin2.ResubmitRequest
. It runs OK elevated, but fails with Access Denied when ran unelevated:
System.UnauthorizedAccessException: CCertAdmin::ResubmitRequest: Access is denied. 0x80070005 (WIN32: 5)
at CERTADMINLib.ICertAdmin2.ResubmitRequest(String strConfig, Int32 RequestId)
Thanks in advance to all the Good Samaritans out there.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ProcMon 不会,但 filemon 可能会。它告诉您成功/拒绝和搜索。
有可能它试图写入程序文件(但不限于此),但 filemon 会告诉你
ProcMon wont, but filemon probably would. It tells you the success/denies and the searches.
Chances are its trying to write to program files (but not limited to that) but filemon will tell you
您收到的错误代码看起来像 COM HRESULT 错误代码。所有这些都有特定的含义。请查看此处以了解如何解释它们的更多信息。
The error code you're getting looks like a COM HRESULT error code. All these have a specific meaning. Have a look here to find out more how to interpret them.