mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
Do not signal event twice. Thanks to Gunnar for finding the bug
svn path=/trunk/; revision=14933
This commit is contained in:
parent
8441c8115e
commit
13c655b516
1 changed files with 21 additions and 26 deletions
|
@ -1279,7 +1279,26 @@ IoSecondStageCompletion(PKAPC Apc,
|
|||
{
|
||||
/* Signal the Event */
|
||||
KeSetEvent(Irp->UserEvent, 0, FALSE);
|
||||
|
||||
|
||||
/* Check if we should signal the File Object Event as well */
|
||||
if (FileObject)
|
||||
{
|
||||
/* Dereference the Event if this is an ASYNC IRP */
|
||||
if (!Irp->Flags & IRP_SYNCHRONOUS_API)
|
||||
{
|
||||
ObDereferenceObject(Irp->UserEvent);
|
||||
}
|
||||
|
||||
/* If the File Object is SYNC, then we need to signal its event too */
|
||||
if (FileObject->Flags & FO_SYNCHRONOUS_IO)
|
||||
{
|
||||
/* Signal Event */
|
||||
KeSetEvent(&FileObject->Event, 0, FALSE);
|
||||
|
||||
/* Set the Status */
|
||||
FileObject->FinalStatus = Irp->IoStatus.Status;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (FileObject)
|
||||
{
|
||||
|
@ -1289,31 +1308,7 @@ IoSecondStageCompletion(PKAPC Apc,
|
|||
/* Set the Status */
|
||||
FileObject->FinalStatus = Irp->IoStatus.Status;
|
||||
}
|
||||
|
||||
/* Check if there's a File Object */
|
||||
if (FileObject)
|
||||
{
|
||||
/* Dereference the Event if this is an ASYNC IRP */
|
||||
if (!Irp->Flags & IRP_SYNCHRONOUS_API)
|
||||
{
|
||||
if (Irp->UserEvent != &FileObject->Event)
|
||||
{
|
||||
ObDereferenceObject(Irp->UserEvent);
|
||||
}
|
||||
}
|
||||
|
||||
/* If the File Object is SYNC, then we need to signal its event too */
|
||||
if (FileObject->Flags & FO_SYNCHRONOUS_IO)
|
||||
{
|
||||
/* Signal Event */
|
||||
|
||||
KeSetEvent(&FileObject->Event, 0, FALSE);
|
||||
|
||||
/* Set the Status */
|
||||
FileObject->FinalStatus = Irp->IoStatus.Status;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Remove the IRP from the list of Thread Pending IRPs */
|
||||
RemoveEntryList(&Irp->ThreadListEntry);
|
||||
InitializeListHead(&Irp->ThreadListEntry);
|
||||
|
|
Loading…
Reference in a new issue