IoGetAttachedDeviceReferenceWithTag

NTSTATUS __stdcall IoGetAttachedDeviceReferenceWithTag(PDEVICE_OBJECT DeviceObject, UINT32 Tag){
  KIRQL v4; 
  PVOID v5; 
  v4 = KeAcquireQueuedSpinLock(0xAui64);
  IoGetAttachedDevice(DeviceObject);
  LODWORD(DeviceObject) = (_DWORD)v5;
  ObfReferenceObjectWithTag(v5, Tag);
  KeReleaseQueuedSpinLock(0xAui64, v4);
  return(int)DeviceObject;
}

Referenced by:

IopEjectDevice
IopSynchronousCall
PiControlGetDeviceStack
PipCallDriverAddDevice
PnpAsynchronousCall
PnpQueryInterface
PopAllocateIrp
PopFxRegisterDevice