CmpLightWeightCommitRenameKeyUoW

VOID __stdcall CmpLightWeightCommitRenameKeyUoW(_CM_KCB_UOW *UoW, _LARGE_INTEGER *CommitTime){
  __int64 v2; 
  __int64 v4; 
  _CM_KEY_CONTROL_BLOCK *KeyControlBlock; 
  UINT64 KeyHive; 
  __int64 v8; 
  __int64 v9; 
  unsigned __int16 v10; 
  UINT64 *PrepareDataPointer; 
  _CM_KEY_CONTROL_BLOCK *v12; 
  __int64 v13[5]; 
  int v14; 
  int v15; 
  int v16; 
  int v17; 

  v15 = 0;
  v17 = 0;
  v4 = v2;
  v14 = -1;
  KeyControlBlock = UoW->KeyControlBlock;
  v16 = -1;
  KeyHive = (UINT64)KeyControlBlock->KeyHash.KeyHive;
  CmpUpdateParentForEachSon(KeyHive, KeyControlBlock->KeyHash.KeyCell, 0);
  ++UoW->KeyControlBlock->SequenceNumber;
  v8 = (*(__int64(__fastcall **)(UINT64, _QWORD, int *))(KeyHive + 8))(
         KeyHive,
         UoW->KeyControlBlock->KeyHash.KeyCell,
         &v14);
  *(_DWORD *)(v8 + 16) = UoW->KeyControlBlock->ParentKcb->KeyHash.KeyCell;
  v9 = (*(__int64(__fastcall **)(UINT64, _QWORD, int *))(KeyHive + 8))(
         KeyHive,
         UoW->KeyControlBlock->ParentKcb->KeyHash.KeyCell,
         &v16);
  *(_LARGE_INTEGER *)(v9 + 4) = *CommitTime;
  UoW->KeyControlBlock->ParentKcb->KcbLastWriteTime = *CommitTime;
  ++UoW->KeyControlBlock->ParentKcb->SequenceNumber;
  v10 = 2 * *(_WORD *)(v8 + 72);
  if( (*(_BYTE *)(v8 + 2) & 0x20) == 0 )
    v10 = *(_WORD *)(v8 + 72);
  if( (unsigned __int16)*(_DWORD *)(v9 + 52) < (unsigned int)v10 )
  {
    *(_WORD *)(v9 + 52) = v10;
    UoW->KeyControlBlock->ParentKcb->KcbMaxNameLen = v10;
  }
  (*(void(__fastcall **)(UINT64, int *, _QWORD, __int64))(KeyHive + 16))(KeyHive, &v14, v10, v9);
  (*(void(__fastcall **)(UINT64, int *))(KeyHive + 16))(KeyHive, &v16);
  v13[1] = (__int64)UoW->KeyControlBlock;
  v13[0] = UoW->LastWriteTime.QuadPart;
  CmpSearchKeyControlBlockTreeEx(
    (__int64(__fastcall *)(__int64 *, __int64, __int64, __int64))CmpRefreshParent,
    KeyHive,
    v4,
    (__int64)v13,
    0);
  CmpSearchForOpenSubKeys(&UoW->KeyControlBlock->RefCount, 1, 0i64);
  HvFreeCell(KeyHive, *(_DWORD *)(UoW->LastWriteTime.QuadPart + 40));
  CmpFlushNotifiesOnKeyBodyList(UoW->LastWriteTime.QuadPart, 8i64, v4, 1);
  CmpMarkKeyUnbacked(UoW->LastWriteTime.QuadPart, v4);
  CmpDiscardKcb((UINT64)UoW->ChildKCB, v4);
  PrepareDataPointer = (UINT64 *)UoW->PrepareDataPointer;
  if( *(_DWORD *)PrepareDataPointer == 1 )
    CmpLightWeightSwapParentSubKeyList(
      KeyHive,
      UoW->KeyControlBlock->ParentKcb->KeyHash.KeyCell,
      (INT64)UoW->PrepareDataPointer);
  CmpLightWeightCleanupModifyKeyDataUoW(KeyHive, PrepareDataPointer);
  v12 = UoW->KeyControlBlock;
  UoW->PrepareDataPointer = 0i64;
  CmpDereferenceKeyControlBlockWithLock((ULONG_PTR)v12, v4, 0);
  CmpDereferenceKeyControlBlockWithLock(UoW->LastWriteTime.QuadPart, v4, 0);
}

Referenced by:

CmpProcessLightWeightUOW