Installing the Sample Driver
Similar to the other Windows Portable Devices (WPD) samples, this sample driver installs as a root-enumerated device. It appears under the Portable Devices or WPD node in Device Manager, and has a device ID of ROOT\WPD\NNNN.
When you install a root-enumerated device, you get a device that is always connected. As a result, even if the sensor device is unplugged from the RS-232 port, the device node (devnode) is not removed. To support devnode arrival (or removal) when the RS-232 connection is plugged in (or unplugged), you must supply a Plug and Play (PnP) bus enumerator. A sample bus enumerator is provided with the WDK Toaster Sample.
The installation INF file for the sample driver is based on the INF file for WpdHelloWorldDriver. Most of the changes involve string replacement of WpdHelloWorldDriver with WpdBasicHardwareDriver. The more significant changes are summarized in the following sections.
Enabling File-Handle Targets
The following entry is added under [Basic_Install.Wdf] to enable file handle–based UMDF I/O targets. These I/O targets are used to exchange data with the device by using the RS 232 port. For more information about I/O targets, see Supporting I/O.
UmdfDispatcher = FileHandle
Disabling Legacy WIA Support
The following line is commented out to disable Windows Image Acquisition (WIA) legacy applications from accessing this driver because the sample driver does not support image content:
;HKR,,”EnableLegacySupport”,0x10001,1
Installing the Driver
To install the sample driver, complete the following steps:
- From the Start menu, open the desired build environment .
- Build the sample (“build –cZ”).
- Copy WUDFUpdate_0xxxx.dll from the <WDK Install Location>\redist\wdf\<architecture> directory to the directory that contains the DLL for the driver.
- Install the driver (“devcon install Wpdbasichardwaredriver.inf WUDF\WpdBasicHardware”)
Note The last argument to the devcon command corresponds to the following excerpt from the driver's INF file.
[Microsoft.NTx86]
%BasicDeviceName%=Basic_Install,WUDF\WpdBasicHardware
Removing the Driver
To remove the sample driver, complete the following steps:
- Open Windows Device Manager.
- Right-click the driver under the Portable Devices node, and click Uninstall.
Related topics
The WpdBasicHardwareDriverSample