Bewerken

Delen via


Multiple Binary Opt-In: POOL_NX_OPTIN_AUTO

If you are a hardware vendor who supplies different driver binaries for different versions of Windows, you can use the POOL_NX_OPTIN_AUTO opt-in mechanism. This porting aid builds a separate driver binary for Windows 8 and for each earlier version of Windows that your driver supports.

To use this opt-in mechanism, define POOL_NX_OPTIN_AUTO=1 for all source files that you want to opt-in. To do this, include the following preprocessor definition in the appropriate property page for your driver project:

C_DEFINES=$(C_DEFINES) -DPOOL_NX_OPTIN_AUTO=1

For most drivers, this definition is sufficient to enable the opt-in mechanism to create a different binary for each version of Windows that you support.

Implementation details

The POOL_NX_OPTIN_AUTO definition redefines the NonPagedPool constant name to NonPagedPoolNx. The redefined pool type is still a compile-time constant. The macro that converts instances of the NonPagedPool constant name to NonPagedPoolNx also converts instances of NonPagedPoolCacheAligned to NonPagedPoolNxCacheAligned.