阅读:1994回复:4
驱动程序访问注册表
各位大虾,想请教个问题:
如何在NT,或2K下的驱动中访问注册表呢?很急的,望各位,不吝赐教,在下 谢过了! |
|
最新喜欢:![]() |
沙发#
发布于:2001-09-04 16:45
可以用一下RtlQueryRegistryValues函数
|
|
板凳#
发布于:2001-09-12 17:48
如果是个BOOT START或者SYSTEM START的DRIVER理有很多注册表键有可能无法访问. 需要自己MOUNT注册表.
|
|
|
地板#
发布于:2001-09-13 10:15
lu0:
先生您好, 能向你请教一下,boot start,& system start 是什么意思呢 另外,我应该如何mount注册表呢?小弟初来乍到,望别见笑 |
|
地下室#
发布于:2001-10-25 11:26
[QUOTE]原本由 taihai 发表
[B]可以用一下RtlQueryRegistryValues函数 [/B][/QUOTE] 怎样使用这个函数呢? 我在msdn中看到如下: QueryTable Points to a table of one or more value names and subkey names in which the caller is interested. Each table entry contains a caller-supplied QueryRoutine that will be called for each value name that exists in the registry. The table must be terminated with a NULL table entry, which is a table entry with a NULL QueryRoutine and a NULL Name field. //************ The caller specifies an initial key path and a table. The table contains one or more entries that describe the key values and subkey names in which the caller is interested. RtlQueryRegistryValues starts at the initial key and enumerates the entries in the table. For each entry specifying a value name or subkey name that exists in the registry, RtlQueryRegistryValues calls the QueryRoutine associated with each table entry. *** Each entry’s caller-supplied QueryRoutine is passed the value name, type, data, and data length. *** When building the QueryTable, be sure to allocate an entry for each value being queried, plus a NULL entry at the end. Zero the table and then initialize the entries. 哪位大侠帮忙解释一下,如果我在注册表中注册了两个值怎样读? 我的程序如下: RTL_QUERY_REGISTRY_TABLE paramTable[2]; RtlZeroMemory( paramTable, sizeof(paramTable) ); //clear zero给三个内存空间清0 paramTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT; paramTable[0].Name = L"Device0"; paramTable[0].EntryContext = &serialPort; paramTable[0].DefaultType = REG_SZ; paramTable[0].DefaultData = &serialPort; paramTable[0].DefaultLength = 0; status = RtlQueryRegistryValues( RTL_REGISTRY_ABSOLUTE, parameterPath.Buffer,//注册表的位置 ¶mTable[0], NULL, NULL ); 我安装了两个设备,注册表\Parameters下有两个值\Device0 "com1"和\Device1 "com2",如果驱动执行两个设备,还需要再初始化一个paramTable[1]吗?还是不用? 请大侠赐教! |
|
|