How To Query the NDIS Version at Run Time (195391)



The information in this article applies to:

  • Microsoft Windows NT 4.0 Driver Development Kit (DDK), when used with:
    • the operating system: Microsoft Windows NT 3.51
    • the operating system: Microsoft Windows NT 4.0
  • Microsoft Windows 2000 Driver Development Kit (DDK), when used with:
    • the operating system: Microsoft Windows 2000
  • Microsoft Windows XP Driver Development Kit (DDK), when used with:
    • the operating system: Microsoft Windows XP

This article was previously published under Q195391

SUMMARY

This article explains how drivers using NDIS (miniports, protocols) can query the current NDIS version at run time. This is particularly useful when you need to make changes to legacy drivers to adapt to later versions of NDIS.

MORE INFORMATION

Sample Code

   NDIS_STRING VersionStr = NDIS_STRING_CONST("NdisVersion");
   PNDIS_CONFIGURATION_PARAMETER ReturnedValue;

   NdisReadConfiguration(&Status,
                         &ReturnedValue,
                         ConfigHandle,
                         &VersionStr,
                         NdisParameterInteger);
   if (Status == NDIS_STATUS)
   {
           // 
           // The returned value has the NDIS version of the form
           // 0xMMMMmmmm, where MMMM is major version and mmmm is minor
           // version so 0x00050000 is 5.0
           // 
           Version = ReturnedValue->ParameterData.IntegerData;
   }
				

Modification Type:MinorLast Reviewed:8/30/2004
Keywords:kbinfo kbNDIS KB195391