CmpCopyKeyPartial
INT64 __fastcall CmpCopyKeyPartial(UINT64 a1, INT64 a2, UINT64 a3, UINT64 a4, INT16 a5, CHAR a6, UINT64 Type){
HSTORAGE_TYPE v7;
int v10;
unsigned int v11;
INT64 v12;
__int64 v13;
__int64 v14;
int v15;
int v16;
char v17;
__int16 v18;
unsigned int v19;
int v20;
unsigned int v21;
char v22;
unsigned int *v24;
unsigned int v25;
unsigned int v26;
__int64 v27;
UINT64 AllocationCount;
unsigned int ValueCell;
unsigned int ValueCella;
int ValueCell_4;
unsigned int v32;
UINT64 v33;
int v34[2];
int v35[2];
int v36[2];
int v37[2];
int v38[2];
unsigned int *v39;
__int64 v40;
unsigned int BugCheckParameter3;
unsigned int SourceCell;
unsigned int Typea;
SourceCell = a2;
v7 = (int)Type;
v36[1] = 0;
v37[1] = 0;
BugCheckParameter3 = -1;
v36[0] = -1;
v10 = a4;
v32 = 0;
v11 = -1;
v37[0] = -1;
v12 = 0i64;
v39 = 0i64;
v38[0] = -1;
v38[1] = 0;
v35[0] = -1;
v35[1] = 0;
v34[0] = -1;
v34[1] = 0;
if( (_DWORD)Type == 2 )
{
if( (_DWORD)a4 == -1 )
v7 = Stable;
else
v7 = (unsigned int)a4 >> 31;
}
v13 = (*(__int64(__fastcall **)(UINT64, INT64, int *))(a1 + 8))(a1, a2, v36);
v40 = v13;
v14 = v13;
if( !v13 )
return 0xFFFFFFFFi64;
v15 = *(unsigned __int16 *)(v13 + 74);
ValueCell = *(_DWORD *)(v13 + 44);
v16 = *(_DWORD *)(v13 + 48);
if( (a5 & 2) == 0 )
v16 = -1;
LODWORD(v33) = v16;
ValueCell_4 = (a5 & 2) != 0 ? v15 : 0;
Typea = CmpCopyCell((_HHIVE *)a1, SourceCell, (_HHIVE *)a3, v7);
if( Typea == -1 )
{
v19 = -1;
goto LABEL_56;
}
if( ValueCell_4 )
{
BugCheckParameter3 = CmpCopyCell((_HHIVE *)a1, (unsigned int)v33, (_HHIVE *)a3, v7);
if( BugCheckParameter3 == -1 )
{
v19 = Typea;
LABEL_56:
v22 = 0;
goto LABEL_24;
}
}
v12 = (*(__int64(__fastcall **)(UINT64, _QWORD, int *))(a3 + 8))(a3, Typea, v37);
if( !v12 )
goto LABEL_39;
*(_DWORD *)(v12 + 20) = 0;
*(_DWORD *)(v12 + 24) = 0;
v17 = a5;
*(_DWORD *)(v12 + 48) = BugCheckParameter3;
*(_WORD *)(v12 + 74) = ValueCell_4;
*(_DWORD *)(v12 + 44) = -1;
*(_DWORD *)(v12 + 28) = -1;
*(_DWORD *)(v12 + 32) = -1;
*(_DWORD *)(v12 + 16) = v10;
*(_BYTE *)(v12 + 12) = 0;
if( (a5 & 0x100) != 0 )
*(_BYTE *)(v12 + 13) &= 0xFCu;
if( (a5 & 0x80u) != 0 )
*(_BYTE *)(v12 + 13) |= 0x80u;
v18 = *(_WORD *)(v14 + 2) & 0x30;
*(_WORD *)(v12 + 2) = v18;
if( (a5 & 0x20) != 0 )
{
v18 = *(_WORD *)(v14 + 2) & 0xFFBF;
*(_WORD *)(v12 + 2) = v18;
}
if( v10 == -1 )
*(_WORD *)(v12 + 2) = v18 | 0xC;
if( (a5 & 0x10) != 0 )
goto LABEL_20;
CmpLockTwoSecurityCachesExclusiveShared(a3, a1);
if( !CmpFindSecurityCellCacheIndex(a1, ValueCell, &v32) )
{
CmpUnlockTwoSecurityCaches((_CMHIVE *)a3, (_CMHIVE *)a1);
LABEL_39:
v19 = Typea;
goto LABEL_31;
}
v19 = Typea;
v20 = CmpAssignSecurityDescriptor(
a3,
Typea,
v12,
(VOID *)(*(_QWORD *)(*(_QWORD *)(a1 + 1880) + 16i64 * v32 + 8) + 32i64),
0);
CmpUnlockTwoSecurityCaches((_CMHIVE *)a3, (_CMHIVE *)a1);
if( v20 < 0 )
{
LABEL_31:
v22 = 0;
goto LABEL_24;
}
v14 = v40;
v17 = a5;
LABEL_20:
if( (*(_BYTE *)(v14 + 2) & 0x40) != 0 )
v21 = 0;
else
v21 = *(_DWORD *)(v14 + 36);
*(_DWORD *)(v12 + 36) = 0;
*(_DWORD *)(v12 + 40) = -1;
if( v21 && (v17 & 4) != 0 )
{
v24 = (unsigned int *)(*(__int64(__fastcall **)(UINT64, _QWORD, int *))(a1 + 8))(
a1,
*(unsigned int *)(v14 + 40),
v38);
v39 = v24;
if( v24 )
{
v25 = 0;
v33 = (UINT64)v24;
while( 1 )
{
v26 = CmpCopyValue(a1, *v24, a3, (unsigned int)v7);
ValueCella = v26;
if( v26 == -1 || !(*(__int64(__fastcall **)(UINT64, _QWORD, int *))(a3 + 8))(a3, v26, v34) )
{
v11 = *(_DWORD *)(v12 + 40);
goto LABEL_39;
}
(*(void(__fastcall **)(UINT64, int *))(a3 + 16))(a3, v34);
LODWORD(AllocationCount) = v21;
if( CmpAddValueToListEx(
(_HHIVE *)a3,
ValueCella,
v25,
(unsigned int)v7,
(_CHILD_LIST *)(v12 + 36),
AllocationCount) < 0 )
break;
++v25;
v24 = (unsigned int *)(v33 + 4);
v33 += 4i64;
if( v25 >= v21 )
goto LABEL_23;
}
v11 = *(_DWORD *)(v12 + 40);
if( v11 == -1 )
{
v19 = Typea;
v22 = 0;
goto LABEL_24;
}
v27 = (*(__int64(__fastcall **)(UINT64, _QWORD, int *))(a3 + 8))(a3, v11, v35);
if( v27 )
{
while( v25 )
HvFreeCell(a3, *(unsigned int *)(v27 + 4i64 * --v25));
(*(void(__fastcall **)(UINT64, int *))(a3 + 16))(a3, v35);
}
}
goto LABEL_39;
}
LABEL_23:
v19 = Typea;
v22 = 1;
LABEL_24:
(*(void(__fastcall **)(UINT64, int *))(a1 + 16))(a1, v36);
if( v12 )
(*(void(__fastcall **)(UINT64, int *))(a3 + 16))(a3, v37);
if( v39 )
(*(void(__fastcall **)(UINT64, int *))(a1 + 16))(a1, v38);
if( v22 )
return v19;
if( v11 != -1 )
HvFreeCell(a3, v11);
if( BugCheckParameter3 != -1 )
HvFreeCell(a3, BugCheckParameter3);
if( v19 != -1 )
HvFreeCell(a3, v19);
return 0xFFFFFFFFi64;
}Referenced by:
CmRestoreKey
CmSaveMergedKeys
CmpCommitAddKeyUoW
CmpCopySyncTree2
CmpLightWeightPrepareAddKeyUoW
CmpLoadHiveVolatile
CmpReorganizeHive