1

I'm trying to read a value of type REG_RESOURCE_LIST from the registry, but without success.
The specific value I'm trying to read is HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\{YourNetworkInterface}\{GUID}\Control\AllocConfig.
You can find this value by going to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI, and searching for a key that his subkey (the {GUID} part in the path) have a value named Class with a value of Net. Or you can just search for it.

The strange thing is, when I'm opening the Control key through code, and calling GetValueNames() I'm getting the AllocConfig value name, but when calling GetValue("AllocConfig") I'm getting null (not null in reality).
Also, in ProccessMonitor, I see that when calling GetValue("AllocConfig") the result is Buffer Overflow.
Any help will be appriciated, thanks.

4

2 回答 2

3

要获得 REG_RESOURCE_LIST,您需要使用 RegQueryValueEx()。lpType out 参数中的值应该是 8(见这里)。您在 lpData out 参数中返回的数据是CM_RESOURCE_LIST

首先调用 RegQueryValueEx 获取列表的大小,分配该大小的缓冲区,调用 ReqQueryValueEx 填充缓冲区,并将缓冲区指针转换为 PCM_RESOURCE_LIST。上面链接的 CM_RESOURCE_LIST 文档告诉您如何遍历列表并提取内容。

于 2013-12-13T07:22:56.630 回答
0

http://blogs.microsoft.co.il/ischen/2007/12/04/querying-device-hardware-resources-from-the-windows-registry-using-c/

c# 项目正确解码注册表中的 REG_RESOURCE_LIST 数据结构,该结构基于 CM_RESOURCE_LIST 结构,该结构是包含许多 CM_FULL_RESOURCE_DESCRIPTOR 的列表。

于 2019-08-18T15:38:41.440 回答