AuditSetSecurity function (ntsecapi.h)
The AuditSetSecurity function sets a security descriptor that delegates access to audit policy.
Syntax
BOOLEAN AuditSetSecurity(
[in] SECURITY_INFORMATION SecurityInformation,
[in] PSECURITY_DESCRIPTOR pSecurityDescriptor
);
Parameters
[in] 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.
[in] 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 |
---|---|
|
The caller does not have the privilege or access rights necessary to call this function. |
|
One or more parameters are invalid. |
Remarks
To successfully call this function, the caller must have SeSecurityPrivilege.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | ntsecapi.h |
Library | Advapi32.lib |
DLL | Advapi32.dll |