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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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..
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Utilities

From novice to tech pro — start learning today.