网站首页  词典首页

请输入您要查询的函数:

 

术语 regsavekeyex
释义 RegSaveKeyEx
语法:
C++
LONG WINAPI RegSaveKeyEx(
__in HKEY hKey,
__in LPCTSTR lpFile,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD Flags
);
RegSaveKeyEx功能
保存指定键和其子项和值都到注册表文件,在指定的格式。
参数
hKey [in]
句柄到打开注册表项。这种处理必须指定一个注册表配置单元。
此函数不支持在HKEY_CLASSES_ROOT预定义项。
lpFile [in]
该文件中指定键和子项予以保留的名称。如果该文件已经存在,函数失败。
新的文件具有存档属性。
如果字符串不包括路径,该文件是为本地的关键,还是在%systemroot%\\ system32为远程关键目录中调用进程的当前目录。
lpSecurityAttributes [中,可选]
一个 SECURITY_ATTRIBUTES结构,指定新文件的安全描述符指针。如果lpSecurityAttributes为NULL,则文件被默认的安全描述。在一个文件的默认安全描述符的ACL都继承自它的父目录。
标志 [in]
该格式保存的密钥或单元。此参数可以是下列值之一。
ValueMeaning
REG_STANDARD_FORMAT
1The键或单元的标准格式保存。标准格式是唯一的格式支持Windows 2000。
REG_LATEST_FORMAT
2The键或配置单元保存在最新的格式。最新的格式支持与Windows XP开始。后键或单元在这种格式保存的,它不能被加载了此前的制度。
REG_NO_COMPRESSION
4The键或单元与无压缩保存。此选项可容纳更快的数据保存。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个非零错误代码Winerror.h中定义。您可以使用带有FORMAT_MESSAGE_FROM_SYSTEM标记的FormatMessage函数获得错误的一般说明。
如果以上列举了上述标志参数的可能值之一,是在一个指定的调用这个函数,例如,如果两个或多个值或运算,这个函数返回ERROR_INVALID_PARAMETER。
备注
与RegSaveKey,这个函数不支持在HKEY_CLASSES_ROOT预定义项。
如果hKey代表远程计算机上的关键,由lpFile描述的路径是相对于远程计算机。
该RegSaveKeyEx功能只保存非易失性的关键。它不保存动荡的关键。关键是由不稳定,或在其创建的非易失性,见RegCreateKeyEx的。
您可以使用RegSaveKeyEx创造的RegLoadKey,RegReplaceKey,或RegRestoreKey函数后续调用文件。如果RegSaveKeyEx未能通过其运作中途,该文件将被腐败的后续调用的文件RegLoadKey,RegReplaceKey,或RegRestoreKey将失败。
RegSaveKeyEx是经常与RegRestoreKey一起复制在注册表子树。这种方法的一个替代方法是使用SHCopyKey功能。
调用进程必须具有SE_BACKUP_NAME特权启用。有关更多信息,请运行特权。
要求:
最低支持client-Windows XP
最低支持serverWindows服务器2003
HeaderWinreg.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesRegSaveKeyExW(Unicode)和RegSaveKeyExA(ANSI)的
参见
RegCreateKeyEx的
RegDeleteKey
注册表文件
登记职能
RegLoadKey
RegReplaceKey
RegRestoreKey
RegSaveKey
SECURITY_ATTRIBUTES
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==RegSaveKeyEx Function
Saves the specified key and all of its subkeys and values to a registry file, in the specified format.
Syntax
C++
LONG WINAPI RegSaveKeyEx(
__in HKEY hKey,
__in LPCTSTR lpFile,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD Flags
);
Parameters
hKey [in]
A handle to an open registry key. This handle must specify a registry hive .
This function does not support the HKEY_CLASSES_ROOT predefined key.
lpFile [in]
The name of the file in which the specified key and subkeys are to be saved. If the file already exists, the function fails.
The new file has the archive attribute.
If the string does not include a path, the file is created in the current directory of the calling process for a local key, or in the %systemroot%\\system32 directory for a remote key.
lpSecurityAttributes [in, optional]
A pointer to a SECURITY_ATTRIBUTES structure that specifies a security descriptor for the new file. If lpSecurityAttributes is NULL, the file gets a default security descriptor. The ACLs in a default security descriptor for a file are inherited from its parent directory.
Flags [in]
The format of the saved key or hive. This parameter can be one of the following values.
ValueMeaning
REG_STANDARD_FORMAT
1The key or hive is saved in standard format. The standard format is the only format supported by Windows 2000.
REG_LATEST_FORMAT
2The key or hive is saved in the latest format. The latest format is supported starting with Windows XP. After the key or hive is saved in this format, it cannot be loaded on an earlier system.
REG_NO_COMPRESSION
4The key or hive is saved with no compression. This option accommodates faster save operations.

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.
If more than one of the possible values listed above for the Flags parameter is specified in one call to this function—for example, if two or more values are OR'ed—this function returns ERROR_INVALID_PARAMETER.
Remarks
Unlike RegSaveKey , this function does not support the HKEY_CLASSES_ROOT predefined key.
If hKey represents a key on a remote computer, the path described by lpFile is relative to the remote computer.
The RegSaveKeyEx function saves only nonvolatile keys. It does not save volatile keys. A key is made volatile or nonvolatile at its creation; see RegCreateKeyEx.
You can use the file created by RegSaveKeyEx in subsequent calls to the RegLoadKey , RegReplaceKey , or RegRestoreKey function. If RegSaveKeyEx fails partway through its operation, the file will be corrupt and subsequent calls to RegLoadKey, RegReplaceKey, or RegRestoreKey for the file will fail.
RegSaveKeyEx is often used in conjunction with RegRestoreKey to copy subtrees in the registry. An alternative to this approach is to use the SHCopyKey function.
The calling process must have the SE_BACKUP_NAME privilege enabled. For more information, see Running with Special Privileges .
Requirements
Minimum supported clientWindows XP
Minimum supported serverWindows Server 2003
HeaderWinreg.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesRegSaveKeyExW (Unicode) and RegSaveKeyExA (ANSI)
See Also
RegCreateKeyEx
RegDeleteKey
Registry Files
Registry Functions
RegLoadKey
RegReplaceKey
RegRestoreKey
RegSaveKey
SECURITY_ATTRIBUTES
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724919(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:23:36