mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 16:10:29 +00:00
- Wait for NdisMFreeSharedMemoryPassive to complete before returning
See issue #4428 for more details. svn path=/trunk/; revision=40722
This commit is contained in:
parent
c68a776204
commit
74989188d4
2 changed files with 17 additions and 0 deletions
|
@ -71,6 +71,7 @@ typedef struct _MINIPORT_SHARED_MEMORY {
|
|||
BOOLEAN Cached;
|
||||
PNDIS_MINIPORT_BLOCK Adapter;
|
||||
PVOID Context;
|
||||
PKEVENT Event;
|
||||
} MINIPORT_SHARED_MEMORY, *PMINIPORT_SHARED_MEMORY;
|
||||
|
||||
/* A structure of WrapperConfigurationContext (not compatible with the
|
||||
|
|
|
@ -181,6 +181,7 @@ NdisMFreeSharedMemoryPassive(
|
|||
*/
|
||||
{
|
||||
PMINIPORT_SHARED_MEMORY Memory = (PMINIPORT_SHARED_MEMORY)Context;
|
||||
PRKEVENT Event = Memory->Event;
|
||||
|
||||
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
|
||||
|
||||
|
@ -191,6 +192,10 @@ NdisMFreeSharedMemoryPassive(
|
|||
Memory->VirtualAddress, Memory->Cached);
|
||||
|
||||
ExFreePool(Memory);
|
||||
|
||||
KeSetEvent(Event,
|
||||
IO_NO_INCREMENT,
|
||||
FALSE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -221,6 +226,7 @@ NdisMFreeSharedMemory(
|
|||
HANDLE ThreadHandle;
|
||||
PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)MiniportAdapterHandle;
|
||||
PMINIPORT_SHARED_MEMORY Memory;
|
||||
KEVENT Event;
|
||||
|
||||
NDIS_DbgPrint(MAX_TRACE,("Called.\n"));
|
||||
|
||||
|
@ -235,14 +241,24 @@ NdisMFreeSharedMemory(
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue