This function retrieves the type and data for a specified value associated with an open registry key.
This function returns the type and data of the specified value.
A Remote Application Interface (rapi) version of this function exists called ceregqueryvalueex (rapi ).
The version of a remote application interface of this function is ceregqueryvalueex (rapi ).
Long regqueryvalueex (
Hkey,
Lpcwstr lpvaluename,
Lpdword lpreserved,
Lpdword lptype,
Lpbyte lpdata,
Lpdword lpcbdata
);
Hkey
[In] handle to a currently open key or any of the following predefined reserved handle
Enter the handle that currently opens the key value or any of the following predefined reserved handles
Values:
HKEY_LOCAL_MACHINE
Hkey_classes_root
HKEY_CURRENT_USER
HKEY_USERS
Lpvaluename
[In] pointer to a string containing the name of the value to query. if this parameter is set to null or an empty string, the function retrieves the type and data for the key's unnamed value. A registry key does not automatically have an unnamed or default value. unnamed values can be of any type.
Enter a string that points to the name of the value to be queried. If this parameter is set to null or a null string, the function returns the type or data without a named key value. A registered key value cannot automatically obtain an untitled or default value. The Untitled value can be of any type.
Lpreserved
[In] reserved. Set to null.
Input retention settings null
Lptype
[Out] pointer to a variable that sums es the type of data associated with the specified value. The following table shows possible values.
The output points to a variable that receives the type and data of the specified value. The following table shows possible values.
Value description
Value description
REG_BINARY specifies binary data in any form.
REG_BINARY specifies binary data in any format
REG_DWORD specifies a 32-bit number.
REG_DWORD specifies a 32bit data
Reg_dword_big_endian specifies a 32-bit number in big-Endian format.
Reg_dword_big_endian specifies a 32bit data, which is arranged according to the big-end format.
In big-Endian format, a multibyte value is stored in memory from the highest byte to the lowest byte. for example, the value 0x12345678 is stored as (0x12 0x34 0x56 0x78) in big-Endian format.
In the large-end format, a multi-byte value is stored in the memory in the order of high bytes to low bytes. For example, the 0x12345678 value is arranged as follows: 0x12 0x34 0x56 0x78
Reg_dword_little_endian specifies a 32-bit number in little-Endian format. This is equivalent to REG_DWORD.
Reg_dword_little_endian specifies that a 32bit data is arranged in the small-end format. This is equivalent to REG_DWORD.
In little-Endian format, a multibyte value is stored in memory from the lowest byte to the highest byte. for example, the value 0x12345678 is stored as (0x78 0x56 0x34 0x12) in little-Endian format.
In the small-end mode, a multi-byte is stored in the memory in ascending mode. For example, the value 0x78 0x56 0x34 0x12 is stored in the small-end mode.
REG_EXPAND_SZ specifies a null-terminated string that contains unexpanded references to environment variables. For example, % PATH %.
REG_EXPAND_SZ specifies a zero-value terminal string (a null-terminated string) that contains a non-extended reference (unexpanded references) for an environment variable, such as: % PATH %.
Reg_link specifies a unicode symbolic link. used internally. applications do not use this type.
Reg_link specifies a unicode Symbolic Link (symbolic link ). Internal use. This type is not used by applications.
Reg_multi_sz specifies an array of null-terminated strings, terminated by two null characters.
Reg_multi_sz specifies a zero-value terminal string (null-terminated strings) in the array, ending with two zero-value characters (terminated by two null characters ).
Reg_none no defined value type.
Reg_none is not defined as a value type.
Reg_resource_list specifies a device-driver resource list.
Reg_resource_list specifies a list of device driver resources.
REG_SZ specifies a null-terminated Unicode string.
REG_SZ specifies a zero-value terminal Unicode string (a null-terminated Unicode string ).
This parameter can be set to null if the type is not required.
This parameter can be set to null if the type is not required.
Lpdata
[Out] pointer to a buffer that contains Es value data. This parameter can be set to null if the data is not required.
The buffer that points to the value of the received data. This parameter can be set to null if data is not required.
Lpcbdata
[In, out] pointer to a variable that specifies the size, in bytes, of the buffer pointed to by the lpdata parameter. when the function returns, this variable contains the size of the Data copied to lpdata.
Input and Output point to a variable, which specifies the size of the lpdata parameter pointing to the cache, expressed in bytes. When the function returns, this variable contains the size of the Data copied to lpdata.
If the data has the REG_SZ, reg_multi_sz or the reg_expand_sz type, this function checks for a terminating null character. if one is not found, the string is stored with a null Terminator. this parameter also parameters des the size of the terminating null character.
If the data has the REG_SZ, reg_multi_sz or the reg_expand_sz type, this function verifies whether the terminal has a character (a terminating null character ). If no character is found, the string is stored in a null Terminator. This parameter also includes the terminal null character size.
This parameter can be set to null only if lpdata is set to null.
This parameter can be set to null if lpdata is also set to null.
If the buffer specified by lpdata is not large enough to hold the data, including a null Terminator for string data, the function returns error_more_data and stores the required buffer size, in bytes, to the variable pointed to by this parameter.
If the cache specified by lpdata is not large enough to load data, it includes a null terminator (a null Terminator) for loading string data ). The function returns error_more_data and stores the required cache size, in bytes, according to the variable pointed to by this parameter.
If lpdata is set to null, and this parameter is non-null, the function returns error_success and stores the size of the data, in bytes, in the variable pointed to by this parameter. this enables an application to determine the best way to allocate a buffer for value data.
If lpdata is set to null and this parameter is non-null, the function returns error_success and stores the data size, in bytes, in the variable to which this parameter points. This allows an application to decide the best way to allocate a cache to value data.
Return Value
Return Value
Error_success indicates success. A nonzero error code defined in winerror. h indicates failure. to get a generic description of the error, call the formatmessage function with the format_message_from_system flag set. the message resource is optional, so formatmessage might fail.
Error_success indicates success. A non-zero error code is defined in winerror. h to indicate an error. To obtain the general description of the error, call the formatting information function that sets the format_message_from_system flag Flag. Information resources can be selected, so formatting information may fail.
Requirements
Requirements
Header winreg. h
Library coredll. Lib
Windows Embedded ce Windows CE 1.0 and later