Source code of Windows XP (NT5)
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.

73 lines
2.8 KiB

  1. //---------------------------------------------------------------------------
  2. // DisableTarget.h
  3. //
  4. // Comment: This is a COM object extension for the MCS DCTAccountReplicator.
  5. // This object implements the IExtendAccountMigration interface. In
  6. // the process method this object disables the Source and the Target
  7. // accounts depending on the settings in the VarSet.
  8. //
  9. // (c) Copyright 1995-1998, Mission Critical Software, Inc., All Rights Reserved
  10. //
  11. // Proprietary and confidential to Mission Critical Software, Inc.
  12. //---------------------------------------------------------------------------
  13. #ifndef __DISABLETARGET_H_
  14. #define __DISABLETARGET_H_
  15. #include "resource.h" // main symbols
  16. #include <comdef.h>
  17. #include "ResStr.h"
  18. #include "ExtSeq.h"
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CDisableTarget
  21. class ATL_NO_VTABLE CDisableTarget :
  22. public CComObjectRootEx<CComMultiThreadModel>,
  23. public CComCoClass<CDisableTarget, &CLSID_DisableTarget>,
  24. public IDispatchImpl<IExtendAccountMigration, &IID_IExtendAccountMigration, &LIBID_DISABLETARGETACCOUNTLib>
  25. {
  26. public:
  27. CDisableTarget()
  28. {
  29. m_sName = L"Disable Accounts";
  30. m_sDesc = L"Extensions to Disable accounts.";
  31. m_Sequence = AREXT_DEFAULT_SEQUENCE_NUMBER;
  32. }
  33. //DECLARE_REGISTRY_RESOURCEID(IDR_DISABLETARGET)
  34. static HRESULT WINAPI UpdateRegistry( BOOL bUpdateRegistry )
  35. {
  36. _ATL_REGMAP_ENTRY regMap[] =
  37. {
  38. { OLESTR("DISPIDVER"), GET_BSTR(IDS_COM_DisPidVer) },
  39. { OLESTR("DISACCT"), GET_BSTR(IDS_COM_DisTarget) },
  40. { OLESTR("DISPID"), GET_BSTR(IDS_COM_DisPid) },
  41. { 0, 0 }
  42. };
  43. return _Module.UpdateRegistryFromResourceD( IDR_DISABLETARGET, bUpdateRegistry, regMap );
  44. }
  45. DECLARE_PROTECT_FINAL_CONSTRUCT()
  46. BEGIN_COM_MAP(CDisableTarget)
  47. COM_INTERFACE_ENTRY(IExtendAccountMigration)
  48. COM_INTERFACE_ENTRY(IDispatch)
  49. END_COM_MAP()
  50. // IExtendAccountMigration
  51. public:
  52. STDMETHOD(ProcessUndo)(/*[in]*/ IUnknown * pSource, /*[in]*/ IUnknown * pTarget, /*[in]*/ IUnknown * pMainSettings, /*[in, out]*/ IUnknown ** pPropToSet);
  53. STDMETHOD(PreProcessObject)(/*[in]*/ IUnknown * pSource, /*[in]*/ IUnknown * pTarget, /*[in]*/ IUnknown * pMainSettings, /*[in,out]*/ IUnknown ** ppPropsToSet);
  54. STDMETHOD(ProcessObject)(/*[in]*/ IUnknown * pSource, /*[in]*/ IUnknown * pTarget, /*[in]*/ IUnknown * pMainSettings, /*[in,out]*/ IUnknown ** ppPropsToSet);
  55. STDMETHOD(get_sDesc)(/*[out, retval]*/ BSTR *pVal);
  56. STDMETHOD(put_sDesc)(/*[in]*/ BSTR newVal);
  57. STDMETHOD(get_sName)(/*[out, retval]*/ BSTR *pVal);
  58. STDMETHOD(put_sName)(/*[in]*/ BSTR newVal);
  59. STDMETHOD(get_SequenceNumber)(/*[out, retval]*/ LONG * value) { (*value) = m_Sequence; return S_OK; }
  60. private:
  61. _bstr_t m_sDesc;
  62. _bstr_t m_sName;
  63. long m_Sequence;
  64. };
  65. #endif //__DISABLETARGET_H_