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
6767b740
Commit
6767b740
authored
Sep 06, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 08, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Move builtin function info lookup to separated function.
parent
9cf0563f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
24 deletions
+36
-24
dispex.c
dlls/mshtml/dispex.c
+36
-24
No files found.
dlls/mshtml/dispex.c
View file @
6767b740
/*
* Copyright 2008 Jacek Caban for CodeWeavers
* Copyright 2008
-2009
Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -607,6 +607,34 @@ static HRESULT function_invoke(DispatchEx *This, func_info_t *func, WORD flags,
return
hres
;
}
static
HRESULT
get_builtin_func
(
dispex_data_t
*
data
,
DISPID
id
,
func_info_t
**
ret
)
{
int
min
,
max
,
n
;
min
=
0
;
max
=
data
->
func_cnt
-
1
;
while
(
min
<=
max
)
{
n
=
(
min
+
max
)
/
2
;
if
(
data
->
funcs
[
n
].
id
==
id
)
break
;
if
(
data
->
funcs
[
n
].
id
<
id
)
min
=
n
+
1
;
else
max
=
n
-
1
;
}
if
(
min
>
max
)
{
WARN
(
"invalid id %x
\n
"
,
id
);
return
DISP_E_UNKNOWNNAME
;
}
*
ret
=
data
->
funcs
+
n
;
return
S_OK
;
}
#define DISPATCHEX_THIS(iface) DEFINE_THIS(DispatchEx, IDispatchEx, iface)
static
HRESULT
WINAPI
DispatchEx_QueryInterface
(
IDispatchEx
*
iface
,
REFIID
riid
,
void
**
ppv
)
...
...
@@ -748,7 +776,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
{
DispatchEx
*
This
=
DISPATCHEX_THIS
(
iface
);
dispex_data_t
*
data
;
int
min
,
max
,
n
;
func_info_t
*
func
;
HRESULT
hres
;
TRACE
(
"(%p)->(%x %x %x %p %p %p %p)
\n
"
,
This
,
id
,
lcid
,
wFlags
,
pdp
,
pvarRes
,
pei
,
pspCaller
);
...
...
@@ -828,30 +856,14 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
if
(
!
data
)
return
E_FAIL
;
min
=
0
;
max
=
data
->
func_cnt
-
1
;
while
(
min
<=
max
)
{
n
=
(
min
+
max
)
/
2
;
if
(
data
->
funcs
[
n
].
id
==
id
)
break
;
if
(
data
->
funcs
[
n
].
id
<
id
)
min
=
n
+
1
;
else
max
=
n
-
1
;
}
if
(
min
>
max
)
{
WARN
(
"invalid id %x
\n
"
,
id
);
return
DISP_E_UNKNOWNNAME
;
}
hres
=
get_builtin_func
(
data
,
id
,
&
func
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
data
->
funcs
[
n
].
func_disp_idx
==
-
1
)
hres
=
typeinfo_invoke
(
This
,
data
->
funcs
+
n
,
wFlags
,
pdp
,
pvarRes
,
pei
);
if
(
func
->
func_disp_idx
==
-
1
)
hres
=
typeinfo_invoke
(
This
,
func
,
wFlags
,
pdp
,
pvarRes
,
pei
);
else
hres
=
function_invoke
(
This
,
data
->
funcs
+
n
,
wFlags
,
pdp
,
pvarRes
,
pei
);
hres
=
function_invoke
(
This
,
func
,
wFlags
,
pdp
,
pvarRes
,
pei
);
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