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.

102 lines
2.9 KiB

  1. // --------------------------------------------------------------------------------
  2. // trawler.h
  3. // --------------------------------------------------------------------------------
  4. #ifndef __TRAWLER_H__
  5. #define __TRAWLER_H__
  6. #include "imnxport.h"
  7. #define CCH_MAX 4096
  8. interface IMimeMessage;
  9. class CTrawler : public INNTPCallback
  10. {
  11. public:
  12. CTrawler(void);
  13. ~CTrawler(void);
  14. STDMETHODIMP QueryInterface(REFIID, LPVOID*);
  15. STDMETHODIMP_(ULONG) AddRef(void);
  16. STDMETHODIMP_(ULONG) Release(void);
  17. // ----------------------------------------------------------------------------
  18. // ITransportCallback methods
  19. // ----------------------------------------------------------------------------
  20. STDMETHODIMP OnLogonPrompt(
  21. LPINETSERVER pInetServer,
  22. IInternetTransport *pTransport);
  23. STDMETHODIMP_(INT) OnPrompt(
  24. HRESULT hrError,
  25. LPCTSTR pszText,
  26. LPCTSTR pszCaption,
  27. UINT uType,
  28. IInternetTransport *pTransport);
  29. STDMETHODIMP OnStatus(
  30. IXPSTATUS ixpstatus,
  31. IInternetTransport *pTransport);
  32. STDMETHODIMP OnError(
  33. IXPSTATUS ixpstatus,
  34. LPIXPRESULT pIxpResult,
  35. IInternetTransport *pTransport);
  36. STDMETHODIMP OnProgress(
  37. DWORD dwIncrement,
  38. DWORD dwCurrent,
  39. DWORD dwMaximum,
  40. IInternetTransport *pTransport);
  41. STDMETHODIMP OnCommand(
  42. CMDTYPE cmdtype,
  43. LPSTR pszLine,
  44. HRESULT hrResponse,
  45. IInternetTransport *pTransport);
  46. STDMETHODIMP OnTimeout(
  47. DWORD *pdwTimeout,
  48. IInternetTransport *pTransport);
  49. // ----------------------------------------------------------------------------
  50. // INNTPCallback methods
  51. // ----------------------------------------------------------------------------
  52. STDMETHODIMP OnResponse(
  53. LPNNTPRESPONSE pResponse);
  54. HRESULT Init();
  55. HRESULT Close();
  56. HRESULT DoTrawl();
  57. private:
  58. ULONG m_cRef,
  59. m_uMin,
  60. m_uMax;
  61. INNTPTransport *m_pNNTP;
  62. char m_szGroups[CCH_MAX],
  63. m_szTypes[CCH_MAX],
  64. m_szPath[MAX_PATH],
  65. m_szServer[MAX_PATH];
  66. LPSTREAM m_pstm;
  67. void ShowMsg(LPSTR psz, BYTE fgColor);
  68. void Error(LPSTR psz);
  69. void OnArticle(LPSTR lpszLines, ULONG cbLines, BOOL fDone);
  70. void DumpMsg(IMimeMessage *pMsg);
  71. HRESULT LoadIniData();
  72. HRESULT SelectGroup(LPSTR lpszGroup);
  73. HRESULT DumpGroup(LPSTR lpszGroup);
  74. HRESULT IsValidType(char *szExt);
  75. };
  76. HRESULT HrCreateTrawler(CTrawler **ppTrawler);
  77. #endif // __TRAWLER_H__