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.

72 lines
2.0 KiB

  1. #ifndef __POP3_AUTH_METHODS_H__
  2. #define __POP3_AUTH_METHODS_H__
  3. #include "resource.h"
  4. #include <vector>
  5. struct AUTH_METHOD_INFO
  6. {
  7. IAuthMethod *pIAuthMethod;
  8. BSTR bstrGuid;
  9. BSTR bstrName;
  10. BOOL bIsValid;
  11. };
  12. typedef AUTH_METHOD_INFO *PAUTH_METHOD_INFO ;
  13. typedef std::vector<PAUTH_METHOD_INFO> AUTHVECTOR;
  14. typedef std::vector<long> AUTHINDEX;
  15. class ATL_NO_VTABLE CAuthMethods :
  16. public CComObjectRootEx<CComSingleThreadModel>,
  17. public CComCoClass<CAuthMethods, &CLSID_AuthMethods>,
  18. public IDispatchImpl<IAuthMethods, &IID_IAuthMethods, &LIBID_Pop3Auth>
  19. {
  20. public:
  21. CAuthMethods();
  22. virtual ~CAuthMethods();
  23. DECLARE_REGISTRY_RESOURCEID(IDR_AUTHMETHODS)
  24. DECLARE_PROTECT_FINAL_CONSTRUCT()
  25. BEGIN_COM_MAP(CAuthMethods)
  26. COM_INTERFACE_ENTRY(IAuthMethods)
  27. COM_INTERFACE_ENTRY(IDispatch)
  28. END_COM_MAP()
  29. //IAuthMethods
  30. public:
  31. STDMETHOD(get_Count)(/*[out]*/ LONG *pVal);
  32. STDMETHOD(get_Item)(/*[in]*/ VARIANT vID, /*[out, retval]*/ IAuthMethod **ppVal);
  33. STDMETHOD(get__NewEnum)(/*[out, retval]*/ IEnumVARIANT **ppVal);
  34. STDMETHOD(Add)(/*[in]*/BSTR bstrName, /*[in]*/BSTR bstrGUID);
  35. STDMETHOD(Remove)(/*[in]*/ VARIANT vID);
  36. STDMETHOD(Save)(void);
  37. STDMETHOD(get_CurrentAuthMethod)(/*[out, retval]*/VARIANT *pVal);
  38. STDMETHOD(put_CurrentAuthMethod)(/*[in]*/ VARIANT vID);
  39. STDMETHOD(get_MachineName)(/*[out, retval]*/ BSTR *pVal);
  40. STDMETHOD(put_MachineName)(/*[in]*/ BSTR newVal);
  41. STDMETHOD(VerifyCurrentAuthMethod)(int iIndex);
  42. private:
  43. BOOL Initialize();
  44. void CleanUp();
  45. HRESULT CreateObj(PAUTH_METHOD_INFO pAuthInfo, IAuthMethod **ppVal);
  46. HRESULT VerifyAuthMethod(BSTR bstrGuid);
  47. BOOL PopulateAuthMethods(WCHAR *wBuffer, DWORD cbSize);
  48. HRESULT SetMachineRole();
  49. CRITICAL_SECTION m_csVectorGuard;
  50. BOOL m_bIsInitialized;
  51. long m_lCurrentMethodIndex;
  52. BSTR m_bstrServerName;
  53. AUTHVECTOR m_AuthVector;
  54. AUTHINDEX m_Index;
  55. long m_lMachineRole;
  56. };
  57. #endif//__POP3_AUTH_METHODS_H__