flat assembler
Message board for the users of flat assembler.

Index > Windows > what does Ctrl + C in console mode actually does?

Author
Thread Post new topic Reply to topic
sleepsleep



Joined: 05 Oct 2006
Posts: 13100
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 12 Aug 2009, 16:36
hi there,

let say, we got a console app.

Code:
.j1:
      invoke Sleep,3000
      cinvoke printf,"hi world %c%c",13,10
      jmp .j1

.j2:
      ; code to clean all handles and flush everything before we exit.
    


when i press Ctrl + C in win32 console app, what actually windows does? run my .j2 code to flush all things nicely? or just terminate.
Post 12 Aug 2009, 16:36
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 12 Aug 2009, 16:57
Depends... you should take a look here: http://msdn.microsoft.com/en-us/library/ms686016(VS.85).aspx

If console app doesn't set up any handler, then IMO it is brute-force closed, that means it doesn't close its stuff... but windows, when it ends process, is supposed to close everything opened by process, and AFAIK this is reliable. For example HLA standard library relies on this behavior.
Post 12 Aug 2009, 16:57
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.