CmpInitializeHardwareConfiguration
NTSTATUS __stdcall CmpInitializeHardwareConfiguration(_LOADER_PARAMETER_BLOCK *LoaderBlock){
_CONFIGURATION_COMPONENT_DATA *v1;
NTSTATUS result;
UINT64 v3;
UINT64 v4;
struct _OBJECT_ATTRIBUTES ObjectAttributes;
UINT64 Disposition;
void *KeyHandle;
v1 = (_CONFIGURATION_COMPONENT_DATA *)*((_QWORD *)LoaderBlock + 22);
*(&ObjectAttributes.Length + 1) = 0;
memset(&ObjectAttributes.Attributes + 1, 0, 20);
KeyHandle = 0i64;
LODWORD(Disposition) = 0;
ObjectAttributes.RootDirectory = 0i64;
ObjectAttributes.ObjectName = &CmRegistryMachineHardwareDeviceMapName;
LODWORD(v3) = 0;
ObjectAttributes.Length = 48;
ObjectAttributes.Attributes = 576;
result = ZwCreateKey(&KeyHandle, 0x2001Fui64, &ObjectAttributes, 0i64, 0i64, v3, &Disposition);
if( result >= 0 )
{
ZwClose(KeyHandle);
ObjectAttributes.RootDirectory = 0i64;
ObjectAttributes.ObjectName = &CmRegistryMachineHardwareDescriptionName;
ObjectAttributes.Length = 48;
LODWORD(v4) = 0;
ObjectAttributes.Attributes = 576;
*(_OWORD *)&ObjectAttributes.SecurityDescriptor = 0i64;
result = ZwCreateKey(&KeyHandle, 0x2001Fui64, &ObjectAttributes, 0i64, 0i64, v4, &Disposition);
if( result >= 0 )
{
CmpConfigurationData = ExAllocatePoolWithTag(PagedPool, (unsigned int)CmpConfigurationAreaSize, 0x20204D43ui64);
if( CmpConfigurationData )
{
if( v1 )
LODWORD(v1) = CmpSetupConfigurationTree(v1, KeyHandle, InterfaceTypeUndefined, 0xFFFFFFFFui64);
ExFreePoolWithTag(CmpConfigurationData, 0);
CmpConfigurationData = 0i64;
}
else
{
LODWORD(v1) = -1073741670;
}
ZwClose(KeyHandle);
return(int)v1;
}
}
return result;
}Referenced by:
CmInitSystem1