<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: LISTBOX_Directory() returns LB_OKAY for invalid directory / f ilen ame</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Yesssss! got it, stupid mistake.... </FONT>
<BR><FONT SIZE=2>It should be...</FONT>
<BR><FONT SIZE=2>if ((le == ERROR_NO_MORE_FILES) || (le == ERROR_FILE_NOT_FOUND)) return LB_ERR;</FONT>
</P>

<P><FONT SIZE=2>Thanks,</FONT>
<BR><FONT SIZE=2>Krishna</FONT>
<BR><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Dimitrie O. Paun [<A HREF="mailto:dpaun@rogers.com">mailto:dpaun@rogers.com</A>] </FONT>
<BR><FONT SIZE=2>Sent: Tuesday, June 22, 2004 2:01 PM</FONT>
<BR><FONT SIZE=2>To: Krishna Murthy</FONT>
<BR><FONT SIZE=2>Cc: 'Alexandre Julliard'; wine-devel@winehq.org</FONT>
<BR><FONT SIZE=2>Subject: Re: LISTBOX_Directory() returns LB_OKAY for invalid directory / f ilen ame</FONT>
</P>

<P><FONT SIZE=2>On Tue, Jun 22, 2004 at 11:08:28AM -0700, Krishna Murthy wrote:</FONT>
<BR><FONT SIZE=2>&gt; The 'le' is an integer value and not a bitwise value. This means it </FONT>
<BR><FONT SIZE=2>&gt; could have only one error condition at a time.</FONT>
</P>

<P><FONT SIZE=2>Right. Because of this fact:</FONT>
</P>

<P><FONT SIZE=2>&gt; if ((le != ERROR_NO_MORE_FILES) || (le != ERROR_FILE_NOT_FOUND)) </FONT>
<BR><FONT SIZE=2>&gt; return LB_ERR;</FONT>
</P>

<P><FONT SIZE=2>Will always return LB_ERR. Proof:</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; (le != ERROR_NO_MORE_FILES) || (le != ERROR_FILE_NOT_FOUND) ## by deMorgan's Law == !((le == ERROR_NO_MORE_FILES) &amp;&amp; (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</FONT></P>

<P><FONT SIZE=2>;)</FONT>
</P>

<P><FONT SIZE=2>--</FONT>
<BR><FONT SIZE=2>Dimi.</FONT>
</P>

<P><FONT SIZE=2>P.S. I haven't done a formal proof since I was doing my M.Sc. at UofT :)</FONT>
</P>

</BODY>
</HTML>