mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
[NTOSKRNL]
- Dereference the correct device object (the one who asked for shutdown notification) instead of whatever happens to be on the top of the device stack - Fix flag issues svn path=/trunk/; revision=56087
This commit is contained in:
parent
f3bea9c548
commit
592be28128
1 changed files with 13 additions and 7 deletions
|
@ -174,8 +174,11 @@ IoShutdownSystem(IN ULONG Phase)
|
|||
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
||||
}
|
||||
|
||||
/* Remove the flag */
|
||||
ShutdownEntry->DeviceObject->Flags &= ~DO_SHUTDOWN_REGISTERED;
|
||||
|
||||
/* Get rid of our reference to it */
|
||||
ObDereferenceObject(DeviceObject);
|
||||
ObDereferenceObject(ShutdownEntry->DeviceObject);
|
||||
|
||||
/* Free the shutdown entry and reset the event */
|
||||
ExFreePoolWithTag(ShutdownEntry, TAG_SHUTDOWN_ENTRY);
|
||||
|
@ -228,8 +231,11 @@ IoShutdownSystem(IN ULONG Phase)
|
|||
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
||||
}
|
||||
|
||||
/* Remove the flag */
|
||||
ShutdownEntry->DeviceObject->Flags &= ~DO_SHUTDOWN_REGISTERED;
|
||||
|
||||
/* Get rid of our reference to it */
|
||||
ObDereferenceObject(DeviceObject);
|
||||
ObDereferenceObject(ShutdownEntry->DeviceObject);
|
||||
|
||||
/* Free the shutdown entry and reset the event */
|
||||
ExFreePoolWithTag(ShutdownEntry, TAG_SHUTDOWN_ENTRY);
|
||||
|
@ -1486,6 +1492,9 @@ IoUnregisterShutdownNotification(PDEVICE_OBJECT DeviceObject)
|
|||
PLIST_ENTRY NextEntry;
|
||||
KIRQL OldIrql;
|
||||
|
||||
/* Remove the flag */
|
||||
DeviceObject->Flags &= ~DO_SHUTDOWN_REGISTERED;
|
||||
|
||||
/* Acquire the shutdown lock and loop the shutdown list */
|
||||
KeAcquireSpinLock(&ShutdownListLock, &OldIrql);
|
||||
NextEntry = ShutdownListHead.Flink;
|
||||
|
@ -1543,9 +1552,6 @@ IoUnregisterShutdownNotification(PDEVICE_OBJECT DeviceObject)
|
|||
|
||||
/* Release the shutdown lock */
|
||||
KeReleaseSpinLock(&ShutdownListLock, OldIrql);
|
||||
|
||||
/* Now remove the flag */
|
||||
DeviceObject->Flags &= ~DO_SHUTDOWN_REGISTERED;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue