3.1.5.9 BaseRegDeleteValue (Opnum 8)
The BaseRegDeleteValue method is called by the client. In response, the server removes a named value from the specified registry key.
-
error_status_t BaseRegDeleteValue( [in] RPC_HKEY hKey, [in] PRRP_UNICODE_STRING lpValueName );
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.
lpValueName: A pointer to an RRP_UNICODE_STRING structure that MUST contain the name of the value (as specified in section 3.1.1) to remove. If the client sets the lpValueName parameter to NULL, the server SHOULD<18> fail this method and return ERROR_INVALID_PARAMETER.
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_SET_VALUE access rights.
0x00000057
ERROR_INVALID_PARAMETER
A parameter is incorrect.
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 delete the named value from the registry key that is specified by the hKey parameter in the client request.
If the lpValueName parameter in the client request is an empty Unicode string, server MUST delete the data in the default value (as specified in section 3.1.1.5) of the specified key.
The server MUST set to TRUE the KEYISMODIFIED property of the key indicated by hKey.
The caller MUST have KEY_SET_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] section 2.2) to indicate an error.
If the caller does not have access, the server MUST return ERROR_ACCESS_DENIED.