Author: cgutman
Date: Wed Apr 29 02:30:23 2009
New Revision: 40722
URL:
http://svn.reactos.org/svn/reactos?rev=40722&view=rev
Log:
- Wait for NdisMFreeSharedMemoryPassive to complete before returning
See issue #4428 for more details.
Modified:
trunk/reactos/drivers/network/ndis/include/miniport.h
trunk/reactos/drivers/network/ndis/ndis/memory.c
Modified: trunk/reactos/drivers/network/ndis/include/miniport.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/inclu…
==============================================================================
--- trunk/reactos/drivers/network/ndis/include/miniport.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/include/miniport.h [iso-8859-1] Wed Apr 29 02:30:23
2009
@@ -71,6 +71,7 @@
BOOLEAN Cached;
PNDIS_MINIPORT_BLOCK Adapter;
PVOID Context;
+ PKEVENT Event;
} MINIPORT_SHARED_MEMORY, *PMINIPORT_SHARED_MEMORY;
/* A structure of WrapperConfigurationContext (not compatible with the
Modified: trunk/reactos/drivers/network/ndis/ndis/memory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/memory.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/memory.c [iso-8859-1] Wed Apr 29 02:30:23
2009
@@ -181,6 +181,7 @@
*/
{
PMINIPORT_SHARED_MEMORY Memory = (PMINIPORT_SHARED_MEMORY)Context;
+ PRKEVENT Event = Memory->Event;
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
@@ -191,6 +192,10 @@
Memory->VirtualAddress, Memory->Cached);
ExFreePool(Memory);
+
+ KeSetEvent(Event,
+ IO_NO_INCREMENT,
+ FALSE);
}
@@ -221,6 +226,7 @@
HANDLE ThreadHandle;
PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)MiniportAdapterHandle;
PMINIPORT_SHARED_MEMORY Memory;
+ KEVENT Event;
NDIS_DbgPrint(MAX_TRACE,("Called.\n"));
@@ -234,15 +240,25 @@
NDIS_DbgPrint(MID_TRACE, ("Insufficient resources\n"));
return;
}
+
+ KeInitializeEvent(&Event, NotificationEvent, FALSE);
Memory->AdapterObject = Adapter->NdisMiniportBlock.SystemAdapterObject;
Memory->Length = Length;
Memory->PhysicalAddress = PhysicalAddress;
Memory->VirtualAddress = VirtualAddress;
Memory->Cached = Cached;
+ Memory->Adapter = &Adapter->NdisMiniportBlock;
+ Memory->Event = &Event;
PsCreateSystemThread(&ThreadHandle, THREAD_ALL_ACCESS, 0, 0, 0,
NdisMFreeSharedMemoryPassive, Memory);
ZwClose(ThreadHandle);
+
+ KeWaitForSingleObject(&Event,
+ Executive,
+ KernelMode,
+ FALSE,
+ NULL);
}
VOID