Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9195e1b7
Commit
9195e1b7
authored
Nov 01, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Moved global property allocation to separated function.
parent
ed106504
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
21 deletions
+37
-21
htmlwindow.c
dlls/mshtml/htmlwindow.c
+37
-21
No files found.
dlls/mshtml/htmlwindow.c
View file @
9195e1b7
...
...
@@ -1399,6 +1399,37 @@ static HRESULT WINAPI WindowDispEx_Invoke(IDispatchEx *iface, DISPID dispIdMembe
pVarResult
,
pExcepInfo
,
puArgErr
);
}
static
global_prop_t
*
alloc_global_prop
(
HTMLWindow
*
This
,
BSTR
name
)
{
if
(
This
->
global_prop_cnt
==
This
->
global_prop_size
)
{
global_prop_t
*
new_props
;
DWORD
new_size
;
if
(
This
->
global_props
)
{
new_size
=
This
->
global_prop_size
*
2
;
new_props
=
heap_realloc
(
This
->
global_props
,
new_size
*
sizeof
(
global_prop_t
));
}
else
{
new_size
=
16
;
new_props
=
heap_alloc
(
new_size
*
sizeof
(
global_prop_t
));
}
if
(
!
new_props
)
return
NULL
;
This
->
global_props
=
new_props
;
This
->
global_prop_size
=
new_size
;
}
This
->
global_props
[
This
->
global_prop_cnt
].
name
=
heap_strdupW
(
name
);
if
(
!
This
->
global_props
[
This
->
global_prop_cnt
].
name
)
return
NULL
;
return
This
->
global_props
+
This
->
global_prop_cnt
++
;
}
static
inline
DWORD
prop_to_dispid
(
HTMLWindow
*
This
,
global_prop_t
*
prop
)
{
return
MSHTML_DISPID_CUSTOM_MIN
+
(
prop
-
This
->
global_props
);
}
static
HRESULT
WINAPI
WindowDispEx_GetDispID
(
IDispatchEx
*
iface
,
BSTR
bstrName
,
DWORD
grfdex
,
DISPID
*
pid
)
{
HTMLWindow
*
This
=
DISPEX_THIS
(
iface
);
...
...
@@ -1417,31 +1448,16 @@ static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName,
}
if
(
find_global_prop
(
This
,
bstrName
,
grfdex
,
&
script_host
,
&
id
))
{
if
(
This
->
global_prop_cnt
==
This
->
global_prop_size
)
{
global_prop_t
*
new_props
;
DWORD
new_size
;
if
(
This
->
global_props
)
{
new_size
=
This
->
global_prop_size
*
2
;
new_props
=
heap_realloc
(
This
->
global_props
,
new_size
*
sizeof
(
global_prop_t
));
}
else
{
new_size
=
16
;
new_props
=
heap_alloc
(
new_size
*
sizeof
(
global_prop_t
));
}
if
(
!
new_props
)
return
E_OUTOFMEMORY
;
This
->
global_props
=
new_props
;
This
->
global_prop_size
=
new_size
;
}
global_prop_t
*
prop
;
This
->
global_props
[
This
->
global_prop_cnt
].
name
=
heap_strdupW
(
bstrName
);
if
(
!
This
->
global_props
[
This
->
global_prop_cnt
].
name
)
prop
=
alloc_global_prop
(
This
,
bstrName
);
if
(
!
prop
)
return
E_OUTOFMEMORY
;
This
->
global_props
[
This
->
global_prop_cnt
].
script_host
=
script_host
;
This
->
global_props
[
This
->
global_prop_cnt
].
id
=
id
;
prop
->
script_host
=
script_host
;
prop
->
id
=
id
;
*
pid
=
MSHTML_DISPID_CUSTOM_MIN
+
(
This
->
global_prop_cnt
++
);
*
pid
=
prop_to_dispid
(
This
,
prop
);
return
S_OK
;
}
...
...
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