Making use of setupapi

James Hawkins truiken at
Tue Feb 19 17:49:05 CST 2008

On Feb 19, 2008 5:40 PM, Maarten Lankhorst <m.b.lankhorst at> wrote:
> Hi folks,
> Any one around who understands setupapi? For iTunes I would need to
> add appropriate registry keys so that my usb device is detected. My
> idea is to use libusb to find the things like guid, revision etc and
> then adding the keys. However I am not 100% what the layout of the
> keys is.

The test suite is your friend.  Off the top of my head, I don't know
if the setupapi device installation API requires an actual device or
not, but regardless, tests are possible.  The SetupDi.*Get.* APIs can
be tested using regmon.  You call the function in question then look
at the regmon results to see what registry keys were queried.  With
this method, you then know the format of the registry entries.  This
is how most of the msi tests concerning the registry were written.
Check out dlls/msi/tests/msi.c,source.c.  It's tedious but accurate.

James Hawkins

More information about the wine-devel mailing list