diff --git a/packetWin7/npf/npf/Openclos.c b/packetWin7/npf/npf/Openclos.c index 28b5dda6..bb33c569 100644 --- a/packetWin7/npf/npf/Openclos.c +++ b/packetWin7/npf/npf/Openclos.c @@ -615,10 +615,6 @@ NPF_OpenAdapter( NPF_AddToGroupOpenArray(Open, pFiltMod); NPF_StopUsingBinding(pFiltMod, NPF_IRQL_UNKNOWN); } - else - { - Open->OpenStatus = OpenDetached; - } Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = FILE_OPENED; @@ -1589,6 +1585,8 @@ NPF_AddToGroupOpenArray( NdisReleaseRWLock(pFiltMod->OpenInstancesLock, &lockState); + pOpen->OpenStatus = OpenAttached; + TRACE_EXIT(); } @@ -2074,7 +2072,7 @@ NPF_CreateOpenObject(NDIS_HANDLE NdisHandle) // NdisAllocateSpinLock(&Open->CountersLock); - Open->OpenStatus = OpenAttached; + Open->OpenStatus = OpenDetached; TRACE_EXIT(); return Open; @@ -2108,7 +2106,7 @@ NPF_CreateFilterModule( RtlZeroMemory(pFiltMod, sizeof(NPCAP_FILTER_MODULE)); pFiltMod->AdapterHandle = NdisFilterHandle; - pFiltMod->AdapterBindingStatus = FilterAttaching; + pFiltMod->AdapterBindingStatus = FilterStateUnspecified; #ifdef HAVE_WFP_LOOPBACK_SUPPORT pFiltMod->Loopback = FALSE; #endif @@ -2186,7 +2184,7 @@ NPF_CreateFilterModule( // // set the proper binding flags before trying to open the MAC // - pFiltMod->AdapterBindingStatus = FilterRunning; + pFiltMod->AdapterBindingStatus = FilterInitialized; pFiltMod->AdapterHandleUsageCounter = 0; NdisAllocateSpinLock(&pFiltMod->AdapterHandleLock); diff --git a/packetWin7/npf/npf/Packet.c b/packetWin7/npf/npf/Packet.c index 80360ba1..6c964fcf 100644 --- a/packetWin7/npf/npf/Packet.c +++ b/packetWin7/npf/npf/Packet.c @@ -627,6 +627,7 @@ DriverEntry( break; } pFiltMod->Loopback = TRUE; + pFiltMod->AdapterBindingStatus = FilterRunning; pFiltMod->MaxFrameSize = NPF_LOOPBACK_INTERFACR_MTU + ETHER_HDR_LEN; // No need to mess with SendToRx/BlockRx, packet filters, NDIS filter characteristics, Dot11, etc.