NDIS 6.20 filter Sample

Hi

Does anybody have or know where to get an NDIS 6.20 Filter Driver Sample? The summary of porting a driver sample fails to show how you are to obtain information regarding to the update structures to the device, particularly NDIS_DEVICE_OBJECT_ATTRIBUTES_REVISION_2 and the required additional power management structure. It talks about obtaining it from the updated PARAMETERS structure obtained from ProtocolBindEx, but fiilter drivers never use this? so how do we get this type of information. A sample would help a greta deal.

Regards

Steve

The steps required to update the stock 6.0 filter driver sample to 6.20 are pretty straightforward:

  • In filter.c: Use NDIS_FILTER_CHARACTERISTICS_REVISION_2 instead of _1. This gives you the opportunity to add 3 handlers related to Direct OIDs. But you can just leave them NULL if you don’t care about Direct OIDs (that’s typical).
  • In filter.h: Change FILTER_MINOR_NDIS_VERSION to 20.
  • In sources: Change -DNDIS60=1 to -DNDIS620=1.

That’s it :slight_smile:

I don’t actually know where you’re getting “NDIS_DEVICE_OBJECT_ATTRIBUTES_REVISION_2” from. The latest version of the WDK only has revision 1. (I can’t find it mentioned in ndis.h or on our documentation).

Maybe our versioning philosophy is not entirely clear – we increment the revision # on a structure on a structure-by-structure basis, not globally. So if a structure doesn’t change (like NDIS_DEVICE_OBJECT_ATTRIBUTES didn’t change between Vista RTM and Win7 RTM), then we just leave the revision alone.

Also, for ancillary structures like this, we probably wouldn’t be strict about versioning anyway – if we had a hypothetical revision 2 of the structure, we’d probably still allow 6.20 drivers to use revision 1. (Of course, they wouldn’t get any of the hypothetical new features in revision 2). That pattern is not always true; we reserve the right to be more strict when a structure is critical to driver functionality. For example, NdisFRegisterFilterDriver demands that the revision of the NDIS_FILTER_DRIVER_CHARACTERISTICS structure exactly matches the MinorNdisVersion. (In this case, 6.0 must use revision 1, while 6.1 and 6.20 must use revision 2).

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@bemac.com
Sent: Friday, April 01, 2011 3:01 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] NDIS 6.20 filter Sample

Hi

Does anybody have or know where to get an NDIS 6.20 Filter Driver Sample? The summary of porting a driver sample fails to show how you are to obtain information regarding to the update structures to the device, particularly NDIS_DEVICE_OBJECT_ATTRIBUTES_REVISION_2 and the required additional power management structure. It talks about obtaining it from the updated PARAMETERS structure obtained from ProtocolBindEx, but fiilter drivers never use this? so how do we get this type of information. A sample would help a greta deal.

Regards

Steve


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hi,

I have tried doing what you suggest, again, but I still get a 10005 error, Invalid characteristics when loading the filter driver, under Windows 7 32 bit o/s. The DDK I am using is 7600.16385.1. The O/S does not have to have SP1 on it?

The DDK states that on 6.20 that these are mandatory functions and cannot be null? but other docs say they are optional.

#if (NDIS_SUPPORT_NDIS61) || (NDIS_SUPPORT_NDIS620)
#pragma message(“NDIS6.20 Support”)

// NDIS Version 6.2
FChars.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS;
FChars.Header.Size = NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2;
FChars.Header.Revision = NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2;

#else

// NDIS Version 6.00
FChars.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS;
FChars.Header.Size = NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_1;
FChars.Header.Revision = NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_1;

#endif

added

#if (NDIS_SUPPORT_NDIS61) || (NDIS_SUPPORT_NDIS620)
// required characteristics for NDIS 6.10 & 6.20
// default them to nothing
FChars.CancelDirectOidRequestHandler = NULL;
FChars.DirectOidRequestHandler = NULL;
FChars.DirectOidRequestCompleteHandler = NULL;
#endif

Steve

This might be a bit of a forehead-slapper… it looks like you accidentally picked up the *miniport driver* characteristics, and not the *filter driver* characteristics.

NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS

should be

NDIS_OBJECT_TYPE_FILTER_DRIVER_CHARACTERISTICS

and similar for the other constants.

For a filter driver, only 4 handlers are actually mandatory: Attach/Detach, Pause/Restart. All others are optional. (However, there is an NDIS bug in Vista and Win7 that causes sub-optimal OID handling for a few specific OIDs if you do not provide an OidRequest handler, and you’re the top filter in a stack. Best to provide that one too.)

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@bemac.com
Sent: Friday, April 01, 2011 4:43 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] NDIS 6.20 filter Sample

Hi,

I have tried doing what you suggest, again, but I still get a 10005 error, Invalid characteristics when loading the filter driver, under Windows 7 32 bit o/s. The DDK I am using is 7600.16385.1. The O/S does not have to have SP1 on it?

The DDK states that on 6.20 that these are mandatory functions and cannot be null? but other docs say they are optional.

#if (NDIS_SUPPORT_NDIS61) || (NDIS_SUPPORT_NDIS620) #pragma message(“NDIS6.20 Support”)

// NDIS Version 6.2
FChars.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS;
FChars.Header.Size = NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2;
FChars.Header.Revision = NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2;

#else

// NDIS Version 6.00
FChars.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS;
FChars.Header.Size = NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_1;
FChars.Header.Revision = NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_1;

#endif

added

#if (NDIS_SUPPORT_NDIS61) || (NDIS_SUPPORT_NDIS620)
// required characteristics for NDIS 6.10 & 6.20
// default them to nothing
FChars.CancelDirectOidRequestHandler = NULL;
FChars.DirectOidRequestHandler = NULL;
FChars.DirectOidRequestCompleteHandler = NULL; #endif

Steve


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hi,

Thanks, doh! copy and pasted from the athwifi sample, missed the structure name. Driver now loads. What we are trying to achieve is to bind to a wifi dongle. We have two dongle’s one from vodaphone and one from 3 niether one of these seem to support NDIS 6.20. the vodaphone one, is seen as a ethernet adapter any way, and doesnt require a NDIS 6.20 filter, and the 3 uses PPP which also doesnt bind. What devices are there out there and how many actually support NDIS 6.20. or is there a better way to consistantly filter packets through Wifi dongles going forward with Windows 7 +

I thought MBB was the way forward, but in reality it does not seem that this has been adopted, or am I missing something?

Steve

Hi,

I have found this in the documentation regarding the bindings, I have set media types and added the appropriate test into the FilterAttach Function, but this extract also mentions LowerRange but does not indicate what it needs to be set too. The std filter just specifies “nolower”, do we need to change this?

QUOTE : "LowerRange and MediaType specified in the network miniport driver?s INF file are important changes for an NDIS LWF driver. To bind to Windows 7 mobile broadband driver, the filter driver should add ?ppip? in the FilterMediaTypes section of the filter driver?s INF file. It should also accept miniport drivers with NdisMediumWirelessWan in their FilterAttach function. "

Thanks
Steve

LWFs never need to change their UpperRange/LowerRange from the sample INF. Here’s a snippet from a LWF that binds to WWAN:

HKR, Ndi\Interfaces,UpperRange,“noupper”
HKR, Ndi\Interfaces,LowerRange,“nolower”
HKR, Ndi\Interfaces,FilterMediaTypes,“ethernet,ppip”

The Win7 MB driver model is definitely the future of WWAN on Windows. But it’s going to take awhile before we get all the way there. Manufacturers are generally releasing their *new* chips with 6.20 MB drivers, but there are many end-of-life’d models still in the market.

If you want to maximize your coverage, you’ll need to support both the old and the new way of doing things.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@bemac.com
Sent: Friday, April 01, 2011 7:38 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] NDIS 6.20 filter Sample

Hi,

I have found this in the documentation regarding the bindings, I have set media types and added the appropriate test into the FilterAttach Function, but this extract also mentions LowerRange but does not indicate what it needs to be set too. The std filter just specifies “nolower”, do we need to change this?

QUOTE : "LowerRange and MediaType specified in the network miniport driver?s INF file are important changes for an NDIS LWF driver. To bind to Windows 7 mobile broadband driver, the filter driver should add ?ppip? in the FilterMediaTypes section of the filter driver?s INF file. It should also accept miniport drivers with NdisMediumWirelessWan in their FilterAttach function. "

Thanks
Steve


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hi,

Thanks for the insite, you mentioned the old way of doing things, can the LWF do it the old way? and what are you referrring to with respect to the old way? Can you point me to some reading material regarding this old way? or is this just using passthrough driver sample and binding to wan, which gives rise to other issues, i.e. emulating packet processeing or hooking drivers that no longer work under windows 7?

Steve

Oh I was referring to how WWAN used to (and for end-of-life’d drivers, still does) emulate Ethernet or they’ll plug in as a modem.

It’s pretty easy for a LWF to filter the fake-Ethernet guys. Since they look just like Ethernet, the unmodified sample LWF will bind to them without any problem. (In fact, the hardest part is knowing whether you’re on top of fake-Ethernet or real Ethernet. In the general case, you can never be 100% sure.)

You can also bind a LWF on top of PPP stacks. There was a good thread here recently on just that topic: http://www.osronline.com/showThread.CFM?link=198292 , so I won’t attempt to repeat all the thoughtful guidance that others have already contributed. However, I would like to specifically call out Dave’s suggestion to move to WFP. You may find that WFP is a better solution for you, since then you don’t have to worry about the media-specific MAC layer (or fakery thereof).

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@bemac.com
Sent: Monday, April 04, 2011 1:47 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] NDIS 6.20 filter Sample

Hi,

Thanks for the insite, you mentioned the old way of doing things, can the LWF do it the old way? and what are you referrring to with respect to the old way? Can you point me to some reading material regarding this old way? or is this just using passthrough driver sample and binding to wan, which gives rise to other issues, i.e. emulating packet processeing or hooking drivers that no longer work under windows 7?

Steve


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer