Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.6 KiB

  1. // ImportExportConfig.h : Declaration of the CImportExportConfig
  2. #ifndef __IMPORTEXPORTCONFIG_H_
  3. #define __IMPORTEXPORTCONFIG_H_
  4. #include "resource.h" // main symbols
  5. #include "common.h"
  6. /////////////////////////////////////////////////////////////////////////////
  7. // CImportExportConfig
  8. class ATL_NO_VTABLE CImportExportConfig :
  9. public CComObjectRootEx<CComSingleThreadModel>,
  10. public CComCoClass<CImportExportConfig, &CLSID_ImportExportConfig>,
  11. public IDispatchImpl<IImportExportConfig, &IID_IImportExportConfig, &LIBID_IISUIOBJLib>
  12. {
  13. public:
  14. CImportExportConfig()
  15. {
  16. m_dwImportFlags = 0;
  17. m_dwExportFlags = MD_EXPORT_INHERITED;
  18. m_strUserPasswordEncrypted = NULL;
  19. m_cbUserPasswordEncrypted = 0;
  20. }
  21. ~CImportExportConfig()
  22. {
  23. if (m_strUserPasswordEncrypted)
  24. {
  25. if (m_cbUserPasswordEncrypted > 0)
  26. {
  27. SecureZeroMemory(m_strUserPasswordEncrypted,m_cbUserPasswordEncrypted);
  28. }
  29. LocalFree(m_strUserPasswordEncrypted);
  30. m_strUserPasswordEncrypted = NULL;
  31. m_cbUserPasswordEncrypted = 0;
  32. }
  33. }
  34. DECLARE_REGISTRY_RESOURCEID(IDR_IMPORTEXPORTCONFIG)
  35. DECLARE_PROTECT_FINAL_CONSTRUCT()
  36. BEGIN_COM_MAP(CImportExportConfig)
  37. COM_INTERFACE_ENTRY(IImportExportConfig)
  38. COM_INTERFACE_ENTRY(IDispatch)
  39. END_COM_MAP()
  40. // IImportExportConfig
  41. public:
  42. STDMETHOD(get_ExportFlags)(/*[out, retval]*/ DWORD *pVal);
  43. STDMETHOD(put_ExportFlags)(/*[in]*/ DWORD newVal);
  44. STDMETHOD(get_ImportFlags)(/*[out, retval]*/ DWORD *pVal);
  45. STDMETHOD(put_ImportFlags)(/*[in]*/ DWORD newVal);
  46. STDMETHOD(ImportConfigFromFileUI)(/*[in]*/ BSTR bstrMetabasePath,/*[in]*/ BSTR bstrKeyType);
  47. STDMETHOD(ImportConfigFromFile)(/*[in]*/ BSTR bstrFileNameAndPath,/*[in]*/ BSTR SourcePath, /*[in]*/ BSTR bstrDestinationPath, /*[in]*/ BSTR bstrPassword);
  48. STDMETHOD(ExportConfigToFileUI)(/*[in]*/ BSTR bstrMetabasePath);
  49. STDMETHOD(ExportConfigToFile)(/*[in]*/ BSTR bstrFileNameAndPath, /*[in]*/ BSTR bstrMetabasePath, /*[in]*/ BSTR bstrPassword);
  50. STDMETHOD(put_UserPassword)(/*[in]*/ BSTR newVal);
  51. STDMETHOD(get_UserName)(/*[out, retval]*/ BSTR *pVal);
  52. STDMETHOD(put_UserName)(/*[in]*/ BSTR newVal);
  53. STDMETHOD(get_MachineName)(/*[out, retval]*/ BSTR *pVal);
  54. STDMETHOD(put_MachineName)(/*[in]*/ BSTR newVal);
  55. private:
  56. CComPtr<IImportExportConfig> m_pObj;
  57. CString m_strMachineName;
  58. CString m_strUserName;
  59. LPWSTR m_strUserPasswordEncrypted;
  60. DWORD m_cbUserPasswordEncrypted;
  61. CString m_strMetabasePath;
  62. CString m_strKeyType;
  63. DWORD m_dwImportFlags;
  64. DWORD m_dwExportFlags;
  65. };
  66. #endif //__IMPORTEXPORTCONFIG_H_