diff --git a/reactos/ntoskrnl/KrnlFun.c b/reactos/ntoskrnl/KrnlFun.c index b6561edb396..a9aa4abc50d 100644 --- a/reactos/ntoskrnl/KrnlFun.c +++ b/reactos/ntoskrnl/KrnlFun.c @@ -9,12 +9,14 @@ // Failure to respect this will *ACHIEVE NOTHING*. // // Io: -// - Add tracing to iofunc.c, file.c and device.c +// - See why queueing IRPs and cancelling them causes crashes. // - Add Access Checks in IopParseDevice. // - Add validation checks in IoCreateFile. // - Add probe/alignment checks for Query/Set routines. -// - Verify ShareAccess APIs, XP added some new semantics. +// - Add tracing to iofunc.c +// - Add tracing to file.c // - Add support for some fast-paths when querying/setting data. +// - Verify ShareAccess APIs, XP added some new semantics. // - Add support for Fast Dispatch I/O. // // Ob: diff --git a/reactos/ntoskrnl/include/internal/io.h b/reactos/ntoskrnl/include/internal/io.h index dd7df40c58a..1e30e5e883f 100644 --- a/reactos/ntoskrnl/include/internal/io.h +++ b/reactos/ntoskrnl/include/internal/io.h @@ -16,8 +16,6 @@ // These define the Debug Masks Supported // #define IO_IRP_DEBUG 0x01 -#define IO_FO_DEBUG 0x02 -#define IO_DEVICE_DEBUG 0x04 // // Debug/Tracing support diff --git a/reactos/ntoskrnl/io/iomgr/file.c b/reactos/ntoskrnl/io/iomgr/file.c index 6acf2caeb12..e7086eda399 100644 --- a/reactos/ntoskrnl/io/iomgr/file.c +++ b/reactos/ntoskrnl/io/iomgr/file.c @@ -373,7 +373,7 @@ IopParseDevice(IN PVOID ParseObject, OpenPacket->FileObject = FileObject; /* Queue the IRP and call the driver */ - IopQueueIrpToThread(Irp); + //IopQueueIrpToThread(Irp); Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { @@ -404,7 +404,7 @@ IopParseDevice(IN PVOID ParseObject, FileObject->Event.Header.SignalState = 1; /* Now that we've signaled the events, de-associate the IRP */ - IopUnQueueIrpFromThread(Irp); + //IopUnQueueIrpFromThread(Irp); /* Check if the IRP had an input buffer */ if ((Irp->Flags & IRP_BUFFERED_IO) && @@ -611,7 +611,6 @@ IopDeleteFile(IN PVOID ObjectBody) NTSTATUS Status; KEVENT Event; PDEVICE_OBJECT DeviceObject; - KIRQL OldIrql; /* Check if the file has a device object */ if (FileObject->DeviceObject) @@ -657,7 +656,7 @@ IopDeleteFile(IN PVOID ObjectBody) StackPtr->FileObject = FileObject; /* Queue the IRP */ - IopQueueIrpToThread(Irp); + //IopQueueIrpToThread(Irp); /* Call the FS Driver */ Status = IoCallDriver(DeviceObject, Irp); @@ -667,11 +666,6 @@ IopDeleteFile(IN PVOID ObjectBody) KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); } - /* Raise to APC level and de-queue the IRP */ - KeRaiseIrql(APC_LEVEL, &OldIrql); - IopUnQueueIrpFromThread(Irp); - KeLowerIrql(OldIrql); - /* Free the IRP */ IoFreeIrp(Irp); @@ -836,7 +830,7 @@ IopSecurityFile(IN PVOID ObjectBody, } /* Queue the IRP */ - IopQueueIrpToThread(Irp); + //IopQueueIrpToThread(Irp); /* Update operation counts */ IopUpdateOperationCount(IopOtherTransfer); @@ -1030,7 +1024,6 @@ IopCloseFile(IN PEPROCESS Process OPTIONAL, PIO_STACK_LOCATION StackPtr; NTSTATUS Status; PDEVICE_OBJECT DeviceObject; - KIRQL OldIrql; /* Check if the file is locked and has more then one handle opened */ if ((FileObject->LockOperation) && (SystemHandleCount != 1)) @@ -1082,7 +1075,7 @@ IopCloseFile(IN PEPROCESS Process OPTIONAL, StackPtr->FileObject = FileObject; /* Queue the IRP */ - IopQueueIrpToThread(Irp); + //IopQueueIrpToThread(Irp); /* Update operation counts */ IopUpdateOperationCount(IopOtherTransfer); @@ -1095,11 +1088,6 @@ IopCloseFile(IN PEPROCESS Process OPTIONAL, KeWaitForSingleObject(&Event, UserRequest, KernelMode, FALSE, NULL); } - /* Raise to APC level and de-queue the IRP */ - KeRaiseIrql(APC_LEVEL, &OldIrql); - IopUnQueueIrpFromThread(Irp); - KeLowerIrql(OldIrql); - /* Free the IRP */ IoFreeIrp(Irp); diff --git a/reactos/ntoskrnl/io/iomgr/iofunc.c b/reactos/ntoskrnl/io/iomgr/iofunc.c index a5aac527e15..110b6c07626 100644 --- a/reactos/ntoskrnl/io/iomgr/iofunc.c +++ b/reactos/ntoskrnl/io/iomgr/iofunc.c @@ -14,8 +14,6 @@ #define NDEBUG #include -ULONG IopMissedOptimizations; - #if 0 IOTRACE(IO_IRP_DEBUG, "%s - Queueing IRP %p\n", @@ -129,7 +127,7 @@ IopPerformSynchronousRequest(IN PDEVICE_OBJECT DeviceObject, PAGED_CODE(); /* Queue the IRP */ - IopQueueIrpToThread(Irp); + //IopQueueIrpToThread(Irp); /* Update operation counts */ IopUpdateOperationCount(TransferType); @@ -451,7 +449,7 @@ IopQueryDeviceInformation(IN PFILE_OBJECT FileObject, } /* Queue the IRP */ - IopQueueIrpToThread(Irp); + //IopQueueIrpToThread(Irp); /* Call the Driver */ Status = IoCallDriver(FileObject->DeviceObject, Irp); @@ -698,17 +696,7 @@ IoSetInformation(IN PFILE_OBJECT FileObject, StackPtr->Parameters.SetFile.Length = Length; /* Queue the IRP */ - IopQueueIrpToThread(Irp); - - /* FIXME BUGBUG TEMPORARY CODE */ - if ((FileInformationClass == FileModeInformation) || - (FileInformationClass == FileRenameInformation ) || - (FileInformationClass == FileLinkInformation ) || - (FileInformationClass == FileMoveClusterInformation)) - { - DPRINT1("Missed optimization: %lx\n", FileInformationClass); - IopMissedOptimizations++; - } + //IopQueueIrpToThread(Irp); /* Call the Driver */ Status = IoCallDriver(FileObject->DeviceObject, Irp); @@ -1647,21 +1635,11 @@ NtQueryInformationFile(IN HANDLE FileHandle, StackPtr->Parameters.QueryFile.Length = Length; /* Queue the IRP */ - IopQueueIrpToThread(Irp); + //IopQueueIrpToThread(Irp); /* Update operation counts */ IopUpdateOperationCount(IopOtherTransfer); - /* FIXME BUGBUG TEMPORARY CODE */ - if ((FileInformationClass == FileAccessInformation) || - (FileInformationClass == FileModeInformation) || - (FileInformationClass == FileAlignmentInformation) || - (FileInformationClass == FileAllInformation)) - { - DPRINT1("Missed optimization: %lx\n", FileInformationClass); - IopMissedOptimizations++; - } - /* Call the Driver */ Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) @@ -2203,22 +2181,12 @@ NtSetInformationFile(IN HANDLE FileHandle, StackPtr->Parameters.SetFile.Length = Length; /* Queue the IRP */ - IopQueueIrpToThread(Irp); + //IopQueueIrpToThread(Irp); /* Update operation counts */ IopUpdateOperationCount(IopOtherTransfer); - /* FIXME BUGBUG TEMPORARY CODE */ - if ((FileInformationClass == FileModeInformation) || - (FileInformationClass == FileRenameInformation ) || - (FileInformationClass == FileLinkInformation ) || - (FileInformationClass == FileMoveClusterInformation ) || - (FileInformationClass == FileDispositionInformation )) - { - DPRINT1("Missed optimization: %lx\n", FileInformationClass); - IopMissedOptimizations++; - } - + /* FIXME: Later, we can implement a lot of stuff here and avoid a driver call */ /* Handle IO Completion Port quickly */ if (FileInformationClass == FileCompletionInformation) {