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.

87 lines
4.2 KiB

  1. // --------------------------------------------------------------------------------
  2. // Ixpbase.h
  3. // Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  4. // Steven J. Bailey
  5. // --------------------------------------------------------------------------------
  6. #ifndef __IXPBASE_H
  7. #define __IXPBASE_H
  8. // ------------------------------------------------------------------------------------
  9. // Depends
  10. // ------------------------------------------------------------------------------------
  11. #include "imnxport.h"
  12. #include "asynconn.h"
  13. // --------------------------------------------------------------------------------
  14. // CIxpBase
  15. // --------------------------------------------------------------------------------
  16. class CIxpBase : public IInternetTransport, public IAsyncConnCB, public IAsyncConnPrompt
  17. {
  18. protected:
  19. BOOL m_fBusy; // Are we in the busy state
  20. IXPSTATUS m_status; // Status of the transport
  21. ULONG m_cRef; // Reference Count
  22. LPSTR m_pszResponse; // Last Server Response String
  23. UINT m_uiResponse; // Server Response Error
  24. HRESULT m_hrResponse; // Server Response Error
  25. ILogFile *m_pLogFile; // Logfile Object
  26. CAsyncConn *m_pSocket; // Socket Object
  27. ITransportCallback *m_pCallback; // Transport callback object
  28. INETSERVER m_rServer; // Internet Server information
  29. BOOL m_fConnectAuth; // Proceed with user auth
  30. BOOL m_fConnectTLS; // Proceed with TLS encryption
  31. BOOL m_fCommandLogging;// Do ITransportCallback::OnCommand
  32. BOOL m_fAuthenticated; // Has the user been authenticated successfully...
  33. IXPTYPE m_ixptype; // Transport type
  34. CRITICAL_SECTION m_cs; // Thread Safety
  35. protected:
  36. HRESULT HrSendLine(LPSTR pszLine);
  37. HRESULT HrReadLine(LPSTR *ppszLine, INT *pcbLine, BOOL *pfComplete);
  38. HRESULT HrSendCommand(LPSTR pszCommand, LPSTR pszParameters, BOOL fDoBusy=TRUE);
  39. HRESULT OnInitNew(LPSTR pszProtocol, LPSTR pszLogFilePath, DWORD dwShareMode, ITransportCallback *pCallback);
  40. void Reset(void);
  41. HRESULT HrEnterBusy(void);
  42. void OnStatus(IXPSTATUS ixpstatus);
  43. void OnError(HRESULT hrResult, LPSTR pszProblem=NULL);
  44. void LeaveBusy(void);
  45. virtual void ResetBase(void) PURE;
  46. virtual void DoQuit(void) PURE;
  47. virtual void OnConnected(void);
  48. virtual void OnDisconnected(void);
  49. virtual void OnEnterBusy(void) PURE;
  50. virtual void OnLeaveBusy(void) PURE;
  51. public:
  52. // ----------------------------------------------------------------------------
  53. // Construction
  54. // ----------------------------------------------------------------------------
  55. CIxpBase(IXPTYPE ixptype);
  56. virtual ~CIxpBase(void);
  57. // ----------------------------------------------------------------------------
  58. // IAsyncConnPrompt methods
  59. // ----------------------------------------------------------------------------
  60. int OnPrompt(HRESULT hrError, LPCTSTR pszText, LPCTSTR pszCaption, UINT uType);
  61. // ----------------------------------------------------------------------------
  62. // IAsyncConnCB methods
  63. // ----------------------------------------------------------------------------
  64. virtual void OnNotify(ASYNCSTATE asOld, ASYNCSTATE asNew, ASYNCEVENT ae);
  65. // ----------------------------------------------------------------------------
  66. // IInternetTransport methods
  67. // ----------------------------------------------------------------------------
  68. virtual STDMETHODIMP Connect(LPINETSERVER pInetServer, boolean fAuthenticate, boolean fCommandLogging);
  69. virtual STDMETHODIMP Disconnect(void);
  70. STDMETHODIMP DropConnection(void);
  71. STDMETHODIMP IsState(IXPISSTATE isstate);
  72. STDMETHODIMP GetServerInfo(LPINETSERVER pInetServer);
  73. STDMETHODIMP_(IXPTYPE) GetIXPType(void);
  74. STDMETHODIMP InetServerFromAccount(IImnAccount *pAccount, LPINETSERVER pInetServer);
  75. STDMETHODIMP HandsOffCallback(void);
  76. STDMETHODIMP GetStatus(IXPSTATUS *pCurrentStatus);
  77. };
  78. #endif // __IXPBASE_H