Create a Custom Driver Executable Technical Note TN149 Version 1.0 Clearance No.: FTDI# 332 Appendix A – Terminology EXE Executable FTDI Future Technology Devices International USB Universal Serial Bus CDM Combined Driver Model. Windows driver package which incorporates both D2XX and VCP drivers.
-->For certain Universal Serial Bus (USB) devices, such as devices that are accessed by only a single application, you can install WinUSB (Winusb.sys) in the device's kernel-mode stack as the USB device's function driver instead of implementing a driver.
This topic contains these sections:
Automatic installation of WinUSB without an INF file
As an OEM or independent hardware vendor (IHV), you can build your device so that the Winusb.sys gets installed automatically on Windows 8 and later versions of the operating system. Such a device is called a WinUSB device and does not require you to write a custom INF file that references in-box Winusb.inf.
When you connect a WinUSB device, the system reads device information and loads Winusb.sys automatically.
For more information, see WinUSB Device.
Installing WinUSB by specifying the system-provided device class
When you connect your device, you might notice that Windows loads Winusb.sys automatically (if the IHV has defined the device as a WinUSB Device). Otherwise follow these instructions to load the driver:
- Plug in your device to the host system.
- Open Device Manager and locate the device.
- Right-click the device and select Update driver software... from the context menu.
- In the wizard, select Browse my computer for driver software.
- Select Let me pick from a list of device drivers on my computer.
- From the list of device classes, select Universal Serial Bus devices.
- The wizard displays WinUsb Device. Select it to load the driver.
If Universal Serial Bus devices does not appear in the list of device classes, then you need to install the driver by using a custom INF.The preceding procedure does not add a device interface GUID for an app (UWP app or Windows desktop app) to access the device. You must add the GUID manually by following this procedure.
- Load the driver as described in the preceding procedure.
- Generate a device interface GUID for your device, by using a tool such as guidgen.exe.
- Find the registry key for the device under this key:HKEY_LOCAL_MACHINESYSTEMCurrentControlSetEnumUSB<VID_vvvv&PID_pppp>
- Under the Device Parameters key, add a String registry entry named DeviceInterfaceGUID or a Multi-String entry named DeviceInterfaceGUIDs. Set the value to the GUID you generated in step 2.
- Disconnect the device from the system and reconnect it to the same physical port.Note If you change the physical port then you must repeat steps 1 through 4.
Writing a custom INF for WinUSB installation
As part of the driver package, you provide an .inf file that installs Winusb.sys as the function driver for the USB device.
![Driver Driver](https://visualgdb.com/UsbDriverTool/UsbDriverTool.png)
The following example .inf file shows WinUSB installation for most USB devices with some modifications, such as changing USB_Install in section names to an appropriate DDInstall value. You should also change the version, manufacturer, and model sections as necessary. For example, provide an appropriate manufacture's name, the name of your signed catalog file, the correct device class, and the vendor identifier (VID) and product identifier (PID) for the device.
Also notice that the setup class is set to 'USBDevice'. Vendors can use the 'USBDevice' setup class for devices that do not belong to another class and are not USB host controllers or hubs.
If you are installing WinUSB as the function driver for one of the functions in a USB composite device, you must provide the hardware ID that is associated with the function, in the INF. You can obtain the hardware ID for the function from the properties of the devnode in Device Manager. The hardware ID string format is 'USBVID_vvvv&PID_pppp'.
The following INF installs WinUSB as the OSR USB FX2 board's function driver on a x64-based system.
Starting in Windows 10, version 1709, the Windows Driver Kit provides InfVerif.exe that you can use to test a driver INF file to make sure there are no syntax issues and the INF file is universal. We recommened that you provide a universal INF. For more information, see Using a Universal INF File.
Only include a ClassInstall32 section in a device INF file to install a new custom device setup class. INF files for devices in an installed class, whether a system-supplied device setup class or a custom class, must not include a ClassInstall32 section.
Except for device-specific values and several issues that are noted in the following list, you can use these sections and directives to install WinUSB for any USB device. These list items describe the Includes and Directives in the preceding .inf file.
- USB_Install: The Include and Needs directives in the USB_Install section are required for installing WinUSB. You should not modify these directives.
- USB_Install.Services: The Include directive in the USB_Install.Services section includes the system-supplied .inf for WinUSB (WinUSB.inf). This .inf file is installed by the WinUSB co-installer if it isn't already on the target system. The Needs directive specifies the section within WinUSB.inf that contains information required to install Winusb.sys as the device's function driver. You should not modify these directives.Note Because Windows XP doesn't provide WinUSB.inf, the file must either be copied to Windows XP systems by the co-installer, or you should provide a separate decorated section for Windows XP.
- USB_Install.HW: This section is the key in the .inf file. It specifies the device interface globally unique identifier (GUID) for your device. The AddReg directive sets the specified interface GUID in a standard registry value. When Winusb.sys is loaded as the device's function driver, it reads the registry value DeviceInterfaceGUIDs key and uses the specified GUID to represent the device interface. You should replace the GUID in this example with one that you create specifically for your device. If the protocols for the device change, create a new device interface GUID.Note User-mode software must call SetupDiGetClassDevs to enumerate the registered device interfaces that are associated with one of the device interface classes specified under the DeviceInterfaceGUIDs key. SetupDiGetClassDevs returns the device handle for the device that the user-mode software must then pass to the WinUsb_Initialize routine to obtain a WinUSB handle for the device interface. For more info about these routines, see How to Access a USB Device by Using WinUSB Functions.
The following INF installs WinUSB as the OSR USB FX2 board's function driver on a x64-based system. The example shows INF with WDF coinstallers.
- USB_Install.CoInstallers: This section, which includes the referenced AddReg and CopyFiles sections, contains data and instructions to install the WinUSB and KMDF co-installers and associate them with the device. Most USB devices can use these sections and directives without modification.
- The x86-based and x64-based versions of Windows have separate co-installers.Note Each co-installer has free and checked versions. Use the free version to install WinUSB on free builds of Windows, including all retail versions. Use the checked version (with the '_chk' suffix) to install WinUSB on checked builds of Windows.
Each time Winusb.sys loads, it registers a device interface that has the device interface classes that are specified in the registry under the DeviceInterfaceGUIDs key.
Note If you use the redistributable WinUSB package for Windows XP or Windows Server 2003, make sure that you don't uninstall WinUSB in your uninstall packages. Other USB devices might be using WinUSB, so its binaries must remain in the shared folder.
How to create a driver package that installs Winusb.sys
To use WinUSB as the device's function driver, you create a driver package. The driver package must contain these files:
- WinUSB co-installer (Winusbcoinstaller.dll)
- KMDF co-installer (WdfcoinstallerXXX.dll)
- An .inf file that installs Winusb.sys as the device's function driver. For more information, see Writing an .Inf File for WinUSB Installation.
- A signed catalog file for the package. This file is required to install WinUSB on x64 versions of Windows starting with Vista.
Note Make sure that the driver package contents meet these requirements:
- The KMDF and WinUSB co-installer files must be obtained from the same version of the Windows Driver Kit (WDK).
- The co-installer files must be obtained from the latest version of the WDK, so that the driver supports all the latest Windows releases.
- The contents of the driver package must be digitally signed with a Winqual release signature. For more info about how to create and test signed catalog files, see Kernel-Mode Code Signing Walkthrough on the Windows Dev Center - Hardware site.
- Download the Windows Driver Kit (WDK) and install it.
- Create a driver package folder on the machine that the USB device is connected to. For example, c:UsbDevice.
- Copy the WinUSB co-installer (WinusbcoinstallerX.dll) from the WinDDKBuildNumberredistwinusb folder to the driver package folder.The WinUSB co-installer (Winusbcoinstaller.dll) installs WinUSB on the target system, if necessary. The WDK includes three versions of the co-installer depending on the system architecture: x86-based, x64-based, and Itanium-based systems. They are all named WinusbcoinstallerX.dll and are located in the appropriate subdirectory in the WinDDKBuildNumberredistwinusb folder.
- Copy the KMDF co-installer (WdfcoinstallerXXX.dll) from the WinDDKBuildNumberredistwdf folder to the driver package folder.The KMDF co-installer (WdfcoinstallerXXX.dll) installs the correct version of KMDF on the target system, if necessary. The version of WinUSB co-installer must match the KMDF co-installer because KMDF-based client drivers, such as Winusb.sys, require the corresponding version of the KMDF framework to be installed properly on the system. For example, Winusbcoinstaller2.dll requires KMDF version 1.9, which is installed by Wdfcoinstaller01009.dll. The x86 and x64 versions of WdfcoinstallerXXX.dll are included with the WDK under the WinDDKBuildNumberredistwdf folder. The following table shows the WinUSB co-installer and the associated KMDF co-installer to use on the target system.Use this table to determine the WinUSB co-installer and the associated KMDF co-installer.
WinUSB co-installer KMDF library version KMDF co-installer Winusbcoinstaller.dll Requires KMDF version 1.5 or later Wdfcoinstaller01005.dllWdfcoinstaller01007.dllWdfcoinstaller01009.dllWinusbcoinstaller2.dll Requires KMDF version 1.9 or later Wdfcoinstaller01009.dll Winusbcoinstaller2.dll Requires KMDF version 1.11 or later WdfCoInstaller01011.dll - Write an .inf file that installs Winusb.sys as the function driver for the USB device.
- Create a signed catalog file for the package. This file is required to install WinUSB on x64 versions of Windows.
- Attach the USB device to your computer.
- Open Device Manager to install the driver. Follow the instructions on the Update Driver Software wizard and choose manual installation. You will need to provide the location of the driver package folder to complete the installation.
Related topics
WinUSB Architecture and Modules
Choosing a driver model for developing a USB client driver
How to Access a USB Device by Using WinUSB Functions
WinUSB Power Management
WinUSB Functions for Pipe Policy Modification
WinUSB Functions
WinUSB
Choosing a driver model for developing a USB client driver
How to Access a USB Device by Using WinUSB Functions
WinUSB Power Management
WinUSB Functions for Pipe Policy Modification
WinUSB Functions
WinUSB
Whether you plan to upgrade your Windows XP, Vista, 7 or 8 machine to Windows 10 or buy a new PC with Windows 10 pre-installed, you can use Windows Easy Transfer to copy all your files and settings from your old machine or old version of Windows to your new machine running Windows 10. In this article, I’ll walk you through the steps to configure Windows Easy Transfer.
Before we get started, let me clarify exactly what you can transfer using Windows Easy Transfer:
– User Accounts
– Documents
– Videos
– Music
– Pictures
– Email
– Browser Favorties
It will not transfer over the programs. You will have to reinstall any programs that you want on your new Windows 10 PC.
Windows Easy Transfer on Windows 10
Before we get started, there is one big issue we have to deal with. Microsoft has removed Windows Easy Transfer from Windows 10 and now suggests some third-party program PCmover Express, which costs money! There is no way I’m paying any money just to transfer some data from one PC to another.
Luckily, there is a way to get around this problem. Basically, the Windows Easy Transfer program is already installed on Windows 7 and Windows 8. If you are using Windows XP or Vista, you can download the appropriate version from here:
Windows XP Easy Transfer – https://www.microsoft.com/en-us/download/details.aspx?id=7349
Windows Vista Easy Transfer – https://www.microsoft.com/en-us/download/details.aspx?id=14179
Now, if you try to download the Vista version and run it on Windows 10, it gives you an error. However, if you have a Windows 7 64-bit machine, you can copy over the folder that contains the Windows Easy Transfer program to a USB stick and then run it on Windows 10 and it works just fine.
If you do not have access to a Windows 7 64-bit machine, I copied the folder and zipped it up, which you can download from here. If you have 32-bit Windows 7, run the preinstalled 32-bit version on the Windows 7 machine, but download the 64-bit version on Windows 10. It can import a 32-bit version of an Easy Transfer file. Simply uncompress the folder and run migwiz.exe.
Run WET on Old Computer
To get started, you need to open Windows Easy Transfer on your old PC or the PC that is running Windows XP, Vista, 7 or 8. Note that if you are doing an upgrade, think of the old machine as the old version of Windows, in this case Windows XP, Vista, or 7.
Also, note that if you are upgrading Windows XP or Vista, you will need to download and install Windows Easy Transfer as it does not come with the program built-in. If you are running Windows 7 or 8, it’s already there and you can just search for it. The download links are above.
Note that it says it’s for transferring from XP or Vista to Windows 7, but you can use it to transfer to Windows 8 also. In Windows 7, just search for Easy Transfer and you’ll see it show up:
To start, we will open Easy Transfer on the old machine, in my case Windows 7. Once you start it, the Welcome dialog will pop up and give you an overview of what items you can transfer:
Click Next and then choose the method you want to use to transfer between the old PC and Windows 8. You can choose from Easy Transfer Cable, a Network, or an external hard disk or USB flash drive:
If you are upgrading a computer to Windows 10, then you can choose external hard disk or USB flash drive since the old and the new computer is actually the same computer. You’ll, of course, have to have a external drive or USB flash drive in order to do this.
If you’re transferring between two computers, then the best option is a network connection since you probably have the computers on the same wireless home network. If you don’t have any network setup at home, then you can use an Easy Transfer Cable, which is a special cable you have to buy. Here is a list from Amazon:
In this article, I’ll go through the network method since that is what most people will be using. If you are transferring to Windows 10, then choose the USB method instead. Click on A network and choose whether this is the old or the new computer. In our case, we are starting with the old computer, so click on This is my old computer.
On the next screen, you’ll see some instructions and you’ll see a Windows Easy Transfer key. You will need to use this key on the new computer.
Now go to your new Windows machine and start the Windows Easy Transfer wizard. You can open it in Windows 8 by going to the Start screen and then right-clicking anywhere until you see All apps at the bottom right. Then scroll to the right and you’ll see it under Windows System.
In Windows 10, you’ll need to either download the Windows 7 64-bit WET in the link I have above or you can do it yourself by going to the following folder on your Windows 7 PC:
Find the migwiz folder and copy it to a USB flash drive or to the cloud, etc. However you do it, just copy that entire folder to your Windows 10 PC and then double-click on migwiz.exe.
Now follow the same steps as above: click Next on the welcome screen, choose a network for how you want to transfer, and then choose This is my new PC. On the next screen, you have to tell Windows whether you installed Easy Transfer or if you’re running Windows 7, in which case it’s already installed.
In my case, I am transferring from Windows 7, so I chose My old PC is running Windows 7 or Windows 8. Click Next. You’ll get the instructions to go to your old PC and get the key, which we already did. Click Next again.
Now go ahead and type in the key that you got from your old computer and click Next. The program will download any updates to the Easy Transfer program first:
Once it has done that, it will scan the user accounts on the old computer (which takes a few minutes) and tell you exactly how many MBs worth of data will be transferred:
You can click on the Customize link to see exactly how big each folder will be and you can uncheck specific folders if you don’t want to transfer everything like Music or Videos, etc. If you click on the Advanced link here, you will get an Explorer dialog where you can check and uncheck specific folders under each of the main folders.
If you click on Advanced Options, you can change how the mapping of the user accounts will occur. If the names of the accounts on both computers are the same, it will automatically link them, but you can change it here:
That’s pretty much it. Click on Transfer and your files and settings will be transferred over! The most important thing here is the App Settings, which is really useful if you installed some heavy-duty programs on your computer like MS Office, customized them, and now have to reinstall them on Windows 10. If you transfer the settings using the Easy Transfer wizard, you can install the app on Windows 10 and retain all those settings and customizations. If you have any questions about the transfer process, post a comment here and I’ll try to help. Enjoy!