Partager via


3.1.5.30 BaseRegQueryMultipleValues2 (Opnum 34)

The BaseRegQueryMultipleValues2 method is called by the client. In response, the server returns the type and data for a client-specified list of value names that are associated with the specified registry key.

 error_status_t BaseRegQueryMultipleValues2(
   [in] RPC_HKEY hKey,
   [in, size_is(num_vals), length_is(num_vals)] 
     PRVALENT val_listIn,
   [out, size_is(num_vals), length_is(num_vals)] 
     PRVALENT val_listOut,
   [in] DWORD num_vals,
   [in, out, unique, size_is(*ldwTotsize), length_is(*ldwTotsize)] 
     char* lpvalueBuf,
   [in] LPDWORD ldwTotsize,
   [out] LPDWORD ldwRequiredSize
 );

hKey: A handle to a key that MUST have been opened previously by using one of the open methods that are specified in section 3.1.5: OpenClassesRoot, OpenCurrentUser, OpenLocalMachine, OpenPerformanceData, OpenUsers, BaseRegCreateKey, BaseRegOpenKey, OpenCurrentConfig, OpenPerformanceText, OpenPerformanceNlsText. The server SHOULD NOT process requests on predefined keys.

val_listIn: A pointer to an array of RVALENT structures, one for each value to query. The array holds the list of value names for which the type and data MUST be returned.

val_listOut: A pointer to an array of RVALENT structures, one for each value to be queried. This parameter is a placeholder to return the type, size, and data offset for each requested value.

num_vals: The size as the number of RVALENT structures of the val_list array.

lpvalueBuf: The data for each value that is specified by the val_listOut parameter.

ldwTotsize: A value that indicates the size in bytes of lpvalueBuf.

ldwRequiredSize: If lpvalueBuf is not large enough to contain all the data, this parameter MUST return the size in bytes that is needed for lpvalueBuf to contain all the required data.

Return Values: The method returns 0 (ERROR_SUCCESS) to indicate success; otherwise, it returns a nonzero error code, as specified in [MS-ERREF] section 2.2. The most common error codes are listed in the following table.

Return value/code

Description

0x00000005

ERROR_ACCESS_DENIED

The caller does not have KEY_QUERY_VALUE access rights.

0x00000057

ERROR_INVALID_PARAMETER

A parameter is incorrect.

0x00000078

ERROR_CALL_NOT_IMPLEMENTED

This function is not supported on this system.

0x000000EA

ERROR_MORE_DATA

More data is available.

0x00000013

ERROR_WRITE_PROTECT

A read or write operation was attempted to a volume after it was dismounted. The server can no longer service registry requests because server shutdown has been initiated.

Server Operations

If the registry server can no longer service registry requests because server shutdown has been initiated (SHUTDOWNINPROGRESS is set to TRUE), the server MUST return ERROR_WRITE_PROTECT.

In response to this request from the client, for a successful operation, the server MUST return the data that is associated with the values that are specified in the RVALENT parameter val_listIn of the client request for the key that is specified by hKey.

The server MUST return the data that is associated with the specified values in the buffer pointed to by the lpvalueBuf parameter of the response. For each of the requested values supplied in the val_listIn parameter, the server MUST include, in a corresponding structure in the val_listOut parameter, the size, type, and pointer to the lpvalueBuf offset of the data that is associated with that value in the ve_valuelen, ve_type, and ve_valueptr parameters of the RVALENT structure, respectively.

If the size of the buffer that is pointed to by lpvalueBuf is not large enough, the server MUST return ERROR_MORE_DATA, and then return the buffer size that is required in the ldwRequiredSize parameter of the response.

The caller MUST have KEY_QUERY_VALUE access rights to invoke this method. For more information, see section 2.2.4.

The server MUST return 0 to indicate success or an appropriate error code (as specified in [MS-ERREF]) to indicate an error.

If the caller does not have access, the server MUST return ERROR_ACCESS_DENIED.

If any one of the parameters ldwTotsize, ldwRequiredSize, and val_listOut is NULL, the server MUST return ERROR_INVALID_PARAMETER.

If the parameter num_vals has a value greater than zero, and if parameter val_listIn is NULL, the server MUST return ERROR_INVALID_PARAMETER.

For each of the RVALENT structures returned by calling the val_listIn parameter: if the return value is greater than zero and the buffer is NULL, the server MUST return ERROR_INVALID_PARAMETER.