diff options
Diffstat (limited to 'NSCmpts/Encrypt.h')
-rw-r--r-- | NSCmpts/Encrypt.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/NSCmpts/Encrypt.h b/NSCmpts/Encrypt.h new file mode 100644 index 0000000..a7b449f --- /dev/null +++ b/NSCmpts/Encrypt.h @@ -0,0 +1,103 @@ +// Encrypt.h : Declaration of the CEncrypt + +#ifndef __ENCRYPT_H_ +#define __ENCRYPT_H_ + +#include "resource.h" // main symbols +#include <atlextra.h> + +#include "../common/cmptdata.h" +#include "ActionEngine.h" + +#include "../common/interfaces.h" +#include "EncryptActions.h" + +///////////////////////////////////////////////////////////////////////////// +// CEncrypt +class ATL_NO_VTABLE CEncrypt : + public CComObjectRootEx<CComSingleThreadModel>, + public CComCoClass<CEncrypt, &CLSID_Encrypt>, + public ISupportErrorInfo, + public IDispatchImpl<ISecureShutdownWin, &IID_ISecureShutdownWin, &LIBID_NightSecCmpts>, + public IObjectWithSiteImpl<CEncrypt>, + public ISpecifyPropertyPagesImplEx + + +{ +public: + CEncrypt() + { + m_bDisablePassword = false; + } + ~CEncrypt() + { + try + { + if(m_bDisablePassword && (m_xpyPass != NULL)) + m_xpyPass->Disable(); + } + catch(_com_error&) + { } + + ATLTRACE(_T("Destroying Backup\n")); + } + +DECLARE_REGISTRY_RESOURCEID(IDR_ENCRYPT) + +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CEncrypt) + COM_INTERFACE_ENTRY(ISecureShutdownWin) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(ISupportErrorInfo) + COM_INTERFACE_ENTRY(IObjectWithSite) + COM_INTERFACE_ENTRY(ISpecifyPropertyPages) +END_COM_MAP() + + virtual ATL_PROPMAP_ENTRY* GetPropertyMap() + { + static ATL_PROPMAP_ENTRY pNormalPropMap[] = + { + PROP_PAGE(CLSID_EncryptSourceProp) + {NULL, 0, NULL, &IID_NULL, 0, 0, 0} + }; + + static ATL_PROPMAP_ENTRY pAdvancedPropMap[] = + { + PROP_PAGE(CLSID_EncryptSourceProp) + PROP_PAGE(CLSID_EncryptAdvancedProp) + {NULL, 0, NULL, &IID_NULL, 0, 0, 0} + }; + + INightSecSiteInfoPtr pInfo = (IUnknown*)m_spUnkSite; + + if(pInfo) + { + CComVariant var; + pInfo->get_Info(nsAdvanced, &var); + + if(var.vt == VT_BOOL && var.bVal == TRUE) + return pAdvancedPropMap; + } + + return pNormalPropMap; + } + +// ISupportsErrorInfo + STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); + +// ISecureShutdownWin +public: + STDMETHOD(get_Info)(/*[in]*/ NightSecInfo nsItem, /*[out, retval]*/ VARIANT* pvVal); + STDMETHOD(DoShutdown)(/*[in]*/ long hParent, /*[in]*/ long lMode); + STDMETHOD(SetData)(/*[in]*/ IUnknown* pUnk); + +protected: + CPropertyBag m_Data; + CActionEngine m_Engine; + bool m_bDisablePassword; + + IXpyPassUIPtr m_xpyPass; +}; + +#endif //__ENCRYPT_H_ |