Yesssss! got it, stupid mistake....
It should be...
if ((le == ERROR_NO_MORE_FILES) || (le == ERROR_FILE_NOT_FOUND)) return LB_ERR;
Thanks,
Krishna
-----Original Message-----
From: Dimitrie O. Paun [mailto:dpaun@rogers.com]
Sent: Tuesday, June 22, 2004 2:01 PM
To: Krishna Murthy
Cc: 'Alexandre Julliard'; wine-devel@winehq.org
Subject: Re: LISTBOX_Directory() returns LB_OKAY for invalid directory / f ilen ame
On Tue, Jun 22, 2004 at 11:08:28AM -0700, Krishna Murthy wrote:
> The 'le' is an integer value and not a bitwise value. This means it
> could have only one error condition at a time.
Right. Because of this fact:
> if ((le != ERROR_NO_MORE_FILES) || (le != ERROR_FILE_NOT_FOUND))
> return LB_ERR;
Will always return LB_ERR. Proof:
(le != ERROR_NO_MORE_FILES) || (le != ERROR_FILE_NOT_FOUND) ## by deMorgan's Law == !((le == ERROR_NO_MORE_FILES) && (le == ERROR_FILE_NOT_FOUND)) ## by transitivity == !(ERROR_NO_MORE_FILES == ERROR_FILE_NOT_FOUND) ## by the definition of these error codes == !(18 == 2) ## different numbers are not equal == !(FALSE) ## by negation == TRUE
;)
--
Dimi.
P.S. I haven't done a formal proof since I was doing my M.Sc. at UofT :)