防止WPF应用程序从任务管理器中被杀死 [英] prevent wpf application from getting killed from task manager

查看:382
本文介绍了防止WPF应用程序从任务管理器中被杀死的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何防止我的WPF应用程序被任务管理器杀死?
请帮帮我...

预先感谢U.

How can i prevent my WPF application from getting killed from task manager ?
Please help me out...

Thank U in advance.

推荐答案

没有办法.但是您可以将您的应用程序附加到另一个进程.为此,您必须将应用程序类型更改为类库,并将其添加到rundll.exe或其他进程(例如explorer.exe,winlogon.exe).
要了解更多信息,请访问
http://stackoverflow.com/questions/187983/how-do-i-hide-a-process-in-task-manager-in-c [ http://bytes.com/topic/c-sharp/answers/825121-how-can-i-prevent-application-being-end-task-manager-howto-keep-always-alive [
There is no way to do that. But you can attach your application to another process. TO do this you have to change your application type to class library and add this into rundll.exe or any other process like explorer.exe, winlogon.exe.
To know more about it go
http://stackoverflow.com/questions/187983/how-do-i-hide-a-process-in-task-manager-in-c[^]

http://bytes.com/topic/c-sharp/answers/825121-how-can-i-prevent-application-being-ended-task-manager-howto-keep-always-alive[^]


您不能.任务管理器可以看到所有内容,并且任务管理器可以杀死所有内容-在所有访问级别.

您可以隐藏您的进程,但这可能需要您编写一个内核模式驱动程序来拦截对NtQuerySystemInformation的调用,以使SystemProcessInformation类无法列出您的进程.

不太可能获得在公司服务器上安装类似内容的权限,并且UAC会阻止它在台式机上发生.
You can''t. Task Manager sees all, and Task Manager can kill all - at ALL access levels.

You could hide your process, but that would probably require you to to write a kernel-mode driver to intercept calls to NtQuerySystemInformation so that the SystemProcessInformation class can''t list your process.

Getting permission to install something like that on a corporate server would be unlikely, and the UAC prevents it from happening on desktop machines.


确保用户不是任何类型的管理员-管理员显然需要能够终止他们想要的任何进程.

提供从登录会话到具有所需特权的用户的访问权限,以在登录会话中启动该过程.您可以通过服务来做到这一点.这是有关
Window Station安全和访问权限 [ ^ ]

拒绝登录用户的过程的PROCESS_TERMINATE权限.
有关进程安全性和访问权限的更多信息,请此处 [
Smss.exe是会话管理器子系统,它负责启动用户会话.此过程由主系统线程启动,并负责各种活动,包括启动Winlogon和Win32(Csrss.exe)进程以及设置系统变量.启动这些过程后,它将等待Winlogon或Csrss结束.如果正常,系统将关闭;否则,系统将关闭.如果发生意外,Smss.exe会导致系统停止响应

所以阻止它们不是一个好主意

最好的问候
Espen Harlinn
Make sure that the user is not any kind of administrator - administrators obviously needs to be able to kill any process they want.

Provide access from the logon session to a user with required priviledges to start the process in the logon session. That''s something you can do from a service. Here is some info on Window Station Security and Access Rights[^]

Deny the logged on user the PROCESS_TERMINATE permission for the process.
More on process security and access rights here[^].

So basically it can be done ... but it''s not entirely trivial :)

[Update]
Csrss.exe is the user-mode portion of the Win32 subsystem; Win32.sys is the kernel-mode portion. Csrss stands for Client/Server Run-Time Subsystem, and is an essential subsystem that must be running at all times. Csrss is responsible for console windows, creating and/or deleting threads, and implementing some portions of the 16-bit virtual MS-DOS environment.

Smss.exe is the session manager subsystem, which is responsible for starting the user session. This process is initiated by the main system thread and is responsible for various activities, including launching the Winlogon and Win32 (Csrss.exe) processes, and setting system variables. After it has launched these processes, it waits for either Winlogon or Csrss to end. If this happens normally, the system shuts down; if it happens unexpectedly, Smss.exe causes the system to stop responding

So stopping them is not a good idea

Best regards
Espen Harlinn


这篇关于防止WPF应用程序从任务管理器中被杀死的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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