如何在驱动程序模式下从Registry获取64位值。 我可以获得32位值(REG_DWORD)。但是64位值(REG_QWORD)不能。 这是一个代码:
RTL_QUERY_REGISTRY_TABLE parameters[2];
RtlZeroMemory(parameters, sizeof(parameters));
parameters[0].Flags = RTL_QUERY_REGISTRY_DIRECT;
parameters[0].Name = L"MaxTotalSize";
parameters[0].EntryContext = &Globals.g_MaxTotalSize;
parameters[0].DefaultType = REG_DWORD; //But REG_QWORD doesn't work, what i must to write?
parameters[0].DefaultData = &Globals.g_MaxTotalSize;
parameters[0].DefaultLength = 4; //And here what I must to write?
status = RtlQueryRegistryValues(
RTL_REGISTRY_ABSOLUTE | RTL_REGISTRY_OPTIONAL,
RegistryPath->Buffer,
parameters,
NULL,
NULL
);
答案 0 :(得分:0)
这里我试图从注册表中获取64位值:
RTL_QUERY_REGISTRY_TABLE parameters[2];
RtlZeroMemory(parameters, sizeof(parameters));
parameters[0].Flags = RTL_QUERY_REGISTRY_DIRECT;
parameters[0].Name = L"MaxTotalSize";
parameters[0].EntryContext = &Globals.g_MaxTotalSize;
parameters[0].DefaultType = REG_QWORD;
parameters[0].DefaultData = &Globals.g_MaxTotalSize;
parameters[0].DefaultLength = 8;
status = RtlQueryRegistryValues(
RTL_REGISTRY_ABSOLUTE | RTL_REGISTRY_OPTIONAL,
RegistryPath->Buffer,
parameters,
NULL,
NULL
);
Globals.g_MaxTotalSize ULONGLONG 类型