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.

140 lines
3.5 KiB

  1. /*===================================================================
  2. Microsoft Denali
  3. Microsoft Confidential.
  4. Copyright 1996 Microsoft Corporation. All Rights Reserved.
  5. Component: Server object
  6. File: Server.h
  7. Owner: CGrant
  8. This file contains the header info for defining the Server object.
  9. Note: This was largely stolen from Kraig Brocjschmidt's Inside OLE2
  10. second edition, chapter 14 Beeper v5.
  11. ===================================================================*/
  12. #ifndef _Server_H
  13. #define _Server_H
  14. #include "debug.h"
  15. #include "dispatch.h"
  16. #include "denguid.h"
  17. #include "memcls.h"
  18. #include "ftm.h"
  19. #ifdef USE_LOCALE
  20. extern DWORD g_dwTLS;
  21. #endif
  22. //This file is generated from MKTYPLIB on denali.obj
  23. #include "asptlb.h"
  24. // Forward declr
  25. class CHitObj;
  26. /*
  27. * C S e r v e r D a t a
  28. *
  29. * Structure that holds the intrinsic's properties.
  30. * The instrinsic keeps pointer to it (NULL when lightweight)
  31. */
  32. class CServerData
  33. {
  34. public:
  35. // Interface to indicate that we support ErrorInfo reporting
  36. CSupportErrorInfo m_ISupportErrImp;
  37. // CIsapiReqInfo block for HTTP info
  38. CIsapiReqInfo *m_pIReq;
  39. // Back pointer to current HitObj (required for the MapPath)
  40. CHitObj *m_pHitObj;
  41. // Cache on per-class basis
  42. ACACHE_INCLASS_DEFINITIONS()
  43. };
  44. /*
  45. * C S e r v e r
  46. *
  47. * Implements the Server object
  48. */
  49. class CServer : public IServerImpl, public CFTMImplementation
  50. {
  51. private:
  52. // Flags
  53. DWORD m_fInited : 1; // Is initialized?
  54. DWORD m_fDiagnostics : 1; // Display ref count in debug output
  55. DWORD m_fOuterUnknown : 1; // Ref count outer unknown?
  56. // Ref count / Outer unknown
  57. union
  58. {
  59. DWORD m_cRefs;
  60. IUnknown *m_punkOuter;
  61. };
  62. // Properties
  63. CServerData *m_pData; // pointer to structure that holds
  64. // CServer properties
  65. public:
  66. CServer(IUnknown *punkOuter = NULL);
  67. ~CServer();
  68. HRESULT Init();
  69. HRESULT UnInit();
  70. HRESULT ReInit(CIsapiReqInfo *pIReq, CHitObj *pHitObj);
  71. HRESULT MapPathInternal(DWORD dwContextId, WCHAR *wszVirtPath,
  72. TCHAR *szPhysPath, TCHAR *szVirtPath = NULL);
  73. // Retrieve HitObj
  74. inline CHitObj *PHitObj() { return m_pData ? m_pData->m_pHitObj : NULL; }
  75. //Non-delegating object IUnknown
  76. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  77. STDMETHODIMP_(ULONG) AddRef(void);
  78. STDMETHODIMP_(ULONG) Release(void);
  79. // GetIDsOfNames special-case implementation
  80. STDMETHODIMP GetIDsOfNames(REFIID, OLECHAR **, UINT, LCID, DISPID *);
  81. // Tombstone stub
  82. HRESULT CheckForTombstone();
  83. //IServer functions
  84. STDMETHODIMP CreateObject(BSTR bstr, IDispatch **ppdispObject);
  85. STDMETHODIMP MapPath(BSTR bstrLogicalPath, BSTR *pbstrPhysicalPath);
  86. STDMETHODIMP HTMLEncode(BSTR bstrIn, BSTR *pbstrEncoded);
  87. STDMETHODIMP URLEncode(BSTR bstrIn, BSTR *pbstrEncoded);
  88. STDMETHODIMP URLPathEncode(BSTR bstrIn, BSTR *pbstrEncoded);
  89. STDMETHODIMP get_ScriptTimeout(long * plTimeoutSeconds);
  90. STDMETHODIMP put_ScriptTimeout(long lTimeoutSeconds);
  91. STDMETHODIMP Execute(BSTR bstrURL);
  92. STDMETHODIMP Transfer(BSTR bstrURL);
  93. STDMETHODIMP GetLastError(IASPError **ppASPErrorObject);
  94. // Debug support
  95. #ifdef DBG
  96. inline void TurnDiagsOn() { m_fDiagnostics = TRUE; }
  97. inline void TurnDiagsOff() { m_fDiagnostics = FALSE; }
  98. void AssertValid() const;
  99. #else
  100. inline void TurnDiagsOn() {}
  101. inline void TurnDiagsOff() {}
  102. inline void AssertValid() const {}
  103. #endif
  104. // Cache on per-class basis
  105. ACACHE_INCLASS_DEFINITIONS()
  106. };
  107. typedef CServer *PCServer;
  108. #endif //_Server_H