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
1b2ea8b2
Commit
1b2ea8b2
authored
Dec 17, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Pre-allocate the window procedure for DefWindowProc.
parent
53393b0f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
18 deletions
+6
-18
class.c
dlls/user32/class.c
+0
-3
controls.h
dlls/user32/controls.h
+1
-0
winproc.c
dlls/user32/winproc.c
+5
-15
No files found.
dlls/user32/class.c
View file @
1b2ea8b2
...
...
@@ -423,9 +423,6 @@ void CLASS_RegisterBuiltinClasses(void)
register_builtin
(
&
MESSAGE_builtin_class
);
register_builtin
(
&
SCROLL_builtin_class
);
register_builtin
(
&
STATIC_builtin_class
);
/* the DefWindowProc winprocs are magic too */
WINPROC_AllocProc
(
DefWindowProcA
,
DefWindowProcW
);
}
...
...
dlls/user32/controls.h
View file @
1b2ea8b2
...
...
@@ -35,6 +35,7 @@ enum builtin_winprocs
{
WINPROC_BUTTON
=
0
,
WINPROC_COMBO
,
WINPROC_DEFWND
,
WINPROC_DIALOG
,
WINPROC_EDIT
,
WINPROC_LISTBOX
,
...
...
dlls/user32/winproc.c
View file @
1b2ea8b2
...
...
@@ -45,7 +45,6 @@ typedef struct tagWINDOWPROC
}
WINDOWPROC
;
#define MAX_WINPROCS 4096
#define BUILTIN_WINPROCS 9
/* first BUILTIN_WINPROCS entries are reserved for builtin procs */
#define MAX_WINPROC_RECURSION 64
#define WINPROC_PROC16 ((WINDOWPROC *)1)
/* placeholder for 16-bit window procs */
...
...
@@ -68,6 +67,7 @@ static WINDOWPROC winproc_array[MAX_WINPROCS] =
{
{
ButtonWndProcA
,
ButtonWndProcW
},
/* WINPROC_BUTTON */
{
ComboWndProcA
,
ComboWndProcW
},
/* WINPROC_COMBO */
{
DefWindowProcA
,
DefWindowProcW
},
/* WINPROC_DEFWND */
{
DefDlgProcA
,
DefDlgProcW
},
/* WINPROC_DIALOG */
{
EditWndProcA
,
EditWndProcW
},
/* WINPROC_EDIT */
{
ListBoxWndProcA
,
ListBoxWndProcW
},
/* WINPROC_LISTBOX */
...
...
@@ -76,8 +76,7 @@ static WINDOWPROC winproc_array[MAX_WINPROCS] =
{
StaticWndProcA
,
StaticWndProcW
},
/* WINPROC_STATIC */
};
static
UINT
builtin_used
=
NB_BUILTIN_WINPROCS
;
static
UINT
winproc_used
=
BUILTIN_WINPROCS
;
static
UINT
winproc_used
=
NB_BUILTIN_WINPROCS
;
static
CRITICAL_SECTION
winproc_cs
;
static
CRITICAL_SECTION_DEBUG
critsect_debug
=
...
...
@@ -105,14 +104,14 @@ static inline WINDOWPROC *find_winproc( WNDPROC funcA, WNDPROC funcW )
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
builtin_used
;
i
++
)
for
(
i
=
0
;
i
<
NB_BUILTIN_WINPROCS
;
i
++
)
{
/* match either proc, some apps confuse A and W */
if
(
funcA
&&
winproc_array
[
i
].
procA
!=
funcA
&&
winproc_array
[
i
].
procW
!=
funcA
)
continue
;
if
(
funcW
&&
winproc_array
[
i
].
procA
!=
funcW
&&
winproc_array
[
i
].
procW
!=
funcW
)
continue
;
return
&
winproc_array
[
i
];
}
for
(
i
=
BUILTIN_WINPROCS
;
i
<
winproc_used
;
i
++
)
for
(
i
=
NB_
BUILTIN_WINPROCS
;
i
<
winproc_used
;
i
++
)
{
if
(
funcA
&&
winproc_array
[
i
].
procA
!=
funcA
)
continue
;
if
(
funcW
&&
winproc_array
[
i
].
procW
!=
funcW
)
continue
;
...
...
@@ -153,16 +152,7 @@ static inline WINDOWPROC *alloc_winproc( WNDPROC funcA, WNDPROC funcW )
/* check if we already have a winproc for that function */
if
(
!
(
proc
=
find_winproc
(
funcA
,
funcW
)))
{
if
(
funcA
&&
funcW
)
{
assert
(
builtin_used
<
BUILTIN_WINPROCS
);
proc
=
&
winproc_array
[
builtin_used
++
];
proc
->
procA
=
funcA
;
proc
->
procW
=
funcW
;
TRACE
(
"allocated %p for builtin %p/%p (%d/%d used)
\n
"
,
proc_to_handle
(
proc
),
funcA
,
funcW
,
builtin_used
,
BUILTIN_WINPROCS
);
}
else
if
(
winproc_used
<
MAX_WINPROCS
)
if
(
winproc_used
<
MAX_WINPROCS
)
{
proc
=
&
winproc_array
[
winproc_used
++
];
proc
->
procA
=
funcA
;
...
...
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