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
11f41aa0
Commit
11f41aa0
authored
Dec 05, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Treat VT_UNKNOWN VARIANTs supporting IDispatch interface as VT_DISPATCH.
parent
61448249
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
jsutils.c
dlls/jscript/jsutils.c
+12
-0
run.c
dlls/jscript/tests/run.c
+20
-3
No files found.
dlls/jscript/jsutils.c
View file @
11f41aa0
...
...
@@ -315,6 +315,18 @@ HRESULT variant_to_jsval(VARIANT *var, jsval_t *r)
case
VT_INT
:
*
r
=
jsval_number
(
V_INT
(
var
));
return
S_OK
;
case
VT_UNKNOWN
:
if
(
V_UNKNOWN
(
var
))
{
IDispatch
*
disp
;
HRESULT
hres
;
hres
=
IUnknown_QueryInterface
(
V_UNKNOWN
(
var
),
&
IID_IDispatch
,
(
void
**
)
&
disp
);
if
(
SUCCEEDED
(
hres
))
{
*
r
=
jsval_disp
(
disp
);
return
S_OK
;
}
}
/* fall through */
default:
return
jsval_variant
(
r
,
var
);
}
...
...
dlls/jscript/tests/run.c
View file @
11f41aa0
...
...
@@ -125,6 +125,7 @@ DEFINE_EXPECT(DeleteMemberByDispID);
#define DISPID_GLOBAL_GETSHORT 0x1014
#define DISPID_GLOBAL_TESTARGTYPES 0x1015
#define DISPID_GLOBAL_INTPROP 0x1016
#define DISPID_GLOBAL_DISPUNK 0x1017
#define DISPID_GLOBAL_TESTPROPDELETE 0x2000
...
...
@@ -592,6 +593,11 @@ static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD
return
S_OK
;
}
if
(
!
strcmp_wa
(
bstrName
,
"dispUnk"
))
{
*
pid
=
DISPID_GLOBAL_DISPUNK
;
return
S_OK
;
}
if
(
strict_dispid_check
&&
strcmp_wa
(
bstrName
,
"t"
))
ok
(
0
,
"unexpected call %s
\n
"
,
wine_dbgstr_w
(
bstrName
));
return
DISP_E_UNKNOWNNAME
;
...
...
@@ -987,8 +993,13 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
V_INT
(
pvarRes
)
=
22
;
return
S_OK
;
case
DISPID_GLOBAL_DISPUNK
:
V_VT
(
pvarRes
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
pvarRes
)
=
(
IUnknown
*
)
&
testObj
;
return
S_OK
;
case
DISPID_GLOBAL_TESTARGTYPES
:
{
VARIANT
args
[
2
];
VARIANT
args
[
3
];
DISPPARAMS
dp
=
{
args
,
NULL
,
sizeof
(
args
)
/
sizeof
(
*
args
),
0
};
HRESULT
hres
;
...
...
@@ -996,7 +1007,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
ok
(
wFlags
==
DISPATCH_METHOD
,
"wFlags = %x
\n
"
,
wFlags
);
ok
(
pdp
!=
NULL
,
"pdp == NULL
\n
"
);
ok
(
pdp
->
rgvarg
!=
NULL
,
"rgvarg != NULL
\n
"
);
ok
(
pdp
->
cArgs
==
5
,
"cArgs = %d
\n
"
,
pdp
->
cArgs
);
ok
(
pdp
->
cArgs
==
6
,
"cArgs = %d
\n
"
,
pdp
->
cArgs
);
ok
(
!
pvarRes
,
"pvarRes != NULL
\n
"
);
ok
(
V_VT
(
pdp
->
rgvarg
+
1
)
==
VT_I4
,
"V_VT(pdp->rgvarg+1) = %d
\n
"
,
V_VT
(
pdp
->
rgvarg
+
1
));
...
...
@@ -1011,12 +1022,17 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
ok
(
V_VT
(
pdp
->
rgvarg
+
4
)
==
VT_I4
,
"V_VT(pdp->rgvarg+4) = %d
\n
"
,
V_VT
(
pdp
->
rgvarg
+
4
));
ok
(
V_I4
(
pdp
->
rgvarg
+
4
)
==
22
,
"V_I4(pdp->rgvarg+4) = %d
\n
"
,
V_I4
(
pdp
->
rgvarg
+
4
));
ok
(
V_VT
(
pdp
->
rgvarg
+
5
)
==
VT_DISPATCH
,
"V_VT(pdp->rgvarg+5) = %d
\n
"
,
V_VT
(
pdp
->
rgvarg
+
5
));
ok
(
V_DISPATCH
(
pdp
->
rgvarg
+
5
)
==
(
IDispatch
*
)
&
testObj
,
"V_DISPATCH(pdp->rgvarg+5) != testObj
\n
"
);
ok
(
V_VT
(
pdp
->
rgvarg
)
==
VT_DISPATCH
,
"V_VT(pdp->rgvarg) = %d
\n
"
,
V_VT
(
pdp
->
rgvarg
));
V_VT
(
args
)
=
VT_I2
;
V_I2
(
args
)
=
2
;
V_VT
(
args
+
1
)
=
VT_INT
;
V_INT
(
args
+
1
)
=
22
;
V_VT
(
args
+
2
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
args
+
2
)
=
(
IUnknown
*
)
&
testObj
;
hres
=
IDispatch_Invoke
(
V_DISPATCH
(
pdp
->
rgvarg
),
DISPID_VALUE
,
&
IID_NULL
,
0
,
DISPATCH_METHOD
,
&
dp
,
NULL
,
NULL
,
NULL
);
ok
(
hres
==
S_OK
,
"Invoke failed: %08x
\n
"
,
hres
);
...
...
@@ -1839,9 +1855,10 @@ static BOOL run_tests(void)
CHECK_CALLED
(
global_propargput_i
);
SET_EXPECT
(
global_testargtypes_i
);
parse_script_a
(
"testArgTypes(
intProp(), intProp, getShort(), shortProp, function(
i,s) {"
parse_script_a
(
"testArgTypes(
dispUnk, intProp(), intProp, getShort(), shortProp, function(d,
i,s) {"
" ok(getVT(i) === 'VT_I4', 'getVT(i) = ' + getVT(i));"
" ok(getVT(s) === 'VT_I4', 'getVT(s) = ' + getVT(s));"
" ok(getVT(d) === 'VT_DISPATCH', 'getVT(d) = ' + getVT(d));"
"});"
);
CHECK_CALLED
(
global_testargtypes_i
);
...
...
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