Compile Flags Used by NDIS Drivers

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

NDIS drivers use the compile flags described in this section to direct NDIS to conditionally include a set of commands at compile time. The following compile flags can be enabled in the driver's sources file or embedded at the start of the driver's source code before the ndis.h header file is included:

  • BINARY_COMPATIBLE
    Compiles a binary of an NDIS driver that can run on Windows 98/Me platforms and NT-based platforms.

  • NDIS_WDM
    Directs NDIS to include the appropriate WDM header file.

  • USE_KLOCKS
    Directs spin locks of NDIS drivers built for Windows 98/Me platforms to operate; otherwise, these spin locks do not operate.

  • WIRELESS_WAN
    Directs NDIS to include a set of commands related to a wireless wide area network (WAN). This flag is obsolete for Windows 2000 and later.

Although NDIS_WRAPPER is a compile flag, NDIS drivers must not use it.

If a compile flag is included in the driver's sources file, it is preceded with "-D". To enable a compile flag, you must assign it a nonzero value. The following statement shows how to enable the NDIS_WDM compile flag in a sources file:

C_DEFINES=$(C_DEFINES) -DNDIS_WDM=1

The following code shows how to enable the NDIS_WDM compile flag in a driver's source code:

#define NDIS_WDM 1

 

 

Send comments about this topic to Microsoft