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.

71 lines
2.2 KiB

  1. /*---------------------------------------------------------------------------
  2. File: ComputerPwdAge.h
  3. Comments: Definition of COM object to retrieve password age for computer
  4. accounts (used to detect defunct accounts).
  5. (c) Copyright 1999, Mission Critical Software, Inc., All Rights Reserved
  6. Proprietary and confidential to Mission Critical Software, Inc.
  7. REVISION LOG ENTRY
  8. Revision By: Christy Boles
  9. Revised on 02/15/99 11:20:20
  10. ---------------------------------------------------------------------------
  11. */
  12. // ComputerPwdAge.h : Declaration of the CComputerPwdAge
  13. #ifndef __COMPUTERPWDAGE_H_
  14. #define __COMPUTERPWDAGE_H_
  15. #include "resource.h" // main symbols
  16. #include <comdef.h>
  17. #include "Err.hpp"
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CComputerPwdAge
  20. class ATL_NO_VTABLE CComputerPwdAge :
  21. public CComObjectRootEx<CComSingleThreadModel>,
  22. public CComCoClass<CComputerPwdAge, &CLSID_ComputerPwdAge>,
  23. public IDispatchImpl<IComputerPwdAge, &IID_IComputerPwdAge, &LIBID_MCSDCTWORKEROBJECTSLib>
  24. {
  25. _bstr_t m_Domain;
  26. _bstr_t m_DomainCtrl;
  27. public:
  28. CComputerPwdAge()
  29. {
  30. }
  31. DECLARE_REGISTRY_RESOURCEID(IDR_COMPPWDAGE)
  32. DECLARE_NOT_AGGREGATABLE(CComputerPwdAge)
  33. DECLARE_PROTECT_FINAL_CONSTRUCT()
  34. BEGIN_COM_MAP(CComputerPwdAge)
  35. COM_INTERFACE_ENTRY(IComputerPwdAge)
  36. COM_INTERFACE_ENTRY(IDispatch)
  37. END_COM_MAP()
  38. // IWorkNode
  39. public:
  40. STDMETHOD(Process)(IUnknown *pWorkItem);
  41. // IComputerPwdAge
  42. public:
  43. STDMETHOD(ExportPasswordAgeNewerThan)(BSTR domain, BSTR filename, DWORD maxAge);
  44. STDMETHOD(ExportPasswordAgeOlderThan)(BSTR domain, BSTR filename, DWORD minAge);
  45. STDMETHOD(ExportPasswordAge)(BSTR domain, BSTR filename);
  46. STDMETHOD(GetPwdAge)(BSTR DomainName,BSTR ComputerName,DWORD * age);
  47. STDMETHOD(SetDomain)(BSTR domain);
  48. protected:
  49. DWORD GetDomainControllerForDomain(WCHAR const * domain, WCHAR * domctrl);
  50. DWORD GetSinglePasswordAgeInternal(WCHAR const * domctrl, WCHAR const * computer, DWORD * pwdage);
  51. DWORD ExportPasswordAgeInternal(WCHAR const * domctrl, WCHAR const * filename, DWORD minOrMaxAge, BOOL bOlder);
  52. };
  53. #endif //__COMPUTERPWDAGE_H_