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
d984fb14
Commit
d984fb14
authored
Oct 31, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Oct 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Implement VariantChangeType for VT_DISPATCH and VT_UNKNOWN.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
4920d08e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
3 deletions
+31
-3
jsutils.c
dlls/jscript/jsutils.c
+10
-0
caller.c
dlls/jscript/tests/caller.c
+21
-3
No files found.
dlls/jscript/jsutils.c
View file @
d984fb14
...
...
@@ -955,6 +955,16 @@ HRESULT variant_change_type(script_ctx_t *ctx, VARIANT *dst, VARIANT *src, VARTY
case
VT_NULL
:
hres
=
V_VT
(
src
)
==
VT_NULL
?
S_OK
:
E_NOTIMPL
;
break
;
case
VT_UNKNOWN
:
case
VT_DISPATCH
:
if
(
V_VT
(
src
)
!=
vt
)
hres
=
E_NOTIMPL
;
else
{
IUnknown_AddRef
(
V_UNKNOWN
(
src
));
V_UNKNOWN
(
dst
)
=
V_UNKNOWN
(
src
);
hres
=
S_OK
;
}
break
;
default:
FIXME
(
"vt %d not implemented
\n
"
,
vt
);
hres
=
E_NOTIMPL
;
...
...
dlls/jscript/tests/caller.c
View file @
d984fb14
...
...
@@ -97,14 +97,14 @@ static void _call_change_type(unsigned line, IVariantChangeType *change_type, VA
HRESULT
hres
;
VariantInit
(
dst
);
if
(
V_VT
(
src
)
==
VT_DISPATCH
&&
vt
!=
VT_BOOL
)
{
if
(
V_VT
(
src
)
!=
vt
&&
vt
!=
VT_BOOL
&&
(
V_VT
(
src
)
==
VT_DISPATCH
||
V_VT
(
src
)
==
VT_UNKNOWN
)
)
{
SET_EXPECT
(
OnEnterScript
);
SET_EXPECT
(
OnLeaveScript
);
}
hres
=
IVariantChangeType_ChangeType
(
change_type
,
dst
,
src
,
0
,
vt
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"ChangeType(%d) failed: %08lx
\n
"
,
vt
,
hres
);
ok_
(
__FILE__
,
line
)(
V_VT
(
dst
)
==
vt
,
"V_VT(dst) = %d
\n
"
,
V_VT
(
dst
));
if
(
V_VT
(
src
)
==
VT_DISPATCH
&&
vt
!=
VT_BOOL
)
{
if
(
V_VT
(
src
)
!=
vt
&&
vt
!=
VT_BOOL
&&
(
V_VT
(
src
)
==
VT_DISPATCH
||
V_VT
(
src
)
==
VT_UNKNOWN
)
)
{
CHECK_CALLED
(
OnEnterScript
);
CHECK_CALLED
(
OnLeaveScript
);
}
...
...
@@ -118,7 +118,7 @@ static void _change_type_fail(unsigned line, IVariantChangeType *change_type, VA
V_VT
(
&
v
)
=
VT_EMPTY
;
hres
=
IVariantChangeType_ChangeType
(
change_type
,
&
v
,
src
,
0
,
vt
);
ok_
(
__FILE__
,
line
)(
hres
==
exhres
,
"ChangeType failed: %08lx, expected %08lx
\n
"
,
hres
,
exhres
);
ok_
(
__FILE__
,
line
)(
hres
==
exhres
,
"ChangeType failed: %08lx, expected %08lx
[%d]
\n
"
,
hres
,
exhres
,
V_VT
(
src
)
);
}
static
void
test_change_type
(
IVariantChangeType
*
change_type
,
VARIANT
*
src
,
const
conv_results_t
*
ex
)
...
...
@@ -158,6 +158,20 @@ static void test_change_type(IVariantChangeType *change_type, VARIANT *src, cons
call_change_type
(
change_type
,
&
v
,
src
,
VT_I2
);
ok
(
V_I2
(
&
v
)
==
(
INT16
)
ex
->
int_result
,
"V_I2(v) = %d, expected %d
\n
"
,
V_I2
(
&
v
),
ex
->
int_result
);
if
(
V_VT
(
src
)
!=
VT_UNKNOWN
)
change_type_fail
(
change_type
,
src
,
VT_UNKNOWN
,
E_NOTIMPL
);
else
{
call_change_type
(
change_type
,
&
v
,
src
,
VT_UNKNOWN
);
ok
(
V_UNKNOWN
(
&
v
)
==
V_UNKNOWN
(
src
),
"V_UNKNOWN(v) != V_UNKNOWN(src)
\n
"
);
}
if
(
V_VT
(
src
)
!=
VT_DISPATCH
)
change_type_fail
(
change_type
,
src
,
VT_DISPATCH
,
E_NOTIMPL
);
else
{
call_change_type
(
change_type
,
&
v
,
src
,
VT_DISPATCH
);
ok
(
V_DISPATCH
(
&
v
)
==
V_DISPATCH
(
src
),
"V_DISPATCH(v) != V_DISPATCH(src)
\n
"
);
}
}
static
void
test_change_types
(
IVariantChangeType
*
change_type
,
IDispatch
*
obj_disp
)
...
...
@@ -200,6 +214,10 @@ static void test_change_types(IVariantChangeType *change_type, IDispatch *obj_di
V_VT
(
&
v
)
=
VT_NULL
;
test_change_type
(
change_type
,
&
v
,
&
null_results
);
V_VT
(
&
v
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
&
v
)
=
(
IUnknown
*
)
obj_disp
;
test_change_type
(
change_type
,
&
v
,
&
obj_results
);
V_VT
(
&
v
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
v
)
=
obj_disp
;
test_change_type
(
change_type
,
&
v
,
&
obj_results
);
...
...
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