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.

114 lines
2.1 KiB

  1. //
  2. // AlgFTP.h : Declaration of the CAlgFTP
  3. //
  4. #pragma once
  5. #include "FtpControl.h"
  6. // {6E590D61-F6BC-4dad-AC21-7DC40D304059}
  7. DEFINE_GUID(CLSID_AlgFTP, 0x6e590d61, 0xf6bc, 0x4dad, 0xac, 0x21, 0x7d, 0xc4, 0xd, 0x30, 0x40, 0x59);
  8. extern IApplicationGatewayServices* g_pIAlgServicesAlgFTP;
  9. extern USHORT g_nFtpPort; // By Default this will be 21 band can be overwritten by
  10. // a RegKey see MyAlg.cpp->Initialize
  11. /////////////////////////////////////////////////////////////////////////////
  12. //
  13. // CAlgFTP
  14. //
  15. class ATL_NO_VTABLE CAlgFTP:
  16. public CComObjectRootEx<CComMultiThreadModel>,
  17. public CComCoClass<CAlgFTP, &CLSID_AlgFTP>,
  18. public IApplicationGateway
  19. {
  20. public:
  21. CAlgFTP();
  22. ~CAlgFTP();
  23. public:
  24. // DECLARE_REGISTRY(CAlgFTP, TEXT("ALG_FTP.MyALG.1"), TEXT("ALG_FTP.MyALG"), -1, THREADFLAGS_BOTH)
  25. DECLARE_NO_REGISTRY()
  26. DECLARE_NOT_AGGREGATABLE(CAlgFTP)
  27. BEGIN_COM_MAP(CAlgFTP)
  28. COM_INTERFACE_ENTRY(IApplicationGateway)
  29. END_COM_MAP()
  30. //
  31. // IApplicationGateway
  32. //
  33. public:
  34. STDMETHODIMP Initialize(
  35. IApplicationGatewayServices* pIAlgServices
  36. );
  37. STDMETHODIMP Stop(
  38. void
  39. );
  40. //
  41. // Properties
  42. //
  43. private:
  44. HANDLE m_hNoMoreAccept;
  45. public:
  46. IPrimaryControlChannel* m_pPrimaryControlChannel;
  47. ULONG m_ListenAddress;
  48. USHORT m_ListenPort;
  49. SOCKET m_ListenSocket;
  50. //
  51. // Methods
  52. //
  53. public:
  54. //
  55. HRESULT
  56. GetFtpPortToUse(
  57. USHORT& usPort
  58. );
  59. //
  60. void
  61. CleanUp();
  62. //
  63. HRESULT
  64. MyGetOriginalDestinationInfo(
  65. PUCHAR Buffer,
  66. ULONG* pAddr,
  67. USHORT* pPort,
  68. CONNECTION_TYPE* pConnType
  69. );
  70. //
  71. ULONG
  72. MakeListenerSocket();
  73. //
  74. ULONG
  75. RedirectToMyPort();
  76. //
  77. void
  78. AcceptCompletionRoutine(
  79. ULONG ErrCode,
  80. ULONG BytesTransferred,
  81. PNH_BUFFER Bufferp
  82. );
  83. };