mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 01:42:30 +00:00
[NTOSKRNL] Implement IopVerifyDeviceObjectOnStack()
This commit is contained in:
parent
1820aa8fe6
commit
161b6728ef
|
@ -687,6 +687,40 @@ IopGetRelatedTargetDevice(IN PFILE_OBJECT FileObject,
|
|||
return Status;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
IopVerifyDeviceObjectOnStack(IN PDEVICE_OBJECT BaseDeviceObject,
|
||||
IN PDEVICE_OBJECT TopDeviceObjectHint)
|
||||
{
|
||||
KIRQL OldIrql;
|
||||
BOOLEAN Result;
|
||||
PDEVICE_OBJECT LoopObject;
|
||||
|
||||
ASSERT(BaseDeviceObject != NULL);
|
||||
|
||||
Result = FALSE;
|
||||
/* Simply loop on the device stack and try to find our hint */
|
||||
OldIrql = KeAcquireQueuedSpinLock(LockQueueIoDatabaseLock);
|
||||
for (LoopObject = BaseDeviceObject; ; LoopObject = LoopObject->AttachedDevice)
|
||||
{
|
||||
/* It was found, it's a success */
|
||||
if (LoopObject == TopDeviceObjectHint)
|
||||
{
|
||||
Result = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* End of the stack, that's a failure - default */
|
||||
if (LoopObject == NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
KeReleaseQueuedSpinLock(LockQueueIoDatabaseLock, OldIrql);
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
/* PUBLIC FUNCTIONS ***********************************************************/
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue