网站首页  词典首页

请输入您要查询的函数:

 

术语 regrestorekey
释义 RegRestoreKey
语法:
C++
LONG WINAPI RegRestoreKey(
__in HKEY hKey,
__in LPCTSTR lpFile,
__in DWORD dwFlags
);
RegRestoreKey功能
读取指定的文件中,并在指定的键复制它的注册表信息。此注册表信息可能会在一个关键的形式和多层次的子项。
参数
hKey [in]
句柄到打开注册表项。这种处理是由RegCreateKeyEx的或RegOpenKeyEx函数返回。它也可以是下列预定义项之一:
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
在这个关键所载的任何资料,其后代键是文件中的信息覆盖指出由lpFile参数。
lpFile [in]
此次与注册表的信息文件的名称。此文件通常是由使用的RegSaveKey功能。
dwFlags [in]
这些标志,指示如何键或键恢复。此参数可以是下列值之一。
ValueMeaning
REG_FORCE_RESTORE
0x00000008LIf指定,执行恢复操作,即使是打开的句柄存在或下注册表中的层次位置,以该hKey参数点。
REG_WHOLE_HIVE_VOLATILE
0x00000001LIf指定一个新的,不稳定的(内存使用)设置注册表的信息,或单元,是创建。如果REG_WHOLE_HIVE_VOLATILE指定,由hKey参数必须是于HKEY_USERS或HKEY_LOCAL_MACHINE值确定的关键。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个非零错误代码Winerror.h中定义。您可以使用带有FORMAT_MESSAGE_FROM_SYSTEM标记的FormatMessage函数获得错误的一般说明。
备注
有两个不同的注册表配置单元文件格式。注册表配置单元创建当前的操作系统通常不能由早先的加载系统。
如果hKey参数的任何子项是公开,RegRestoreKey失败。
调用进程必须在计算机上的注册表中,居住SE_RESTORE_NAME和SE_BACKUP_NAME特权。有关更多信息,请运行特权。
这个函数替换键和下方的键和值是附属于该顶级文件中的Level的关键,无论什么样的顶级Level,在文件名可能是关键指定键的值。例如,hKey可能确定一个子项B和C,而lpFile参数指定Y和Z的RegRestoreKey后调用文件,其中包含有子项关键X中,将包含与注册表子项关键的一个关键阿Y和Z的一种是由X的值项替换值项
在由lpFile指定的文件的新信息覆盖由hKey参数指定的关键除了项名称,内容。
如果hKey代表了远程计算机的关键,由lpFile描述的路径是相对于远程计算机。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinreg.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesRegRestoreKeyW(Unicode)和RegRestoreKeyA(ANSI)的
参见
RegDeleteKey
登记职能
注册表概述
RegLoadKey
RegReplaceKey
RegSaveKey
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==RegRestoreKey Function
Reads the registry information in a specified file and copies it over the specified key. This registry information may be in the form of a key and multiple levels of subkeys.
Syntax
C++
LONG WINAPI RegRestoreKey(
__in HKEY hKey,
__in LPCTSTR lpFile,
__in DWORD dwFlags
);
Parameters
hKey [in]
A handle to an open registry key. This handle is returned by the RegCreateKeyEx or RegOpenKeyEx function. It can also be one of the following predefined keys :
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
Any information contained in this key and its descendent keys is overwritten by the information in the file pointed to by the lpFile parameter.
lpFile [in]
The name of the file with the registry information. This file is typically created by using the RegSaveKey function.
dwFlags [in]
The flags that indicate how the key or keys are to be restored. This parameter can be one of the following values.
ValueMeaning
REG_FORCE_RESTORE
0x00000008LIf specified, the restore operation is executed even if open handles exist at or beneath the location in the registry hierarchy to which the hKey parameter points.
REG_WHOLE_HIVE_VOLATILE
0x00000001LIf specified, a new, volatile (memory only) set of registry information, or hive, is created. If REG_WHOLE_HIVE_VOLATILE is specified, the key identified by the hKey parameter must be either the HKEY_USERS or HKEY_LOCAL_MACHINE value.

Return Value
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
There are two different registry hive file formats. Registry hives created on current operating systems typically cannot be loaded by earlier ones.
If any subkeys of the hKey parameter are open, RegRestoreKey fails.
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 .
This function replaces the keys and values below the specified key with the keys and values that are subsidiary to the top-level key in the file, no matter what the name of the top-level key in the file might be. For example, hKey might identify a key A with subkeys B and C, while the lpFile parameter specifies a file containing key X with subkeys Y and Z. After a call to RegRestoreKey, the registry would contain key A with subkeys Y and Z. The value entries of A would be replaced by the value entries of X.
The new information in the file specified by lpFile overwrites the contents of the key specified by the hKey parameter, except for the key name.
If hKey represents a key in a remote computer, the path described by lpFile is relative to the remote computer.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinreg.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesRegRestoreKeyW (Unicode) and RegRestoreKeyA (ANSI)
See Also
RegDeleteKey
Registry Functions
Registry Overview
RegLoadKey
RegReplaceKey
RegSaveKey
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724915(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 13:25:50