This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems on accessing Windows network resources


At 10:31 AM 7/12/2003 +0200, Corinna Vinschen wrote:

>thanks for the patch but it has a problem.  You're comparing tokens against
>NULL while the correct "NULL" value for tokens is INVALID_HANDLE_VALUE. 

Corinna,

That's by design, using of Chris' astute observations. As he once
pointed out, INVALID_HANDLE_VALUE is the value returned in case of error
but NULL is not a legal handle value either, as implied by CreateFile
itself. Microsoft is using NULL handle values all the time. For the 
specific case of a NULL token handle, see SetThreadToken.

So I do like Microsoft and I use NULL to denote the legitimate absence 
of a token. I also use INVALID_HANDLE_VALUE in the error case.

Pierre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]