Author: ion
Date: Fri Jul 28 00:16:48 2006
New Revision: 23325
URL:
http://svn.reactos.org/svn/reactos?rev=23325&view=rev
Log:
- Enable IopReferenceDeviceObject in IopParseDevice (not much use for now except OS
"Correctness" and identifying broken drivers). DO referencing isn't fully
used in the kernel yet.
- Fix broken drivers: i8042 and videoprt. NDIS might be broken too, but downloading worked
fine for me, so it's not hitting the check in IopParseDevice.
Modified:
trunk/reactos/drivers/input/i8042prt/i8042prt.c
trunk/reactos/drivers/video/videoprt/videoprt.c
trunk/reactos/ntoskrnl/io/iomgr/device.c
trunk/reactos/ntoskrnl/io/iomgr/driver.c
trunk/reactos/ntoskrnl/io/iomgr/file.c
Modified: trunk/reactos/drivers/input/i8042prt/i8042prt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/i80…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/i8042prt.c (original)
+++ trunk/reactos/drivers/input/i8042prt/i8042prt.c Fri Jul 28 00:16:48 2006
@@ -741,6 +741,7 @@
KeInitializeTimer(&DevExt->TimerMouseTimeout);
Status = I8042Initialize(DevExt);
+ Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
if (!NT_SUCCESS(STATUS_SUCCESS)) {
DPRINT1("Initialization failure: %x\n", Status);
return Status;
@@ -790,6 +791,7 @@
}
InsertTailList(&DevExt->BusDevices, &FdoDevExt->BusDevices);
+ Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
}
else
DevExt->KeyboardExists = FALSE;
@@ -838,6 +840,7 @@
}
InsertTailList(&DevExt->BusDevices, &FdoDevExt->BusDevices);
+ Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
}
else
DevExt->MouseExists = FALSE;
Modified: trunk/reactos/drivers/video/videoprt/videoprt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/videoprt/vid…
==============================================================================
--- trunk/reactos/drivers/video/videoprt/videoprt.c (original)
+++ trunk/reactos/drivers/video/videoprt/videoprt.c Fri Jul 28 00:16:48 2006
@@ -362,6 +362,8 @@
DeviceExtension->NextDeviceObject = IoAttachDeviceToDeviceStack(
*DeviceObject, PhysicalDeviceObject);
+ /* Remove the initailizing flag */
+ (*DeviceObject)->Flags &= ~DO_DEVICE_INITIALIZING;
return STATUS_SUCCESS;
}
Modified: trunk/reactos/ntoskrnl/io/iomgr/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/device.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/device.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/device.c Fri Jul 28 00:16:48 2006
@@ -342,6 +342,9 @@
(DeviceObject->Flags & DO_DEVICE_INITIALIZING))
{
/* It's unloading or initializing, so fail */
+ DPRINT1("You are seeing this because the following ROS driver: %wZ\n"
+ " sucks. Please fix it's AddDevice Routine\n",
+ &DeviceObject->DriverObject->DriverName);
return STATUS_NO_SUCH_DEVICE;
}
else
Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/driver.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/driver.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/driver.c Fri Jul 28 00:16:48 2006
@@ -622,8 +622,6 @@
return Status;
}
- IopReinitializeDrivers();
-
/* Set the driver as initialized */
Driver->Flags |= DRVO_INITIALIZED;
DeviceObject = Driver->DeviceObject;
@@ -633,6 +631,8 @@
DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
DeviceObject = DeviceObject->NextDevice;
}
+
+ IopReinitializeDrivers();
return STATUS_SUCCESS;
}
Modified: trunk/reactos/ntoskrnl/io/iomgr/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/file.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/file.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/file.c Fri Jul 28 00:16:48 2006
@@ -67,9 +67,9 @@
OriginalDeviceObject = OpenPacket->RelatedFileObject->DeviceObject;
}
- /* Reference the DO FIXME: Don't allow failure */
- //Status = IopReferenceDeviceObject(OriginalDeviceObject);
- OriginalDeviceObject->ReferenceCount++;
+ /* Reference the DO */
+ Status = IopReferenceDeviceObject(OriginalDeviceObject);
+ if (!NT_SUCCESS(Status)) return Status;
/* Map the generic mask and set the new mapping in the access state */
RtlMapGenericMask(&AccessState->RemainingDesiredAccess,