FilterDirectOidRequest

Hi guys,

My ndis 6.0 filter driver does not receive OID requests in windows 7. I’ve noticed that the driver I’m trying to filter does not specify ndis version but has directoid handlers, which implies ndis 6.1 at least.
I think I need to upgrade my filter driver, but can’t find any samples for FilterDirectOidRequest. Can anyone help?

Thanks,
Anatoly.

NDIS does not require filter drivers to match the NDIS version of the underlying miniport driver. NDIS should do any work necessary to make a 6.0 LWF function normally over a 6.40 miniport driver. (For that matter, you can put a 4.0 filter driver over a 6.40 miniport, and only a few things will break.)

Should you want to upgrade to 6.1+, FilterDirectOidRequest is actually optional for LWFs. So you can be a 6.1-compliant LWF with NULL FilterDirectOidRequest handlers.

Should you want to implement FIlterDirectOidRequest, you can start with the trivial implementation:

NDIS_STATUS
FilterDirectOidRequest(
IN NDIS_HANDLE FilterModuleContext,
IN PNDIS_OID_REQUEST Request
)
{
PMS_FILTER pFilter = (PMS_FILTER)FilterModuleContext;
return NdisFDirectOidRequest(pFilter->FilterHandle, Request);
}

Of course, if that’s all you ever do, it would be more efficient to delete your FilterDirectOidRequest handler and just let NDIS handle it on your behalf - the NDIS default implementation is the same as the above.

Anyway, it sounds like the real problem is that your filter driver doesn’t receive regular OID requests, i.e., non-direct OID requests. If that’s the case, verify that NDIS has your filter’s OidRequestHandler by running !ndiskd.filterdriver in the kernel debugger – look for something like this:

HANDLERS

Filter handler Function pointer Symbol (if available)
OidRequestHandler fffff800014028e0 mydriver!MyFilterOidRequest
OidRequestCompleteHandler fffff800014026a0 mydriver!MyFilterOidRequestComplete

If you see that OidRequestHandler is not NULL and has a symbol, then NDIS knows about your filter’s OID handlers, and NDIS ought to call them. Set a breakpoint on those functions and verify that they really aren’t being called.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Friday, December 6, 2013 8:27 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] FilterDirectOidRequest

Hi guys,

My ndis 6.0 filter driver does not receive OID requests in windows 7. I’ve noticed that the driver I’m trying to filter does not specify ndis version but has directoid handlers, which implies ndis 6.1 at least.
I think I need to upgrade my filter driver, but can’t find any samples for FilterDirectOidRequest. Can anyone help?

Thanks,
Anatoly.


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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’ve developed this filter for vista to filter wifi adapters. You’re right the problem is not in directoid.
I can see that when Dot11 requests are sent from wlanmsm, vwififlt receives them but my filter does not. And vise versa, I see that some OIDs are received in my filter and in vwififlt are not.
Any ideas?

Thanks,
Anatoly.

PS: I get error “ndiskd has no filterdriver export”. What am I misssing?

If it’s a monitoring LWF then the instance at the lowest altitude should see
the Native Wi-Fi requests. Here is an example executable:

http://pcausa.com/WlanExplorer/default.htm

If it’s a modifying filter, then you may not be able to attach directly
above the Native WiFi miniport.

Thomas F. Divine
http://www.pcausa.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Friday, December 6, 2013 1:12 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] FilterDirectOidRequest

Hi,

I’ve developed this filter for vista to filter wifi adapters. You’re right
the problem is not in directoid.
I can see that when Dot11 requests are sent from wlanmsm, vwififlt receives
them but my filter does not. And vise versa, I see that some OIDs are
received in my filter and in vwififlt are not.
Any ideas?

Thanks,
Anatoly.

PS: I get error “ndiskd has no filterdriver export”. What am I misssing?


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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

> I get error “ndiskd has no filterdriver export”. What am I misssing?

You’re missing the latest WDK, I think. What’s the output of !ndiskd.ndiskdversion? It should be something like this:

1: kd> !ndiskd.ndiskdversion
NDISKD Version 13.04.00 (Windows Driver Kit 8.1)

I can see that when Dot11 requests are sent from wlanmsm, vwififlt receives them but my filter does not. And vise versa, I see that some OIDs are received in my filter and in vwififlt are not.

Well that’s odd. How many instances of your filter are there? E.g., how many times was your FilterAttach invoked? Or, if you get !ndiskd.filterdriver working, how many entries do you have listed under your drvier?

You might be seeing trace statements from two different instances (either at different altitudes on the same stack, due to monitoring filter, or on different stacks).

As it turns out, it was enough to change a line in the inf file to match FilterClass of vwififlt:
HKR, Ndi,FilterClass, ms_medium_converter_128

Jeffrey, was this class available on vista?

I think that class may be reserved for MSFT use only. I don’t know offhand
(having never tried) if you can get such a filter through WHQL.

I do believe, however, that this class has been round since Vista.

See this thread for a MSFT statement on whether or not using such a
FilterClass is advised.

http://osronline.com/showThread.CFM?link=220570

Good Luck,
Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Saturday, December 07, 2013 4:21 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] FilterDirectOidRequest

As it turns out, it was enough to change a line in the inf file to match
FilterClass of vwififlt:
HKR, Ndi,FilterClass, ms_medium_converter_128

Jeffrey, was this class available on vista?


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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

Right this isn’t officially supported.

Note: if you copy the altitude of another driver, then it’s nondeterministic what order your filter and the other filter will attach. Nondeterminism is bad! Nondeterminism wastes your time with random issues, and contributes to the perception that your product is mysteriously flaky. You should strive for every boot of every computer to operate in exactly the same way.

INetCfg on Windows 8.1 uses the install date as a tiebreaker (although Windows Phone uses something else, and I’m seriously contemplating switching desktop Windows to use Windows Phone’s tiebreaker rules). For now, that means if you install vwifi *after* installing your driver, they will bind in the opposite order. It’s quite possible for this to happen - one example is on Windows Server, where vwifi needs to be explicitly installed as part of the wireless feature.