LISTBOX_Directory() returns LB_OKAY for invalid directory / f ilen ame

Dimitrie O. Paun dpaun at rogers.com
Tue Jun 22 16:01:08 CDT 2004


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 :)



More information about the wine-devel mailing list