DrvDbGetDriverInfFileMappedPropertyKeys

NTSTATUS __stdcall DrvDbGetDriverInfFileMappedPropertyKeys(
        _DRVDB_CONTEXT *pDrvDbCtx,
        WCHAR *DriverInfFileName,
        VOID *ObjectBaseKey,
        _DEVPROPKEY *PropertyKeys,
        UINT64 BufferLength,
        UINT64 *PropertyCount){
  UINT64 *v6; 
  unsigned int v8; 
  _DEVPROPKEY *v10; 
  signed int CompositeMappedPropertyKeys; 
  INT64 v13; 
  __int64 v14; 
  __int64 v15; 
  __int64 v16; 
  __int64(**v17)[3]; 
  unsigned int i; 
  const wchar_t *v19; 
  signed int Value; 
  __int64(*v21)[3]; 
  __int64 v22; 
  unsigned int v23; 
  int v24; 
  unsigned int v25; 
  INT64 v27; 
  UINT64 *v28; 
  __int64 v29[2]; 

  v6 = PropertyCount;
  v8 = BufferLength;
  v29[0] = 0i64;
  v28 = PropertyCount;
  *(_DWORD *)PropertyCount = 0;
  v10 = PropertyKeys;
  LODWORD(v27) = BufferLength;
  CompositeMappedPropertyKeys = DrvDbGetCompositeMappedPropertyKeys(
                                  pDrvDbCtx,
                                  (const _DEVPROPKEY **)&off_140C0F0A8,
                                  1ui64,
                                  PropertyKeys,
                                  v27,
                                  v28);
  if( CompositeMappedPropertyKeys >= 0 )
  {
    v15 = *(unsigned int *)v6;
    if( (_DWORD)v15 )
    {
      if( v14 )
        v10 = (_DEVPROPKEY *)(v14 + 20 * v15);
      v8 = BufferLength - v15;
    }
    if( ObjectBaseKey )
      goto LABEL_9;
    CompositeMappedPropertyKeys = DrvDbOpenDriverInfFileRegKey(
                                    (INT64 *)pDrvDbCtx,
                                    (INT64)DriverInfFileName,
                                    v13,
                                    0,
                                    (INT64)v29,
                                    0i64);
    if( CompositeMappedPropertyKeys >= 0 )
    {
      ObjectBaseKey = (VOID *)v29[0];
LABEL_9:
      v16 = 0i64;
      v17 = &off_140001C60;
      for( i = 0; i < 4; ++i )
      {
        v19 = (const wchar_t *)v17[2];
        LODWORD(PropertyCount) = 0;
        Value = RegRtlQueryValue(ObjectBaseKey, v19, 0i64, 0i64, (__int64)&PropertyCount);
        CompositeMappedPropertyKeys = Value;
        if( Value == -1073741772 )
        {
          CompositeMappedPropertyKeys = 0;
        }
        else
        {
          if( Value && Value != -1073741789 )
            break;
          if( v10 && (unsigned int)v16 < v8 )
          {
            v21 = *v17;
            v22 = v16;
            v16 = (unsigned int)(v16 + 1);
            v10[v22].fmtid = *(_GUID *)*v17;
            v10[v22].pid = (*v21)[2];
          }
          v23 = *(_DWORD *)v6;
          v24 = -1;
          v25 = *(_DWORD *)v6 + 1;
          if( v25 >= *(_DWORD *)v6 )
            v24 = *(_DWORD *)v6 + 1;
          CompositeMappedPropertyKeys = v25 < v23 ? 0xC0000095 : 0;
          *(_DWORD *)v6 = v24;
          if( v25 < v23 )
          {
            *(_DWORD *)v6 = 0;
            break;
          }
        }
        v17 += 5;
      }
    }
    if( v29[0] )
      ZwClose(v29[0]);
  }
  return CompositeMappedPropertyKeys;
}

Referenced by:

DrvDbDispatchDriverInfFile