Windows 7开发中存在管理员和提升问题 [英] Windows 7 development with administrator and elevation issues

查看:91
本文介绍了Windows 7开发中存在管理员和提升问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您以管理员权限在Windows 7(64位)上运行应用程序(C ++本机,32位),则其中的某些功能不起作用.例如:

-调用MAPI函数将挂起或失败,并显示通用错误代码(使用Outlook 2007).
-如果您的应用程序使用ActiveScript,则stop命令不会给您附加脚本调试器的选项.甚至没有任何JIT菜单.
-您的应用程序无法与Excel通信,除非它也被设置为以管理员身份运行.

如果您不以管理员身份运行程序,那么以上三者工作正常.现在,我了解到Microsoft试图劝阻人们不要运行具有管理员权限的软件,但是我们当中的许多人在现实世界中都拥有大量的旧版软件.

在Vista中也会出现相同的问题,并且甚至禁用了admin和非admin程序之间的复制/粘贴.

我的问题是:

我可以理解,非提升(无admin)程序无法与之通信提升权限的内容(以管理员身份运行).

但是为什么具有提升权限的内容(管理员权限)不能与没有提升权限的内容进行通信?

这对我来说毫无意义.我将假设管理员概念曾经用来表示与普通用户相同的权限,但也允许它执行普通应用程序无法完成的任务".为什么管理程序会以某种方式瘫痪,或被禁止执行非管理程序可以做的某些事情?

是否存在注册表设置,允许管理程序与非管理程序进行通讯?
还是对此有一个合理的解释,我可以去阅读并尝试理解.

谢谢.

If you run an application (C++ native, 32-bit) on Windows 7 (64 bit) with administrator privileges,  then some functionality in does not work. For example:

- Calls to MAPI functions will hang or fail with a generic error code (using Outlook 2007).
- If your application uses ActiveScript, then the stop command does not give you the option of attaching a script debugger. No JIT menu even comes up.
- Your application cannot communicate with Excel unless it is also set to run as administrator.

If you do not run your program as administrator, then above three all work fine. Now I understand that Microsoft is trying to discourage people from running software with admin rights, but a lot of us are in the real world with large chunks of legacy software.

The same issue manifests on Vista, and there even copy/paste between admin and non admin programs are disabled.

My question is this:

I can understand that a non elevated (no admin) program cannot communicate with something that is elevated (run as administrator).

But why can something run with elevated permissions (admin rights), not communicate with something that doesnt run with elevated permissions?

That makes no sense to me. I would assume the administrator concept used to mean "The same permissions as normal, but also allow it to do things normal applications cant". Why is an admin program crippled in some ways, or prevented from doing some things that a non admin program can?

Is there a registry setting to allow admin programs to talk to non admin programs?
Or is there a rational explanation for this somewhere that I can go and read to try and understand?

Thank you.

推荐答案

你好

> 对MAPI函数的调用将挂起或失败,并显示通用错误代码(使用Outlook 2007).有问题吗?

>您的应用程序无法与Excel通信,除非它也被设置为以管理员身份运行.

未提升的应用程序应该能够在未提升Excel的情况下与Excel通信.请在多合一代码框架中尝试使用CppAutomateExcel或CSAutomateExcel或VBAutomateExcel示例.这些示例演示了如何从C ++/C#/VB.NET客户端自动化Excel.

>但是,为什么某些具有提升权限的权限(管理员权限)不能与不具有提升权限的内容进行通信?

请参阅我上面的答复.您能给我一些重现该问题的步骤吗?

Hello

> Calls to MAPI functions will hang or fail with a generic error code (using Outlook 2007).

Could you please give me the detailed steps to see this problem?

> Your application cannot communicate with Excel unless it is also set to run as administrator.

The application that is not elevated should be able to communicate with Excel when Excel is not elevated. Please try the CppAutomateExcel or CSAutomateExcel or VBAutomateExcel samples in All-In-One Code Framework. These samples demonstrate automating Excel from C++/C#/VB.NET clients.

> But why can something run with elevated permissions (admin rights), not communicate with something that doesnt run with elevated permissions?

Please see my above reply. Could you please give me the steps to reproduce the problem?


这篇关于Windows 7开发中存在管理员和提升问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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