MiReferenceExistingControlArea

INT64 __fastcall MiReferenceExistingControlArea(INT64 a1){
  __int64 v1; 
  __int64 v3; 
  INT64 *v4; 
  int v5; 
  INT64 v6; 
  _MI_CONTROL_AREA_WAIT_BLOCK *v7; 
  KIRQL v9; 
  v1 = *(_QWORD *)(a1 + 48);
  v9 = 0;
  v3 = MiLockSectionControlArea(*(_QWORD **)(v1 + 40), (*(_BYTE *)(a1 + 19) & 1) == 0, &v9);
  if( !v3 )
    return 3221225473i64;
  v4 = (INT64 *)(v3 + 72);
  if( (*(_DWORD *)(v3 + 56) & 3) != 0 )
  {
    ExReleaseSpinLockExclusiveFromDpcLevel(v4);
    __writecr8(v9);
    return 3221225473i64;
  }
  v5 = MiValidateControlAreaPartition(a1, v3);
  if( v5 < 0 )
  {
    ExReleaseSpinLockExclusiveFromDpcLevel(v4);
    __writecr8(v9);
    return(unsigned int)v5;
  }
  else
  {
    v7 = MiReferenceActiveControlArea((_DWORD *)a1, v6);
    ExReleaseSpinLockExclusiveFromDpcLevel(v4);
    __writecr8(v9);
    MiReleaseControlAreaWaiters(v7);
    return 0i64;
  }
}

Referenced by:

MiCreateImageOrDataSection