afxisapi.inl 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. #ifdef _DEBUG
  14. : m_dwStatusCode(DWORD(-1)), m_bSendHeaders(TRUE), m_pECB(pECB),
  15. m_pStream(NULL), m_dwEndOfHeaders(0), m_dwOldEndOfHeaders(0),
  16. m_dwChunkSize(0)
  17. #else
  18. : m_dwStatusCode(DWORD(-1)), m_bSendHeaders(TRUE), m_pECB(pECB),
  19. m_pStream(NULL), m_dwEndOfHeaders(0), m_dwChunkSize(0)
  20. #endif
  21. { }
  22. _AFXISAPI_INLINE CHttpServerContext::~CHttpServerContext()
  23. { if (m_pStream != NULL) delete m_pStream; }
  24. _AFXISAPI_INLINE CHttpServerContext& CHttpServerContext::operator<<(double d)
  25. { ISAPIASSERT(m_pStream != NULL);
  26. if (m_pStream != NULL) *m_pStream << d;
  27. return *this; }
  28. _AFXISAPI_INLINE CHttpServerContext& CHttpServerContext::operator<<(float f)
  29. { ISAPIASSERT(m_pStream != NULL);
  30. if (m_pStream != NULL) *m_pStream << f;
  31. return *this; }
  32. _AFXISAPI_INLINE CHttpServerContext& CHttpServerContext::operator<<(long int dw)
  33. { ISAPIASSERT(m_pStream != NULL);
  34. if (m_pStream != NULL) *m_pStream << dw;
  35. return *this; }
  36. _AFXISAPI_INLINE CHttpServerContext& CHttpServerContext::operator<<(short int w)
  37. { ISAPIASSERT(m_pStream != NULL);
  38. if (m_pStream != NULL) *m_pStream << w;
  39. return *this; }
  40. _AFXISAPI_INLINE CHttpServerContext& CHttpServerContext::operator<<(const CHtmlStream& stream)
  41. { ISAPIASSERT(m_pStream != NULL);
  42. if (m_pStream != NULL) *m_pStream << stream;
  43. return *this; }
  44. _AFXISAPI_INLINE CHttpServerContext& CHttpServerContext::operator<<(LPCTSTR psz)
  45. { ISAPIASSERT(m_pStream != NULL && psz != NULL);
  46. if (m_pStream != NULL && psz != NULL) *m_pStream << psz;
  47. return *this; }
  48. _AFXISAPI_INLINE BOOL CHttpServerContext::GetServerVariable(LPTSTR lpszVariableName,
  49. LPVOID lpvBuffer, LPDWORD lpdwSize)
  50. {
  51. return m_pECB->GetServerVariable(m_pECB->ConnID,
  52. lpszVariableName, lpvBuffer, lpdwSize);
  53. }
  54. _AFXISAPI_INLINE BOOL CHttpServerContext::WriteClient(LPVOID pBuffer, LPDWORD lpdwBytes,
  55. DWORD dwReserved /* = 0 */)
  56. {
  57. return m_pECB->WriteClient(m_pECB->ConnID, pBuffer,
  58. lpdwBytes, dwReserved);
  59. }
  60. _AFXISAPI_INLINE BOOL CHttpServerContext::ReadClient(LPVOID lpvBuffer, LPDWORD lpdwSize)
  61. {
  62. return m_pECB->ReadClient(m_pECB->ConnID, lpvBuffer, lpdwSize);
  63. }
  64. _AFXISAPI_INLINE BOOL CHttpServerContext::ServerSupportFunction(DWORD dwHSERRequest,
  65. LPVOID lpvBuffer, LPDWORD lpdwSize, LPDWORD lpdwDataType)
  66. {
  67. return m_pECB->ServerSupportFunction(m_pECB->ConnID, dwHSERRequest,
  68. lpvBuffer, lpdwSize, lpdwDataType);
  69. }
  70. _AFXISAPI_INLINE DWORD CHtmlStream::GetStreamSize() const
  71. { return m_nStreamSize; }
  72. _AFXISAPI_INLINE CHttpFilterContext::CHttpFilterContext(PHTTP_FILTER_CONTEXT pCtx)
  73. : m_pFC(pCtx)
  74. { }
  75. _AFXISAPI_INLINE BOOL CHttpFilterContext::GetServerVariable(LPTSTR lpszVariableName,
  76. LPVOID lpvBuffer, LPDWORD lpdwSize)
  77. {
  78. return m_pFC->GetServerVariable(m_pFC, lpszVariableName, lpvBuffer, lpdwSize);
  79. }
  80. _AFXISAPI_INLINE BOOL CHttpFilterContext::AddResponseHeaders(LPTSTR lpszHeaders,
  81. DWORD dwReserved /* = 0 */)
  82. {
  83. return m_pFC->AddResponseHeaders(m_pFC, lpszHeaders, dwReserved);
  84. }
  85. _AFXISAPI_INLINE BOOL CHttpFilterContext::WriteClient(LPVOID lpvBuffer,
  86. LPDWORD lpdwBytes, DWORD dwReserved /* = 0 */)
  87. {
  88. return m_pFC->WriteClient(m_pFC, lpvBuffer, lpdwBytes, dwReserved);
  89. }
  90. _AFXISAPI_INLINE LPVOID CHttpFilterContext::AllocMem(DWORD cbSize,
  91. DWORD dwReserved /* = 0 */)
  92. {
  93. return m_pFC->AllocMem(m_pFC, cbSize, dwReserved);
  94. }
  95. _AFXISAPI_INLINE BOOL CHttpFilterContext::ServerSupportFunction(enum SF_REQ_TYPE sfReq,
  96. LPVOID lpvBuffer, LPDWORD lpdwSize, LPDWORD lpdwDataType)
  97. {
  98. //WINBUG: HTTPFLT.H has the last two params as type DWORD
  99. return m_pFC->ServerSupportFunction(m_pFC, sfReq, lpvBuffer,
  100. (DWORD) lpdwSize, (DWORD) lpdwDataType);
  101. }
  102. #endif // _AFXISAPI_INLINE