ReactOS  0.4.15-dev-4853-g3a72a52
jscript.c File Reference
#include <initguid.h>
#include <ole2.h>
#include <activscp.h>
#include <objsafe.h>
#include <dispex.h>
#include "wine/test.h"
Include dependency graph for jscript.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 
#define IActiveScriptParse_QueryInterface   IActiveScriptParse32_QueryInterface
 
#define IActiveScriptParse_Release   IActiveScriptParse32_Release
 
#define IActiveScriptParse_InitNew   IActiveScriptParse32_InitNew
 
#define IActiveScriptParse_ParseScriptText   IActiveScriptParse32_ParseScriptText
 
#define DEFINE_EXPECT(func)   static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
 
#define SET_EXPECT(func)   expect_ ## func = TRUE
 
#define CHECK_EXPECT2(func)
 
#define CHECK_EXPECT(func)
 
#define CHECK_CALLED(func)
 
#define test_state(s, ss)   _test_state(__LINE__,s,ss)
 

Functions

 DEFINE_GUID (GUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
 
 DEFINE_EXPECT (GetLCID)
 
 DEFINE_EXPECT (OnStateChange_UNINITIALIZED)
 
 DEFINE_EXPECT (OnStateChange_STARTED)
 
 DEFINE_EXPECT (OnStateChange_CONNECTED)
 
 DEFINE_EXPECT (OnStateChange_DISCONNECTED)
 
 DEFINE_EXPECT (OnStateChange_CLOSED)
 
 DEFINE_EXPECT (OnStateChange_INITIALIZED)
 
 DEFINE_EXPECT (OnEnterScript)
 
 DEFINE_EXPECT (OnLeaveScript)
 
static BSTR a2bstr (const char *str)
 
static void _test_state (unsigned line, IActiveScript *script, SCRIPTSTATE exstate)
 
static HRESULT WINAPI ActiveScriptSite_QueryInterface (IActiveScriptSite *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ActiveScriptSite_AddRef (IActiveScriptSite *iface)
 
static ULONG WINAPI ActiveScriptSite_Release (IActiveScriptSite *iface)
 
static HRESULT WINAPI ActiveScriptSite_GetLCID (IActiveScriptSite *iface, LCID *plcid)
 
static HRESULT WINAPI ActiveScriptSite_GetItemInfo (IActiveScriptSite *iface, LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti)
 
static HRESULT WINAPI ActiveScriptSite_GetDocVersionString (IActiveScriptSite *iface, BSTR *pbstrVersion)
 
static HRESULT WINAPI ActiveScriptSite_OnScriptTerminate (IActiveScriptSite *iface, const VARIANT *pvarResult, const EXCEPINFO *pexcepinfo)
 
static HRESULT WINAPI ActiveScriptSite_OnStateChange (IActiveScriptSite *iface, SCRIPTSTATE ssScriptState)
 
static HRESULT WINAPI ActiveScriptSite_OnScriptError (IActiveScriptSite *iface, IActiveScriptError *pscripterror)
 
static HRESULT WINAPI ActiveScriptSite_OnEnterScript (IActiveScriptSite *iface)
 
static HRESULT WINAPI ActiveScriptSite_OnLeaveScript (IActiveScriptSite *iface)
 
static void test_script_dispatch (IDispatchEx *dispex)
 
static IDispatchEx * get_script_dispatch (IActiveScript *script)
 
static void test_no_script_dispatch (IActiveScript *script)
 
static void test_safety (IUnknown *unk)
 
static HRESULT set_script_prop (IActiveScript *engine, DWORD property, VARIANT *val)
 
static void test_invoke_versioning (IActiveScript *script)
 
static IActiveScriptcreate_jscript (void)
 
static void test_jscript (void)
 
static void test_jscript2 (void)
 
static void test_jscript_uninitializing (void)
 
static void test_aggregation (void)
 
static BOOL check_jscript (void)
 
 START_TEST (jscript)
 

Variables

static const CLSID CLSID_JScript
 
static const CLSID CLSID_JScriptEncode
 
static const CLSIDengine_clsid = &CLSID_JScript
 
static const IActiveScriptSiteVtbl ActiveScriptSiteVtbl
 
static IActiveScriptSite ActiveScriptSite = { &ActiveScriptSiteVtbl }
 

Macro Definition Documentation

◆ CHECK_CALLED

#define CHECK_CALLED (   func)
Value:
do { \
ok(called_ ## func, "expected " #func "\n"); \
expect_ ## func = called_ ## func = FALSE; \
}while(0)
GLenum func
Definition: glext.h:6028
#define FALSE
Definition: types.h:117

Definition at line 71 of file jscript.c.

◆ CHECK_EXPECT

#define CHECK_EXPECT (   func)
Value:
do { \
CHECK_EXPECT2(func); \
expect_ ## func = FALSE; \
}while(0)
GLenum func
Definition: glext.h:6028
#define FALSE
Definition: types.h:117

Definition at line 65 of file jscript.c.

◆ CHECK_EXPECT2

#define CHECK_EXPECT2 (   func)
Value:
do { \
ok(expect_ ##func, "unexpected call " #func "\n"); \
called_ ## func = TRUE; \
}while(0)
GLenum func
Definition: glext.h:6028
#define TRUE
Definition: types.h:120
#define expect_(expected, got, precision)
Definition: font.c:29

Definition at line 59 of file jscript.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file jscript.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 20 of file jscript.c.

◆ DEFINE_EXPECT

#define DEFINE_EXPECT (   func)    static BOOL expect_ ## func = FALSE, called_ ## func = FALSE

Definition at line 53 of file jscript.c.

◆ IActiveScriptParse_InitNew

#define IActiveScriptParse_InitNew   IActiveScriptParse32_InitNew

Definition at line 41 of file jscript.c.

◆ IActiveScriptParse_ParseScriptText

#define IActiveScriptParse_ParseScriptText   IActiveScriptParse32_ParseScriptText

Definition at line 42 of file jscript.c.

◆ IActiveScriptParse_QueryInterface

#define IActiveScriptParse_QueryInterface   IActiveScriptParse32_QueryInterface

Definition at line 39 of file jscript.c.

◆ IActiveScriptParse_Release

#define IActiveScriptParse_Release   IActiveScriptParse32_Release

Definition at line 40 of file jscript.c.

◆ SET_EXPECT

#define SET_EXPECT (   func)    expect_ ## func = TRUE

Definition at line 56 of file jscript.c.

◆ test_state

#define test_state (   s,
  ss 
)    _test_state(__LINE__,s,ss)

Definition at line 101 of file jscript.c.

Function Documentation

◆ _test_state()

static void _test_state ( unsigned  line,
IActiveScript script,
SCRIPTSTATE  exstate 
)
static

Definition at line 102 of file jscript.c.

103 {
104  SCRIPTSTATE state = -1;
105  HRESULT hres;
106 
107  hres = IActiveScript_GetScriptState(script, &state);
108  ok_(__FILE__,line) (hres == S_OK, "GetScriptState failed: %08x\n", hres);
109  ok_(__FILE__,line) (state == exstate, "state=%d, expected %d\n", state, exstate);
110 }
script
Definition: msipriv.h:382
Definition: parser.c:48
enum tagSCRIPTSTATE SCRIPTSTATE
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
static int state
Definition: maze.c:121
#define S_OK
Definition: intsafe.h:52
#define ok_(x1, x2)
Definition: atltest.h:61

◆ a2bstr()

static BSTR a2bstr ( const char str)
static

Definition at line 89 of file jscript.c.

90 {
91  BSTR ret;
92  int len;
93 
94  len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
97 
98  return ret;
99 }
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
#define CP_ACP
Definition: compat.h:109
OLECHAR * BSTR
Definition: compat.h:2152
const WCHAR * str
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110

Referenced by test_script_dispatch().

◆ ActiveScriptSite_AddRef()

static ULONG WINAPI ActiveScriptSite_AddRef ( IActiveScriptSite iface)
static

Definition at line 127 of file jscript.c.

128 {
129  return 2;
130 }

◆ ActiveScriptSite_GetDocVersionString()

static HRESULT WINAPI ActiveScriptSite_GetDocVersionString ( IActiveScriptSite iface,
BSTR pbstrVersion 
)
static

Definition at line 150 of file jscript.c.

151 {
152  ok(0, "unexpected call\n");
153  return E_NOTIMPL;
154 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_GetItemInfo()

static HRESULT WINAPI ActiveScriptSite_GetItemInfo ( IActiveScriptSite iface,
LPCOLESTR  pstrName,
DWORD  dwReturnMask,
IUnknown **  ppiunkItem,
ITypeInfo **  ppti 
)
static

Definition at line 143 of file jscript.c.

145 {
146  ok(0, "unexpected call\n");
147  return E_NOTIMPL;
148 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_GetLCID()

static HRESULT WINAPI ActiveScriptSite_GetLCID ( IActiveScriptSite iface,
LCID plcid 
)
static

Definition at line 137 of file jscript.c.

138 {
139  CHECK_EXPECT(GetLCID);
140  return E_NOTIMPL;
141 }
#define CHECK_EXPECT(func)
Definition: jscript.c:65
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_OnEnterScript()

static HRESULT WINAPI ActiveScriptSite_OnEnterScript ( IActiveScriptSite iface)
static

Definition at line 197 of file jscript.c.

198 {
199  CHECK_EXPECT(OnEnterScript);
200  return S_OK;
201 }
#define CHECK_EXPECT(func)
Definition: jscript.c:65
#define S_OK
Definition: intsafe.h:52

◆ ActiveScriptSite_OnLeaveScript()

static HRESULT WINAPI ActiveScriptSite_OnLeaveScript ( IActiveScriptSite iface)
static

Definition at line 203 of file jscript.c.

204 {
205  CHECK_EXPECT(OnLeaveScript);
206  return S_OK;
207 }
#define CHECK_EXPECT(func)
Definition: jscript.c:65
#define S_OK
Definition: intsafe.h:52

◆ ActiveScriptSite_OnScriptError()

static HRESULT WINAPI ActiveScriptSite_OnScriptError ( IActiveScriptSite iface,
IActiveScriptError pscripterror 
)
static

Definition at line 191 of file jscript.c.

192 {
193  ok(0, "unexpected call\n");
194  return E_NOTIMPL;
195 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_OnScriptTerminate()

static HRESULT WINAPI ActiveScriptSite_OnScriptTerminate ( IActiveScriptSite iface,
const VARIANT pvarResult,
const EXCEPINFO *  pexcepinfo 
)
static

Definition at line 156 of file jscript.c.

158 {
159  ok(0, "unexpected call\n");
160  return E_NOTIMPL;
161 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_OnStateChange()

static HRESULT WINAPI ActiveScriptSite_OnStateChange ( IActiveScriptSite iface,
SCRIPTSTATE  ssScriptState 
)
static

Definition at line 163 of file jscript.c.

164 {
165  switch(ssScriptState) {
167  CHECK_EXPECT(OnStateChange_UNINITIALIZED);
168  return S_OK;
169  case SCRIPTSTATE_STARTED:
170  CHECK_EXPECT(OnStateChange_STARTED);
171  return S_OK;
173  CHECK_EXPECT(OnStateChange_CONNECTED);
174  return S_OK;
176  CHECK_EXPECT(OnStateChange_DISCONNECTED);
177  return S_OK;
178  case SCRIPTSTATE_CLOSED:
179  CHECK_EXPECT(OnStateChange_CLOSED);
180  return S_OK;
182  CHECK_EXPECT(OnStateChange_INITIALIZED);
183  return S_OK;
184  default:
185  ok(0, "unexpected call %d\n", ssScriptState);
186  }
187 
188  return E_NOTIMPL;
189 }
#define CHECK_EXPECT(func)
Definition: jscript.c:65
#define S_OK
Definition: intsafe.h:52
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_QueryInterface()

static HRESULT WINAPI ActiveScriptSite_QueryInterface ( IActiveScriptSite iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 112 of file jscript.c.

113 {
114  *ppv = NULL;
115 
117  *ppv = iface;
118  else if(IsEqualGUID(&IID_IActiveScriptSite, riid))
119  *ppv = iface;
120  else
121  return E_NOINTERFACE;
122 
123  IUnknown_AddRef((IUnknown*)*ppv);
124  return S_OK;
125 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ ActiveScriptSite_Release()

static ULONG WINAPI ActiveScriptSite_Release ( IActiveScriptSite iface)
static

Definition at line 132 of file jscript.c.

133 {
134  return 1;
135 }

◆ check_jscript()

static BOOL check_jscript ( void  )
static

Definition at line 667 of file jscript.c.

668 {
669  IActiveScriptProperty *script_prop;
670  HRESULT hres;
671 
672  hres = CoCreateInstance(&CLSID_JScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
673  &IID_IActiveScriptProperty, (void**)&script_prop);
674  if(SUCCEEDED(hres))
675  IActiveScriptProperty_Release(script_prop);
676 
677  return hres == S_OK;
678 }
if SUCCEEDED(hr)
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112
static const CLSID CLSID_JScript
Definition: jscript.c:48

Referenced by START_TEST().

◆ create_jscript()

static IActiveScript* create_jscript ( void  )
static

Definition at line 427 of file jscript.c.

428 {
430  HRESULT hres;
431 
432  hres = CoCreateInstance(engine_clsid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
433  &IID_IActiveScript, (void**)&ret);
434  ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
435 
436  return ret;
437 }
static const CLSID * engine_clsid
Definition: jscript.c:87
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
int ret
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:52
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112

Referenced by test_jscript(), test_jscript2(), and test_jscript_uninitializing().

◆ DEFINE_EXPECT() [1/9]

DEFINE_EXPECT ( GetLCID  )

◆ DEFINE_EXPECT() [2/9]

DEFINE_EXPECT ( OnStateChange_UNINITIALIZED  )

◆ DEFINE_EXPECT() [3/9]

DEFINE_EXPECT ( OnStateChange_STARTED  )

◆ DEFINE_EXPECT() [4/9]

DEFINE_EXPECT ( OnStateChange_CONNECTED  )

◆ DEFINE_EXPECT() [5/9]

DEFINE_EXPECT ( OnStateChange_DISCONNECTED  )

◆ DEFINE_EXPECT() [6/9]

DEFINE_EXPECT ( OnStateChange_CLOSED  )

◆ DEFINE_EXPECT() [7/9]

DEFINE_EXPECT ( OnStateChange_INITIALIZED  )

◆ DEFINE_EXPECT() [8/9]

DEFINE_EXPECT ( OnEnterScript  )

◆ DEFINE_EXPECT() [9/9]

DEFINE_EXPECT ( OnLeaveScript  )

◆ DEFINE_GUID()

DEFINE_GUID ( GUID_NULL  ,
,
,
,
,
,
,
,
,
,
,
 
)

◆ get_script_dispatch()

static IDispatchEx* get_script_dispatch ( IActiveScript script)
static

Definition at line 264 of file jscript.c.

265 {
266  IDispatchEx *dispex;
267  IDispatch *disp;
268  HRESULT hres;
269 
270  disp = (void*)0xdeadbeef;
271  hres = IActiveScript_GetScriptDispatch(script, NULL, &disp);
272  ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres);
273 
274  hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
275  IDispatch_Release(disp);
276  ok(hres == S_OK, "Could not get IDispatch iface: %08x\n", hres);
277  return dispex;
278 }
script
Definition: msipriv.h:382
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
#define S_OK
Definition: intsafe.h:52
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112

Referenced by test_jscript(), and test_jscript_uninitializing().

◆ set_script_prop()

static HRESULT set_script_prop ( IActiveScript engine,
DWORD  property,
VARIANT val 
)
static

Definition at line 382 of file jscript.c.

383 {
384  IActiveScriptProperty *script_prop;
385  HRESULT hres;
386 
387  hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptProperty,
388  (void**)&script_prop);
389  ok(hres == S_OK, "Could not get IActiveScriptProperty: %08x\n", hres);
390  if(FAILED(hres))
391  return hres;
392 
393  hres = IActiveScriptProperty_SetProperty(script_prop, property, NULL, val);
394  IActiveScriptProperty_Release(script_prop);
395  return hres;
396 }
GLuint GLfloat * val
Definition: glext.h:7180
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
#define S_OK
Definition: intsafe.h:52
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112

Referenced by test_invoke_versioning().

◆ START_TEST()

START_TEST ( jscript  )

Definition at line 680 of file jscript.c.

681 {
683 
684  if(check_jscript()) {
685  trace("Testing JScript object...\n");
686  test_jscript();
687  test_jscript2();
690 
691  trace("Testing JScriptEncode object...\n");
693  test_jscript();
694  }else {
695  win_skip("Broken engine, probably too old\n");
696  }
697 
698  CoUninitialize();
699 }
static void test_aggregation(void)
Definition: jscript.c:655
static const CLSID * engine_clsid
Definition: jscript.c:87
static void test_jscript2(void)
Definition: jscript.c:506
static void test_jscript_uninitializing(void)
Definition: jscript.c:560
#define trace
Definition: atltest.h:70
static void test_jscript(void)
Definition: jscript.c:439
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define NULL
Definition: types.h:112
static const CLSID CLSID_JScriptEncode
Definition: jscript.c:50
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
#define win_skip
Definition: test.h:160
static BOOL check_jscript(void)
Definition: jscript.c:667

◆ test_aggregation()

static void test_aggregation ( void  )
static

Definition at line 655 of file jscript.c.

656 {
657  IUnknown *unk = (IUnknown*)0xdeadbeef;
658  HRESULT hres;
659 
660  hres = CoCreateInstance(&CLSID_JScript, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
661  &IID_IUnknown, (void**)&unk);
663  "CoCreateInstance failed: %08x, expected CLASS_E_NOAGGREGATION\n", hres);
664  ok(!unk || broken(unk != NULL), "unk = %p\n", unk);
665 }
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
const GUID IID_IUnknown
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define broken(x)
Definition: _sntprintf.h:21
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
static const CLSID CLSID_JScript
Definition: jscript.c:48

Referenced by START_TEST().

◆ test_invoke_versioning()

static void test_invoke_versioning ( IActiveScript script)
static

Definition at line 398 of file jscript.c.

399 {
400  VARIANT v;
401  HRESULT hres;
402 
403  V_VT(&v) = VT_NULL;
404  hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v);
405  if(hres == E_NOTIMPL) {
406  win_skip("SCRIPTPROP_INVOKESTRING not supported\n");
407  return;
408  }
409  ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres);
410 
411  V_VT(&v) = VT_I2;
412  V_I2(&v) = 0;
413  hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v);
414  ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres);
415 
416  V_VT(&v) = VT_I4;
417  V_I4(&v) = 16;
418  hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v);
419  ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres);
420 
421  V_VT(&v) = VT_I4;
422  V_I4(&v) = 2;
423  hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v);
424  ok(hres == S_OK, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres);
425 }
Definition: compat.h:2157
#define V_I2(A)
Definition: oleauto.h:245
#define V_I4(A)
Definition: oleauto.h:247
#define E_INVALIDARG
Definition: ddrawi.h:101
script
Definition: msipriv.h:382
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:52
const GLdouble * v
Definition: gl.h:2040
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT set_script_prop(IActiveScript *engine, DWORD property, VARIANT *val)
Definition: jscript.c:382
#define win_skip
Definition: test.h:160
Definition: compat.h:2156

Referenced by test_jscript().

◆ test_jscript()

static void test_jscript ( void  )
static

Definition at line 439 of file jscript.c.

440 {
441  IActiveScriptParse *parse;
443  IDispatchEx *dispex;
444  ULONG ref;
445  HRESULT hres;
446 
448 
449  hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse);
450  ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
451 
455 
457  ok(hres == S_OK, "InitNew failed: %08x\n", hres);
458 
460  ok(hres == E_UNEXPECTED, "InitNew failed: %08x, expected E_UNEXPECTED\n", hres);
461 
462  hres = IActiveScript_SetScriptSite(script, NULL);
463  ok(hres == E_POINTER, "SetScriptSite failed: %08x, expected E_POINTER\n", hres);
464 
467 
468  SET_EXPECT(GetLCID);
469  SET_EXPECT(OnStateChange_INITIALIZED);
470  hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
471  ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
472  CHECK_CALLED(GetLCID);
473  CHECK_CALLED(OnStateChange_INITIALIZED);
474 
476 
477  hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
478  ok(hres == E_UNEXPECTED, "SetScriptSite failed: %08x, expected E_UNEXPECTED\n", hres);
479 
480  dispex = get_script_dispatch(script);
481  test_script_dispatch(dispex);
482 
483  SET_EXPECT(OnStateChange_STARTED);
484  hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_STARTED);
485  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
486  CHECK_CALLED(OnStateChange_STARTED);
487 
489 
490  SET_EXPECT(OnStateChange_CLOSED);
491  hres = IActiveScript_Close(script);
492  ok(hres == S_OK, "Close failed: %08x\n", hres);
493  CHECK_CALLED(OnStateChange_CLOSED);
494 
497  test_script_dispatch(dispex);
498  IDispatchEx_Release(dispex);
499 
501 
502  ref = IActiveScript_Release(script);
503  ok(!ref, "ref = %d\n", ref);
504 }
#define IActiveScriptParse_InitNew
Definition: jscript.c:41
static void test_script_dispatch(IDispatchEx *dispex)
Definition: jscript.c:225
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
script
Definition: msipriv.h:382
#define IActiveScriptParse_Release
Definition: jscript.c:40
#define CHECK_CALLED(func)
Definition: jscript.c:71
static IDispatchEx * get_script_dispatch(IActiveScript *script)
Definition: jscript.c:264
static IActiveScriptSite ActiveScriptSite
Definition: jscript.c:223
HRESULT hres
Definition: protocol.c:465
static IActiveScript * create_jscript(void)
Definition: jscript.c:427
LONG HRESULT
Definition: typedefs.h:79
static void test_safety(IUnknown *unk)
Definition: jscript.c:291
#define test_state(s, ss)
Definition: jscript.c:101
#define SET_EXPECT(func)
Definition: jscript.c:56
static void test_invoke_versioning(IActiveScript *script)
Definition: jscript.c:398
#define S_OK
Definition: intsafe.h:52
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define E_UNEXPECTED
Definition: winerror.h:2456
static void test_no_script_dispatch(IActiveScript *script)
Definition: jscript.c:280
unsigned int ULONG
Definition: retypes.h:1
#define E_POINTER
Definition: winerror.h:2365

Referenced by START_TEST().

◆ test_jscript2()

static void test_jscript2 ( void  )
static

Definition at line 506 of file jscript.c.

507 {
508  IActiveScriptParse *parse;
510  ULONG ref;
511  HRESULT hres;
512 
514 
515  hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse);
516  ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
517 
519 
520  SET_EXPECT(GetLCID);
521  hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
522  ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
523  CHECK_CALLED(GetLCID);
524 
526 
527  SET_EXPECT(OnStateChange_INITIALIZED);
529  ok(hres == S_OK, "InitNew failed: %08x\n", hres);
530  CHECK_CALLED(OnStateChange_INITIALIZED);
531 
533  ok(hres == E_UNEXPECTED, "InitNew failed: %08x, expected E_UNEXPECTED\n", hres);
534 
535  SET_EXPECT(OnStateChange_CONNECTED);
536  hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED);
537  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hres);
538  CHECK_CALLED(OnStateChange_CONNECTED);
539 
541 
542  SET_EXPECT(OnStateChange_DISCONNECTED);
543  SET_EXPECT(OnStateChange_INITIALIZED);
544  SET_EXPECT(OnStateChange_CLOSED);
545  hres = IActiveScript_Close(script);
546  ok(hres == S_OK, "Close failed: %08x\n", hres);
547  CHECK_CALLED(OnStateChange_DISCONNECTED);
548  CHECK_CALLED(OnStateChange_INITIALIZED);
549  CHECK_CALLED(OnStateChange_CLOSED);
550 
553 
555 
556  ref = IActiveScript_Release(script);
557  ok(!ref, "ref = %d\n", ref);
558 }
#define IActiveScriptParse_InitNew
Definition: jscript.c:41
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
script
Definition: msipriv.h:382
#define IActiveScriptParse_Release
Definition: jscript.c:40
#define CHECK_CALLED(func)
Definition: jscript.c:71
static IActiveScriptSite ActiveScriptSite
Definition: jscript.c:223
HRESULT hres
Definition: protocol.c:465
static IActiveScript * create_jscript(void)
Definition: jscript.c:427
LONG HRESULT
Definition: typedefs.h:79
#define test_state(s, ss)
Definition: jscript.c:101
#define SET_EXPECT(func)
Definition: jscript.c:56
#define S_OK
Definition: intsafe.h:52
#define ok(value,...)
Definition: atltest.h:57
#define E_UNEXPECTED
Definition: winerror.h:2456
static void test_no_script_dispatch(IActiveScript *script)
Definition: jscript.c:280
unsigned int ULONG
Definition: retypes.h:1

Referenced by START_TEST().

◆ test_jscript_uninitializing()

static void test_jscript_uninitializing ( void  )
static

Definition at line 560 of file jscript.c.

561 {
562  IActiveScriptParse *parse;
564  IDispatchEx *dispex;
565  ULONG ref;
566  HRESULT hres;
567 
568  static const WCHAR script_textW[] =
569  {'f','u','n','c','t','i','o','n',' ','f','(',')',' ','{','}',0};
570 
572 
573  hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse);
574  ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
575 
577 
579  ok(hres == S_OK, "InitNew failed: %08x\n", hres);
580 
581  SET_EXPECT(GetLCID);
582  SET_EXPECT(OnStateChange_INITIALIZED);
583  hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
584  ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
585  CHECK_CALLED(GetLCID);
586  CHECK_CALLED(OnStateChange_INITIALIZED);
587 
589 
590  hres = IActiveScriptParse_ParseScriptText(parse, script_textW, NULL, NULL, NULL, 0, 1, 0x42, NULL, NULL);
591  ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
592 
593  hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
594  ok(hres == E_UNEXPECTED, "SetScriptSite failed: %08x, expected E_UNEXPECTED\n", hres);
595 
596  SET_EXPECT(OnStateChange_UNINITIALIZED);
597  hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
598  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hres);
599  CHECK_CALLED(OnStateChange_UNINITIALIZED);
600 
602 
603  hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
604  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hres);
605 
606  SET_EXPECT(GetLCID);
607  SET_EXPECT(OnStateChange_INITIALIZED);
608  hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
609  ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
610  CHECK_CALLED(GetLCID);
611  CHECK_CALLED(OnStateChange_INITIALIZED);
612 
613  SET_EXPECT(OnStateChange_CONNECTED);
614  SET_EXPECT(OnEnterScript);
615  SET_EXPECT(OnLeaveScript);
616  hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED);
617  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hres);
618  CHECK_CALLED(OnStateChange_CONNECTED);
619  CHECK_CALLED(OnEnterScript);
620  CHECK_CALLED(OnLeaveScript);
621 
623 
624  dispex = get_script_dispatch(script);
625  ok(dispex != NULL, "dispex == NULL\n");
626  IDispatchEx_Release(dispex);
627 
628  SET_EXPECT(OnStateChange_DISCONNECTED);
629  SET_EXPECT(OnStateChange_INITIALIZED);
630  SET_EXPECT(OnStateChange_UNINITIALIZED);
631  hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
632  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hres);
633  CHECK_CALLED(OnStateChange_DISCONNECTED);
634  CHECK_CALLED(OnStateChange_INITIALIZED);
635  CHECK_CALLED(OnStateChange_UNINITIALIZED);
636 
638 
639  hres = IActiveScript_Close(script);
640  ok(hres == S_OK, "Close failed: %08x\n", hres);
641 
643 
644  hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
645  ok(hres == E_UNEXPECTED, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x, expected E_UNEXPECTED\n", hres);
646 
648 
650 
651  ref = IActiveScript_Release(script);
652  ok(!ref, "ref = %d\n", ref);
653 }
#define IActiveScriptParse_InitNew
Definition: jscript.c:41
Definition: send.c:48
#define IActiveScriptParse_ParseScriptText
Definition: jscript.c:42
GLenum GLint ref
Definition: glext.h:6028
script
Definition: msipriv.h:382
#define IActiveScriptParse_Release
Definition: jscript.c:40
#define CHECK_CALLED(func)
Definition: jscript.c:71
static IDispatchEx * get_script_dispatch(IActiveScript *script)
Definition: jscript.c:264
static IActiveScriptSite ActiveScriptSite
Definition: jscript.c:223
HRESULT hres
Definition: protocol.c:465
static IActiveScript * create_jscript(void)
Definition: jscript.c:427
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define test_state(s, ss)
Definition: jscript.c:101
#define SET_EXPECT(func)
Definition: jscript.c:56
#define S_OK
Definition: intsafe.h:52
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define E_UNEXPECTED
Definition: winerror.h:2456
unsigned int ULONG
Definition: retypes.h:1

Referenced by START_TEST().

◆ test_no_script_dispatch()

static void test_no_script_dispatch ( IActiveScript script)
static

Definition at line 280 of file jscript.c.

281 {
282  IDispatch *disp;
283  HRESULT hres;
284 
285  disp = (void*)0xdeadbeef;
286  hres = IActiveScript_GetScriptDispatch(script, NULL, &disp);
287  ok(hres == E_UNEXPECTED, "hres = %08x, expected E_UNEXPECTED\n", hres);
288  ok(!disp, "disp != NULL\n");
289 }
script
Definition: msipriv.h:382
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define E_UNEXPECTED
Definition: winerror.h:2456

Referenced by test_jscript(), and test_jscript2().

◆ test_safety()

static void test_safety ( IUnknown unk)
static

Definition at line 291 of file jscript.c.

292 {
293  IObjectSafety *safety;
294  DWORD supported, enabled;
295  HRESULT hres;
296 
297  hres = IUnknown_QueryInterface(unk, &IID_IObjectSafety, (void**)&safety);
298  ok(hres == S_OK, "Could not get IObjectSafety: %08x\n", hres);
299  if(FAILED(hres))
300  return;
301 
302  hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_NULL, &supported, NULL);
303  ok(hres == E_POINTER, "GetInterfaceSafetyOptions failed: %08x, expected E_POINTER\n", hres);
304  hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_NULL, NULL, &enabled);
305  ok(hres == E_POINTER, "GetInterfaceSafetyOptions failed: %08x, expected E_POINTER\n", hres);
306 
307  supported = enabled = 0xdeadbeef;
308  hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_NULL, &supported, &enabled);
309  ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres);
310  ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
311  "supported=%x\n", supported);
312  ok(enabled == INTERFACE_USES_DISPEX, "enabled=%x\n", enabled);
313 
314  supported = enabled = 0xdeadbeef;
315  hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScript, &supported, &enabled);
316  ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres);
317  ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
318  "supported=%x\n", supported);
319  ok(enabled == INTERFACE_USES_DISPEX, "enabled=%x\n", enabled);
320 
321  supported = enabled = 0xdeadbeef;
322  hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled);
323  ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres);
324  ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
325  "supported=%x\n", supported);
326  ok(enabled == INTERFACE_USES_DISPEX, "enabled=%x\n", enabled);
327 
328  hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse,
329  INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER
330  |INTERFACESAFE_FOR_UNTRUSTED_CALLER,
331  INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER);
332  ok(hres == E_FAIL, "SetInterfaceSafetyOptions failed: %08x, expected E_FAIL\n", hres);
333 
334  hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse,
335  INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER,
336  INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER);
337  ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hres);
338 
339  supported = enabled = 0xdeadbeef;
340  hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled);
341  ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres);
342  ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
343  "supported=%x\n", supported);
344  ok(enabled == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
345  "enabled=%x\n", enabled);
346 
347  hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, INTERFACESAFE_FOR_UNTRUSTED_DATA, 0);
348  ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hres);
349 
350  supported = enabled = 0xdeadbeef;
351  hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled);
352  ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres);
353  ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
354  "supported=%x\n", supported);
355  ok(enabled == (INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER), "enabled=%x\n", enabled);
356 
357  hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse,
358  INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER, 0);
359  ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hres);
360 
361  supported = enabled = 0xdeadbeef;
362  hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled);
363  ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres);
364  ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
365  "supported=%x\n", supported);
366  ok(enabled == INTERFACE_USES_DISPEX, "enabled=%x\n", enabled);
367 
368  hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse,
369  INTERFACE_USES_DISPEX, 0);
370  ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hres);
371 
372  supported = enabled = 0xdeadbeef;
373  hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled);
374  ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres);
375  ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
376  "supported=%x\n", supported);
377  ok(enabled == INTERFACE_USES_DISPEX, "enabled=%x\n", enabled);
378 
379  IObjectSafety_Release(safety);
380 }
#define E_FAIL
Definition: ddrawi.h:102
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IID_NULL
Definition: guiddef.h:98
#define S_OK
Definition: intsafe.h:52
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define E_POINTER
Definition: winerror.h:2365

Referenced by test_jscript().

◆ test_script_dispatch()

static void test_script_dispatch ( IDispatchEx *  dispex)
static

Definition at line 225 of file jscript.c.

226 {
227  DISPPARAMS dp = {NULL,NULL,0,0};
228  EXCEPINFO ei;
229  BSTR str;
230  DISPID id;
231  VARIANT v;
232  HRESULT hres;
233 
234  str = a2bstr("ActiveXObject");
235  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id);
237  ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
238 
239  str = a2bstr("Math");
240  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id);
242  ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
243 
244  memset(&ei, 0, sizeof(ei));
245  hres = IDispatchEx_InvokeEx(dispex, id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
246  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
247  ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
248  ok(V_DISPATCH(&v) != NULL, "V_DISPATCH(v) = NULL\n");
249  VariantClear(&v);
250 
251  str = a2bstr("String");
252  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id);
254  ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
255 
256  memset(&ei, 0, sizeof(ei));
257  hres = IDispatchEx_InvokeEx(dispex, id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
258  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
259  ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
260  ok(V_DISPATCH(&v) != NULL, "V_DISPATCH(v) = NULL\n");
261  VariantClear(&v);
262 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
OLECHAR * BSTR
Definition: compat.h:2152
#define V_DISPATCH(A)
Definition: oleauto.h:239
const WCHAR * str
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
static BSTR a2bstr(const char *str)
Definition: jscript.c:89
struct stdole::EXCEPINFO EXCEPINFO
#define S_OK
Definition: intsafe.h:52
static VARIANTARG static DISPID
Definition: ordinal.c:49
const GLdouble * v
Definition: gl.h:2040
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS
GLenum GLuint id
Definition: glext.h:5579
#define memset(x, y, z)
Definition: compat.h:39

Referenced by test_jscript().

Variable Documentation

◆ ActiveScriptSite

IActiveScriptSite ActiveScriptSite = { &ActiveScriptSiteVtbl }
static

Definition at line 223 of file jscript.c.

Referenced by test_jscript(), test_jscript2(), and test_jscript_uninitializing().

◆ ActiveScriptSiteVtbl

const IActiveScriptSiteVtbl ActiveScriptSiteVtbl
static
Initial value:
= {
}
static HRESULT WINAPI ActiveScriptSite_QueryInterface(IActiveScriptSite *iface, REFIID riid, void **ppv)
Definition: jscript.c:112
static ULONG WINAPI ActiveScriptSite_Release(IActiveScriptSite *iface)
Definition: jscript.c:132
static HRESULT WINAPI ActiveScriptSite_GetDocVersionString(IActiveScriptSite *iface, BSTR *pbstrVersion)
Definition: jscript.c:150
static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti)
Definition: jscript.c:143
static ULONG WINAPI ActiveScriptSite_AddRef(IActiveScriptSite *iface)
Definition: jscript.c:127
static HRESULT WINAPI ActiveScriptSite_OnEnterScript(IActiveScriptSite *iface)
Definition: jscript.c:197
static HRESULT WINAPI ActiveScriptSite_OnLeaveScript(IActiveScriptSite *iface)
Definition: jscript.c:203
static HRESULT WINAPI ActiveScriptSite_OnStateChange(IActiveScriptSite *iface, SCRIPTSTATE ssScriptState)
Definition: jscript.c:163
static HRESULT WINAPI ActiveScriptSite_OnScriptError(IActiveScriptSite *iface, IActiveScriptError *pscripterror)
Definition: jscript.c:191
static HRESULT WINAPI ActiveScriptSite_OnScriptTerminate(IActiveScriptSite *iface, const VARIANT *pvarResult, const EXCEPINFO *pexcepinfo)
Definition: jscript.c:156
static HRESULT WINAPI ActiveScriptSite_GetLCID(IActiveScriptSite *iface, LCID *plcid)
Definition: jscript.c:137

Definition at line 209 of file jscript.c.

◆ CLSID_JScript

const CLSID CLSID_JScript
static
Initial value:
=
{0xf414c260,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}}

Definition at line 48 of file jscript.c.

Referenced by check_jscript(), and test_aggregation().

◆ CLSID_JScriptEncode

const CLSID CLSID_JScriptEncode
static
Initial value:
=
{0xf414c262,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}}

Definition at line 50 of file jscript.c.

Referenced by DllGetClassObject(), and START_TEST().

◆ engine_clsid

const CLSID* engine_clsid = &CLSID_JScript
static

Definition at line 87 of file jscript.c.

Referenced by create_jscript(), and START_TEST().