How do I install a hardware driver (inf file) using C++?
Platform : Win32
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The process is usually called pre-installation. (The normal install process is triggered by the arrival of an hardware device.)
The relevant functions can be found in
<DIFxAPI.h>from the DDK. You probably want to callDriverPackageInstall(). The expected return value isERROR_NO_SUCH_DEVINST[sic] as there won’t be such a device yet.There’s some 64 bit funkyness: you can’t install a 64 bits driver from a Win32 app (at least not in XP/Vista/Windows7/2003/2008). Hence, your Win32 installer must check if
DriverPackageInstall()returnsERROR_IN_WOW64and then callCreateProcessto start your 64 bits installer.