Hang the process

Is there a (more or less) easy way to make a Windows application process hang and not respond? Or does it completely depend on the application / process in question?

Change: . I wanted to try: this application has a web interface and several running processes in the background. It was reported that when one of these processes crashed, the web interface stopped responding. I would like to try to reproduce this, but I understand that this may not be so simple.

+3
source share
6 answers

If you can get a handle to the thread in the application, you can call SuspendThread(), which will lead to this topic until pause.

( , , , . , .)

, , Process Explorer . .

+4

, "" " ". , , .

+1

while (true) {}

0

, , . . ,

0

, for(;;); - . , - Process Explorer. "" .

0

Windows Sysinternals Process Explorer , . Process Explorer v16.05. , .

This will work with any executable as it is, but depending on the account in which this process is running, you may need administrative privileges to pause the process or thread.

0
source

Source: https://habr.com/ru/post/1711982/


All Articles