PiPnpRtlIsDeviceEnumerableForUser

NTSTATUS __stdcall PiPnpRtlIsDeviceEnumerableForUser(
        PWCHAR DeviceIntanceId,
        PVOID ObjectBaseKey,
        SECURITY_SUBJECT_CONTEXT *SecuritySubjectContext,
        UINT8 *EnumerableForUser){
  int ObjectProperty; 
  int v6; 
  INT64 v8; 
  int v9; 
  PVOID P; 
  struct _GENERIC_MAPPING GenericMapping; 
  UINT8 *AccessGranted; 
  LODWORD(v8) = 0;
  v9 = 0;
  P = 0i64;
  GenericMapping.GenericWrite = 0x20000;
  GenericMapping.GenericExecute = 0x20000;
  GenericMapping.GenericRead = 131073;
  GenericMapping.GenericAll = 983041;
  *AccessGranted = 0;
  ObjectProperty = PnpGetObjectProperty(
                     1198550608i64,
                     512i64,
                     (INT64)ObjectBaseKey,
                     1i64,
                     (const WCHAR *)SecuritySubjectContext,
                     0i64,
                     (INT64 *)&DEVPKEY_Device_RestrictedSD,
                     (UINT64)&v9,
                     (INT64)&P,
                     0i64,
                     v8);
  v6 = ObjectProperty;
  if( ObjectProperty == -1073741275 )
    goto LABEL_2;
  if( ObjectProperty >= 0 )
  {
    if( v9 != 19 )
      goto LABEL_3;
    v6 = PiAuVerifyAccessToObject(
           1ui64,
           P,
           &GenericMapping,
           (SECURITY_SUBJECT_CONTEXT *)EnumerableForUser,
           AccessGranted);
    if( v6 < 0 )
    {
LABEL_2:
      v6 = 0;
LABEL_3:
      *AccessGranted = 1;
    }
  }
  if( P )
    ExFreePoolWithTag(P, 0x47706E50u);
  return v6;
}

Referenced by:

PiPnpRtlApplyMandatoryDeviceFilters