如何在Win32上使用C ++安装硬件驱动程序? [英] How do I install hardware driver using C++ on Win32?
问题描述
如何使用C ++安装硬件驱动程序( inf文件)?
How do I install a hardware driver (inf file) using C++?
平台: Win32 / p>
Platform : Win32
推荐答案
此过程通常称为预安装。 (正常的安装过程是由硬件设备的到来触发的)
The process is usually called pre-installation. (The normal install process is triggered by the arrival of an hardware device.)
相关功能可以在< DIFxAPI.h>
。你可能想调用 DriverPackageInstall()
。预期的回传值为 ERROR_NO_SUCH_DEVINST
[sic],因为目前还没有这类装置。
The relevant functions can be found in <DIFxAPI.h>
from the DDK. You probably want to call DriverPackageInstall()
. The expected return value is ERROR_NO_SUCH_DEVINST
[sic] as there won't be such a device yet.
64位的性能:你不能从Win32应用程序(至少不是在XP / Vista / Windows7 / 2003/2008)中安装64位驱动程序。因此,您的Win32安装程序必须检查 DriverPackageInstall()
是否返回 ERROR_IN_WOW64
,然后调用 CreateProcess
启动64位安装程序。
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()
returns ERROR_IN_WOW64
and then call CreateProcess
to start your 64 bits installer.
这篇关于如何在Win32上使用C ++安装硬件驱动程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!