#include <windows.h>
#include "caccesscontrol.h"


extern HWND hMainWnd ;
extern int LockCount, ObjectCount ;

CAccessControl::CAccessControl (void)
{
    m_RefCount = 1 ;
	AddRef( ) ;   
    return;
}


CAccessControl::~CAccessControl(void)
{
    return;
}



STDMETHODIMP CAccessControl::QueryInterface(REFIID riid, LPVOID *ppv)
{
    if (IsEqualIID(riid, IID_IUnknown)
        || IsEqualIID(riid, IID_IAccessControl))
	{
        *ppv = (LPVOID)this;
		AddRef( ) ;
		return NOERROR;
	}
	else
	{
    	*ppv = NULL ;
    	return  E_NOINTERFACE ;
	}
        
}


STDMETHODIMP_(ULONG) CAccessControl::AddRef(void)
{
    return ++m_RefCount;
}


STDMETHODIMP_(ULONG) CAccessControl::Release(void)
{
	m_RefCount -- ;

    if (m_RefCount == 0)
	{
        delete this;
		return 0 ;
	}

    return m_RefCount ;
}





