[python-win32] SafeTerminateProcess and request for CreateRemoteThread()

Stefan Rank stefan.rank at ofai.at
Thu Jun 22 14:28:40 CEST 2006


Hi,

I spent some time finding a safe way to kill/terminate a process on 
Windows. Attached is my current version, modelled after a DDJ article.

It should work for gui and console applications, has lots of unnecessary 
print output, uses ctypes for a call to CreateRemoteThread, and bypasses 
(I think ?) any signal handlers that might be registered.

I hope this is useful for someone.

Two questions:

- The first is the request to include CreateRemoteThread in win32api 
(which I will post on sourceforge)

- Does anyone know a similarly safe way for terminating a process so 
that a SIGINT/SIGTERM handler will still be called (without the need for 
a shared console or process group ids)?

cheers,
stefan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: win32helper.py
Url: http://mail.python.org/pipermail/python-win32/attachments/20060622/2a459df2/attachment.asc 


More information about the Python-win32 mailing list