Reply To: WinpkFilter 3.0: Wireless Access Failure

Home Forums Discussions Support Portal WinpkFilter 3.0: Wireless Access Failure Reply To: WinpkFilter 3.0: Wireless Access Failure

#6659

Methusaleh
Participant

Thanks for the investigation you have performed. It is often difficult for us to ask and assist customers to uninstall existing software from their machines to help diagnose problems.

On our side we have tracked down the second half of this problem to a line of code in our application. Once that line of code was executed, an adapter could no longer have its DHCP assigned IP address renewed. For example:

ipconfig /release

followed by:

ipconfig /renew

The problem would then remain until the network device is reset or the machine is rebooted (even after the driver is closed and the application is shutdown). The code we are using to manage a network adapter is as follows:

public Adapter(IntPtr hDriver, IntPtr hAdapter)
{
_buffer = new INTERMEDIATE_BUFFER();
_ptrBuffer = Win32Helper.Malloc(Marshal.SizeOf(_buffer));
_request = new ETH_REQUEST(hAdapter, _ptrBuffer);
_event = new ManualResetEvent(false);
ADAPTER_MODE mode = new ADAPTER_MODE(hAdapter, (uint) (MSTCP_FLAG.MSTCP_FLAG_SENT_LISTEN | MSTCP_FLAG.MSTCP_FLAG_RECV_LISTEN));
/* Ndisapi.SetHwPacketFilter Locks adapter until reset */
Ndisapi.SetHwPacketFilter(hDriver, hAdapter, (uint) NDIS_PACKET_TYPE.NDIS_PACKET_TYPE_DIRECTED);
Ndisapi.SetAdapterMode(hDriver, ref mode);
Ndisapi.SetPacketEvent(hDriver, hAdapter, _event.SafeWaitHandle);
}

Once we commented out the ‘Ndisapi.SetHwPacketFilter’ line the problem disappeared. Having reviewed the sdk sample code, I can see that SetHwPacketFilter is only used to set and restore the device from promiscuous mode; nevertheless, I wouldn’t have expected that outcome.