- 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.

svn path=/trunk/; revision=23325
This commit is contained in:
Alex Ionescu 2006-07-27 20:16:48 +00:00
parent bef11ebb29
commit 48d3c8e74f
5 changed files with 13 additions and 5 deletions

View file

@ -741,6 +741,7 @@ static NTSTATUS STDCALL I8042AddDevice(PDRIVER_OBJECT DriverObject,
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 @@ static NTSTATUS STDCALL I8042AddDevice(PDRIVER_OBJECT DriverObject,
}
InsertTailList(&DevExt->BusDevices, &FdoDevExt->BusDevices);
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
}
else
DevExt->KeyboardExists = FALSE;
@ -838,6 +840,7 @@ static NTSTATUS STDCALL I8042AddDevice(PDRIVER_OBJECT DriverObject,
}
InsertTailList(&DevExt->BusDevices, &FdoDevExt->BusDevices);
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
}
else
DevExt->MouseExists = FALSE;

View file

@ -362,6 +362,8 @@ IntVideoPortCreateAdapterDeviceObject(
DeviceExtension->NextDeviceObject = IoAttachDeviceToDeviceStack(
*DeviceObject, PhysicalDeviceObject);
/* Remove the initailizing flag */
(*DeviceObject)->Flags &= ~DO_DEVICE_INITIALIZING;
return STATUS_SUCCESS;
}

View file

@ -342,6 +342,9 @@ IopReferenceDeviceObject(IN PDEVICE_OBJECT DeviceObject)
(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

View file

@ -622,8 +622,6 @@ IopInitializeDriverModule(
return Status;
}
IopReinitializeDrivers();
/* Set the driver as initialized */
Driver->Flags |= DRVO_INITIALIZED;
DeviceObject = Driver->DeviceObject;
@ -634,6 +632,8 @@ IopInitializeDriverModule(
DeviceObject = DeviceObject->NextDevice;
}
IopReinitializeDrivers();
return STATUS_SUCCESS;
}

View file

@ -67,9 +67,9 @@ IopParseDevice(IN PVOID ParseObject,
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,