SetupCopyOemInf on non WHQL USB drivers

Posted on 2008-11-10
Last Modified: 2013-12-01
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

Question by:adslsw
    LVL 11

    Expert Comment

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

    Author Comment

    Hi alexchon, the idea you gave is not working.. I tried it but it doesn't work..
    LVL 11

    Accepted Solution

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now