CmpLightWeightCommitSetSecDescUoW

VOID __stdcall CmpLightWeightCommitSetSecDescUoW(_CM_KCB_UOW *UoW, _LARGE_INTEGER *CommitTime){
  _CM_KEY_CONTROL_BLOCK *KeyControlBlock; 
  _DWORD *PrepareDataPointer; 
  _HHIVE *KeyHive; 
  __int64 v7; 
  ULONG_PTR v8; 
  __int64 v9; 
  int v10; 
  int v11; 
  int v12; 
  int v13; 
  int v14; 

  v14 = 0;
  v12 = 0;
  KeyControlBlock = UoW->KeyControlBlock;
  PrepareDataPointer = UoW->PrepareDataPointer;
  v13 = -1;
  v11 = -1;
  KeyHive = KeyControlBlock->KeyHash.KeyHive;
  v7 = (__int64)KeyHive->GetCellRoutine(KeyHive, KeyControlBlock->KeyHash.KeyCell, (_HV_GET_CELL_CONTEXT *)&v13);
  v8 = *(_DWORD *)(v7 + 44);
  v9 = (__int64)KeyHive->GetCellRoutine(KeyHive, v8, (_HV_GET_CELL_CONTEXT *)&v11);
  *(_DWORD *)(v7 + 44) = *PrepareDataPointer;
  v10 = *(_DWORD *)(v9 + 12);
  if( v10 == 1 )
  {
    KeyHive->ReleaseCellRoutine(KeyHive, (_HV_GET_CELL_CONTEXT *)&v11);
    v9 = 0i64;
    CmpRemoveSecurityCellList(KeyHive, v8);
    HvFreeCell((ULONG_PTR)KeyHive, v8);
  }
  else
  {
    *(_DWORD *)(v9 + 12) = v10 - 1;
  }
  *(_LARGE_INTEGER *)(v7 + 4) = *CommitTime;
  UoW->KeyControlBlock->KcbLastWriteTime = *CommitTime;
  ++UoW->KeyControlBlock->SequenceNumber;
  CmpAssignSecurityToKcb((UINT64)UoW->KeyControlBlock, *(unsigned int *)(v7 + 44), 0i64, 0, 0);
  KeyHive->ReleaseCellRoutine(KeyHive, (_HV_GET_CELL_CONTEXT *)&v13);
  if( v9 )
    KeyHive->ReleaseCellRoutine(KeyHive, (_HV_GET_CELL_CONTEXT *)&v11);
  ExFreePoolWithTag(PrepareDataPointer, 0x77554D43u);
  UoW->PrepareDataPointer = 0i64;
}

Referenced by:

CmpProcessLightWeightUOW