Frequently asked questions

Unable to link with the static build of nfapi.lib, the linker shows “unresolved external symbol” errors.

Define the symbol _NFAPI_STATIC_LIB in the project configuration or insert the following string before including nfapi.h: #define _NFAPI_STATIC_LIB 1

Unable to programmatically install the driver from a 32-bit process on 64-bit Windows.

The driver is always saved to windows\SysWOW64\drivers instead of windows\system32\drivers and can’t start.

This is a feature of 64-bit Windows called virtualization. It applies to 32-bit applications. Windows redirects file system and registry calls to different locations, which are used as an alternate view of the standard folders and registry keys:

http://msdn.microsoft.com/en-us/library/aa384249%28VS.85%29.aspx

The following ways can be used to install the driver properly on x64:

  • Call the API function Wow64DisableWow64FsRedirection from the 32-bit installer before saving the driver to windows\system32\drivers:

http://msdn.microsoft.com/en-us/library/aa365743(VS.85).aspx

It is possible to do this using the System plug-in in NSIS, and using direct API call in other installers.

  • Use a 64-bit installer on x64. For example, Windows Installer (MSI) allows you to avoid all compatibility problems.