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.

158 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 1995-1997 Microsoft Corporation
  3. Module Name :
  4. wamobj.hxx
  5. Abstract:
  6. Header file for the WAM (web application manager) object
  7. Author:
  8. David Kaplan ( DaveK ) 11-Mar-1997
  9. Wade Hilmo ( WadeH ) 08-Sep-2000
  10. Environment:
  11. User Mode - Win32
  12. Project:
  13. Wam DLL
  14. --*/
  15. # ifndef _WAMOBJ_HXX_
  16. # define _WAMOBJ_HXX_
  17. # define WAM_SIGNATURE (DWORD )' MAW' // will become "WAM " on debug
  18. # define WAM_SIGNATURE_FREE (DWORD )'fMAW' // will become "WAMf" on debug
  19. /************************************************************
  20. * Include Headers
  21. ************************************************************/
  22. # include "iwam.h"
  23. # include "resource.h"
  24. # include <atlbase.h>
  25. # include <w3isapi.h>
  26. class CWamModule: public CComModule
  27. {
  28. public:
  29. // LONG Lock();
  30. // LONG Unlock();
  31. };
  32. extern CWamModule _Module;
  33. # include <atlcom.h>
  34. /************************************************************
  35. * Type Definitions
  36. ************************************************************/
  37. /*++
  38. class WAM
  39. Class definition for the WAM object.
  40. --*/
  41. class ATL_NO_VTABLE WAM :
  42. public CComObjectRootEx<CComMultiThreadModel>,
  43. public CComCoClass<WAM, &CLSID_Wam>,
  44. public IWam
  45. {
  46. public:
  47. WAM()
  48. : m_dwSignature( WAM_SIGNATURE),
  49. m_fShuttingDown( FALSE ),
  50. m_pUnkMarshaler(NULL)
  51. {
  52. }
  53. ~WAM()
  54. {
  55. // check for memory corruption and dangling pointers
  56. m_dwSignature = WAM_SIGNATURE_FREE;
  57. }
  58. DECLARE_GET_CONTROLLING_UNKNOWN()
  59. DECLARE_REGISTRY_RESOURCEID(IDR_WAM)
  60. BEGIN_COM_MAP(WAM)
  61. COM_INTERFACE_ENTRY(IWam)
  62. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
  63. END_COM_MAP()
  64. HRESULT FinalConstruct()
  65. {
  66. return CoCreateFreeThreadedMarshaler(
  67. GetControllingUnknown(), &m_pUnkMarshaler.p);
  68. }
  69. void FinalRelease()
  70. {
  71. m_pUnkMarshaler.Release();
  72. }
  73. CComPtr<IUnknown> m_pUnkMarshaler;
  74. public:
  75. HRESULT STDMETHODCALLTYPE
  76. WamProcessIsapiRequest(
  77. BYTE *pCoreData,
  78. DWORD cbCoreData,
  79. IIsapiCore *pIsapiCore,
  80. DWORD *pdwHseResult
  81. );
  82. HRESULT STDMETHODCALLTYPE
  83. WamProcessIsapiCompletion(
  84. DWORD64 IsapiContext,
  85. DWORD cbCompletion,
  86. DWORD cbCompletionStatus
  87. );
  88. HRESULT STDMETHODCALLTYPE
  89. WamInitProcess(
  90. BYTE *szIsapiModule,
  91. DWORD cbIsapiModule,
  92. DWORD *pdwProcessId,
  93. LPSTR szClsid,
  94. LPSTR szIsapiHandlerInstance,
  95. DWORD dwCallingProcess
  96. );
  97. HRESULT STDMETHODCALLTYPE
  98. WamUninitProcess(
  99. VOID
  100. );
  101. HRESULT STDMETHODCALLTYPE
  102. WamMarshalAsyncReadBuffer(
  103. DWORD64 IsapiContext,
  104. BYTE *pBuffer,
  105. DWORD cbBuffer
  106. );
  107. private:
  108. DWORD m_dwSignature;
  109. BOOL m_fInProcess; // inproc or oop?
  110. BOOL m_fInPool; // can have multiple WAMs
  111. BOOL m_fShuttingDown; // shutting down?
  112. static HMODULE sm_hIsapiModule;
  113. static PFN_ISAPI_TERM_MODULE sm_pfnTermIsapiModule;
  114. static PFN_ISAPI_PROCESS_REQUEST sm_pfnProcessIsapiRequest;
  115. static PFN_ISAPI_PROCESS_COMPLETION sm_pfnProcessIsapiCompletion;
  116. }; // class WAM
  117. typedef WAM * PWAM;
  118. # endif // _WAMOBJ_HXX_
  119. /************************ End of File ***********************/