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
2.9 KiB

  1. /*-----------------------------------------------------------------------------
  2. Microsoft Denali
  3. Microsoft Confidential
  4. Copyright 1996 Microsoft Corporation. All Rights Reserved.
  5. Component: Executive
  6. File: Executor.h
  7. Owner: DGottner
  8. Executor API definition
  9. -----------------------------------------------------------------------------*/
  10. #ifndef _EXECUTOR_H
  11. #define _EXECUTOR_H
  12. // Includes -------------------------------------------------------------------
  13. #include "HitObj.h"
  14. // Forward References ---------------------------------------------------------
  15. class CResponse;
  16. class CRequest;
  17. class CServer;
  18. class CScriptingNamespace;
  19. // Error codes ----------------------------------------------------------------
  20. #define E_PAGE_HAS_SESSAPP_OBJECTS 0x8000E001L
  21. // Types and Constants --------------------------------------------------------
  22. class CIntrinsicObjects
  23. {
  24. private:
  25. BOOL m_fIsChild;
  26. CResponse * m_pResponse;
  27. CRequest * m_pRequest;
  28. CServer * m_pServer;
  29. CScriptingNamespace * m_pScriptingNamespace;
  30. public:
  31. inline CResponse * PResponse() const { return m_pResponse; }
  32. inline CRequest * PRequest() const { return m_pRequest; }
  33. inline CServer * PServer() const { return m_pServer; }
  34. inline CScriptingNamespace *PScriptingNamespace() const { return m_pScriptingNamespace; }
  35. CIntrinsicObjects()
  36. {
  37. m_fIsChild = FALSE;
  38. m_pResponse = NULL;
  39. m_pRequest = NULL;
  40. m_pServer = NULL;
  41. m_pScriptingNamespace = NULL;
  42. }
  43. ~CIntrinsicObjects()
  44. {
  45. Cleanup();
  46. }
  47. HRESULT Prepare(CSession *pSession);
  48. HRESULT PrepareChild(CResponse *pResponse, CRequest *pRequest, CServer *pServer);
  49. HRESULT Cleanup();
  50. };
  51. struct TemplateGoodies
  52. {
  53. int iScriptBlock;
  54. CTemplate * pTemplate;
  55. };
  56. // CONSIDER: declare pScriptEngine to be a CActiveScriptEngine, because that's its
  57. // actual type.
  58. //
  59. struct ScriptingInfo
  60. {
  61. CHAR * szScriptEngine; // name of this scripting engine
  62. PROGLANG_ID * pProgLangId; // ptr to prog lang id of the script engine
  63. CScriptEngine * pScriptEngine; // pointer to scripting engine
  64. TemplateGoodies LineMapInfo; // used to map lines back to VBScript
  65. };
  66. struct ActiveEngineInfo
  67. {
  68. int cEngines; // required engines
  69. int cActiveEngines; // successfully instantiated engines
  70. ScriptingInfo *rgActiveEngines; // pointer to array of engines
  71. // when only one engine rgActiveEngines points to here
  72. ScriptingInfo siOneActiveEngine;
  73. };
  74. // Prototypes -----------------------------------------------------------------
  75. HRESULT Execute
  76. (
  77. CTemplate *pTemplate,
  78. CHitObj *pHitObj,
  79. const CIntrinsicObjects &intrinsics,
  80. BOOL fChild = FALSE
  81. );
  82. HRESULT LoadTemplate
  83. (
  84. const TCHAR *szFile,
  85. CHitObj *pHitObj,
  86. CTemplate **ppTemplate,
  87. const CIntrinsicObjects &intrinsics,
  88. BOOL fGlobalAsa,
  89. BOOL *pfTemplateInCache
  90. );
  91. #endif // _EXECUTOR_H