Detecting an invalid handle in setupapi

Juan Lang juan.lang at gmail.com
Sat May 16 12:31:31 CDT 2009


Hi Paul,

> 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).
>
> What ways do we have to detect invalid handles or better yet how can this be
> solved?

When we detect application usage like this, the usual approach is to
avoid returning pointers as handles, and instead introduce the use of
a handle table.  Then closed handles can be detected.
--Juan



More information about the wine-devel mailing list