使用 ShellExecuteEx 启动的进程的默认访问权限是什么?
我需要对以 ShellExecuteEx
启动的进程执行某些操作 - 例如等待它、复制句柄、查询和设置信息等。现在我想知道是否可以在 上执行所有这些操作hProcess
成员,它在我传递给 ShellExecuteEx
的 SHELLEXECUTEINFO
结构中返回。有人知道这个吗?
调用ShellExecuteEx
的进程是否拥有PROCESS_DUP_HANDLE
、SYNCHRONIZE
、PROCESS_SET_INFORMATION
、PROCESS_QUERY_INFORMATION
等权限> (等等)默认情况下,当使用返回的 hProcess
?
I need to perform certain operations on a process started with ShellExecuteEx
- like waiting for it, duplicating handles, querying and setting information etc. Now I am wondering if I can do all these things on the hProcess
member which is returned in the SHELLEXECUTEINFO
structure I pass to ShellExecuteEx
. Does anybody know this?
Does the process that called ShellExecuteEx
have rights like PROCESS_DUP_HANDLE
, SYNCHRONIZE
, PROCESS_SET_INFORMATION
, PROCESS_QUERY_INFORMATION
(and so on) by default, when using the returned hProcess
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我猜想它与您从 CreateProcess 获得的内容相同,尽管该文档也没有说明(我冒险使用 PROCESS_ALL_ACCESS)。无论如何,您始终可以执行 GetProcessId() 和 OpenProcess() 以使用您需要的任何访问权限打开它。
I would guess that it is the same as what you get from CreateProcess, though even that documentation doesn't say (I would venture PROCESS_ALL_ACCESS). In any event, you could always do GetProcessId() and OpenProcess() to open it with whatever access you need.
是的。在线的时候你需要担心访问权限的问题是如果你做了任何触发uac的任务,那么你需要设置
requestedExecutionLevel= 'highestAvailable'
Yes. The online time you need to worry about access rights is if you do any task that trigger the uac, then you need to set the
requestedExecutionLevel= 'highestAvailable'