0

I have NDIS 6.2 Supporting Miniport Driver . Now I want to port NDIS 6.2 to NDIS 6.3 .

https://msdn.microsoft.com/en-us/library/windows/hardware/dn232191(v=vs.85).aspx

Using this link I changed some general requirements and Power Management for Enhancements in NDIS 6.30 .

i put all changes are in same NDIS 6.2 file .

The chnages are (miniport.cpp)

ndisMiniportDriverCharacteristics.MajorNdisVersion                = 6;
ndisMiniportDriverCharacteristics.MinorNdisVersion                = 30;

ndisMiniportDriverCharacteristics.MajorDriverVersion              = VERSION_MAJOR_NUM;
ndisMiniportDriverCharacteristics.MinorDriverVersion              = VERSION_MINOR_NUM;

ndisMiniportDriverCharacteristics.SetOptionsHandler               = CMiniport::SetOptions;
ndisMiniportDriverCharacteristics.InitializeHandlerEx             = CMiniport::InitializeEx;

...... ....etc

then inside InitializeEx() funcion the changes for NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES are :

NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES ndisMiniportAdapterRegistrationAttributes;
NdisZeroMemory(&ndisMiniportAdapterRegistrationAttributes, sizeof(NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES));

#if (NDIS_SUPPORT_NDIS630)

C_ASSERT(sizeof(NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES) >= NDIS_SIZEOF_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_2);
ndisMiniportAdapterRegistrationAttributes.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES;
ndisMiniportAdapterRegistrationAttributes.Header.Size = NDIS_SIZEOF_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_2;
ndisMiniportAdapterRegistrationAttributes.Header.Revision = NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_2;

#else

C_ASSERT(sizeof(NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES) >= NDIS_SIZEOF_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1);
ndisMiniportAdapterRegistrationAttributes.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES;
ndisMiniportAdapterRegistrationAttributes.Header.Size = NDIS_SIZEOF_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1;
ndisMiniportAdapterRegistrationAttributes.Header.Revision = NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1;

#endif // NDIS MINIPORT VERSION

ndisMiniportAdapterRegistrationAttributes.MiniportAdapterContext = CMiniport::m_pMiniport;


#if (NDIS_SUPPORT_NDIS630)

    ndisMiniportAdapterRegistrationAttributes.AttributeFlags |= NDIS_MINIPORT_ATTRIBUTES_NO_PAUSE_ON_SUSPEND;

#else

   ndisMiniportAdapterRegistrationAttributes.AttributeFlags = NDIS_MINIPORT_ATTRIBUTES_SURPRISE_REMOVE_OK | NDIS_MINIPORT_ATTRIBUTES_NDIS_WDM;

#endif  

ndisMiniportAdapterRegistrationAttributes.CheckForHangTimeInSeconds = 5;

and for the chnage NDIS_PM_CAPABILITIES i wrote like this :

 NDIS_PM_CAPABILITIES ndisPmCapabilities;
 NdisZeroMemory(&ndisPmCapabilities, sizeof(NDIS_PM_CAPABILITIES));


#if (NDIS_SUPPORT_NDIS630)

    C_ASSERT(sizeof(NDIS_PM_CAPABILITIES) >= NDIS_SIZEOF_NDIS_PM_CAPABILITIES_REVISION_2);
    ndisPmCapabilities.Header.Type = NDIS_OBJECT_TYPE_DEFAULT;
    ndisPmCapabilities.Header.Size = NDIS_SIZEOF_NDIS_PM_CAPABILITIES_REVISION_2;
    ndisPmCapabilities.Header.Revision = NDIS_PM_CAPABILITIES_REVISION_2;

    ndisPmCapabilities.MinMagicPacketWakeUp = NdisDeviceStateUnspecified;
    ndisPmCapabilities.MinPatternWakeUp = NdisDeviceStateUnspecified;
    ndisPmCapabilities.MinLinkChangeWakeUp = NdisDeviceStateUnspecified;

#else

    C_ASSERT(sizeof(NDIS_PM_CAPABILITIES) >= NDIS_SIZEOF_NDIS_PM_CAPABILITIES_REVISION_1);
    ndisPmCapabilities.Header.Type = NDIS_OBJECT_TYPE_DEFAULT;
    ndisPmCapabilities.Header.Size = NDIS_SIZEOF_NDIS_PM_CAPABILITIES_REVISION_1;
    ndisPmCapabilities.Header.Revision = NDIS_PM_CAPABILITIES_REVISION_1;

    ndisPmCapabilities.MinMagicPacketWakeUp = NdisDeviceStateUnspecified;
    ndisPmCapabilities.MinPatternWakeUp = NdisDeviceStateUnspecified;
    ndisPmCapabilities.MinLinkChangeWakeUp = NdisDeviceStateUnspecified;

#endif // NDIS MINIPORT VERSION

So my doubts are :

  1. can i use this NDIS 6.30 for windows 7 NDIS 6.2 ?
  2. how to activate NDIS_SUPPORT_NDIS630 macro ?

in ndis.h WDK file the macros are like this :

#if !defined(NDIS_SUPPORT_NDIS630)
#if  (((defined (NDIS_MINIPORT_MAJOR_VERSION) && (NDIS_MINIPORT_MAJOR_VERSION >= 6)) && \
       (defined (NDIS_MINIPORT_MINOR_VERSION) && (NDIS_MINIPORT_MINOR_VERSION >= 30))) || \
      (defined (NDIS630)) || NDIS_WRAPPER)
#define NDIS_SUPPORT_NDIS630      1
#else
#define NDIS_SUPPORT_NDIS630      0
#endif
#endif // !defined(NDIS_SUPPORT_NDIS630)

but when i use ndisPmCapabilities.Header.Revision = NDIS_PM_CAPABILITIES_REVISION_2; directly i got error like NDIS_PM_CAPABILITIES_REVISION_2 is not defined .

How to use this NDIS_SUPPORT_NDIS630 macro ?

vinay kp
  • 35
  • 8

2 Answers2

1

You activate the relevant NDIS version by defining the appropriate NDIS6XX_MINIPORT in your project. You can see it in more details in comments at the beginning of ndis.h header.

You can compile your driver with whatever NDIS version that you want, but they are not backwards compatible - each Windows version is provided with a different NDIS version, naturally older OS versions can't work with newer NDIS versions.

SomeWittyUsername
  • 18,025
  • 3
  • 42
  • 85
  • It's working after changing NDIS630_MINIPORT=1 from NDIS620_MINIPORT=1 inside .vcxproj file . so the problem were in the build ommands . – vinay kp Dec 18 '15 at 09:07
  • Thanks for the information . So i should build my application speific to different OS ? like NDIS 6.2 - windows 7 and NDIS 6.3 - Windows 8 , 8.1 like this ? – vinay kp Dec 18 '15 at 09:09
  • I'm not sure what you're trying to achieve. If you specify NDIS630_MINIPORT, your code should comply with NDIS 6.3 specification (which has some differences compared to NDIS 6.2, especially within the registration process). But the resulting driver won't install on Windows 7 because it doesn't support NDIS 6.3. You can target your driver to NDIS 6.2 and it should work on both Windows 7 and 8. – SomeWittyUsername Dec 18 '15 at 09:58
  • But when i use NDIS 6.2 , I got some crash on windows 8 , 8.1 . The dump file pointed out " ntoskrnl.exe " . I think this is due to power management pblm . That's why i port to NDIS 6.3 . so it will help me ? any idea ? – vinay kp Dec 18 '15 at 14:30
  • It's hard to tell without actual debugging – SomeWittyUsername Dec 18 '15 at 18:43
1

Windows 7 does not support NDIS 6.30. Windows 7 only goes up to 6.20.

Jeffrey Tippet
  • 3,146
  • 1
  • 14
  • 15