Click here to Skip to main content
12,241,564 members (58,161 online)
Click here to Skip to main content


14 bookmarked

Query the New Windows Audit Policies Programmatically

, 26 Feb 2010 CPOL
This sample show how to access the information retrieved by running Auditpol.
//	---------------------------------------------------------------------------------------------
//	Author:			Marc Ochsenmeier
//	Email:
//	Web:
//	Date:			25.02.2010
//	Description:	Read the Windows Audit Policy settings programmatically like "Auditpol" does.
//	---------------------------------------------------------------------------------------------
#include "stdafx.h"

CAuditPolicy::CAuditPolicy(GUID* const subcategory, ULONG auditInfo): 
	m_pGuidSubcategory(subcategory), m_uAuditInfo(auditInfo)
	m_pGuidSubcategory = NULL;
const GUID* CAuditPolicy::GetGuid() const
	return m_pGuidSubcategory;
bool CAuditPolicy::IsAuditEventSuccess()
	return (m_uAuditInfo & (ULONG)POLICY_AUDIT_EVENT_SUCCESS)?true:false;
bool CAuditPolicy::IsAuditEventFailure()
	return (m_uAuditInfo & (ULONG)POLICY_AUDIT_EVENT_FAILURE)?true:false;
bool CAuditPolicy::IsAuditEventNone()

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

marc ochsenmeier
Software Developer (Senior) winitor
Germany Germany
Marc Ochsenmeier is the author of PEStudio ( and works as developer with the focus on Windows Hardening.

PEStudio is on twitter at:

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160426.1 | Last Updated 26 Feb 2010
Article Copyright 2010 by marc ochsenmeier
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid