FAQ
Unable to link with the static build of nfapi.lib, the linker shows "unresolved external symbol" errors.
Define a symbol _NFAPI_STATIC_LIB in project configuration or insert the following string before including nfapi.h:
#define _NFAPI_STATIC_LIB 1
Unable to programmatically install the driver from 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 is applied to 32-bit applications. Windows redirects file system
and registry calls to different locations, 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 API function Wow64DisableWow64FsRedirection from 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 System plug-in in NSIS, and using
direct API call in other installers.
- Use 64-bit installer on x64. For example Windows Installer (MSI)
allows to avoid all compatibility problems.