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
1c60a21a
Commit
1c60a21a
authored
Oct 02, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use dispinterface DISPID_VALUE implementation if available.
parent
df90f665
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
20 deletions
+32
-20
dispex.c
dlls/mshtml/dispex.c
+32
-20
No files found.
dlls/mshtml/dispex.c
View file @
1c60a21a
...
...
@@ -31,6 +31,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
static
const
WCHAR
objectW
[]
=
{
'['
,
'o'
,
'b'
,
'j'
,
'e'
,
'c'
,
't'
,
']'
,
0
};
typedef
struct
{
DISPID
id
;
BSTR
name
;
...
...
@@ -244,10 +246,12 @@ static dispex_data_t *preprocess_dispex_data(DispatchEx *This)
TRACE
(
"(%p)
\n
"
,
This
);
hres
=
get_typeinfo
(
This
->
data
->
disp_tid
,
&
dti
);
if
(
FAILED
(
hres
))
{
ERR
(
"Could not get disp type info: %08x
\n
"
,
hres
);
return
NULL
;
if
(
This
->
data
->
disp_tid
)
{
hres
=
get_typeinfo
(
This
->
data
->
disp_tid
,
&
dti
);
if
(
FAILED
(
hres
))
{
ERR
(
"Could not get disp type info: %08x
\n
"
,
hres
);
return
NULL
;
}
}
data
=
heap_alloc
(
sizeof
(
dispex_data_t
));
...
...
@@ -421,8 +425,6 @@ HRESULT dispex_get_dprop_ref(DispatchEx *This, const WCHAR *name, BOOL alloc, VA
static
HRESULT
dispex_value
(
DispatchEx
*
This
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
params
,
VARIANT
*
res
,
EXCEPINFO
*
ei
,
IServiceProvider
*
caller
)
{
static
const
WCHAR
objectW
[]
=
{
'['
,
'o'
,
'b'
,
'j'
,
'e'
,
'c'
,
't'
,
']'
,
0
};
if
(
This
->
data
->
vtbl
&&
This
->
data
->
vtbl
->
value
)
return
This
->
data
->
vtbl
->
value
(
This
->
outer
,
lcid
,
flags
,
params
,
res
,
ei
,
caller
);
...
...
@@ -537,11 +539,13 @@ static const dispex_static_data_vtbl_t function_dispex_vtbl = {
NULL
};
static
const
tid_t
function_iface_tids
[]
=
{
0
};
static
dispex_static_data_t
function_dispex
=
{
&
function_dispex_vtbl
,
LAST
_tid
,
NULL
_tid
,
NULL
,
NULL
function_iface_tids
};
static
func_disp_t
*
create_func_disp
(
DispatchEx
*
obj
,
func_info_t
*
info
)
...
...
@@ -572,6 +576,18 @@ static HRESULT function_invoke(DispatchEx *This, func_info_t *func, WORD flags,
case
DISPATCH_PROPERTYGET
:
{
dispex_dynamic_data_t
*
dynamic_data
;
if
(
func
->
id
==
DISPID_VALUE
)
{
BSTR
ret
;
ret
=
SysAllocString
(
objectW
);
if
(
!
ret
)
return
E_OUTOFMEMORY
;
V_VT
(
res
)
=
VT_BSTR
;
V_BSTR
(
res
)
=
ret
;
return
S_OK
;
}
dynamic_data
=
get_dynamic_data
(
This
,
TRUE
);
if
(
!
dynamic_data
)
return
E_OUTOFMEMORY
;
...
...
@@ -613,8 +629,10 @@ static HRESULT get_builtin_func(dispex_data_t *data, DISPID id, func_info_t **re
while
(
min
<=
max
)
{
n
=
(
min
+
max
)
/
2
;
if
(
data
->
funcs
[
n
].
id
==
id
)
break
;
if
(
data
->
funcs
[
n
].
id
==
id
)
{
*
ret
=
data
->
funcs
+
n
;
return
S_OK
;
}
if
(
data
->
funcs
[
n
].
id
<
id
)
min
=
n
+
1
;
...
...
@@ -622,13 +640,8 @@ static HRESULT get_builtin_func(dispex_data_t *data, DISPID id, func_info_t **re
max
=
n
-
1
;
}
if
(
min
>
max
)
{
WARN
(
"invalid id %x
\n
"
,
id
);
return
DISP_E_UNKNOWNNAME
;
}
*
ret
=
data
->
funcs
+
n
;
return
S_OK
;
WARN
(
"invalid id %x
\n
"
,
id
);
return
DISP_E_UNKNOWNNAME
;
}
#define DISPATCHEX_THIS(iface) DEFINE_THIS(DispatchEx, IDispatchEx, iface)
...
...
@@ -777,9 +790,6 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
TRACE
(
"(%p)->(%x %x %x %p %p %p %p)
\n
"
,
This
,
id
,
lcid
,
wFlags
,
pdp
,
pvarRes
,
pei
,
pspCaller
);
if
(
id
==
DISPID_VALUE
)
return
dispex_value
(
This
,
lcid
,
wFlags
,
pdp
,
pvarRes
,
pei
,
pspCaller
);
if
(
is_custom_dispid
(
id
)
&&
This
->
data
->
vtbl
&&
This
->
data
->
vtbl
->
invoke
)
return
This
->
data
->
vtbl
->
invoke
(
This
->
outer
,
id
,
lcid
,
wFlags
,
pdp
,
pvarRes
,
pei
,
pspCaller
);
...
...
@@ -853,6 +863,8 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
return
E_FAIL
;
hres
=
get_builtin_func
(
data
,
id
,
&
func
);
if
(
id
==
DISPID_VALUE
&&
hres
==
DISP_E_UNKNOWNNAME
)
return
dispex_value
(
This
,
lcid
,
wFlags
,
pdp
,
pvarRes
,
pei
,
pspCaller
);
if
(
FAILED
(
hres
))
return
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