网站首页  词典首页

请输入您要查询的函数:

 

术语 regenumvalue
释义 RegEnumValue
语法:
C++
LONG WINAPI RegEnumValue(
__in HKEY hKey,
__in DWORD dwIndex,
__out LPTSTR lpValueName,
__inout LPDWORD lpcchValueName,
__reserved LPDWORD lpReserved,
__out_opt LPDWORD lpType,
__out_opt LPBYTE lpData,
__inout_opt LPDWORD lpcbData
);
RegEnumValue函数
指定打开注册表关键字枚举的值。函数复制一个索引值的名称和数据块的关键每次调用的时候。
参数
hKey [in]
句柄到打开注册表项。密钥必须与已开放的KEY_QUERY_VALUE访问权限。有关更多信息,请参见注册表关键的安全和访问权限。
这种处理是由RegCreateKeyEx的,RegCreateKeyTransacted,RegOpenKeyEx,或RegOpenKeyTransacted函数返回。它也可以是下列预定义项之一:
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_PERFORMANCE_DATA
HKEY_USERS
dwIndex [in]
值的索引检索。这个参数应该是零一次调用RegEnumValue函数,然后用于后续调用递增。
由于值不下令,任何新的价值将有任意索引。这意味着,该函数可能会返回任何顺序值。
lpValueName [out]
阿一个缓冲区,它接收作为一个空值的名称结尾的字符串指针。这个缓冲区必须足够大,包括终止空字符。
有关更多信息,请注册元素的大小限制。
lpcchValueName [ in , out ]
一个变量,它指定的缓冲区大小的指针指向的lpValueName参数,以字符。当函数返回时,变量接收到存储在缓冲区中的字符数不包括终止空字符。
lpReserved
这个参数是保留,必须为NULL。
lpType [指出,可选]
一项阿变量收到代码,以显示在指定的值存储的数据类型的指针。对于可能的类型代码清单,请参阅注册表值类型。该lpType参数可以是NULL类型代码是不需要的。
lpData [指出,可选]
阿一个缓冲区,它接收的值项数据的指针。 This parameter can be NULL if the data is not required.
如果lpData为NULL和lpcbData是非空的变量,函数存储数据的大小,以字节,指向lpcbData。这使得一个应用程序,以确定最佳方式分配一个数据缓冲区。
lpcbData [中,指出,可选]
一个变量,它指定的缓冲区大小的指针指向的lpData参数,以字节为单位。当函数返回时,变量reeives的存储在缓冲区中的字节数。
此参数可以为NULL只有lpData为NULL。
如果数据是REG_SZ,均为REG_MULTI_SZ或REG_EXPAND_SZ类型,这样的规模包括任何终止空字符或字符。有关更多信息,请参见备注。
如果lpData指定的缓冲区不够大,无法容纳数据,该函数返回ERROR_MORE_DATA并存储在变量所需的缓冲区大小指向lpcbData。在这种情况下,lpData的内容是不确定的。
注册表值名称被限制为32767字节。这个函数的ANSI版本视为一个USHORT珍惜这个帕拉姆。因此,如果您指定一个值大于32767个字节,有一个溢出的该函数可能会返回ERROR_MORE_DATA。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个系统错误代码。如果没有提供更多的价值,该函数返回ERROR_NO_MORE_ITEMS。
如果lpData缓冲区太小,无法接受值,该函数返回ERROR_MORE_DATA。
备注
枚举值,应用程序应该首先调用设置为零的dwIndex参数RegEnumValue功能。然后应用程序增加dwIndex并调用RegEnumValue函数,直到没有更多的价值(直到函数返回ERROR_NO_MORE_ITEMS)。
该应用程序还可以设置,直到与索引0值dwIndex到在第一次调用该函数和自减指数最后价值指数枚举。要检索的最后价值指数,使用RegQueryInfoKey功能。
当使用RegEnumValue,应用程序不应调用任何注册表函数,可能会改变,关键是质疑。
如果数据是REG_SZ,均为REG_MULTI_SZ或REG_EXPAND_SZ类型,字符串可能不会被存储在正确的空终止字符。因此,即使该函数返回ERROR_SUCCESS,应用程序应确保正确的字符串使用前终止,否则,就可能会覆盖缓冲区。 (请注意,均为REG_MULTI_SZ字符串应该有两空终止字符。)
要确定的名称和数据缓冲区的最大尺寸,使用RegQueryInfoKey功能。
实例
有关示例,请参见枚举注册表子项。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinreg.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesRegEnumValueW(Unicode)和RegEnumValueA(ANSI)的
参见
RegCreateKeyEx的
RegEnumKeyEx
登记职能
注册表概述
RegOpenKeyEx
RegQueryInfoKey
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==RegEnumValue Function
Enumerates the values for the specified open registry key. The function copies one indexed value name and data block for the key each time it is called.
Syntax
C++
LONG WINAPI RegEnumValue(
__in HKEY hKey,
__in DWORD dwIndex,
__out LPTSTR lpValueName,
__inout LPDWORD lpcchValueName,
__reserved LPDWORD lpReserved,
__out_opt LPDWORD lpType,
__out_opt LPBYTE lpData,
__inout_opt LPDWORD lpcbData
);
Parameters
hKey [in]
A handle to an open registry key. The key must have been opened with the KEY_QUERY_VALUE access right. For more information, see Registry Key Security and Access Rights .
This handle is returned by the RegCreateKeyEx , RegCreateKeyTransacted , RegOpenKeyEx , or RegOpenKeyTransacted function. It can also be one of the following predefined keys :
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_PERFORMANCE_DATA
HKEY_USERS
dwIndex [in]
The index of the value to be retrieved. This parameter should be zero for the first call to the RegEnumValue function and then be incremented for subsequent calls.
Because values are not ordered, any new value will have an arbitrary index. This means that the function may return values in any order.
lpValueName [out]
A pointer to a buffer that receives the name of the value as a null-terminated string. This buffer must be large enough to include the terminating null character.
For more information, see Registry Element Size Limits .
lpcchValueName [in, out]
A pointer to a variable that specifies the size of the buffer pointed to by the lpValueName parameter, in characters. When the function returns, the variable receives the number of characters stored in the buffer, not including the terminating null character.
lpReserved
This parameter is reserved and must be NULL.
lpType [out, optional]
A pointer to a variable that receives a code indicating the type of data stored in the specified value. For a list of the possible type codes, see Registry Value Types . The lpType parameter can be NULL if the type code is not required.
lpData [out, optional]
A pointer to a buffer that receives the data for the value entry. This parameter can be NULL if the data is not required.
If lpData is NULL and lpcbData is non-NULL, the function stores the size of the data, in bytes, in the variable pointed to by lpcbData. This enables an application to determine the best way to allocate a buffer for the data.
lpcbData [in, out, optional]
A pointer to a variable that specifies the size of the buffer pointed to by the lpData parameter, in bytes. When the function returns, the variable reeives the number of bytes stored in the buffer.
This parameter can be NULL only if lpData is NULL.
If the data has the REG_SZ, REG_MULTI_SZ or REG_EXPAND_SZ type, this size includes any terminating null character or characters. For more information, see Remarks.
If the buffer specified by lpData is not large enough to hold the data, the function returns ERROR_MORE_DATA and stores the required buffer size in the variable pointed to by lpcbData. In this case, the contents of lpData are undefined.
Registry value names are limited to 32767 bytes. The ANSI version of this function treats this param as a USHORT value. Therefore, if you specify a value greater than 32767 bytes, there is an overflow and the function may return ERROR_MORE_DATA.
Return Value
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is a system error code . If there are no more values available, the function returns ERROR_NO_MORE_ITEMS.
If the lpData buffer is too small to receive the value, the function returns ERROR_MORE_DATA.
Remarks
To enumerate values, an application should initially call the RegEnumValue function with the dwIndex parameter set to zero. The application should then increment dwIndex and call the RegEnumValue function until there are no more values (until the function returns ERROR_NO_MORE_ITEMS).
The application can also set dwIndex to the index of the last value on the first call to the function and decrement the index until the value with index 0 is enumerated. To retrieve the index of the last value, use the RegQueryInfoKey function.
While using RegEnumValue, an application should not call any registry functions that might change the key being queried.
If the data has the REG_SZ, REG_MULTI_SZ or REG_EXPAND_SZ type, the string may not have been stored with the proper null-terminating characters. Therefore, even if the function returns ERROR_SUCCESS, the application should ensure that the string is properly terminated before using it; otherwise, it may overwrite a buffer. (Note that REG_MULTI_SZ strings should have two null-terminating characters.)
To determine the maximum size of the name and data buffers, use the RegQueryInfoKey function.
Examples
For an example, see Enumerating Registry Subkeys .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinreg.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesRegEnumValueW (Unicode) and RegEnumValueA (ANSI)
See Also
RegCreateKeyEx
RegEnumKeyEx
Registry Functions
Registry Overview
RegOpenKeyEx
RegQueryInfoKey
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724865(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:25:51