Leaked source code of windows server 2003
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.

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