CmpMarkCurrentProfileDirty
void __fastcall CmpMarkCurrentProfileDirty(__int64 a1){
INT64 v1;
_HANDLE v2;
NTSTATUS v3;
NTSTATUS v4;
_ADAPTER_OBJECT *v5;
__int64 v6;
unsigned int ValueByName;
PVOID *Object;
INT64 v9;
_OBJECT_ATTRIBUTES ObjectAttributes;
VOID *KeyHandle;
int v12;
int v13;
VOID *Handle;
Handle = 0i64;
KeyHandle = 0i64;
*(&ObjectAttributes.Length + 1) = 0;
*(&ObjectAttributes.Attributes + 1) = 0;
v12 = -1;
v13 = 0;
if( (int)CmpOpenDevicesControlSet(a1, &Handle, 0i64) >= 0 )
{
v2 = (int)Handle;
ObjectAttributes.ObjectName = (_UNICODE_STRING *)L"$&";
ObjectAttributes.Length = 48;
ObjectAttributes.Attributes = 576;
*(_OWORD *)&ObjectAttributes.SecurityDescriptor = 0i64;
v3 = ZwOpenKey(
&KeyHandle,
0x20019ui64,
&ObjectAttributes,
v1,
(INT64)Object,
v9,
*(INT64 *)&ObjectAttributes.Length,
(INT64)Handle);
ZwClose(v2);
if( v3 >= 0 )
{
Handle = 0i64;
v4 = ObReferenceObjectByHandle(KeyHandle, 0x20019ui64, (_OBJECT_TYPE *)CmKeyObjectType, 0, &Handle, 0i64);
ZwClose((_HANDLE)KeyHandle);
if( v4 >= 0 )
{
CmpLockRegistryExclusive();
v5 = (_ADAPTER_OBJECT *)Handle;
v6 = (*(__int64(__fastcall **)(_QWORD, _QWORD, int *))(*(_QWORD *)(*((_QWORD *)Handle + 1) + 32i64) + 8i64))(
*(_QWORD *)(*((_QWORD *)Handle + 1) + 32i64),
*(unsigned int *)(*((_QWORD *)Handle + 1) + 40i64),
&v12);
if( v6 )
{
ValueByName = CmpFindValueByName(
(__int64)v5->AdapterObject.DmaHeader.DmaOperations->AllocateAdapterChannel,
v6,
(__int64)&CmpCurrentConfigString);
(*((void(__fastcall **)(int(__fastcall *)(_DMA_ADAPTER *, _DEVICE_OBJECT *, unsigned int, _IO_ALLOCATION_ACTION(__fastcall *)(_DEVICE_OBJECT *, _IRP *, void *, void *), void *), int *))v5->AdapterObject.DmaHeader.DmaOperations->AllocateAdapterChannel
+ 2))(
v5->AdapterObject.DmaHeader.DmaOperations->AllocateAdapterChannel,
&v12);
if( ValueByName != -1 )
HvpMarkCellDirty(
v5->AdapterObject.DmaHeader.DmaOperations->AllocateAdapterChannel,
(PVOID)ValueByName,
1u,
CmHiveDirtyNormal);
}
CmpUnlockRegistry();
HalPutDmaAdapter(v5);
}
}
}
}Referenced by:
CmInitSystem1