Added audit functions.

svn path=/trunk/; revision=5167
This commit is contained in:
Eric Kohl 2003-07-20 00:04:06 +00:00
parent 34a2109187
commit b474c2f621
3 changed files with 147 additions and 6 deletions

View file

@ -1,4 +1,4 @@
; $Id: advapi32.edf,v 1.20 2003/06/27 15:19:18 sedwards Exp $
; $Id: advapi32.edf,v 1.21 2003/07/20 00:04:06 ekohl Exp $
;
; advapi32.edf
;
@ -270,10 +270,10 @@ MapGenericMask=MapGenericMask@8
;NTAccessMaskToProvAccessRights=NTAccessMaskToProvAccessRights@12
;NotifyBootConfigStatus=NotifyBootConfigStatus@4
;NotifyChangeEventLog=NotifyChangeEventLog@8
;ObjectCloseAuditAlarmA=ObjectCloseAuditAlarmA@12
;ObjectCloseAuditAlarmW=ObjectCloseAuditAlarmW@12
;ObjectDeleteAuditAlarmA=ObjectDeleteAuditAlarmA@12
;ObjectDeleteAuditAlarmW=ObjectDeleteAuditAlarmW@12
ObjectCloseAuditAlarmA=ObjectCloseAuditAlarmA@12
ObjectCloseAuditAlarmW=ObjectCloseAuditAlarmW@12
ObjectDeleteAuditAlarmA=ObjectDeleteAuditAlarmA@12
ObjectDeleteAuditAlarmW=ObjectDeleteAuditAlarmW@12
;ObjectOpenAuditAlarmA=ObjectOpenAuditAlarmA@48
;ObjectOpenAuditAlarmW=ObjectOpenAuditAlarmW@48
;ObjectPrivilegeAuditAlarmA=ObjectPrivilegeAuditAlarmA@24

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.27 2003/06/27 15:19:18 sedwards Exp $
# $Id: makefile,v 1.28 2003/07/20 00:04:06 ekohl Exp $
PATH_TO_TOP = ../..
@ -30,6 +30,7 @@ REGISTRY_OBJECTS=\
SECURITY_OBJECTS=\
sec/ac.o \
sec/audit.o \
sec/lsa.o \
sec/misc.o \
sec/sec.o \

View file

@ -0,0 +1,140 @@
/* $Id: audit.c,v 1.1 2003/07/20 00:03:40 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/advapi32/sec/audit.c
* PURPOSE: Audit functions
* PROGRAMMER: Eric Kohl (ekohl@rz-online.de)
* UPDATE HISTORY:
* Created 07/19/2003
*/
/* INCLUDES *****************************************************************/
#define NTOS_MODE_USER
#include <ntos.h>
#include <windows.h>
/* FUNCTIONS ****************************************************************/
/*
* @implemented
*/
BOOL STDCALL
ObjectCloseAuditAlarmA (LPCSTR SubsystemName,
LPVOID HandleId,
BOOL GenerateOnClose)
{
UNICODE_STRING Name;
NTSTATUS Status;
Status = RtlCreateUnicodeStringFromAsciiz (&Name,
(PCHAR)SubsystemName);
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError (Status));
return FALSE;
}
Status = NtCloseObjectAuditAlarm (&Name,
HandleId,
GenerateOnClose);
RtlFreeUnicodeString(&Name);
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError (Status));
return FALSE;
}
return TRUE;
}
/*
* @implemented
*/
BOOL STDCALL
ObjectCloseAuditAlarmW (LPCWSTR SubsystemName,
LPVOID HandleId,
BOOL GenerateOnClose)
{
UNICODE_STRING Name;
NTSTATUS Status;
RtlInitUnicodeString (&Name,
(PWSTR)SubsystemName);
Status = NtCloseObjectAuditAlarm (&Name,
HandleId,
GenerateOnClose);
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError (Status));
return FALSE;
}
return TRUE;
}
/*
* @implemented
*/
BOOL STDCALL
ObjectDeleteAuditAlarmA (LPCSTR SubsystemName,
LPVOID HandleId,
BOOL GenerateOnClose)
{
UNICODE_STRING Name;
NTSTATUS Status;
Status = RtlCreateUnicodeStringFromAsciiz (&Name,
(PCHAR)SubsystemName);
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError (Status));
return FALSE;
}
Status = NtDeleteObjectAuditAlarm (&Name,
HandleId,
GenerateOnClose);
RtlFreeUnicodeString(&Name);
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError (Status));
return FALSE;
}
return TRUE;
}
/*
* @implemented
*/
BOOL STDCALL
ObjectDeleteAuditAlarmW (LPCWSTR SubsystemName,
LPVOID HandleId,
BOOL GenerateOnClose)
{
UNICODE_STRING Name;
NTSTATUS Status;
RtlInitUnicodeString (&Name,
(PWSTR)SubsystemName);
Status = NtDeleteObjectAuditAlarm (&Name,
HandleId,
GenerateOnClose);
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError (Status));
return FALSE;
}
return TRUE;
}
/* EOF */