The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Mr Earl on March 31, 2005, 02:57:11 PM

Title: Not Using FindClose
Post by: Mr Earl on March 31, 2005, 02:57:11 PM
I recently discovered FindClose and realized that I had been using FindFirstFile w/o ever closing the handle.  Since the program ran OK before I used FindClose, I have a question:  What problems could that omission have caused.  Also, what problems could you expect if you forget to close any other handle?  Just curious, I don't intend to stop closing my handles.
Title: Re: Not Using FindClose
Post by: hutch-- on March 31, 2005, 02:59:57 PM
 :bg

Depending on your sense of humour, the next Dork at Microsoft who has to revisit the code may change the way it works if you are not using the exact documented technique. If you were running it for a long time you could run out of handles eventually.
Title: Re: Not Using FindClose
Post by: P1 on March 31, 2005, 03:18:34 PM
When your process closed the OS did the did clean up from newbie programming techniques.   :naughty:

Regards,  P1  :8)
Title: Re: Not Using FindClose
Post by: Mark Jones on March 31, 2005, 04:35:15 PM
Hmm.... Microsoft was actually "thinking outside the box" there. Or should I say, "thinking outside the segment."  :lol