PiDevCfgFreeResolveContext

void __fastcall PiDevCfgFreeResolveContext(__int64 a1){
  void *v2; 
  unsigned int i; 
  void **v4; 
  void *v5; 
  void **v6; 
  char *v7; 
  int v8; 
  __int64 v9; 
  __int64 v10; 
  if( *(_QWORD *)(a1 + 24) )
  {
    for( i = 0; i < 0x7F; ++i )
    {
      while( 1 )
      {
        v4 = (void **)(*(_QWORD *)(a1 + 24) + 16i64 * i);
        v5 = *v4;
        if( *v4 == v4 )
          break;
        if( *((void ***)v5 + 1) != v4 || (v6 = *(void ***)v5, *(void **)(*(_QWORD *)v5 + 8i64) != v5) )
          __fastfail(3u);
        *v4 = v6;
        v6[1] = v4;
        RtlFreeAnsiString((_UNICODE_STRING *)v5 + 1);
        v7 = (char *)*((_QWORD *)v5 + 5);
        if( v7 )
        {
          v8 = *((_DWORD *)v5 + 8);
          if( (_WORD)v8 == 0x8000 )
          {
            if( (v8 & 0x100000) != 0 )
            {
              if( PiPnpRtlCtx && (v9 = *(_QWORD *)(PiPnpRtlCtx + 224)) != 0 )
                v10 = *(_QWORD *)(v9 + 8);
              else
                v10 = 0i64;
              RegRtlDeleteTreeInternal(v7, 0i64, v10, 0);
            }
            ZwClose(*((HANDLE *)v5 + 5));
          }
          else
          {
            ExFreePoolWithTag(v7, 0);
          }
        }
        ExFreePoolWithTag(v5, 0);
      }
    }
    ExFreePoolWithTag(*(PVOID *)(a1 + 24), 0);
  }
  v2 = *(void **)(a1 + 16);
  if( v2 )
    ZwClose(v2);
}

Referenced by:

PiDevCfgConfigureDeviceKeys
PiDevCfgInitResolveContext
PiDevCfgVerifyDeviceAllowed