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.

101 lines
3.8 KiB

  1. // Copyright (c) 1999 Microsoft Corporation. All rights reserved.
  2. //
  3. // Declaration of CAudioVBScriptEngine.
  4. //
  5. // CAudioVBScriptEngine is an ActiveX scripting engine that supports a carefully chosen subset of the VBScript language.
  6. // It's goal in life is to be as small and fast as possible and to run on every platform that ports DirectMusic.
  7. #pragma once
  8. #include "activscp.h"
  9. #include "engdisp.h"
  10. const GUID CLSID_DirectMusicAudioVBScript = { 0x4ee17959, 0x931e, 0x49e4, { 0xa2, 0xc6, 0x97, 0x7e, 0xcf, 0x36, 0x28, 0xf3 } }; // {4EE17959-931E-49e4-A2C6-977ECF3628F3}
  11. class CAudioVBScriptEngine
  12. : public IActiveScript,
  13. public IActiveScriptParse
  14. {
  15. public:
  16. static HRESULT CreateInstance(IUnknown* pUnknownOuter, const IID& iid, void** ppv);
  17. // IUnknown
  18. STDMETHOD(QueryInterface)(const IID &iid, void **ppv);
  19. STDMETHOD_(ULONG, AddRef)();
  20. STDMETHOD_(ULONG, Release)();
  21. // IActiveScript
  22. HRESULT STDMETHODCALLTYPE SetScriptSite(
  23. /* [in] */ IActiveScriptSite __RPC_FAR *pass);
  24. HRESULT STDMETHODCALLTYPE GetScriptSite(
  25. /* [in] */ REFIID riid,
  26. /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject) { return E_NOTIMPL; }
  27. HRESULT STDMETHODCALLTYPE SetScriptState(
  28. /* [in] */ SCRIPTSTATE ss) { return S_OK; }
  29. HRESULT STDMETHODCALLTYPE GetScriptState(
  30. /* [out] */ SCRIPTSTATE __RPC_FAR *pssState) { return E_NOTIMPL; }
  31. HRESULT STDMETHODCALLTYPE Close(void);
  32. HRESULT STDMETHODCALLTYPE AddNamedItem(
  33. /* [in] */ LPCOLESTR pstrName,
  34. /* [in] */ DWORD dwFlags);
  35. HRESULT STDMETHODCALLTYPE AddTypeLib(
  36. /* [in] */ REFGUID rguidTypeLib,
  37. /* [in] */ DWORD dwMajor,
  38. /* [in] */ DWORD dwMinor,
  39. /* [in] */ DWORD dwFlags) { return E_NOTIMPL; }
  40. HRESULT STDMETHODCALLTYPE GetScriptDispatch(
  41. /* [in] */ LPCOLESTR pstrItemName,
  42. /* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppdisp);
  43. HRESULT STDMETHODCALLTYPE GetCurrentScriptThreadID(
  44. /* [out] */ SCRIPTTHREADID __RPC_FAR *pstidThread) { return E_NOTIMPL; }
  45. HRESULT STDMETHODCALLTYPE GetScriptThreadID(
  46. /* [in] */ DWORD dwWin32ThreadId,
  47. /* [out] */ SCRIPTTHREADID __RPC_FAR *pstidThread) { return E_NOTIMPL; }
  48. HRESULT STDMETHODCALLTYPE GetScriptThreadState(
  49. /* [in] */ SCRIPTTHREADID stidThread,
  50. /* [out] */ SCRIPTTHREADSTATE __RPC_FAR *pstsState) { return E_NOTIMPL; }
  51. HRESULT STDMETHODCALLTYPE InterruptScriptThread(
  52. /* [in] */ SCRIPTTHREADID stidThread,
  53. /* [in] */ const EXCEPINFO __RPC_FAR *pexcepinfo,
  54. /* [in] */ DWORD dwFlags) { return E_NOTIMPL; }
  55. HRESULT STDMETHODCALLTYPE Clone(
  56. /* [out] */ IActiveScript __RPC_FAR *__RPC_FAR *ppscript) { return E_NOTIMPL; }
  57. // IActiveScriptParse
  58. HRESULT STDMETHODCALLTYPE InitNew(void) { return S_OK; }
  59. HRESULT STDMETHODCALLTYPE AddScriptlet(
  60. /* [in] */ LPCOLESTR pstrDefaultName,
  61. /* [in] */ LPCOLESTR pstrCode,
  62. /* [in] */ LPCOLESTR pstrItemName,
  63. /* [in] */ LPCOLESTR pstrSubItemName,
  64. /* [in] */ LPCOLESTR pstrEventName,
  65. /* [in] */ LPCOLESTR pstrDelimiter,
  66. /* [in] */ DWORD_PTR dwSourceContextCookie,
  67. /* [in] */ ULONG ulStartingLineNumber,
  68. /* [in] */ DWORD dwFlags,
  69. /* [out] */ BSTR __RPC_FAR *pbstrName,
  70. /* [out] */ EXCEPINFO __RPC_FAR *pexcepinfo) { return E_NOTIMPL; }
  71. HRESULT STDMETHODCALLTYPE ParseScriptText(
  72. /* [in] */ LPCOLESTR pstrCode,
  73. /* [in] */ LPCOLESTR pstrItemName,
  74. /* [in] */ IUnknown __RPC_FAR *punkContext,
  75. /* [in] */ LPCOLESTR pstrDelimiter,
  76. /* [in] */ DWORD_PTR dwSourceContextCookie,
  77. /* [in] */ ULONG ulStartingLineNumber,
  78. /* [in] */ DWORD dwFlags,
  79. /* [out] */ VARIANT __RPC_FAR *pvarResult,
  80. /* [out] */ EXCEPINFO __RPC_FAR *pexcepinfo);
  81. private:
  82. // Methods
  83. CAudioVBScriptEngine();
  84. // Data
  85. long m_cRef;
  86. SmartRef::ComPtr<IActiveScriptSite> m_scomActiveScriptSite;
  87. SmartRef::ComPtr<EngineDispatch> m_scomEngineDispatch;
  88. Script m_script;
  89. SmartRef::ComPtr<IDispatch> m_scomGlobalDispatch;
  90. };