News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

ExitProcess and freeing resource

Started by jdoe, January 06, 2006, 04:41:07 AM

Previous topic - Next topic

jdoe


Hi,

While surfing on MSDN, I've found this about ExitProcess()...


Remarks
     Exiting a process causes the following:
        1.  All of the object handles opened by the process are closed.



Does it mean, if I open a file with CreateFile(), map this file with CreateFileMapping() and get a view pointer with MapViewOfFile(), that I don't need to UnmapViewOfFile() and CloseHandle() ?


Thanks


hutch--

jd,

ExitProcess() does a clean exit from a created process, the old rule is anything you start, you finish because while you may get away with it in some places, it will come back to haunt you in others. Memory, device contexts, open files etc ... be tidy with all of them and you will write reliable software, try and take shortcuts and you will end up with trash.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jdoe


Thanks hutch,

I must say that I was wishing this reply. The remark about ExitProcess confused me a little and I thought there was a simpler way I didn't knew, after all those time. I know we never stop learning but there's a limit.  :lol