PopFxIsDevicePotentialDripsConstraint

NTSTATUS __stdcall PopFxIsDevicePotentialDripsConstraint(PVOID Object){
  bool v1; 
  __int64 v3; 
  _KIRQL v4; 
  NTSTATUS result; 
  UINT64 Size; 
  UINT64 RequiredSize; 
  __int64 Str1; 

  Str1 = 0i64;
  v1 = 0;
  RequiredSize = 0i64;
  ObfReferenceObjectWithTag(Object, 0x78466F50ui64);
  if( Object )
    v3 = *(_QWORD *)(*((_QWORD *)Object + 39) + 40i64);
  else
    v3 = 0i64;
  if( v3 )
  {
    LOBYTE(v4) = ExAcquireSpinLockExclusive((INT64 *)(v3 + 88));
    _m_prefetchw((const void *)(v3 + 296));
    if( (_InterlockedOr((volatile signed __int32 *)(v3 + 296), 0) & 4) != 0 )
      v1 = (_InterlockedCompareExchange((volatile signed __int32 *)(*(_QWORD *)(v3 + 80) + 824i64), 0, 0) & 0x10) != 0;
    ExReleaseSpinLockExclusive((PEX_SPIN_LOCK)(v3 + 88), v4);
    if( !v1 )
    {
      LODWORD(Size) = 8;
      if( IoGetDevicePropertyData(
             *(_DEVICE_OBJECT **)(v3 + 32),
             (_DEVPROPKEY *)&DEVPKEY_Device_EnumeratorName,
             0i64,
             0i64,
             Size,
             &Str1,
             &RequiredSize,
             (UINT64 *)((char *)&RequiredSize + 4)) >= 0
        && HIDWORD(RequiredSize) == 18
        && (unsigned int)RequiredSize > 2
        && !*((_WORD *)&RequiredSize + ((unsigned __int64)(unsigned int)RequiredSize >> 1) + 3)
        && !wcsicmp((const wchar_t *)&Str1, L"USB") )
      {
        v1 = 1;
      }
    }
  }
  result = ObfDereferenceObjectWithTag(Object, 0x78466F50ui64);
  LOBYTE(result) = v1;
  return result;
}

Referenced by:

NtPowerInformation