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.

122 lines
4.7 KiB

  1. //
  2. // MODULE: APGTSECB.H
  3. //
  4. // PURPOSE: Interface of CAbstractECB class, which provides an abstraction from Win32's
  5. // EXTENSION_CONTROL_BLOCK. Using this abstract class allows us to have common code for
  6. // the Online Troubleshooter (which actually uses an EXTENSION_CONTROL_BLOCK) and the Local
  7. // Troubleshooter (which needs to simulate similar capabilities).
  8. //
  9. // PROJECT: Generic Troubleshooter DLL for Microsoft AnswerPoint
  10. //
  11. // COMPANY: Saltmine Creative, Inc. (206)-284-7511 [email protected]
  12. //
  13. // AUTHOR: Joe Mabel
  14. //
  15. // ORIGINAL DATE: 01-04-99
  16. //
  17. // NOTES:
  18. // 1. EXTENSION_CONTROL_BLOCK is extensively documented in the VC++ documentation
  19. // 2. It is imaginable that some of these methods are needed only in the Online Troubleshooter
  20. // and might be eliminated from this abstract class.
  21. //
  22. // Version Date By Comments
  23. //--------------------------------------------------------------------
  24. // V3.1 01-04-99 JM Original
  25. //
  26. // apgtsECB.h: interface for the CAbstractECB class.
  27. //
  28. //////////////////////////////////////////////////////////////////////
  29. #if !defined(AFX_APGTSECB_H__56CCF083_A40C_11D2_9646_00C04FC22ADD__INCLUDED_)
  30. #define AFX_APGTSECB_H__56CCF083_A40C_11D2_9646_00C04FC22ADD__INCLUDED_
  31. #if _MSC_VER >= 1000
  32. #pragma once
  33. #endif // _MSC_VER >= 1000
  34. #include <windows.h>
  35. #include <httpext.h>
  36. class CAbstractECB
  37. {
  38. public:
  39. virtual ~CAbstractECB() {}
  40. // Methods corresponding to EXTENSION_CONTROL_BLOCK data members. We must provide
  41. // Get methods for all inputs from end user system and Set methods for all outputs to
  42. // end user system. Classes which inherit from this may need Set methods for inputs
  43. // or Get methods for outputs, as well. For example, the Local Troubleshooter will need
  44. // to set the Method and Query String, since it does not actually receive these in
  45. // an EXTENSION_CONTROL_BLOCK.
  46. // DWORD cbSize IN, not currently used by TS. Would have to add a Get method if
  47. // this is ever needed
  48. // DWORD dwVersion IN, not currently used by TS. Would have to add a Get method if
  49. // this is ever needed
  50. // HCONN ConnID IN, only ever of concern within class COnlineECB
  51. // DWORD dwHttpStatusCode OUT
  52. virtual DWORD SetHttpStatusCode(DWORD dwHttpStatusCode)=0;
  53. // CHAR lpszLogData[HSE_LOG_BUFFER_LEN] OUT, not currently used by TS. Would have
  54. // to add a Set method if this is ever needed
  55. // LPSTR lpszMethod IN
  56. virtual LPSTR GetMethod() const =0;
  57. // LPSTR lpszQueryString IN
  58. virtual LPSTR GetQueryString() const =0;
  59. // LPSTR lpszPathInfo IN, not currently used by TS. Would have to add a Get method if
  60. // this is ever needed
  61. // LPSTR lpszPathTranslated IN, not currently used by TS. Would have to add a Get method if
  62. // this is ever needed
  63. // DWORD cbTotalBytes IN, not currently used by TS. Would have to add a Get method if
  64. // this is ever needed
  65. // DWORD cbAvailable IN
  66. virtual DWORD GetBytesAvailable() const =0;
  67. // LPBYTE lpbData IN
  68. virtual LPBYTE GetData() const =0;
  69. // LPSTR lpszContentType IN
  70. virtual LPSTR GetContentType() const =0;
  71. // Methods corresponding to EXTENSION_CONTROL_BLOCK methods
  72. // Note that EXTENSION_CONTROL_BLOCK uses pointers to functions, not actual function methods,
  73. // but there doesn't seem to be any good reason for that.
  74. virtual BOOL GetServerVariable
  75. ( /*HCONN hConn,*/ // EXTENSION_CONTROL_BLOCK has an argument here, but for us it can
  76. // always be determined from *this
  77. LPCSTR lpszVariableName, // note, more const-ness than EXTENSION_CONTROL_BLOCK
  78. LPVOID lpvBuffer,
  79. LPDWORD lpdwSize ) =0;
  80. virtual BOOL WriteClient
  81. ( /*HCONN ConnID,*/ // EXTENSION_CONTROL_BLOCK has an argument here, but for us it can
  82. // always be determined from *this
  83. LPCSTR Buffer, // EXTENSION_CONTROL_BLOCK::WriteClient uses LPVOID, but it should
  84. // only be legit to pass SBCS text, so we're enforcing that.
  85. // Also, we're adding const-ness.
  86. LPDWORD lpdwBytes
  87. /* ,DWORD dwReserved */ // EXTENSION_CONTROL_BLOCK::WriteClient reserves one more arg.
  88. ) =0;
  89. virtual BOOL ServerSupportFunction
  90. ( /*HCONN hConn,*/ // EXTENSION_CONTROL_BLOCK has an argument here, but for us it can
  91. // always be determined from *this
  92. DWORD dwHSERRequest,
  93. LPVOID lpvBuffer,
  94. LPDWORD lpdwSize,
  95. LPDWORD lpdwDataType ) =0;
  96. // since we don't use this we haven't bothered implementing.
  97. // BOOL ( WINAPI * ReadClient )
  98. // ( HCONN ConnID,
  99. // LPVOID lpvBuffer,
  100. // LPDWORD lpdwSize );
  101. };
  102. #endif // !defined(AFX_APGTSECB_H__56CCF083_A40C_11D2_9646_00C04FC22ADD__INCLUDED_)