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.

179 lines
3.6 KiB

  1. #ifndef _STREAMFILT_H_
  2. #define _STREAMFILT_H_
  3. /*++
  4. Copyright (c) 2000 Microsoft Corporation
  5. Module Name :
  6. streamfilt.h
  7. Abstract:
  8. public interface of the strmfilt.dll
  9. Author:
  10. Bilal Alam (BAlam) 29-March-2000
  11. Environment:
  12. Win32 - User Mode
  13. Project:
  14. Stream Filter Worker Process
  15. --*/
  16. #include <http.h>
  17. #include <httpp.h>
  18. //
  19. // Structure containing friendly local/remote information
  20. //
  21. struct _RAW_STREAM_INFO;
  22. typedef HRESULT (*PFN_SEND_DATA_BACK)
  23. (
  24. PVOID pvStreamContext,
  25. _RAW_STREAM_INFO * pRawStreamInfo
  26. );
  27. typedef union SockAddress {
  28. SOCKADDR_IN ipv4SockAddress;
  29. SOCKADDR_IN6 ipv6SockAddress;
  30. } SockAddress;
  31. typedef struct _CONNECTION_INFO {
  32. USHORT LocalAddressType; // AF_INET or AF_INET6
  33. USHORT RemoteAddressType; // AF_INET or AF_INET6
  34. SockAddress SockLocalAddress;
  35. SockAddress SockRemoteAddress;
  36. BOOL fIsSecure;
  37. HTTP_RAW_CONNECTION_ID RawConnectionId;
  38. PFN_SEND_DATA_BACK pfnSendDataBack;
  39. PVOID pvStreamContext;
  40. ULONG ClientSSLContextLength;
  41. HTTP_CLIENT_SSL_CONTEXT *pClientSSLContext;
  42. } CONNECTION_INFO, *PCONNECTION_INFO;
  43. //
  44. // Structure used to access/alter raw data stream (read/write)
  45. //
  46. typedef struct _RAW_STREAM_INFO {
  47. PBYTE pbBuffer;
  48. DWORD cbData;
  49. DWORD cbBuffer;
  50. } RAW_STREAM_INFO, *PRAW_STREAM_INFO;
  51. //
  52. // Called to handle read raw notifications
  53. //
  54. typedef HRESULT (*PFN_PROCESS_RAW_READ)
  55. (
  56. RAW_STREAM_INFO * pRawStreamInfo,
  57. PVOID pvContext,
  58. BOOL * pfReadMore,
  59. BOOL * pfComplete,
  60. DWORD * pcbNextReadSize
  61. );
  62. //
  63. // Called to handle write raw notifications
  64. //
  65. typedef HRESULT (*PFN_PROCESS_RAW_WRITE)
  66. (
  67. RAW_STREAM_INFO * pRawStreamInfo,
  68. PVOID pvContext,
  69. BOOL * pfComplete
  70. );
  71. //
  72. // Called when a connection goes away
  73. //
  74. typedef VOID (*PFN_PROCESS_CONNECTION_CLOSE)
  75. (
  76. PVOID pvContext
  77. );
  78. //
  79. // Called when a connection is created
  80. //
  81. typedef HRESULT (*PFN_PROCESS_NEW_CONNECTION)
  82. (
  83. CONNECTION_INFO * pConnectionInfo,
  84. PVOID * ppvContext
  85. );
  86. //
  87. // Called to release context
  88. //
  89. typedef VOID (*PFN_RELEASE_CONTEXT)
  90. (
  91. PVOID pvContext
  92. );
  93. //
  94. // Callbacks used to implement Raw ISAPI Filter Support
  95. //
  96. typedef struct _ISAPI_FILTERS_CALLBACKS {
  97. PFN_PROCESS_RAW_READ pfnRawRead;
  98. PFN_PROCESS_RAW_WRITE pfnRawWrite;
  99. PFN_PROCESS_CONNECTION_CLOSE pfnConnectionClose;
  100. PFN_PROCESS_NEW_CONNECTION pfnNewConnection;
  101. PFN_RELEASE_CONTEXT pfnReleaseContext;
  102. } ISAPI_FILTERS_CALLBACKS, *PISAPI_FILTERS_CALLBACKS;
  103. HRESULT
  104. StreamFilterInitialize(
  105. VOID
  106. );
  107. HRESULT
  108. StreamFilterStart(
  109. VOID
  110. );
  111. HRESULT
  112. StreamFilterStop(
  113. VOID
  114. );
  115. VOID
  116. StreamFilterTerminate(
  117. VOID
  118. );
  119. HRESULT
  120. IsapiFilterInitialize(
  121. ISAPI_FILTERS_CALLBACKS * pCallbacks
  122. );
  123. VOID
  124. IsapiFilterTerminate(
  125. VOID
  126. );
  127. //
  128. // typedefs for strmfilt entrypoints
  129. //
  130. typedef HRESULT ( * PFN_STREAM_FILTER_INITIALIZE ) ( VOID );
  131. typedef VOID ( * PFN_STREAM_FILTER_TERMINATE ) ( VOID );
  132. typedef HRESULT ( * PFN_STREAM_FILTER_START ) ( VOID );
  133. typedef HRESULT ( * PFN_STREAM_FILTER_STOP ) ( VOID );
  134. #endif