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.

134 lines
4.5 KiB

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1995-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. // Inlines for AFXISAPI.H
  11. #ifdef _AFXISAPI_INLINE
  12. _AFXISAPI_INLINE CHttpServerContext::CHttpServerContext(EXTENSION_CONTROL_BLOCK* pECB)
  13. #if _MFC_VER >= 0x0600
  14. #ifdef _DEBUG
  15. : m_dwStatusCode(DWORD(-1)), m_bSendHeaders(TRUE), m_pECB(pECB),
  16. m_pStream(NULL), m_dwEndOfHeaders(0), m_dwOldEndOfHeaders(0),
  17. m_dwChunkSize(0)
  18. #else
  19. : m_dwStatusCode(DWORD(-1)), m_bSendHeaders(TRUE), m_pECB(pECB),
  20. m_pStream(NULL), m_dwEndOfHeaders(0), m_dwChunkSize(0)
  21. #endif
  22. #else
  23. #ifdef _DEBUG
  24. : m_bSendHeaders(TRUE), m_pECB(pECB), m_pStream(NULL),
  25. m_dwEndOfHeaders(0), m_dwOldEndOfHeaders(0)
  26. #else
  27. : m_bSendHeaders(TRUE), m_pECB(pECB), m_pStream(NULL),
  28. m_dwEndOfHeaders(0)
  29. #endif
  30. #endif
  31. { }
  32. _AFXISAPI_INLINE CHttpServerContext::~CHttpServerContext()
  33. { if (m_pStream != NULL) delete m_pStream; }
  34. _AFXISAPI_INLINE CHttpServerContext& CHttpServerContext::operator<<(double d)
  35. { ISAPIASSERT(m_pStream != NULL);
  36. if (m_pStream != NULL) *m_pStream << d;
  37. return *this; }
  38. _AFXISAPI_INLINE CHttpServerContext& CHttpServerContext::operator<<(float f)
  39. { ISAPIASSERT(m_pStream != NULL);
  40. if (m_pStream != NULL) *m_pStream << f;
  41. return *this; }
  42. _AFXISAPI_INLINE CHttpServerContext& CHttpServerContext::operator<<(long int dw)
  43. { ISAPIASSERT(m_pStream != NULL);
  44. if (m_pStream != NULL) *m_pStream << dw;
  45. return *this; }
  46. _AFXISAPI_INLINE CHttpServerContext& CHttpServerContext::operator<<(short int w)
  47. { ISAPIASSERT(m_pStream != NULL);
  48. if (m_pStream != NULL) *m_pStream << w;
  49. return *this; }
  50. _AFXISAPI_INLINE CHttpServerContext& CHttpServerContext::operator<<(const CHtmlStream& stream)
  51. { ISAPIASSERT(m_pStream != NULL);
  52. if (m_pStream != NULL) *m_pStream << stream;
  53. return *this; }
  54. _AFXISAPI_INLINE CHttpServerContext& CHttpServerContext::operator<<(LPCTSTR psz)
  55. { ISAPIASSERT(m_pStream != NULL && psz != NULL);
  56. if (m_pStream != NULL && psz != NULL) *m_pStream << psz;
  57. return *this; }
  58. _AFXISAPI_INLINE BOOL CHttpServerContext::GetServerVariable(LPTSTR lpszVariableName,
  59. LPVOID lpvBuffer, LPDWORD lpdwSize)
  60. {
  61. return m_pECB->GetServerVariable(m_pECB->ConnID,
  62. lpszVariableName, lpvBuffer, lpdwSize);
  63. }
  64. _AFXISAPI_INLINE BOOL CHttpServerContext::WriteClient(LPVOID pBuffer, LPDWORD lpdwBytes,
  65. DWORD dwReserved /* = 0 */)
  66. {
  67. return m_pECB->WriteClient(m_pECB->ConnID, pBuffer,
  68. lpdwBytes, dwReserved);
  69. }
  70. _AFXISAPI_INLINE BOOL CHttpServerContext::ReadClient(LPVOID lpvBuffer, LPDWORD lpdwSize)
  71. {
  72. return m_pECB->ReadClient(m_pECB->ConnID, lpvBuffer, lpdwSize);
  73. }
  74. _AFXISAPI_INLINE BOOL CHttpServerContext::ServerSupportFunction(DWORD dwHSERRequest,
  75. LPVOID lpvBuffer, LPDWORD lpdwSize, LPDWORD lpdwDataType)
  76. {
  77. return m_pECB->ServerSupportFunction(m_pECB->ConnID, dwHSERRequest,
  78. lpvBuffer, lpdwSize, lpdwDataType);
  79. }
  80. _AFXISAPI_INLINE DWORD CHtmlStream::GetStreamSize() const
  81. { return m_nStreamSize; }
  82. _AFXISAPI_INLINE CHttpFilterContext::CHttpFilterContext(PHTTP_FILTER_CONTEXT pCtx)
  83. : m_pFC(pCtx)
  84. { }
  85. _AFXISAPI_INLINE BOOL CHttpFilterContext::GetServerVariable(LPTSTR lpszVariableName,
  86. LPVOID lpvBuffer, LPDWORD lpdwSize)
  87. {
  88. return m_pFC->GetServerVariable(m_pFC, lpszVariableName, lpvBuffer, lpdwSize);
  89. }
  90. _AFXISAPI_INLINE BOOL CHttpFilterContext::AddResponseHeaders(LPTSTR lpszHeaders,
  91. DWORD dwReserved /* = 0 */)
  92. {
  93. return m_pFC->AddResponseHeaders(m_pFC, lpszHeaders, dwReserved);
  94. }
  95. _AFXISAPI_INLINE BOOL CHttpFilterContext::WriteClient(LPVOID lpvBuffer,
  96. LPDWORD lpdwBytes, DWORD dwReserved /* = 0 */)
  97. {
  98. return m_pFC->WriteClient(m_pFC, lpvBuffer, lpdwBytes, dwReserved);
  99. }
  100. _AFXISAPI_INLINE LPVOID CHttpFilterContext::AllocMem(DWORD cbSize,
  101. DWORD dwReserved /* = 0 */)
  102. {
  103. return m_pFC->AllocMem(m_pFC, cbSize, dwReserved);
  104. }
  105. _AFXISAPI_INLINE BOOL CHttpFilterContext::ServerSupportFunction(enum SF_REQ_TYPE sfReq,
  106. LPVOID lpvBuffer, LPDWORD lpdwSize, LPDWORD lpdwDataType)
  107. {
  108. //REVIEW
  109. //WINBUG: HTTPFLT.H has the last two params as type DWORD
  110. return m_pFC->ServerSupportFunction(m_pFC, sfReq, lpvBuffer,
  111. (DWORD)(DWORD_PTR)lpdwSize, (DWORD)(DWORD_PTR)lpdwDataType);
  112. }
  113. #endif // _AFXISAPI_INLINE