SetupCopyOemInf on non WHQL USB drivers

I have written a simple application that runs to preinstall driver for the Windows XP such that if you plug in the device, the Add New Hardware Window would not appear.

I am able to perform this successfully when my driver has a valid catalog file, which means it is WHQL certifed.

But for non-WHQL certified drivers, I cannot seem to make this work. When I run SetupCopyOemInf, it always returns TRUE, which means the inf was successfully pre-installed. But when I plugged in the device, the Add New Hardware Window still appears.

So my question is, why does SetupCopyOEMInf return true even with drivers having no WHQL certification/ valid catalog file yet when you plug in the device, the Add New Hardware Window still appears?

/*in this case, result returns 1 (TRUE)*/
/*infPath points to the inf file path*/
/*execPath points to the path of where the inf is contained*/
result = SetupCopyOEMInf(

Open in new window

Who is Participating?
alexcohnConnect With a Mentor Commented:
To install unsigned USB WiFi adapters, we used a special application that was resident when the HW was actually connected, and this app would find and kill the Add New Hardware Window.
Did you try to set the Driver Signing policy setting in the Hardware tab of the System Control Panel to Ignore? (If this trick works, you can do this programmatically).
adslswAuthor Commented:
Hi alexchon, the idea you gave is not working.. I tried it but it doesn't work..
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.