Expand Minimize

AuditSetSecurity function

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

Syntax


BOOLEAN WINAPI AuditSetSecurity(
  _In_  SECURITY_INFORMATION SecurityInformation,
  _In_  PSECURITY_DESCRIPTOR pSecurityDescriptor
);

Parameters

SecurityInformation [in]

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 [in]

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/valueDescription
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

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Ntsecapi.h

Library

Advapi32.lib

DLL

Advapi32.dll

See also

AuditQuerySecurity

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.