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.

98 lines
2.4 KiB

  1. #ifndef __CSCPSITE_H__
  2. #define __CSCPSITE_H__
  3. #include <windows.h>
  4. #include <olectl.h>
  5. #include <activscp.h>
  6. #include "jsproxy.h"
  7. #include "utils.h"
  8. /********************************************************************************************/
  9. // ScriptSite Class
  10. //
  11. //
  12. //
  13. class CScriptSite : public IActiveScriptSite,
  14. public IServiceProvider,
  15. public IInternetHostSecurityManager
  16. {
  17. public:
  18. CScriptSite();
  19. ~CScriptSite();
  20. // IUnknown Interface methods.
  21. STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppvObject);
  22. STDMETHODIMP_(ULONG) AddRef()
  23. {
  24. return ++m_refCount;
  25. }
  26. STDMETHODIMP_(ULONG) Release()
  27. {
  28. if (--m_refCount)
  29. return m_refCount;
  30. delete this;
  31. return 0;
  32. }
  33. STDMETHODIMP GetLCID(LCID *plcid);
  34. STDMETHODIMP GetItemInfo(LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown **ppunkItem, ITypeInfo **ppTypeInfo);
  35. STDMETHODIMP GetDocVersionString(BSTR *pstrVersionString);
  36. STDMETHODIMP OnScriptTerminate(const VARIANT *pvarResult,const EXCEPINFO *pexcepinfo);
  37. STDMETHODIMP OnStateChange(SCRIPTSTATE ssScriptState);
  38. STDMETHODIMP OnScriptError(IActiveScriptError *pase);
  39. STDMETHODIMP OnEnterScript();
  40. STDMETHODIMP OnLeaveScript();
  41. STDMETHODIMP Init(AUTO_PROXY_HELPER_APIS* pAPHA, LPCSTR szScript);
  42. STDMETHODIMP DeInit();
  43. STDMETHODIMP RunScript(LPCSTR szURL, LPCSTR szHost, LPSTR* result);
  44. //
  45. // IServiceProvider
  46. //
  47. STDMETHODIMP QueryService(
  48. REFGUID guidService,
  49. REFIID riid,
  50. void **ppvObject);
  51. //
  52. // IInternetHostSecurityManager
  53. //
  54. STDMETHODIMP GetSecurityId(
  55. BYTE *pbSecurityId,
  56. DWORD *pcbSecurityId,
  57. DWORD_PTR dwReserved);
  58. STDMETHODIMP ProcessUrlAction(
  59. DWORD dwAction,
  60. BYTE *pPolicy,
  61. DWORD cbPolicy,
  62. BYTE *pContext,
  63. DWORD cbContext,
  64. DWORD dwFlags,
  65. DWORD dwReserved);
  66. STDMETHODIMP QueryCustomPolicy(
  67. REFGUID guidKey,
  68. BYTE **ppPolicy,
  69. DWORD *pcbPolicy,
  70. BYTE *pContext,
  71. DWORD cbContext,
  72. DWORD dwReserved);
  73. private:
  74. BOOL m_fInitialized;
  75. long m_refCount;
  76. IActiveScript *m_pios;
  77. IActiveScriptParse *m_pasp;
  78. CJSProxy *m_punkJSProxy;
  79. IDispatch *m_pScriptDispatch; // Stored dispatch for script
  80. DISPID m_Scriptdispid; // DISPID for stored script to facilitate quicker invoke.
  81. };
  82. #endif