简体   繁体   English

限制非管理员用户在任务管理器中停止进程 C++

[英]Restricting Non-Admin Users From Stopping a Process in Task Manager C++

In C++ and using the WinAPI;在 C++ 中并使用 WinAPI; I am trying to start a process with admin rights using CreateProcessWithLogonW(), from within another application that does not have admin rights, but the new process can be stopped from within task manager by the non-admin user.我正在尝试使用 CreateProcessWithLogonW() 从另一个没有管理员权限的应用程序中启动具有管理员权限的进程,但非管理员用户可以从任务管理器中停止新进程。

Any help would be greatly appreciated.任何帮助将不胜感激。

Chaman查曼

As I can remember, Create admin process from non-admin process is very hard in windows.我记得,在 windows 中,从非管理进程创建管理进程非常困难。 The simplest option to start admin process is to build that process exe with admin privilege, and use::ShellExecute.启动管理进程的最简单选项是使用管理员权限构建该进程 exe,并使用::ShellExecute。

In vista and win7, posting message to admin process from non-admin process is not allowed.在 vista 和 win7 中,不允许从非管理员进程向管理员进程发布消息。 you may need to create your own message queue to send msg to admin process in order to kill it.您可能需要创建自己的消息队列以将 msg 发送到管理进程以杀死它。 (boost message queue can be one option). (提升消息队列可以是一种选择)。 Or you can use some other sync techniques to kill it.或者您可以使用其他一些同步技术来杀死它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM