PiGetDeviceDepth

INT64 __stdcall PiGetDeviceDepth(_UNICODE_STRING *DeviceInstance, UINT64 *DeviceDepth){
  unsigned int v4; 
  _QWORD *v5; 
  __int64 v6; 
  *(_DWORD *)DeviceDepth = 0;
  v4 = -1073741810;
  PpDevNodeLockTree(0);
  v5 = PnpDeviceObjectFromDeviceInstanceWithTag((INT64)DeviceInstance, 0x43706E50ui64);
  if( v5 )
  {
    v6 = *(_QWORD *)(v5[39] + 40i64);
    if( v6 )
    {
      v4 = 0;
      *(_DWORD *)DeviceDepth = *(_DWORD *)(v6 + 152);
    }
    ObfDereferenceObjectWithTag(v5, 0x43706E50ui64);
  }
  PpDevNodeUnlockTree(0);
  return v4;
}

Referenced by:

PiCMGetDeviceDepth
PiControlGetDeviceDepth