AuditSetSecurity function

The AuditSetSecurity function sets a security descriptor that delegates access to audit policy.

Syntax

BOOLEAN AuditSetSecurity(
  SECURITY_INFORMATION SecurityInformation,
  PSECURITY_DESCRIPTOR pSecurityDescriptor
);

Parameters

SecurityInformation

A SECURITY_INFORMATION value that specifies which parts of the security descriptor this function sets. Only SACL_SECURITY_INFORMATION and DACL_SECURITY_INFORMATION are supported. Any other values are ignored. If neither SACL_SECURITY_INFORMATION nor DACL_SECURITY_INFORMATION is specified, this function fails and returns ERROR_INVALID_PARAMETER.

pSecurityDescriptor

A pointer to a well-formed SECURITY_DESCRIPTOR structure that controls access to the Audit security object. If this parameter is NULL, the function fails and returns ERROR_INVALID_PARAMETER.

Return Value

If the function succeeds, it returns TRUE.

If the function fails, it returns FALSE. To get extended error information, call GetLastError. GetLastError may return one of the following error codes defined in WinError.h.

Return code/value Description
ERROR_ACCESS_DENIED
5
The caller does not have the privilege or access rights necessary to call this function.
ERROR_INVALID_PARAMETER
87
One or more parameters are invalid.

Remarks

To successfully call this function, the caller must have SeSecurityPrivilege.

Requirements

   
Windows version Windows Vista [desktop apps only] Windows Server 2008 [desktop apps only]
Target Platform Windows
Header ntsecapi.h
Library Advapi32.lib
DLL Advapi32.dll

See Also

AuditQuerySecurity