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
b9975bf8
Commit
b9975bf8
authored
Mar 02, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Correctly handle NULL BSTR in VARIANT in IDispatchEx implementation.
parent
a5437697
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
dispex.c
dlls/mshtml/dispex.c
+13
-2
script.c
dlls/mshtml/tests/script.c
+12
-0
No files found.
dlls/mshtml/dispex.c
View file @
b9975bf8
...
...
@@ -334,6 +334,17 @@ static inline BOOL is_dynamic_dispid(DISPID id)
return
DISPID_DYNPROP_0
<=
id
&&
id
<=
DISPID_DYNPROP_MAX
;
}
static
HRESULT
variant_copy
(
VARIANT
*
dest
,
VARIANT
*
src
)
{
if
(
V_VT
(
src
)
==
VT_BSTR
&&
!
V_BSTR
(
src
))
{
V_VT
(
dest
)
=
VT_BSTR
;
V_BSTR
(
dest
)
=
NULL
;
return
S_OK
;
}
return
VariantCopy
(
dest
,
src
);
}
static
inline
dispex_dynamic_data_t
*
get_dynamic_data
(
DispatchEx
*
This
,
BOOL
alloc
)
{
return
!
alloc
||
This
->
dynamic_data
...
...
@@ -938,7 +949,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
case
DISPATCH_PROPERTYGET
:
if
(
prop
->
flags
&
DYNPROP_DELETED
)
return
DISP_E_UNKNOWNNAME
;
return
VariantC
opy
(
pvarRes
,
&
prop
->
var
);
return
variant_c
opy
(
pvarRes
,
&
prop
->
var
);
case
DISPATCH_PROPERTYPUT
|
DISPATCH_PROPERTYPUTREF
:
case
DISPATCH_PROPERTYPUT
:
if
(
pdp
->
cArgs
!=
1
||
(
pdp
->
cNamedArgs
==
1
&&
*
pdp
->
rgdispidNamedArgs
!=
DISPID_PROPERTYPUT
)
...
...
@@ -949,7 +960,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
TRACE
(
"put %s
\n
"
,
debugstr_variant
(
pdp
->
rgvarg
));
VariantClear
(
&
prop
->
var
);
hres
=
VariantC
opy
(
&
prop
->
var
,
pdp
->
rgvarg
);
hres
=
variant_c
opy
(
&
prop
->
var
,
pdp
->
rgvarg
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/mshtml/tests/script.c
View file @
b9975bf8
...
...
@@ -1986,6 +1986,18 @@ static void test_script_run(void)
ok
(
V_VT
(
&
var
)
==
VT_I4
,
"V_VT(var)=%d
\n
"
,
V_VT
(
&
var
));
ok
(
V_I4
(
&
var
)
==
300
,
"V_I4(&var) = %d
\n
"
,
V_I4
(
&
var
));
V_VT
(
&
var
)
=
VT_BSTR
;
V_BSTR
(
&
var
)
=
NULL
;
dispex_propput
(
document
,
id
,
0
,
&
var
);
VariantInit
(
&
var
);
memset
(
&
dp
,
0
,
sizeof
(
dp
));
memset
(
&
ei
,
0
,
sizeof
(
ei
));
hres
=
IDispatchEx_InvokeEx
(
document
,
id
,
LOCALE_NEUTRAL
,
INVOKE_PROPERTYGET
,
&
dp
,
&
var
,
&
ei
,
NULL
);
ok
(
hres
==
S_OK
,
"InvokeEx failed: %08x
\n
"
,
hres
);
ok
(
V_VT
(
&
var
)
==
VT_BSTR
,
"V_VT(var)=%d
\n
"
,
V_VT
(
&
var
));
ok
(
!
V_BSTR
(
&
var
),
"V_BSTR(&var) = %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
var
)));
unk
=
(
void
*
)
0xdeadbeef
;
hres
=
IDispatchEx_GetNameSpaceParent
(
window_dispex
,
&
unk
);
ok
(
hres
==
S_OK
,
"GetNameSpaceParent 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