<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">oops, I meant to reply-all on this.<br><br>--- On <b>Mon, 5/18/09, Daniel Santos <i>&lt;javatroubadour@yahoo.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Daniel Santos &lt;javatroubadour@yahoo.com&gt;<br>Subject: Re: Detecting an invalid handle in setupapi<br>To: "Paul Vriens" &lt;paul.vriens.wine@gmail.com&gt;<br>Date: Monday, May 18, 2009, 5:43 PM<br><br><div id="yiv2019946854"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; -x-system-font: none;" valign="top">I'm so very glad you brought this up Paul.&nbsp; I'm new to wine development
and I've been working on Lord of the Rings Online issues and I have
discovered and validated that the root cause of two of my problems are
related (<a rel="nofollow" target="_blank" href="http://bugs.winehq.org/show_bug.cgi?id=18371">http://bugs.winehq.org/show_bug.cgi?id=18371</a>).&nbsp; There are numerous places in Wine where the validity of
handles are not checked.&nbsp; If the handle turns out to be invalid, then a NULL pointer is simply passed instead (which sometimes has an alternate meaning).&nbsp; Worse yet, in the code I was working with
(dlls/kernel32/global16.c) the type of object the handle refers to is
not stored!&nbsp; I see this as a critical flaw in Wine and I hope I can come up with a viable solution.&nbsp; I'm planning on setting up some test programs to examine the bit-data of some windows objects (starting with user32 -- where my issue lies) as any solution will have to be bit-compatibile with windows since apps like paint shop pro de-reference handles and examine the data of the underlying objects.<br><br>In truth, if the LOTRO app didn't destroy objects it was still using and then try to use them, the problem wouldn't exist -- this part of wine will work perfectly if the app behaved responsibly.&nbsp; But development timelines and pressures frequently lead to code that works, but is incorrect and is a part of reality.<br><br>Daniel<br><br>--- On <b>Sat, 5/16/09, Paul Vriens <i>&lt;paul.vriens.wine@gmail..com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Paul
 Vriens &lt;paul.vriens.wine@gmail.com&gt;<br>Subject: Detecting an invalid handle in setupapi<br>To: "wine-devel@winehq.org" &lt;wine-devel@winehq.org&gt;<br>Date: Saturday, May 16, 2009, 12:18 PM<br><br><div class="plainMail">Hi,<br><br>I'm trying to install Microsoft's MMC (W2K3) and it crashes every now and then with different symptoms.<br><br>I've tracked it down to what I think is a fault in the application that triggers a bug in Wine. All inf files that are read are closed with SetupCloseInfFile but the app is still trying to use the handle in a call to SetupFindFirstLineA.<br><br>On Windows (tested on W2K3) this will lead to a failure of SetupFindFirstLineA with a last error of ERROR_INVALID_HANDLE. On Wine we don't check the handle and thus the outcome cannot be predicted (mostly crash).<br><br>What ways do we have to detect invalid handles or better yet how can this be solved?<br><br>--
 Cheers,<br><br>Paul.<br><br><br></div></blockquote></td></tr></tbody></table><br>

      </div></blockquote></td></tr></table><br>