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.

117 lines
2.5 KiB

  1. #ifndef _STREAMFILT_H_
  2. #define _STREAMFILT_H_
  3. #include <httpapi.h>
  4. //
  5. // Structure containing friendly local/remote information
  6. //
  7. struct _RAW_STREAM_INFO;
  8. typedef HRESULT (*PFN_SEND_DATA_BACK)
  9. (
  10. PVOID pvStreamContext,
  11. _RAW_STREAM_INFO * pRawStreamInfo
  12. );
  13. typedef struct _CONNECTION_INFO {
  14. USHORT LocalPort;
  15. ULONG LocalAddress;
  16. USHORT RemotePort;
  17. ULONG RemoteAddress;
  18. BOOL fIsSecure;
  19. HTTP_RAW_CONNECTION_ID RawConnectionId;
  20. PFN_SEND_DATA_BACK pfnSendDataBack;
  21. PVOID pvStreamContext;
  22. ULONG ServerNameLength;
  23. PWSTR pServerName;
  24. } CONNECTION_INFO, *PCONNECTION_INFO;
  25. //
  26. // Structure used to access/alter raw data stream (read/write)
  27. //
  28. typedef struct _RAW_STREAM_INFO {
  29. PBYTE pbBuffer;
  30. DWORD cbData;
  31. DWORD cbBuffer;
  32. } RAW_STREAM_INFO, *PRAW_STREAM_INFO;
  33. //
  34. // Called to handle read raw notifications
  35. //
  36. typedef HRESULT (*PFN_PROCESS_RAW_READ)
  37. (
  38. RAW_STREAM_INFO * pRawStreamInfo,
  39. PVOID pvContext,
  40. BOOL * pfReadMore,
  41. BOOL * pfComplete,
  42. DWORD * pcbNextReadSize
  43. );
  44. //
  45. // Called to handle write raw notifications
  46. //
  47. typedef HRESULT (*PFN_PROCESS_RAW_WRITE)
  48. (
  49. RAW_STREAM_INFO * pRawStreamInfo,
  50. PVOID pvContext,
  51. BOOL * pfComplete
  52. );
  53. //
  54. // Called when a connection goes away
  55. //
  56. typedef VOID (*PFN_PROCESS_CONNECTION_CLOSE)
  57. (
  58. PVOID pvContext
  59. );
  60. //
  61. // Called when a connection is created
  62. //
  63. typedef HRESULT (*PFN_PROCESS_NEW_CONNECTION)
  64. (
  65. CONNECTION_INFO * pConnectionInfo,
  66. PVOID * ppvContext
  67. );
  68. //
  69. // Configure the stream filter (SFWP.EXE config will be different than
  70. // INETINFO.EXE config)
  71. //
  72. typedef struct _STREAM_FILTER_CONFIG {
  73. BOOL fSslOnly;
  74. PFN_PROCESS_RAW_READ pfnRawRead;
  75. PFN_PROCESS_RAW_WRITE pfnRawWrite;
  76. PFN_PROCESS_CONNECTION_CLOSE pfnConnectionClose;
  77. PFN_PROCESS_NEW_CONNECTION pfnNewConnection;
  78. } STREAM_FILTER_CONFIG, *PSTREAM_FILTER_CONFIG;
  79. HRESULT
  80. StreamFilterInitialize(
  81. STREAM_FILTER_CONFIG * pStreamFilterConfig
  82. );
  83. HRESULT
  84. StreamFilterStart(
  85. VOID
  86. );
  87. HRESULT
  88. StreamFilterStop(
  89. VOID
  90. );
  91. VOID
  92. StreamFilterTerminate(
  93. VOID
  94. );
  95. #endif