CmGetDeviceCompoundFilters

__int64 __fastcall CmGetDeviceCompoundFilters(
        __int64 a1,
        const wchar_t *a2,
        char *a3,
        __int64 a4,
        int *a5,
        wchar_t *a6,
        int a7,
        unsigned int *a8){
  unsigned int v8; 
  const DEVPROPKEY *v13; 
  int DeviceCompoundFiltersWorker; 
  char *v15; 
  __int64 v16; 
  int v17; 
  unsigned int *v18; 
  int v19; 
  int DeviceMappedPropertyFromRegProp; 
  __int64 v22; 
  HANDLE Handle; 
  HANDLE v24; 
  v8 = 0;
  Handle = 0i64;
  v24 = 0i64;
  if( *(_DWORD *)(a4 + 16) != 22 )
    goto LABEL_2;
  v22 = *(_QWORD *)a4 - DEVPKEY_Device_CompoundUpperFilters;
  if( *(_QWORD *)a4 == DEVPKEY_Device_CompoundUpperFilters )
    v22 = *(_QWORD *)(a4 + 8) - 0x293B573F92A15394i64;
  v13 = &DEVPKEY_Device_UpperFilters;
  if( v22 )
LABEL_2:
    v13 = &DEVPKEY_Device_LowerFilters;
  if( a3 )
  {
    v15 = a3;
    Handle = a3;
  }
  else
  {
    DeviceCompoundFiltersWorker = CmOpenDeviceRegKey(a1, a2, 16, 0, 33554433, 0, (__int64)&Handle, 0i64);
    if( DeviceCompoundFiltersWorker < 0 )
    {
LABEL_27:
      v8 = DeviceCompoundFiltersWorker;
      goto LABEL_11;
    }
    v15 = (char *)Handle;
  }
  if( a1 )
    v16 = *(_QWORD *)(a1 + 224);
  else
    v16 = 0i64;
  v17 = SysCtxRegOpenKey(v16, v15, L"Filters", 0, 0x2001Fu, &v24);
  v18 = a8;
  v19 = a7;
  if( v17 >= 0 )
  {
    DeviceCompoundFiltersWorker = CmGetDeviceCompoundFiltersWorker(
                                    a1,
                                    a2,
                                    (__int64)Handle,
                                    v24,
                                    a4,
                                    (__int64)v13,
                                    (__int64)a5,
                                    (__int64)a6,
                                    a7,
                                    (__int64)a8);
    if( DeviceCompoundFiltersWorker != -1073741772
      && DeviceCompoundFiltersWorker != -1073741444
      && DeviceCompoundFiltersWorker != -1073741275 )
    {
      if( DeviceCompoundFiltersWorker >= 0 )
        goto LABEL_11;
      goto LABEL_27;
    }
  }
  DeviceMappedPropertyFromRegProp = CmGetDeviceMappedPropertyFromRegProp(
                                      a1,
                                      a2,
                                      (__int64)Handle,
                                      (__int64)v13,
                                      a5,
                                      a6,
                                      v19,
                                      v18,
                                      0);
  if( DeviceMappedPropertyFromRegProp < 0 )
    v8 = DeviceMappedPropertyFromRegProp;
LABEL_11:
  if( v24 )
    ZwClose(v24);
  if( Handle && !a3 )
    ZwClose(Handle);
  return v8;
}

Referenced by:

CmGetDeviceMappedPropertyFromComposite