Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
3b2d5ecd
Commit
3b2d5ecd
authored
Oct 19, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added SetProperty(SCRIPTPROP_INVOKEVERSIONING) implementation.
parent
b16634c2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
1 deletion
+67
-1
jscript.c
dlls/jscript/jscript.c
+22
-1
jscript.h
dlls/jscript/jscript.h
+1
-0
jscript.c
dlls/jscript/tests/jscript.c
+44
-0
No files found.
dlls/jscript/jscript.c
View file @
3b2d5ecd
...
...
@@ -51,6 +51,7 @@ typedef struct {
script_ctx_t
*
ctx
;
LONG
thread_id
;
LCID
lcid
;
DWORD
version
;
IActiveScriptSite
*
site
;
...
...
@@ -659,6 +660,7 @@ static HRESULT WINAPI JScriptParse_InitNew(IActiveScriptParse *iface)
ctx
->
ref
=
1
;
ctx
->
state
=
SCRIPTSTATE_UNINITIALIZED
;
ctx
->
safeopt
=
This
->
safeopt
;
ctx
->
version
=
This
->
version
;
jsheap_init
(
&
ctx
->
tmp_heap
);
ctx
=
InterlockedCompareExchangePointer
((
void
**
)
&
This
->
ctx
,
ctx
,
NULL
);
...
...
@@ -822,8 +824,27 @@ static HRESULT WINAPI JScriptProperty_SetProperty(IActiveScriptProperty *iface,
VARIANT
*
pvarIndex
,
VARIANT
*
pvarValue
)
{
JScript
*
This
=
ACTSCPPROP_THIS
(
iface
);
FIXME
(
"(%p)->(%x %p %p)
\n
"
,
This
,
dwProperty
,
pvarIndex
,
pvarValue
);
TRACE
(
"(%p)->(%x %s %s)
\n
"
,
This
,
dwProperty
,
debugstr_variant
(
pvarIndex
),
debugstr_variant
(
pvarValue
));
if
(
pvarIndex
)
FIXME
(
"unsupported pvarIndex
\n
"
);
switch
(
dwProperty
)
{
case
SCRIPTPROP_INVOKEVERSIONING
:
if
(
V_VT
(
pvarValue
)
!=
VT_I4
||
V_I4
(
pvarValue
)
<
0
||
V_I4
(
pvarValue
)
>
15
)
{
WARN
(
"invalid value %s
\n
"
,
debugstr_variant
(
pvarValue
));
return
E_INVALIDARG
;
}
This
->
version
=
V_I4
(
pvarValue
);
break
;
default:
FIXME
(
"Unimplemented property %x
\n
"
,
dwProperty
);
return
E_NOTIMPL
;
}
return
S_OK
;
}
#undef ACTSCPPROP_THIS
...
...
dlls/jscript/jscript.h
View file @
3b2d5ecd
...
...
@@ -262,6 +262,7 @@ struct _script_ctx_t {
IActiveScriptSite
*
site
;
IInternetHostSecurityManager
*
secmgr
;
DWORD
safeopt
;
DWORD
version
;
LCID
lcid
;
jsheap_t
tmp_heap
;
...
...
dlls/jscript/tests/jscript.c
View file @
3b2d5ecd
...
...
@@ -295,6 +295,49 @@ static void test_safety(IUnknown *unk)
IObjectSafety_Release
(
safety
);
}
static
HRESULT
set_script_prop
(
IActiveScript
*
engine
,
DWORD
property
,
VARIANT
*
val
)
{
IActiveScriptProperty
*
script_prop
;
HRESULT
hres
;
hres
=
IActiveScript_QueryInterface
(
engine
,
&
IID_IActiveScriptProperty
,
(
void
**
)
&
script_prop
);
ok
(
hres
==
S_OK
,
"Could not get IActiveScriptProperty iface: %08x
\n
"
,
hres
);
hres
=
IActiveScriptProperty_SetProperty
(
script_prop
,
property
,
NULL
,
val
);
IActiveScriptProperty_Release
(
script_prop
);
return
hres
;
}
static
void
test_invoke_versioning
(
IActiveScript
*
script
)
{
VARIANT
v
;
HRESULT
hres
;
V_VT
(
&
v
)
=
VT_NULL
;
hres
=
set_script_prop
(
script
,
SCRIPTPROP_INVOKEVERSIONING
,
&
v
);
if
(
hres
==
E_NOTIMPL
)
{
win_skip
(
"SCRIPTPROP_INVOKESTRING not supported
\n
"
);
return
;
}
ok
(
hres
==
E_INVALIDARG
,
"SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x
\n
"
,
hres
);
V_VT
(
&
v
)
=
VT_I2
;
V_I2
(
&
v
)
=
0
;
hres
=
set_script_prop
(
script
,
SCRIPTPROP_INVOKEVERSIONING
,
&
v
);
ok
(
hres
==
E_INVALIDARG
,
"SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x
\n
"
,
hres
);
V_VT
(
&
v
)
=
VT_I4
;
V_I4
(
&
v
)
=
16
;
hres
=
set_script_prop
(
script
,
SCRIPTPROP_INVOKEVERSIONING
,
&
v
);
ok
(
hres
==
E_INVALIDARG
,
"SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x
\n
"
,
hres
);
V_VT
(
&
v
)
=
VT_I4
;
V_I4
(
&
v
)
=
2
;
hres
=
set_script_prop
(
script
,
SCRIPTPROP_INVOKEVERSIONING
,
&
v
);
ok
(
hres
==
S_OK
,
"SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x
\n
"
,
hres
);
}
static
void
test_jscript
(
void
)
{
IActiveScriptParse
*
parse
;
...
...
@@ -322,6 +365,7 @@ static void test_jscript(void)
test_state
(
script
,
SCRIPTSTATE_UNINITIALIZED
);
test_safety
(
unk
);
test_invoke_versioning
(
script
);
hres
=
IActiveScriptParse64_InitNew
(
parse
);
ok
(
hres
==
S_OK
,
"InitNew failed: %08x
\n
"
,
hres
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment