DeviceExtension->DeviceEntry = DeviceEntry;
DeviceExtension->BusDeviceExtension = BusDeviceExtension;
- /* TODO: update last creation time in bus device extension */
+ /* not started yet*/
+ DeviceEntry->DeviceState = NotStarted;
+
+ /* get current time */
+ KeQuerySystemTime(&DeviceEntry->TimeCreated);
/* setup flags */
DeviceObject->Flags |= DO_POWER_PAGABLE;
if (Diff.QuadPart > Int32x32To64(15000, 10000))
{
- //DPRINT1("DeviceID %S Instance %S TimeCreated %I64u Now %I64u Diff %I64u hung\n", DeviceEntry->DeviceName, DeviceEntry->Instance, DeviceEntry->TimeCreated.QuadPart, Time.QuadPart, Diff.QuadPart);
-
/* release spin lock */
KeReleaseSpinLock(&BusDeviceExtension->Lock, OldLevel);
+ DPRINT1("DeviceID %S Instance %S TimeCreated %I64u Now %I64u Diff %I64u hung\n", DeviceEntry->DeviceName, DeviceEntry->Instance, DeviceEntry->TimeCreated.QuadPart, Time.QuadPart, Diff.QuadPart);
+
/* deactivate interfaces */
//KspEnableBusDeviceInterface(DeviceEntry, FALSE);
InsertTailList(&DeviceEntry->IrpPendingList, &Irp->Tail.Overlay.ListEntry);
Time.QuadPart = Int32x32To64(1500, -10000);
- DbgPrint("PENDING Irp %p %wZ\n", Irp, &IoStack->FileObject->FileName);
+ DbgPrint("PENDING Irp %p %wZ DeviceState %d\n", Irp, &IoStack->FileObject->FileName, DeviceEntry->DeviceState);
- /* query current time */
- KeQuerySystemTime(&DeviceEntry->TimeCreated);
/* set timer */
KeSetTimer(&BusDeviceExtension->Timer, Time, &BusDeviceExtension->Dpc);
/* insert into irp pending list */
InsertTailList(&DeviceEntry->IrpPendingList, &Irp->Tail.Overlay.ListEntry);
- /* get current time */
- KeQuerySystemTime(&DeviceEntry->TimeCreated);
-
/* invalidate device relations */
IoInvalidateDeviceRelations(BusDeviceExtension->PhysicalDeviceObject, BusRelations);
{
/* start bus */
Status = KspStartBusDevice(DeviceObject, ChildDeviceExtension, Irp);
+ if (NT_SUCCESS(Status))
+ {
+ /* complete pending irps*/
+ KspCompletePendingIrps(ChildDeviceExtension->DeviceEntry, STATUS_REPARSE);
+ }
/* set time out */
Time.QuadPart = Int32x32To64(1500, -10000);