-
-
[旧帖]
[求助]为什么在hkey_local_machine中创建子键会失败
0.00雪花
-
发表于:
2012-7-12 11:29
1389
-
[旧帖] [求助]为什么在hkey_local_machine中创建子键会失败
0.00雪花
NTSTATUS CreateRootKey()
{
UNICODE_STRING ObjectName;
OBJECT_ATTRIBUTES ObjectAttributes;
HANDLE KeyHandle;
ULONG Disposition;
NTSTATUS status;
RtlInitUnicodeString(&ObjectName,L"\\Registry\\Machine\\FFF0SCD");
InitializeObjectAttributes(&ObjectAttributes,&ObjectName,OBJ_CASE_INSENSITIVE,NULL,NULL);
//for test, use volatile CreateOptions,so this key will disappear after reboot
status = ZwCreateKey(&KeyHandle,KEY_ALL_ACCESS,&ObjectAttributes,0,0,REG_OPTION_VOLATILE,&Disposition);
DbgPrint("CreateRootKey,status=%ld",status);
return status;
}
代码如上所示,为什么在根键中创建新键会失败?而如果我换成L"\\Registry\\Machine\\SOFTWARE\\FFF0SCD"就成功了?
如果我想在根键中创建一个新的子键,该怎么操作呢?
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课