Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting... Please check out the Community Guidelines in the
Announcements and Administration Category.

Connectivity issues with LWF and Wifi

John-6John-6 Posts: 57
I've found that my LWF that attaches to wifi adapters causes loss of connectivity. I've narrowed it down to some issue with the OidRequestHandler. If I just make that NULL during the filter registration then the adapter works fine. But if the Oid handler is there and I try to add NDIS_PACKET_TYPE_PROMISCUOUS then the connection drops. There are various other messages about this problem but with no real solution other than just removing the Oid handler completely. I can recreate this problem on Windows 8.1 and 10. Haven't tried on Windows 7 yet.

So to solve this, I created one filter that will detect which version is being loaded (wifi or ethernet) and either enable the Oid handler or just keep it NULL. I use a single INF to install both with the relevant install sections below. The ethernet version is supposed to only attach to "ethernet" media types but I find that this filter is still listed in the wifi adapter properties. The effect being that the wifi drops the connection because this ethernet filter has the Oid handler enabled. The way to fix this is to manually go into the adapter settings and uncheck the non-wifi LWF, disable the adapter and then re-enable. Obviously not a good solution. Is there a way to prevent the ethernet LWF from being added to the wifi via the INF? I thought just listing "ethernet" in the FilterMediaTypes would be sufficient.

Also, what is the issue with NDIS_PACKET_TYPE_PROMISCUOUS and wifi? Why does that cause connection loss?

HKR, Ndi,FilterClass,, custom
HKR, Ndi,FilterType,0x00010001,2
HKR, Ndi\Interfaces,UpperRange,,"noupper"
HKR, Ndi\Interfaces,LowerRange,,"nolower"
HKR, Ndi\Interfaces, FilterMediaTypes,,"ethernet"
HKR, Ndi,FilterRunType,0x00010001, 0x00000002 ; Optional filter

HKR, Ndi,FilterClass,, ms_medium_converter_128
HKR, Ndi,FilterType,0x00010001,2
HKR, Ndi\Interfaces,UpperRange,,"noupper"
HKR, Ndi\Interfaces,LowerRange,,"nolower"
HKR, Ndi\Interfaces, FilterMediaTypes,,"vwifi,vchannel"
HKR, Ndi,FilterRunType,0x00010001, 0x00000002 ; Optional filter

OidRequestHandler code:

Status = NdisAllocateCloneOidRequest(pFilter->FilterHandle, Request, TAG_FILTER, &ClonedRequest);
if (Status == NDIS_STATUS_SUCCESS) {
Context = (PFILTER_REQUEST_CONTEXT)(&ClonedRequest->SourceReserved[0]);
*Context = Request;

bSubmitted = TRUE;
ClonedRequest->RequestId = Request->RequestId;
pFilter->PendingOidRequest = ClonedRequest;

if (ClonedRequest->RequestType == NdisRequestSetInformation) {
flgs = PtrToUlong(ClonedRequest->DATA.SET_INFORMATION.InformationBuffer);
if ((flgs & pro) == 0) {
flgs |= pro;
ClonedRequest->DATA.SET_INFORMATION.InformationBuffer = &flgs;
ClonedRequest->DATA.SET_INFORMATION.InformationBufferLength = sizeof(flgs);

Status = NdisFOidRequest(pFilter->FilterHandle, ClonedRequest);
if (Status != NDIS_STATUS_PENDING) {
FilterOidRequestComplete(pFilter, ClonedRequest, Status);
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!