The ObjectPrivilegeAuditAlarm 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 with an open handle to a private object. Alarms are not supported in the current version of Windows NT.
BOOL ObjectPrivilegeAuditAlarm(
LPCTSTR SubsystemName, // pointer to string for subsystem name
LPVOID HandleId, // pointer to handle identifier
HANDLE ClientToken, // handle to client's access token
DWORD DesiredAccess, // mask for desired access rights
PPRIVILEGE_SET Privileges, // pointer to privileges
BOOL AccessGranted // flag for results
);
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 ObjectPrivilegeAuditAlarm function does not check the client's access to the object or check the client's access token to determine whether the privileges are held or enabled. Typically, you would call the PrivilegeCheck function to determine whether the specified privileges are enabled in the access token, call the AccessCheck function to check the client's access to the object, and then call ObjectPrivilegeAuditAlarm to log the results.
The ObjectPrivilegeAuditAlarm 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, not the impersonation token of the thread. This allows the calling process to impersonate a client during the call.
Windows NT: Requires version 3.1 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use advapi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
Client/Server Access Control Overview, Client/Server Access Control Functions, AccessCheck, AccessCheckAndAuditAlarm, MapGenericMask, ObjectCloseAuditAlarm, ObjectOpenAuditAlarm, PrivilegeCheck, PrivilegedServiceAuditAlarm, PRIVILEGE_SET