CmIsDevicePresent

NTSTATUS __stdcall CmIsDevicePresent(HPNPCTX *hPnpCtx, WCHAR *DeviceInstance, UINT8 *Present){
  NTSTATUS result; 
  int v6; 
  _UNICODE_STRING v7[2]; 
  int v8; 
  int v9; 

  v8 = 0;
  v6 = 0;
  v9 = 0;
  v7[0] = 0i64;
  if( !Present )
    return -1073741811;
  result = RtlInitUnicodeStringEx(v7, DeviceInstance);
  if( result < 0
    || (result = NtPlugPlayGetDeviceStatus((__int64)hPnpCtx, (__int64)v7, (__int64)&v6, (__int64)&v9, (__int64)&v8),
        result < 0) )
  {
    if( result == -1073741810 )
    {
      result = 0;
      *Present = 0;
    }
  }
  else
  {
    *Present = 1;
  }
  return result;
}

Referenced by:

CmEnumSubkeyCallback
PiPnpRtlEnumeratorFilterCallback
PiPnpRtlServiceFilterCallback