CmOpenDeviceContainerRegKey

NTSTATUS __stdcall CmOpenDeviceContainerRegKey(
        HPNPCTX *hPnpCtx,
        const WCHAR *DeviceContainerId,
        INT64 CmKeyTypeFlags,
        INT64 HardwareProfileId,
        INT64 DesiredAccess,
        INT64 Create,
        VOID **DeviceContainerKey,
        UINT64 *Disposition){
  INT64 v10; 
  __int64(__fastcall *v11)(HPNPCTX *, const WCHAR *, __int64); 
  int v12; 
  NTSTATUS v13; 
  NTSTATUS v14; 
  int v16; 
  int v17; 
  int v18; 
  INT64 v19; 
  INT64 *v20; 
  INT64 v21[12]; 

  memset(v21, 0i64, 0x58u);
  v11 = (__int64(__fastcall *)(HPNPCTX *, const WCHAR *, __int64))*((_QWORD *)hPnpCtx + 63);
  LODWORD(v21[3]) = DesiredAccess;
  BYTE4(v21[3]) = Create;
  v21[2] = 80i64;
  v21[4] = (INT64)DeviceContainerKey;
  if( v11 )
  {
    v20 = v21;
    v12 = v11(hPnpCtx, DeviceContainerId, 5i64);
    if( v12 == -1073741822 )
    {
      v11 = 0i64;
    }
    else
    {
      if( v12 == -1073741536 )
      {
LABEL_12:
        v14 = v21[0];
        goto LABEL_5;
      }
      if( v12 )
        return -1073741595;
    }
  }
  LOBYTE(v20) = BYTE4(v21[3]);
  LODWORD(v19) = v21[3];
  v13 = CmOpenDeviceContainerRegKeyWorker(
          hPnpCtx,
          (WCHAR *)DeviceContainerId,
          LODWORD(v21[2]),
          v10,
          v19,
          (INT64)v20,
          (VOID **)v21[4],
          (UINT64 *)&v21[5]);
  v14 = v13;
  if( v11 )
  {
    LODWORD(v21[0]) = v13;
    v16 = v11(hPnpCtx, DeviceContainerId, 5i64);
    v17 = v16;
    if( v16 != -1073741822 )
    {
      if( v16 != -1073741536 )
      {
        v18 = v14;
        if( v17 )
          v18 = -1073741595;
        v14 = v18;
        goto LABEL_5;
      }
      goto LABEL_12;
    }
  }
LABEL_5:
  if( v14 >= 0 && Disposition )
    *(_DWORD *)Disposition = v21[5];
  return v14;
}

Referenced by:

CmCreateDeviceContainerWorker
PnpDispatchDeviceContainer