wiki:libwdi/faq

Version 11 (modified by pbatard, 3 years ago) (diff)

--

(Next) (Back to Table of Content)
[TODO: organize this stuff]

Installation

How can I specify a custom signed inf/driver files for use with libwdi?

See the paragraph 'Using a custom driver file with libwdi' in the installation & compilation guide.

Compilation

Is it possible to cross-compile libwdi?

Currently, this is not possible as the compilation process requires custom embedding of the Windows driver files, and the custom embedder, which is built and called during compilation itself, is targeted at Windows platforms only. We will try to address this problem in an upcoming version.

How can I create a 32+64 bit compatible version of libwdi?

  1. Use Visual Studio (>= 2005) and select Win32 for the target. Note that Visual Studio Express cannot be used, as it doesn't include a 64 bit compiler.
  2. Use the Windows Driver Kit or DDK (v 7.x or later), and run ddk_build.cmd from one of the Windows XP 32 bit command prompts
  3. Use a multilib version of MinGW-w64. Multilib means a compiler that supports both the -m32 and -m64 options. Currently, the binaries provided on the project page are not multilib, so you need to recompile MinGW-w64 yourself.

How can I create a DLL with the DDK environment?

Run 'ddk_build DLL'. Make sure the DLL parameter is specified as uppercase.

I get "fatal error RC1050: Cannot open include file 'afxres.h'." when compiling zadig with Visual Studio Express

This is because Visual Studio Express does not officially support MFC application. You can however get zadig compiled if you edit the 'zadig.rc' file and replace the line

#include "afxres.h"

with

#include <windows.h>
#define IDC_STATIC -1

Running libwdi

Does libwdi support internationalization

Absolutely. The inf file created by libwdi is written in Unicode (UTF-16) format, to preserve any international characters, and the libwdi API calls and string parameters fully support UTF-8, meaning that you can name your devices with non English characters, or use directories in a different locale than English, and libwdi will happily process that data.

Is it possible to remove the UAC prompt during driver installation?

The UAC prompt end users get on Vista and later versions of Windows comes from the autogenerated inf not being signed by Microsoft. By default, when using an unsigned inf, Windows warns end users that the driver might not be trustworthy. The only way to prevent the security warning is to use an inf and cat file that have gone through Microsoft's WHQL/Windows Logo process.

Why is the driver installation slow?

If you have system restore points enabled (default for most installations), Windows will create a restore point before installing the driver. Depending on the system, this can be a fairly lengthy operation (20 seconds or more) that can not be disabled programmatically.

Are the extracted driver files removed after installation?

They aren't. The reason behind this is twofold. First, it is a bad idea to have an application running in elevated mode to delete files, as, if the extraction directory is user selected, we could end up deleting important data. Secondly, it is possible to use libwdi to setup the driver files for the next time the device is plugged in, in which case we must ensure that the files are still available.

Running Zadig

Development considerations

Why does lbwdi use a custom installer instead of Microsoft's redistributable dpinst.exe

The 2 main reasons are the size factor (each dpinst is about 1 MB in size or 300 KB compressed, whereas our installer is a lot smaller) as well as the ability to have greater control over the installation process. We might provide an option to embed and use dpinst in future versions of the library.