Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your application has to the opportunity to handle <kbd>Ctrl</kbd><kbd>C</kbd> and <kbd>Ctrl</kbd><kbd>Break</kbd>, as key strokes or signals (depends on config), meaning that the application has the opportunity to make a clean exit, these would be a much softer way to terminate a process, allowing it a little more execution time if nothing else.</p> <p>TerminateProcess is more of a kick in the teeth, the application cannot handle this, it comes from the kernel, and if the application could handle it, this would create all sorts of issues with 'un killable' processes hanging their TerminateProcess handler and refusing to exit. </p> <p>As I understand it as soon as TerminateProcess is called on the process, it can not execute anymore code thats it, no clean up, no shutdown, its just over, you cant handle it, it simply wouldn't make sense if you could, not from a security perspective.</p> <p>Excellent code project article here on handling windows console signals:</p> <p><a href="http://www.codeproject.com/KB/winsdk/console_event_handling.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/winsdk/console_event_handling.aspx</a></p> <p>Implementing some of the above signal handling you could ensure that the database writes have a chance to complete before the program exits, rather than possibly leaving it to chance.</p> <p>You can block TerminateProcess, but its' not really 'polite' programming, it's more like root kit programming, I have seen a good article on this at rootkit.com so search there for 'Process Invincibility' once you have the invincible process, it could in its own time shut down after receiving such a 'request', and perform any clean up before hnad, but this most certainly a hack.</p> <p>It seems to me though that the <kbd>Ctrl</kbd><kbd>C</kbd> behaviour you are currently seeing is due it not immediately ending the running process.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload