Hi All,
I tried to create registry hive under \Registry\Machine by using following code:
{
OBJECT_ATTRIBUTES ObjectAttributes;
OBJECT_ATTRIBUTES ObjectAttributes2;
UNICODE_STRING FileName = {0};
UNICODE_STRING HKLM = {0};
RtlInitUnicodeString(&FileName, L"\??\C:\THKLM.reg");
InitializeObjectAttributes( &ObjectAttributes, &FileName,
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE , NULL, NULL );
RtlInitUnicodeString(&uniHKLM, L"\REGISTRY\MACHINE");
InitializeObjectAttributes( &ObjectAttributes2, &HKLM,
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE , NULL, NULL );
AdjustPrivilege(SE_RESTORE_PRIVILEGE, TRUE);
AdjustPrivilege(SE_BACKUP_PRIVILEGE, TRUE);
ntStatus = ZwLoadKey(&ObjectAttributes2, &ObjectAttributes);
}
AdjustPrivilege is the same function which is prvide in OSR in link
http://www.osronline.com/article.cfm?article=23
I have used undocumented ZwloadKey and have adjusted privileges too but after running this I am getting error -1073741790 or 0XC0000022.
Can any one guide me what I am doing wrong here?