在Windows 7下调试需要管理员权限的程序 [英] Debug a program that needs administrator rights under Windows 7

查看:206
本文介绍了在Windows 7下调试需要管理员权限的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Win7 64位运行VS2K8。我以管理员身份登录,我以管理员身份运行,但是当我调用受限制的API时,我正在处理的程序失败,访问被拒绝。如果使用以管理员身份运行的资源管理器运行该程序,它将起作用。



我相信VS2K8可以使用VS2K8本身运行的任何权限来调试程序。因为这样,我无法调试我的应用程序,因为这样,我对于发生了什么感到失落。

解决方案

asInvoker ,但如果您需要提升的权限,则不需要它,而是将其设置为 requireAdministrator 在清单属性中。


I'm running VS2K8 in Win7 64-bit. I'm logged in as admin and I'm running it as admin, but the program I'm working on fails with access denied when I call a restricted API. If run the program from Explorer with "Run as Administrator" it works.

I was under the belief that VS2K8 debugs programs with whatever rights VS2K8 itself is running with. As it stands I can't debug my application due to this and I'm at a loss as to what's going on.

解决方案

I found the answer. Turns out that it is, in fact, a manifest issue: by default if you have a manifest you need to set the appropriate admin privilege. The default is asInvoker but that doesn't work if you need elevated privileges, you instead have to set it to requireAdministrator in the manifest properties.

这篇关于在Windows 7下调试需要管理员权限的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆