diff --git a/reactos/ntoskrnl/io/iomgr/device.c b/reactos/ntoskrnl/io/iomgr/device.c index f59e0006fff..1086d330682 100644 --- a/reactos/ntoskrnl/io/iomgr/device.c +++ b/reactos/ntoskrnl/io/iomgr/device.c @@ -37,18 +37,9 @@ IopAttachDeviceToDeviceStackSafe(IN PDEVICE_OBJECT SourceDevice, SourceDeviceExtension = IoGetDevObjExtension(SourceDevice); ASSERT(SourceDeviceExtension->AttachedTo == NULL); - /* FIXME: ROS HACK */ - if (AttachedDevice->Flags & DO_DEVICE_INITIALIZING) - { - DPRINT1("Io: CRITICAL: Allowing attach to device which hasn't " - "cleared its DO_DEVICE_INITIALIZING flag. Fix the damn " - "thing: %p %wZ\n", - AttachedDevice, - &AttachedDevice->DriverObject->DriverName); - } - /* Make sure that it's in a correct state */ - if ((IoGetDevObjExtension(AttachedDevice)->ExtensionFlags & + if ((AttachedDevice->Flags & DO_DEVICE_INITIALIZING) || + (IoGetDevObjExtension(AttachedDevice)->ExtensionFlags & (DOE_UNLOAD_PENDING | DOE_DELETE_PENDING | DOE_REMOVE_PENDING | diff --git a/reactos/ntoskrnl/io/iomgr/irp.c b/reactos/ntoskrnl/io/iomgr/irp.c index 2f6c0a149f8..95290a16b6b 100644 --- a/reactos/ntoskrnl/io/iomgr/irp.c +++ b/reactos/ntoskrnl/io/iomgr/irp.c @@ -346,8 +346,16 @@ IopCompleteRequest(IN PKAPC Apc, /* Check if this is an Asynch API */ if (!(Irp->Flags & IRP_SYNCHRONOUS_API)) { + /* HACK */ + if (*((PULONG)(Irp->UserEvent) - 1) != 0x87878787) + { /* Dereference the event */ ObDereferenceObject(Irp->UserEvent); + } + else + { + DPRINT1("Not an executive event -- should not be dereferenced\n"); + } } /*