]> asedeno.scripts.mit.edu Git - PuTTY.git/commit - windows/winsftp.c
The Windows HANDLE type, despite being a `void *', does not actually
authorSimon Tatham <anakin@pobox.com>
Tue, 29 Aug 2006 18:32:44 +0000 (18:32 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 29 Aug 2006 18:32:44 +0000 (18:32 +0000)
commitf0a9c33f25ab12fa0a2430ea7c305596c4db1bac
tree456266e7c69026cc25f759057eb1ba338a27934e
parent088bc613ed171d70c4829605dc0dbdf8e3ef17cb
The Windows HANDLE type, despite being a `void *', does not actually
behave like a pointer. In particular, the right thing to set a
HANDLE to to indicate that it's invalid is INVALID_HANDLE_VALUE, not
NULL. Crack down on sloppy use of NULL HANDLEs across all Windows
code.

(There is one oddity, which is that {Create,Open}FileMapping are
documented to return a NULL HANDLE instead of INVALID_HANDLE_VALUE
on failure. Shrug. If MS want to be inconsistent, I suppose I have
to live with it.)

[originally from svn r6833]
windows/window.c
windows/winpgntc.c
windows/winser.c
windows/winsftp.c