From 0cceda5e2b1d505eb54201fe5385d8e8b4f3b4ff Mon Sep 17 00:00:00 2001 From: Gunnar Dalsnes Date: Wed, 19 Nov 2003 21:12:35 +0000 Subject: [PATCH] -IoQueueThreadIrp impl. svn path=/trunk/; revision=6718 --- reactos/ntoskrnl/io/buildirp.c | 6 +++++- reactos/ntoskrnl/io/cleanup.c | 14 +++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/io/buildirp.c b/reactos/ntoskrnl/io/buildirp.c index d8494602dd4..f68ffe882ff 100644 --- a/reactos/ntoskrnl/io/buildirp.c +++ b/reactos/ntoskrnl/io/buildirp.c @@ -1,4 +1,4 @@ -/* $Id: buildirp.c,v 1.36 2003/11/16 21:03:59 ekohl Exp $ +/* $Id: buildirp.c,v 1.37 2003/11/19 21:11:47 gdalsnes Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -335,6 +335,8 @@ IoBuildDeviceIoControlRequest(ULONG IoControlCode, break; } + /* synchronous irp's are queued to requestor thread's irp cancel/cleanup list */ + IoQueueThreadIrp(Irp); return(Irp); } @@ -386,6 +388,8 @@ IoBuildSynchronousFsdRequest(ULONG MajorFunction, Irp->UserEvent = Event; + /* synchronous irp's are queued to requestor thread's irp cancel/cleanup list */ + IoQueueThreadIrp(Irp); return(Irp); } diff --git a/reactos/ntoskrnl/io/cleanup.c b/reactos/ntoskrnl/io/cleanup.c index 4441bc7b8fe..9b5dc428734 100644 --- a/reactos/ntoskrnl/io/cleanup.c +++ b/reactos/ntoskrnl/io/cleanup.c @@ -166,7 +166,7 @@ IoSecondStageCompletion_RundownApcRoutine( /* * FUNCTION: Performs the second stage of irp completion for read/write irps * - * Called as a special kernel APC or directly from IofCompleteRequest() + * Called as a special kernel APC kernel-routine or directly from IofCompleteRequest() */ VOID STDCALL IoSecondStageCompletion( @@ -187,6 +187,18 @@ IoSecondStageCompletion( Irp = (PIRP)(*SystemArgument1); PriorityBoost = (CCHAR)(LONG)(*SystemArgument2); + /* + Remove synchronous irp's from the threads cleanup list. + To synchronize with the code inserting the entry, this code must run + at APC_LEVEL, thou this routine is currently (incorrecly?) called at + irql's from 0 to 2. + */ + if (!IsListEmpty(&Irp->ThreadListEntry)) + { + RemoveEntryList(&Irp->ThreadListEntry); + InitializeListHead(&Irp->ThreadListEntry); + } + IoStack = &Irp->Stack[(ULONG)Irp->CurrentLocation]; DeviceObject = IoStack->DeviceObject;