Share via


NDIS Driver Portability

NDIS drivers should be written so that they are easily portable. In general, porting from one hardware platform to another should only require recompilation with a system-compatible compiler.

Driver developers should avoid calling operating system-specific functions, but rather use NDIS equivalents of such calls. If you restrict support calls to NDIS functions, your code can be more easily ported between Microsoft operating systems that support NDIS. NDIS exports a rich set of support functions for writing drivers, and it should not be necessary to call the operating system directly.

Drivers should be written in C. Further, driver code should be restricted to the ANSI C standard and should avoid using any language features that are not supported by other system-compatible compilers. Driver code should not be written using any features that the ANSI C standard designates as implementation defined.

Drivers should avoid any dependencies on data types whose size and layout vary across platforms. Driver code should not call any C run-time library functions instead of NDIS-provided functions.

No floating-point operations are allowed in kernel-mode. It is a fatal error to attempt such operations.

Code to support platform-specific features should be encapsulated between #ifdef and #endif statements.

See Also

Network Driver Programming Considerations

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.