Home Up Search PCAUSA HomeIM Driver FAQ

NDIS FAQ IM Driver FAQ TDI FAQ Win95 IFS FAQ Other Resources Consultants

 

Answers to NDIS IM Driver Frequently Asked Questions

The information on this page is intended primarily for network software developers who are working on NDIS Intermediate device drivers for Windows 98 and Windows NT.

undercon.gif (286 bytes)This FAQ, like most others, is always under construction...

Although PCAUSA has an interest in NDIS Intermediate drivers, PCAUSA does NOT pretend to be an expert in this area. There are others much more thoroughly versed in the area.

However, as a small company, PCAUSA has the flexibility to setup this FAQ in the hope that it will be useful to other developers.

If you have useful information or corrected/improved links that you think should be added to the NDIS IM FAQ, please let us know at ndisimfaq@pcausa.com.

Thanks!!!

 

Table of Contents

 

NDIS Intermediate Driver Questions

What platforms support NDIS Intermediate Drivers?
Where can I find a NDIS Intermediate Driver Sample?
Microsoft ImSamp Developer Notes
About The ImSamp driver
How do I build the ImSamp driver?
How do I install the ImSamp driver?
What are (some) known bugs in ImSamp?
NDIS IM Drivers and NDISWAN/RAS
How to make an IM driver that works with NDISWAN over TCP/IP (Scott Meeuwsen - 5/17/99)
Implementing an intermediate driver that works with RAS under NT (Andrew Zabolotny - 1/6/99)
How Can I Test My NDIS Intermediate Driver? (2/1/99)

 

 

NDIS Intermediate Driver Questions

 

What platforms support NDIS Intermediate Drivers?

NDIS Intermediate drivers are supported on Microsoft platforms that provide NDIS 4.0 and higher. These are:

Microsoft Windows 98
Microsoft Windows NT 4.0
SP3
SP4
SP5
Microsoft Windows NT 5.0/2000

Be sure that you are actually testing on a platform that has NDIS 4.0 or higher support. Some developers have gotten stuck testing on NT 4.0 without SP3 or SP4.

 

Where can I find a NDIS 4 intermediate driver sample?

Microsoft has provided two different NDIS Intermediate driver samples, including:

ImSamp Sample - The Microsoft Windows NT DDK team has a sample NDIS Intermediate (IM) Driver named "ImSamp" on their website at:

http://support.microsoft.com/support/ddk_hardware/ntddk/NTsamples/#Network Device Driver Samples

 

PassThru Sample - The Microsoft NT 5.0 Beta DDK includes a different NDIS IM Driver sample "PassThru" under the directory:

\DDK\Src\Network\NDIS\SampIM

 

Both of these samples are useful. I doubt that either sample is bug-free.

Back to Top

 

Microsoft ImSamp Developer Notes

About The ImSamp driver

The Microsoft ImSamp NDIS Intermediate (IM) driver sample was developed by Jim Mateer of Microsoft. Jim released several versions of ImSamp, including the one on the Microsoft website.

The best approach is to start with the Microsoft ImSamp sample from the Microsoft website as a baseline. Incorporate pieces from the ImSamp Reference Sources if they are helpful.

PCAUSA has one version of ImSamp that is a slight variation from the version on the Microsoft website. It should be considered as an unfinished work. It includes an initial pruning DLL that attempts to review the bindings.

You can download this version of Jim Meteer's IMSAMP from:

icodownl.gif (151 bytes) Download ImSamp w/Prune DLL Driver Sources

Use these sources at your own risk!!!

None of the available IM driver samples are bug-free!!!

PCAUSA does NOT claim any credit for the development of this or any version of ImSamp.

PCAUSA did make infinitesimal changes to the SOURCES file and slightly modified the ImSamp directory structure.

 

 

How do I build the ImSamp driver?

ImSamp is built under the NT DDK using the BUILD tool. Please read the NT DDK Help file for instructions on using BUILD.

Some versions of ImSamp included an interim NDIS.H and other temporary NT DDK components.

At this time it is strongly suggested that you do not use the interim NDIS.H and NDIS library components that came with some versions of ImSamp. It is clear that the interim NDIS.H had bugs in certain macro definitions which could cause problems even when building non-IM NDIS drivers.

The recommended environment for building an NDIS Intermediate driver is the Windows NT 5.0 Beta 3 DDK build environment. It includes the correct NDIS.H header and NDIS library.

The Microsoft Windows NT 5.0 DDK is available on the MSDN Universal Subscription CD. It can also be downloaded from the Microsoft website.

Although the NT 5.0 DDK is needed to properly build ImSamp, you can actually build ImSamp and run it on a NT 4.0 (SP3+) platform.

If you already have the NT 4.0 DDK installed, you can install the NT 5.0 DDK without overwriting your existing NT 4.0 DDK. Just specify a different root directory for the NT 5.0 DDK. After the installation you will have two separate NT DDK program groups.

Lets make this clear. You can:

Use NT 5.0 Beta 2 DDK to build ImSamp. The build itself can be done on NT 4.0 or NT 5.0.
Run the resulting ImSamp on NT 4.0 SP3 or higher and NT 5.0.

So far PCAUSA has ONLY developed and tested ImSamp on NT 4.0 SP3 & SP4.

One last time: You need the NT 5.0 DDK. BUT you don't need NT 5.0!

Back to Top

 

How do I install the ImSamp driver?

Use the following steps to install the ImSamp Reference Driver on the Windows NT 4.0 platform:

  1. You must copy BindPrune.DLL to your System32 directory before installing the IMSAMP driver. This is the helper DLL that prunes the bindings during the review cycle.
  2. Copy DISK1, OEMSETUP.INF, BindPrune.DLL and IMSAMP.SYS to a floppy.
  3. In the NCPA, install a New Service. Select Have Disk, then select the floppy built in Step 2.

NCPA will show the bindings as disabled after install, but they are really enabled.

Back to Top

 

What are (some) known bugs in ImSamp?

1.) ImSamp uses the ProtocolReserved area of the NDIS_PACKET to contain a structure named IM_PACKET_CONTEXT, defined in GLOBALS.H. The size of the IM_PACKET_CONTEXT is passed to NdisAllocatePacketPool.

Some versions of the NT DDK documentation state:

"For packet descriptors to be used in receive indications, this parameter (i.e., the size of the ProtocolReserved area) can be at most 16 (bytes)".

Unfortunately, this statement is incorrect. The correct statement is:

"For packet descriptors to be used in receive indications, this parameter (i.e., the size of the ProtocolReserved area) must be at least 16 (bytes)"

When an IM driver is making a receive indication, it is operating as a miniport. In this case, the IM driver is free to use the 8-byte MiniportReserved field of the NDIS_PACKET when making indications.

Although it is not stated anywhere, the statement about the 16-byte minimum size of the ProtocolReserved area when making indications must mean that some network component (probably the NDIS wrapper) expects to be able to use these 16-bytes for some unspecified purpose. It would also stand to reason that an IM driver could allocate a ProtocolReserved size of greater then 16 bytes, and could use all but the first 16 bytes for its own purpose when making receive indications.

2.) There is an additional problem associated with the definition of the NDIS_PACKET structure. In some versions of NDIS.H, the NDIS_PACKET structure includes two ULONGs before the ProtocolReserved field:

ULONG  Reserved[2]; // For compatibility with Win95
UCHAR  ProtocolReserved[1];

Unfortunately, these two ULONGs are NOT defined in the NT 4.0 DDK. So, there is some question about were the ProtocolReserved area actually starts - at least on the NT 4.0 platform.

There is no good solution for this mixup.

The ImSamp driver, as currently written, is NOT a MINIPORT driver. This means that it won't run as-is on Windows 9X.

  1. If one only looks for a solution that will allow ImSamp to run on Windows NT 4.0, then a workaround for Problem 2 is to logically "comment out" the two Windows 95 Reserved ULONGs. One can do this by modifying use of the CONTAINING_RECORD macro to reference Reserved[0] instead of ProtocolReserved when locating PIM_PACKET_RESERVED. In this case, the size of IM_PACKET_RESERVED could be as large as 16 bytes. However, a different solution would (probably) be required for Windows 2000.
  2. An approach that would (probably) work for Windows NT 4.0 and Windows 2000 is to use the ProtocolReserved field location as defined in the Windows 2000 DDK (which includes the two ULONGs) and reduce the size of the ProtocolReserved area to only 8 bytes.

3.) The attributes passed to NdisMSetAttributes should include NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER.

NdisMSetAttributesEx(
   MiniportAdapterHandle,
   AdapterInList,
   0,
   NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER |
   NDIS_ATTRIBUTE_DESERIALIZE |
   NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT |
   NDIS_ATTRIBUTE_IGNORE_REQUEST_TIMEOUT,
   0
   );

If developers provide PCAUSA with bug fix information concerning the ImSamp Reference Driver, then we will attempt to update it and maintain release notes as time permits. Please understand that maintaining this FAQ is a fairly low priority task.

 

NDIS IM Drivers and NDISWAN/RAS

Working with NDISWAN/RAS and NDIS IM drivers has proven to be a difficult task. Here are some notes from developers that have worked on this problem and have decided to share their findings.

 

How to make an IM driver that works with NDISWAN over TCP/IP

May 17, 1999 - Scott Meeuwsen <scottm@entela.com> has contributed a paper that describes changes you can make to a working Ethernet IM driver that will allow it to function with NDISWAN adapters over TCP/IP. Click the link below to view Mr. Meeuwsen's paper.

How to make an IM driver that works with NDISWAN over TCP/IP

Note: The approach described below by Andrew Zabolotny didn't work for Scott...

 

Implementing An Intermediate Driver that works with RAS under NT

January 6, 1999 - Andrew Zabolotny <bit@eltech.ru> has contributed a paper that includes his instructions on how to adapt a intermediate driver that works with network cards to make it work with RAS. Click the link below to view Mr. Zabolotny's paper.

Implementing An IM Driver That Works With RAS Under NT

Back to Top

 

 

How Can I Test My NDIS Intermediate Driver

February 1, 1999 - At it's upper edge an NDIS Intermediate Driver should function like an ordinary NDIS Miniport driver. This means that the Hardware Compatibility Test (HCT) tools used to test ordinary NDIS Miniport drivers can be used to test NDIS Intermediate Drivers.

NDIS Miniport drivers can be tested with the NDIS Tester, which is available from the Microsoft WHQL (Windows Hardware Quality Labs). The general WHQL web site (for all kinds of devices) is:

http://www.microsoft.com/hwtest

Go to the TEST KITS & FAQs link and check the "LAN Network Self-Test" entry in the table. There you'll find a link to the Hardware Compatibility Test (HCT) CD-ROM, which you must order for a small fee.

There are also links for download of the latest test documents.

Alternatively, e.g. if you do not want to have your driver officially certified by WHQL, download the latest NDIS Tester beta version from:

ftp://ftp.microsoft.com/services/whql/ndis

The NDIS Tester tests all of the Miniport driver's capabilities, depending if it is a NDIS3, NDIS4, or NDIS5 Miniport.

In addition, some HCT Test Tools are included with the MSDN Universal Subscription CDs.

Back to Top
 

 

WinDis 32 is a trademark of Printing Communications Assoc., Inc.
Microsoft, MS, Windows, Windows 95, Windows 98, and Win32 are registered trademarks and Visual C++ and Windows NT are trademarks of the Microsoft Corporation.
Send mail to webmaster@pcausa.com with questions or comments about this web site.
Copyright © 1996-1999 Printing Communications Assoc., Inc.
Last modified: July 07, 1999