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.

129 lines
3.9 KiB

  1. /******************************************************************************
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. HttpContext.h
  5. Abstract:
  6. This file contains the declaration of the MPCHttpContext class,
  7. which handles the interface with IIS.
  8. Revision History:
  9. Davide Massarenti (Dmassare) 04/20/99
  10. created
  11. ******************************************************************************/
  12. #if !defined(__INCLUDED___ULSERVER___HTTPCONTEXT_H___)
  13. #define __INCLUDED___ULSERVER___HTTPCONTEXT_H___
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif // _MSC_VER > 1000
  17. //
  18. // Forward declarations.
  19. //
  20. class MPCServer;
  21. class MPCHttpPipe;
  22. class MPCHttpContext
  23. {
  24. enum FSMstate
  25. {
  26. FSM_REGISTER,
  27. FSM_INPUT ,
  28. FSM_PROCESS ,
  29. FSM_OUTPUT ,
  30. FSM_DELETE
  31. };
  32. enum IOstate
  33. {
  34. IO_IDLE ,
  35. IO_READING,
  36. IO_WRITING
  37. };
  38. LPEXTENSION_CONTROL_BLOCK m_pECB;
  39. MPCServer* m_mpcsServer;
  40. DWORD m_dwSkippedInput;
  41. BOOL m_fRequestProcessed;
  42. BOOL m_fKeepConnection;
  43. BOOL m_fAsync;
  44. FSMstate m_FSMstate;
  45. IOstate m_IOstate;
  46. MPC::Serializer_Memory m_hsInput;
  47. MPC::Serializer_Memory m_hsOutput;
  48. BYTE m_rgBuffer[4096];
  49. DWORD m_dwIOcount;
  50. //////////////////////////////////////////////////////////////////
  51. protected:
  52. DWORD AsyncRead();
  53. DWORD AsyncWrite();
  54. DWORD AdvanceFSM();
  55. DWORD Fsm_Register();
  56. DWORD Fsm_ReceiveInput();
  57. DWORD Fsm_Process();
  58. DWORD Fsm_SendOutput();
  59. static VOID WINAPI IOCompletion( /*[in]*/ EXTENSION_CONTROL_BLOCK* pECB ,
  60. /*[in]*/ PVOID pContext ,
  61. /*[in]*/ DWORD cbIO ,
  62. /*[in]*/ DWORD dwError );
  63. //////////////////////////////////////////////////////////////////
  64. public:
  65. MPCHttpContext();
  66. virtual ~MPCHttpContext();
  67. DWORD Init( /*[in]*/ LPEXTENSION_CONTROL_BLOCK pECB );
  68. HRESULT GetServerVariable ( /*[in]*/ LPCSTR szVar , /*[out]*/ MPC::wstring& szValue );
  69. HRESULT GetRequestSize ( /*[out]*/ DWORD& dwCount );
  70. HRESULT CheckDataAvailable( /*[in] */ DWORD dwCount, /*[out]*/ bool& fAvailable );
  71. HRESULT Read ( /*[in]*/ void* pBuffer, /*[in] */ DWORD dwCount );
  72. HRESULT Write ( /*[in]*/ const void* pBuffer, /*[in] */ DWORD dwCount );
  73. //////////////////////////////////////////////////////////////////
  74. #ifdef DEBUG
  75. bool m_Debug_NO_RESPONSE_TO_OPEN;
  76. bool m_Debug_NO_RESPONSE_TO_WRITE;
  77. bool m_Debug_RESPONSE_TO_OPEN;
  78. DWORD m_Debug_RESPONSE_TO_OPEN_response;
  79. DWORD m_Debug_RESPONSE_TO_OPEN_position;
  80. DWORD m_Debug_RESPONSE_TO_OPEN_protocol;
  81. bool m_Debug_RESPONSE_TO_WRITE;
  82. DWORD m_Debug_RESPONSE_TO_WRITE_response;
  83. DWORD m_Debug_RESPONSE_TO_WRITE_position;
  84. DWORD m_Debug_RESPONSE_TO_WRITE_protocol;
  85. bool m_Debug_RANDOM_POINTER_ERROR;
  86. DWORD m_Debug_RANDOM_POINTER_ERROR_pos_low;
  87. DWORD m_Debug_RANDOM_POINTER_ERROR_pos_high;
  88. bool m_Debug_FIXED_POINTER_ERROR;
  89. DWORD m_Debug_FIXED_POINTER_ERROR_pos;
  90. #endif
  91. //////////////////////////////////////////////////////////////////
  92. };
  93. #endif // !defined(__INCLUDED___ULSERVER___HTTPCONTEXT_H___)