Small fixes to I/O Manager and Implemented IoMakeAssociatedIrp. Parts by Filip Navara.

svn path=/trunk/; revision=10465
This commit is contained in:
Alex Ionescu 2004-08-10 06:26:42 +00:00
parent 2199f89e4d
commit 5317d303e8
4 changed files with 25 additions and 21 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: ps.h,v 1.63 2004/08/08 20:33:17 ion Exp $ /* $Id: ps.h,v 1.64 2004/08/10 06:26:42 ion Exp $
* *
* FILE: ntoskrnl/ke/kthread.c * FILE: ntoskrnl/ke/kthread.c
* PURPOSE: Process manager definitions * PURPOSE: Process manager definitions
@ -169,12 +169,6 @@ typedef struct _KTHREAD
#define FSRTL_FAST_IO_TOP_LEVEL_IRP (0x04) #define FSRTL_FAST_IO_TOP_LEVEL_IRP (0x04)
#define FSRTL_MAX_TOP_LEVEL_IRP_FLAG (0x04) #define FSRTL_MAX_TOP_LEVEL_IRP_FLAG (0x04)
typedef struct _TOP_LEVEL_IRP
{
PIRP TopLevelIrp;
ULONG TopLevelIrpConst;
} TOP_LEVEL_IRP;
typedef struct typedef struct
{ {
PACCESS_TOKEN Token; // 0x0 PACCESS_TOKEN Token; // 0x0
@ -207,7 +201,7 @@ typedef struct _ETHREAD
ULONG PerformanceCounterLow; /* 204/230 */ ULONG PerformanceCounterLow; /* 204/230 */
PPS_IMPERSONATION_INFO ImpersonationInfo; /* 208/234 */ PPS_IMPERSONATION_INFO ImpersonationInfo; /* 208/234 */
LIST_ENTRY IrpList; /* 20C/238 */ LIST_ENTRY IrpList; /* 20C/238 */
TOP_LEVEL_IRP* TopLevelIrp; /* 214/240 */ PIRP TopLevelIrp; /* 214/240 */
PDEVICE_OBJECT DeviceToVerify; /* 218/244 */ PDEVICE_OBJECT DeviceToVerify; /* 218/244 */
ULONG ReadClusterSize; /* 21C/248 */ ULONG ReadClusterSize; /* 21C/248 */
UCHAR ForwardClusterOnly; /* 220/24C */ UCHAR ForwardClusterOnly; /* 220/24C */

View file

@ -1,4 +1,4 @@
/* $Id: buildirp.c,v 1.41 2004/07/20 11:06:47 navaraf Exp $ /* $Id: buildirp.c,v 1.42 2004/08/10 06:26:42 ion Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -469,7 +469,7 @@ IoBuildSynchronousFsdRequestWithMdl(ULONG MajorFunction,
StackPtr->CompletionRoutine = NULL; StackPtr->CompletionRoutine = NULL;
Irp->MdlAddress = Mdl; Irp->MdlAddress = Mdl;
Irp->UserBuffer = NULL; Irp->UserBuffer = MmGetMdlVirtualAddress(Mdl);
Irp->AssociatedIrp.SystemBuffer = NULL; Irp->AssociatedIrp.SystemBuffer = NULL;
if (MajorFunction == IRP_MJ_READ) if (MajorFunction == IRP_MJ_READ)

View file

@ -285,7 +285,7 @@ IoSecondStageCompletion(
KeInitializeApc( &Irp->Tail.Apc, KeInitializeApc( &Irp->Tail.Apc,
KeGetCurrentThread(), KeGetCurrentThread(),
OriginalApcEnvironment, CurrentApcEnvironment,
IoSecondStageCompletion_KernelApcRoutine, IoSecondStageCompletion_KernelApcRoutine,
IoSecondStageCompletion_RundownApcRoutine, IoSecondStageCompletion_RundownApcRoutine,
UserApcRoutine, UserApcRoutine,

View file

@ -1,4 +1,4 @@
/* $Id: irp.c,v 1.62 2004/06/23 21:42:50 ion Exp $ /* $Id: irp.c,v 1.63 2004/08/10 06:26:42 ion Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -116,7 +116,7 @@ IoIsValidNameGraftingBuffer(
} }
/* /*
* @unimplemented * @implemented
*/ */
PIRP STDCALL PIRP STDCALL
IoMakeAssociatedIrp(PIRP Irp, IoMakeAssociatedIrp(PIRP Irp,
@ -131,9 +131,18 @@ IoMakeAssociatedIrp(PIRP Irp,
{ {
PIRP AssocIrp; PIRP AssocIrp;
/* Allocate the IRP */
AssocIrp = IoAllocateIrp(StackSize,FALSE); AssocIrp = IoAllocateIrp(StackSize,FALSE);
UNIMPLEMENTED;
return NULL; /* Set the Flags */
AssocIrp->Flags |= IRP_ASSOCIATED_IRP;
/* Set the Thread */
AssocIrp->Tail.Overlay.Thread = Irp->Tail.Overlay.Thread;
/* Associate them */
AssocIrp->AssociatedIrp.MasterIrp = Irp;
return AssocIrp;
} }
@ -160,6 +169,7 @@ IoInitializeIrp(PIRP Irp,
Irp->CurrentLocation = StackSize; Irp->CurrentLocation = StackSize;
InitializeListHead(&Irp->ThreadListEntry); InitializeListHead(&Irp->ThreadListEntry);
Irp->Tail.Overlay.CurrentStackLocation = &Irp->Stack[(ULONG)StackSize]; Irp->Tail.Overlay.CurrentStackLocation = &Irp->Stack[(ULONG)StackSize];
Irp->ApcEnvironment = KeGetCurrentThread()->ApcStateIndex;
} }
@ -422,7 +432,7 @@ IofCompleteRequest(PIRP Irp,
DPRINT("Dispatching APC\n"); DPRINT("Dispatching APC\n");
KeInitializeApc( &Irp->Tail.Apc, KeInitializeApc( &Irp->Tail.Apc,
&Irp->Tail.Overlay.Thread->Tcb, &Irp->Tail.Overlay.Thread->Tcb,
OriginalApcEnvironment, Irp->ApcEnvironment,
IoSecondStageCompletion,//kernel routine IoSecondStageCompletion,//kernel routine
NULL, NULL,
(PKNORMAL_ROUTINE) NULL, (PKNORMAL_ROUTINE) NULL,
@ -528,7 +538,7 @@ IoSetTopLevelIrp(IN PIRP Irp)
PETHREAD Thread; PETHREAD Thread;
Thread = PsGetCurrentThread(); Thread = PsGetCurrentThread();
Thread->TopLevelIrp->TopLevelIrp = Irp; Thread->TopLevelIrp = Irp;
} }
@ -538,7 +548,7 @@ IoSetTopLevelIrp(IN PIRP Irp)
PIRP STDCALL PIRP STDCALL
IoGetTopLevelIrp(VOID) IoGetTopLevelIrp(VOID)
{ {
return(PsGetCurrentThread()->TopLevelIrp->TopLevelIrp); return(PsGetCurrentThread()->TopLevelIrp);
} }