How To Access To NIC Drivers
From A Win32 Application

Back Next

Developing A Solution

The following steps are involved to develop a framework that allows a common Win32 application to "directly" access NIC drivers on multiple Windows operating systems:

  1. Design, develop and debug the NDIS protocol drivers, since only NDIS protocol drivers can access the top edge of the NDIS Wrapper. Since NDIS protocol drivers are OS-dependent drivers, several different NDIS protocol driver must be provided. At a minimum three separate NDIS protocol drivers are needed:
     
            • NDIS 3.1 VxD Protocol Driver - Windows 9x, Windows 98, Windows Me (Note 1)
            • NDIS 4.0 NT Protocol Driver - Windows NT 4.0
            • NDIS 5.0 NT Protocol Driver - Windows 2000, Windows XP and higher
      

  2. Design a uniform software interface that can be used between applications and each of the NDIS protocol drivers.
     

  3. Optionally design and develop "compatibility DLL" that deals with the differences between the OS-specific components (e.g., the three different NDIS protocol drivers).

 

Where To Start...

bullet

Documentation

See the Network Drivers section of DDK Help Files provided with each of the DDK versions. Each DDK Help File describes a different NDIS version, so you will need to become familiar with each of them.


bullet

Sample NDIS Protocol Drivers

Microsoft provides basic NDIS protocol drivers with the DDKs:
 
bullet

Windows 98 - See the Windows 98 "packet driver" sample under the directory:
\98DDK\src\net\ndis3\packet\VxD
.
 

bullet

Windows NT 4.0 - There are two samples:
bullet

See the Windows NT 4.0 DDK "packet driver" sample under the directory:
\NTDDK\src\network\packet\driver
.

bullet

Also see the Updated Windows NT 4.0 NDIS 3.0 Packet Sample .
 

bullet

Windows 2000 - See the Windows 2000 DDK "packet driver" sample under the directory:
\W2KDDK\src\network\ndis\packet\driver
.
  

bullet

Windows XP and Higher - See the Windows Server 2003 DDK "NDIS Protocol" sample (NDISPROT) under the directory:
\WINDDK\####\src\network\ndis\ndisprot
. (Note 2)

 

Note 1: A reader has pointed out that PCAUSA does not mention the potential use is NDIS 5.0 protocol drivers for Windows 98 and Windows ME.  Certainly this is an omission that should be addressed.

Windows 98 and Windows ME do provide support for "NDIS 5.0". This is certainly true in the context of NDIS miniport (adapter) drivers that interface only to the NDIS wrapper. However, use of a NDIS 5.0 protocol driver on these platforms is not straightforward.

Here are some of the points that led PCAUSA to adopt the VxD model for NDIS protocol drivers from Windows 95 through Windows ME:

bullet

A NDIS 3.1 protocol driver is the only option available for the Windows 95 platform.

bullet

A single NDIS 3.,1 protocol driver can be used successfully on Windows 95, Windows 98. Windows 98 SE and Windows ME.

bullet

The NDIS 5.0 protocol model offers absolutely no functional benefit for a packet collection driver on these platforms.

bullet

The NDIS 5.0 support provided on Windows 98 through Windows ME varies from platform to platform. In particular, the set of NDIS wrapper functions that is exported varies on each platform. This introduces the additional complexity of implementing runtime detection of platform NDIS function differences.

bullet

A NDIS 5.0 protocol driver cannot be dynamically loaded without the use of a companion VxD driver that uses undocumented functions to load the NDIS 5.0 protocol driver.

bullet

A NDIS 5.0 protocol driver can only use the limited set of WDM functions in the implementation of its user mode API (e.g. DeviceIoControl interface). A NDIS 3.1 protocol driver can use the complete set of VxD services in the implementation of its user mode API. As a specific example, a Vxd-based NDIS protocol driver can provide the user mode application with an API that uses asynchronous procedure callbacks (APCs - similar to the ReadFileEx function); this sort of API cannot be implemented using WDM services (AFAIK).

Note 2: The Windows XP DDK included the NDIS User I/O sample (NDISUIO) under the directory \WINDDK\####\src\network\ndis\ndisuio. The NDISUIO driver is, actually, a built-in component of the Windows XP and higher operating system. It is used to support the Microsoft Wireless Zero Configuration (WZC) wireless connection management facility. Do NOT attempt to use the NDISUIO driver from your own application. You can use the NDISUIO source as the starting point for your own driver. See the NDIS.com articles NDIS User Mode I/O (NDISUIO) Version Dependencies and What are the steps needed to rename Microsoft NDISPROT driver?.

 

 
bullet

Other Resources

Visit NDIS.com for additional information .

 

The next topic on the Tour describes the Rawether for Windows solution to this problem.

Back Next

 

Mailing Lists  · PCAUSA Newsletter · PCAUSA Discussion List
·
Privacy Statement · 
WinDis 32 is a trademark of Printing Communications Assoc., Inc. (PCAUSA).
Rawether for Windows and Rawether .NET are trademarks of Printing Communications Assoc., Inc. (PCAUSA).
Microsoft, MS, Windows, Windows 95, Windows 98, Windows Millennium, Windows 2000, Windows XP, and Win32 are registered trademarks and Visual C++ and Windows NT are trademarks of the Microsoft Corporation.
Send mail to rawether-webmaster@pcausa.com with questions or comments about this web site.
Copyright © 1996-2008 Printing Communications Assoc., Inc. (PCAUSA).
All rights reserved.
Last modified: December 31, 2007