KeRemoveEntryDeviceQueue

UINT8 __stdcall KeRemoveEntryDeviceQueue(_KDEVICE_QUEUE *DeviceQueue, _KDEVICE_QUEUE_ENTRY *DeviceQueueEntry){
  unsigned __int8 Inserted; 
  _LIST_ENTRY *Flink; 
  _LIST_ENTRY *Blink; 
  __int64 bf_0; 
  _KLOCK_QUEUE_HANDLE LockHandle; 

  memset(&LockHandle, 0, sizeof(LockHandle));
  KeAcquireInStackQueuedSpinLock(&DeviceQueue->Lock, &LockHandle);
  Inserted = DeviceQueueEntry->Inserted;
  if( Inserted == 1 )
  {
    DeviceQueueEntry->Inserted = 0;
    Flink = DeviceQueueEntry->DeviceListEntry.Flink;
    Blink = DeviceQueueEntry->DeviceListEntry.Blink;
    if( (_KDEVICE_QUEUE_ENTRY *)DeviceQueueEntry->DeviceListEntry.Flink->Blink != DeviceQueueEntry
      || (_KDEVICE_QUEUE_ENTRY *)Blink->Flink != DeviceQueueEntry )
    {
      __fastfail(3u);
    }
    Blink->Flink = Flink;
    Flink->Blink = Blink;
    bf_0 = DeviceQueue->_bf_0;
    if( DeviceQueueEntry == (_KDEVICE_QUEUE_ENTRY *)(bf_0 >> 8) )
      DeviceQueue->_bf_0 = (unsigned __int8)bf_0;
  }
  KeReleaseInStackQueuedSpinLockFromDpcLevel(&LockHandle);
  __writecr8(LockHandle.OldIrql);
  return Inserted;
}

Referenced by:

No references.