如何查找 Windows 计算机上某些访问被拒绝错误的根本原因?

发布于 2024-10-31 22:59:04 字数 506 浏览 3 评论 0原文

我想知道是否有一种方法可以发现 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

坐在坟头思考人生 2024-11-07 22:59:04

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

回忆凄美了谁 2024-11-07 22:59:04

您收到的错误代码看起来像 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文