/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Microsoft Windows Copyright (C) Microsoft Corporation, 1995 - 1999. File: OIDs.h Content: Declaration of COIDs. History: 06-15-2001 dsie created ------------------------------------------------------------------------------*/ #ifndef __OIDs_H_ #define __OIDs_H_ #include "Resource.h" #include "Lock.h" #include "Debug.h" #include "CopyItem.h" #include "OID.h" // // typdefs to make life easier. // typedef std::map > OIDMap; typedef CComEnumOnSTL, OIDMap> OIDEnum; typedef ICollectionOnSTLImpl, OIDEnum> IOIDsCollection; //////////////////////////////////////////////////////////////////////////////// // // Exported functions. // /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Function : CreateOIDsObject Synopsis : Create and initialize an IOIDs collection object. Parameter: PCERT_ENHKEY_USAGE pUsages - Pointer to CERT_ENHKEY_USAGE used to initialize the OIDs collection. BOOL bCertPolicies - TRUE for certificate policies, else application policies is assumed. IOIDs ** ppIOIDs - Pointer to pointer to IOIDs to receive the interface pointer. Remark : ------------------------------------------------------------------------------*/ HRESULT CreateOIDsObject (PCERT_ENHKEY_USAGE pUsages, BOOL bCertPolicies, IOIDs ** ppIOIDs); //////////////////////////////////////////////////////////////////////////////// // // COIDs // class ATL_NO_VTABLE COIDs : public CComObjectRootEx, public CComCoClass, public ICAPICOMError, public IDispatchImpl { public: COIDs() { } DECLARE_NO_REGISTRY() DECLARE_PROTECT_FINAL_CONSTRUCT() BEGIN_COM_MAP(COIDs) COM_INTERFACE_ENTRY(IOIDs) COM_INTERFACE_ENTRY(IDispatch) COM_INTERFACE_ENTRY(ISupportErrorInfo) END_COM_MAP() BEGIN_CATEGORY_MAP(COIDs) END_CATEGORY_MAP() HRESULT FinalConstruct() { HRESULT hr; if (FAILED(hr = m_Lock.Initialized())) { DebugTrace("Error [%#x]: Critical section could not be created for OIDs object.\n", hr); return hr; } return S_OK; } // // IOIDs // public: // // These are the only ones that we need to implemented, others will be // handled by ATL ICollectionOnSTLImpl. // STDMETHOD(get_Item) (VARIANT Index, VARIANT * pVal); STDMETHOD(Add) (/*[in]*/ IOID * pVal); STDMETHOD(Remove) (/*[in]*/ VARIANT Index); STDMETHOD(Clear) (void); // // C++ member function needed to initialize the object. // STDMETHOD(Init) (PCERT_ENHKEY_USAGE pUsages, BOOL bCertPolicies); private: CLock m_Lock; }; #endif //__OIDS_H_