网站首页  词典首页

请输入您要查询的函数:

 

术语 regopenkeytransacted
释义 RegOpenKeyTransacted
语法:
C++
LONG WINAPI RegOpenKeyTransacted(
__in HKEY hKey,
__in_opt LPCTSTR lpSubKey,
__in DWORD ulOptions,
__in REGSAM samDesired,
__out PHKEY phkResult,
__in HANDLE hTransaction,
__reserved PVOID pExtendedParameter
);
RegOpenKeyTransacted功能
打开一个交易指定的注册表键和关联。请注意,键名不区分大小写。
参数
hKey [in]
句柄到打开注册表项。这种处理是由RegCreateKeyEx的,RegCreateKeyTransacted,RegOpenKeyEx,或RegOpenKeyTransacted函数返回。它也可以是下列预定义项之一:
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
lpSubKey [中,可选]
该注册表子项的名称被打开。
键名不区分大小写。
如果此参数为NULL或为空字符串的指针,该函数将打开一个新的句柄的hKey参数确定的关键。
有关更多信息,请注册元素的大小限制。
ulOptions [in]
这个参数是保留,必须为零。
samDesired [in]
阿面具,指定所需的访问权限的关键。函数失败如果关键的安全描述符不允许为调用进程的请求的访问。有关更多信息,请参见注册表关键的安全和访问权限。
phkResult [out]
一个变量,它接收的句柄打开的关键指针。如果关键不是预定义的注册表项之一,调用RegCloseKey函数完成后,您使用的处理。
hTransaction [in]
一个句柄,积极交易。这种处理是由CreateTransaction函数返回。
pExtendedParameter
这个参数是保留,必须为NULL。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个非零错误代码Winerror.h中定义。您可以使用带有FORMAT_MESSAGE_FROM_SYSTEM标记的FormatMessage函数获得错误的一般说明。
备注
当一键打开此功能,就主要是交易随后的行动中。如果非交易操作完成的关键交易前承诺,交易回滚。在交易完成后提交或回滚,则必须重新开放使用的关键,以积极的事务处理,使交易的额外行动RegCreateKeyTransacted或RegOpenKeyTransacted功能。欲了解更多有关交易的信息,请参阅内核事务管理器。
注意,在这一关键是不会自动交易子随后的行动中。因此,RegDeleteKeyEx函数不会执行删除操作交易。相反,使用RegDeleteKeyTransacted函数来执行删除操作交易。
不像RegCreateKeyTransacted功能,RegOpenKeyTransacted函数不创建指定的键,如果不存在注册表中。
如果您的服务或应用程序模拟不同的用户,不要使用HKEY_CURRENT_USER此功能。相反,调用RegOpenCurrentUser功能。
单个注册表项可以打开只有65534倍。当尝试了65535次打开操作,此函数失败,ERROR_NO_SYSTEM_RESOURCES。
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderWinreg.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesRegOpenKeyTransactedW(Unicode)和RegOpenKeyTransactedA(ANSI)的
参见
RegCloseKey
RegCreateKeyTransacted
RegDeleteKeyTransacted
登记职能
注册表概述
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==RegOpenKeyTransacted Function
Opens the specified registry key and associates it with a transaction. Note that key names are not case sensitive.
Syntax
C++
LONG WINAPI RegOpenKeyTransacted(
__in HKEY hKey,
__in_opt LPCTSTR lpSubKey,
__in DWORD ulOptions,
__in REGSAM samDesired,
__out PHKEY phkResult,
__in HANDLE hTransaction,
__reserved PVOID pExtendedParameter
);
Parameters
hKey [in]
A handle to an open registry key. This handle is returned by the RegCreateKeyEx , RegCreateKeyTransacted , RegOpenKeyEx , or RegOpenKeyTransacted function. It can also be one of the following predefined keys :
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
lpSubKey [in, optional]
The name of the registry subkey to be opened.
Key names are not case sensitive.
If this parameter is NULL or a pointer to an empty string, the function will open a new handle to the key identified by the hKey parameter.
For more information, see Registry Element Size Limits .
ulOptions [in]
This parameter is reserved and must be zero.
samDesired [in]
A mask that specifies the desired access rights to the key. The function fails if the security descriptor of the key does not permit the requested access for the calling process. For more information, see Registry Key Security and Access Rights .
phkResult [out]
A pointer to a variable that receives a handle to the opened key. If the key is not one of the predefined registry keys, call the RegCloseKey function after you have finished using the handle.
hTransaction [in]
A handle to an active transaction. This handle is returned by the CreateTransaction function.
pExtendedParameter
This parameter is reserved and must be NULL.
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
When a key is opened using this function, subsequent operations on the key are transacted. If a non-transacted operation is performed on the key before the transaction is committed, the transaction is rolled back. After a transaction is committed or rolled back, you must re-open the key using the RegCreateKeyTransacted or RegOpenKeyTransacted function with an active transaction handle to make additional operations transacted. For more information about transactions, see Kernel Transaction Manager .
Note that subsequent operations on subkeys of this key are not automatically transacted. Therefore, the RegDeleteKeyEx function does not perform a transacted delete operation. Instead, use the RegDeleteKeyTransacted function to perform a transacted delete operation.
Unlike the RegCreateKeyTransacted function, the RegOpenKeyTransacted function does not create the specified key if the key does not exist in the registry.
If your service or application impersonates different users, do not use this function with HKEY_CURRENT_USER. Instead, call the RegOpenCurrentUser function.
A single registry key can be opened only 65,534 times. When attempting the 65,535th open operation, this function fails with ERROR_NO_SYSTEM_RESOURCES.
Requirements
Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderWinreg.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesRegOpenKeyTransactedW (Unicode) and RegOpenKeyTransactedA (ANSI)
See Also
RegCloseKey
RegCreateKeyTransacted
RegDeleteKeyTransacted
Registry Functions
Registry Overview
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa965886(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:19:16