Platform SDK: Access Control |
The PrivilegedServiceAuditAlarm function generates an audit message in the security event log. A protected server can use this function to log attempts by a client to use a specified set of privileges.
Alarms are not currently supported.
BOOL PrivilegedServiceAuditAlarm( LPCTSTR SubsystemName, // subsystem name LPCTSTR ServiceName, // service name HANDLE ClientToken, // handle to access token PPRIVILEGE_SET Privileges, // privileges BOOL AccessGranted // granted access rights );
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The PrivilegedServiceAuditAlarm function does not check the client's access token to determine whether the privileges are held or enabled. Typically, you would first call the PrivilegeCheck function to determine whether the specified privileges are enabled in the access token, and then call PrivilegedServiceAuditAlarm to log the results.
The PrivilegedServiceAuditAlarm function requires the calling process to have SE_AUDIT_NAME privilege enabled. The test for this privilege is always performed against the primary token of the calling process. This allows the calling process to impersonate a client during the call.
Windows NT/2000: Requires Windows NT 3.1 or later.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Advapi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
Client/Server Access Control Overview, Client/Server Access Control Functions, ObjectPrivilegeAuditAlarm, PrivilegeCheck, PRIVILEGE_SET