Author: cgutman
Date: Mon Aug 27 06:19:19 2012
New Revision: 57176
URL:
http://svn.reactos.org/svn/reactos?rev=57176&view=rev
Log:
[AFD]
- Fix a bug causing the event passed to WSAEnumNetworkEvents to remain set after the call
Modified:
trunk/reactos/drivers/network/afd/afd/select.c
Modified: trunk/reactos/drivers/network/afd/afd/select.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/se…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] Mon Aug 27 06:19:19 2012
@@ -324,6 +324,8 @@
PAFD_ENUM_NETWORK_EVENTS_INFO EnumReq =
(PAFD_ENUM_NETWORK_EVENTS_INFO)LockRequest( Irp, IrpSp, TRUE );
PAFD_FCB FCB = FileObject->FsContext;
+ PKEVENT UserEvent;
+ NTSTATUS Status;
AFD_DbgPrint(MID_TRACE,("Called (FCB %x)\n", FCB));
@@ -335,6 +337,23 @@
return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0 );
}
+ Status = ObReferenceObjectByHandle(EnumReq->Event,
+ EVENT_ALL_ACCESS,
+ ExEventObjectType,
+ UserMode,
+ (PVOID *)&UserEvent,
+ NULL);
+ if (!NT_SUCCESS(Status))
+ {
+ AFD_DbgPrint(MIN_TRACE,("Unable to reference event %x\n", Status));
+ return UnlockAndMaybeComplete(FCB, Status, Irp, 0);
+ }
+
+ /* Clear the event */
+ KeClearEvent(UserEvent);
+ ObDereferenceObject(UserEvent);
+
+ /* Copy the poll state */
EnumReq->PollEvents = FCB->PollState;
RtlCopyMemory( EnumReq->EventStatus,
FCB->PollStatus,