DrvDbGetDriverInfFileMappedPropertyKeys

INT64 __fastcall DrvDbGetDriverInfFileMappedPropertyKeys(
        INT64 *a1,
        INT64 a2,
        VOID *hKey,
        UINT64 a4,
        INT64 a5,
        INT64 DataSize){
  unsigned int *v6; 
  unsigned int v8; 
  UINT64 v10; 
  signed int CompositeMappedPropertyKeys; 
  INT64 v13; 
  __int64 v14; 
  __int64 v15; 
  __int64 v16; 
  __int64(**v17)[3]; 
  unsigned int i; 
  const WCHAR *v19; 
  signed int Value; 
  __int64(*v21)[3]; 
  __int64 v22; 
  unsigned int v23; 
  int v24; 
  unsigned int v25; 
  unsigned int *v27; 
  void *Handle[2]; 
  v6 = (unsigned int *)DataSize;
  v8 = a5;
  Handle[0] = 0i64;
  v27 = (unsigned int *)DataSize;
  *(_DWORD *)DataSize = 0;
  v10 = a4;
  CompositeMappedPropertyKeys = DrvDbGetCompositeMappedPropertyKeys(
                                  (__int64)a1,
                                  (_OWORD **)off_140C0F0A8,
                                  1u,
                                  a4,
                                  a5,
                                  v27);
  if( CompositeMappedPropertyKeys >= 0 )
  {
    v15 = *v6;
    if( (_DWORD)v15 )
    {
      if( v14 )
        v10 = v14 + 20 * v15;
      v8 = a5 - v15;
    }
    if( hKey )
      goto LABEL_9;
    CompositeMappedPropertyKeys = DrvDbOpenDriverInfFileRegKey(a1, a2, v13, 0, (INT64)Handle, 0i64);
    if( CompositeMappedPropertyKeys >= 0 )
    {
      hKey = Handle[0];
LABEL_9:
      v16 = 0i64;
      v17 = &off_140001C60;
      for( i = 0; i < 4; ++i )
      {
        v19 = (const WCHAR *)v17[2];
        LODWORD(DataSize) = 0;
        Value = RegRtlQueryValue(hKey, v19, 0i64, 0i64, (__int64)&DataSize);
        CompositeMappedPropertyKeys = Value;
        if( Value == -1073741772 )
        {
          CompositeMappedPropertyKeys = 0;
        }
        else
        {
          if( Value && Value != -1073741789 )
            break;
          if( v10 && (unsigned int)v16 < v8 )
          {
            v21 = *v17;
            v22 = 5 * v16;
            v16 = (unsigned int)(v16 + 1);
            *(_OWORD *)(v10 + 4 * v22) = *(_OWORD *)*v17;
            *(_DWORD *)(v10 + 4 * v22 + 16) = (*v21)[2];
          }
          v23 = *v6;
          v24 = -1;
          v25 = *v6 + 1;
          if( v25 >= *v6 )
            v24 = *v6 + 1;
          CompositeMappedPropertyKeys = v25 < v23 ? 0xC0000095 : 0;
          *v6 = v24;
          if( v25 < v23 )
          {
            *v6 = 0;
            break;
          }
        }
        v17 += 5;
      }
    }
    if( Handle[0] )
      ZwClose(Handle[0]);
  }
  return(unsigned int)CompositeMappedPropertyKeys;
}

Referenced by:

DrvDbDispatchDriverInfFile