Skip to content

Latest commit

 

History

History
135 lines (88 loc) · 4.36 KB

nf-winreg-regunloadkeya.md

File metadata and controls

135 lines (88 loc) · 4.36 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:winreg.RegUnLoadKeyA
RegUnLoadKeyA function (winreg.h)
Unloads the specified registry key and its subkeys from the registry. (ANSI)
RegUnLoadKeyA
winreg/RegUnLoadKeyA
base\regunloadkey.htm
winprog
73b4b6a9-4acb-4247-bd7f-82024ba3e14a
12/05/2018
RegUnLoadKey, RegUnLoadKey function, RegUnLoadKeyA, RegUnLoadKeyW, _win32_regunloadkey, base.regunloadkey, winreg/RegUnLoadKey, winreg/RegUnLoadKeyA, winreg/RegUnLoadKeyW
winreg.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
RegUnLoadKeyW (Unicode) and RegUnLoadKeyA (ANSI)
Advapi32.lib
Advapi32.dll
Windows
19H1
RegUnLoadKeyA
winreg/RegUnLoadKeyA
c++
APIRef
kbSyntax
DllExport
Advapi32.dll
API-MS-Win-Core-Localregistry-l1-1-0.dll
KernelBase.dll
API-MS-Win-Core-Registry-l1-1-0.dll
API-MS-Win-DownLevel-AdvApi32-l1-1-0.dll
API-MS-Win-DownLevel-AdvApi32-l1-1-1.dll
MinKernelBase.dll
api-ms-win-core-registry-l1-1-1.dll
RegUnLoadKey
RegUnLoadKeyA
RegUnLoadKeyW

RegUnLoadKeyA function

-description

Unloads the specified registry key and its subkeys from the registry.

Applications that back up or restore system state including system files and registry hives should use the Volume Shadow Copy Service instead of the registry functions.

-parameters

-param hKey [in]

A handle to the registry key to be unloaded. This parameter can be a handle returned by a call to RegConnectRegistry function or one of the following predefined handles:

HKEY_LOCAL_MACHINE HKEY_USERS

-param lpSubKey [in, optional]

The name of the subkey to be unloaded. The key referred to by the lpSubKey parameter must have been created by using the RegLoadKey function.

Key names are not case sensitive.

For more information, see Registry Element Size Limits.

-returns

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is a nonzero error code defined in Winerror.h. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.

-remarks

This function removes a hive from the registry but does not modify the file containing the registry information. A hive is a discrete body of keys, subkeys, and values that is rooted at the top of the registry hierarchy.

The calling process must have the SE_RESTORE_NAME and SE_BACKUP_NAME privileges on the computer in which the registry resides. For more information, see Running with Special Privileges.

Note

The winreg.h header defines RegUnLoadKey as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

RegConnectRegistry

RegDeleteKey

RegLoadKey

RegRestoreKey

Registry Functions

Registry Overview