Exportar (0) Imprimir
Expandir Tudo
EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

RegSetKeySecurity function

The RegSetKeySecurity function sets the security of an open registry key.

Syntax


LONG WINAPI RegSetKeySecurity(
  _In_  HKEY hKey,
  _In_  SECURITY_INFORMATION SecurityInformation,
  _In_  PSECURITY_DESCRIPTOR pSecurityDescriptor
);

Parameters

hKey [in]

A handle to an open key for which the security descriptor is set.

SecurityInformation [in]

A set of bit flags that indicate the type of security information to set. This parameter can be a combination of the SECURITY_INFORMATION bit flags.

pSecurityDescriptor [in]

A pointer to a SECURITY_DESCRIPTOR structure that specifies the security attributes to set for the specified key.

Return value

If the function succeeds, the function returns ERROR_SUCCESS.

If the function fails, it returns 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

If hKey is one of the predefined keys, use the RegCloseKey function to close the predefined key to ensure that the new security information is in effect the next time the predefined key is referenced.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Winreg.h (include Windows.h)

Library

Advapi32.lib

DLL

Advapi32.dll

See also

Low-level Access Control
Low-level Access Control Functions
FormatMessage
RegCloseKey
RegDeleteKey
RegGetKeySecurity
SECURITY_DESCRIPTOR
SECURITY_INFORMATION

 

 

Contribuições da comunidade

ADICIONAR
Mostrar:
© 2014 Microsoft