Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yoann Laissus
wine
Commits
4cecd4ae
Commit
4cecd4ae
authored
24 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Always initialize msg16 and wparam16 in WINPROC_MapMsg32WTo16.
parent
32fcfc24
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
windows/winproc.c
+6
-13
6 additions, 13 deletions
windows/winproc.c
with
6 additions
and
13 deletions
windows/winproc.c
+
6
−
13
View file @
4cecd4ae
...
...
@@ -260,7 +260,7 @@ static WINDOWPROC *WINPROC_GetPtr( WNDPROC16 handle )
/* Check for a linear pointer */
if
(
H
EAP_IsInsideHeap
(
WinProcHeap
,
0
,
(
LPVOID
)
handle
))
if
(
H
eapValidate
(
WinProcHeap
,
0
,
(
LPVOID
)
handle
))
{
ptr
=
(
BYTE
*
)
handle
;
/* First check if it is the jmp address */
...
...
@@ -278,7 +278,7 @@ static WINDOWPROC *WINPROC_GetPtr( WNDPROC16 handle )
if
(
!
IsBadReadPtr16
((
SEGPTR
)
handle
,
sizeof
(
WINDOWPROC
)
-
sizeof
(
proc
->
thunk
)))
{
ptr
=
(
BYTE
*
)
PTR_SEG_TO_LIN
(
handle
);
if
(
!
H
EAP_IsInsideHeap
(
WinProcHeap
,
0
,
ptr
))
return
NULL
;
if
(
!
H
eapValidate
(
WinProcHeap
,
0
,
ptr
))
return
NULL
;
/* It must be the thunk address */
if
(
*
ptr
==
0x58
/* popl eax */
)
ptr
-=
(
int
)
&
((
WINDOWPROC
*
)
0
)
->
thunk
;
/* Now we have a pointer to the WINDOWPROC struct */
...
...
@@ -2181,6 +2181,8 @@ INT WINPROC_MapMsg32WTo16( HWND hwnd, UINT msg32, WPARAM wParam32,
UINT16
*
pmsg16
,
WPARAM16
*
pwparam16
,
LPARAM
*
plparam
)
{
*
pmsg16
=
LOWORD
(
msg32
);
*
pwparam16
=
LOWORD
(
wParam32
);
switch
(
msg32
)
{
case
LB_ADDSTRING
:
...
...
@@ -2193,10 +2195,9 @@ INT WINPROC_MapMsg32WTo16( HWND hwnd, UINT msg32, WPARAM wParam32,
{
LPSTR
str
=
SEGPTR_STRDUP_WtoA
(
(
LPWSTR
)
*
plparam
);
if
(
!
str
)
return
-
1
;
*
pwparam16
=
(
WPARAM16
)
LOWORD
(
wParam32
);
*
plparam
=
(
LPARAM
)
SEGPTR_GET
(
str
);
}
*
pmsg16
=
(
UINT16
)
msg32
+
(
LB_ADDSTRING16
-
LB_ADDSTRING
);
*
pmsg16
=
(
UINT16
)
msg32
+
(
LB_ADDSTRING16
-
LB_ADDSTRING
);
return
1
;
case
CB_ADDSTRING
:
...
...
@@ -2208,10 +2209,9 @@ INT WINPROC_MapMsg32WTo16( HWND hwnd, UINT msg32, WPARAM wParam32,
{
LPSTR
str
=
SEGPTR_STRDUP_WtoA
(
(
LPWSTR
)
*
plparam
);
if
(
!
str
)
return
-
1
;
*
pwparam16
=
(
WPARAM16
)
LOWORD
(
wParam32
);
*
plparam
=
(
LPARAM
)
SEGPTR_GET
(
str
);
}
*
pmsg16
=
(
UINT16
)
msg32
+
(
CB_ADDSTRING16
-
CB_ADDSTRING
);
*
pmsg16
=
(
UINT16
)
msg32
+
(
CB_ADDSTRING16
-
CB_ADDSTRING
);
return
1
;
case
WM_NCCREATE
:
...
...
@@ -2227,8 +2227,6 @@ INT WINPROC_MapMsg32WTo16( HWND hwnd, UINT msg32, WPARAM wParam32,
cls
=
SEGPTR_STRDUP_WtoA
(
cs32
->
lpszClass
);
cs
->
lpszName
=
SEGPTR_GET
(
name
);
cs
->
lpszClass
=
SEGPTR_GET
(
cls
);
*
pmsg16
=
(
UINT16
)
msg32
;
*
pwparam16
=
(
WPARAM16
)
LOWORD
(
wParam32
);
*
plparam
=
(
LPARAM
)
SEGPTR_GET
(
cs
);
}
return
1
;
...
...
@@ -2244,8 +2242,6 @@ INT WINPROC_MapMsg32WTo16( HWND hwnd, UINT msg32, WPARAM wParam32,
cls
=
SEGPTR_STRDUP_WtoA
(
cs32
->
szClass
);
cs
->
szTitle
=
SEGPTR_GET
(
name
);
cs
->
szClass
=
SEGPTR_GET
(
cls
);
*
pmsg16
=
(
UINT16
)
msg32
;
*
pwparam16
=
(
WPARAM16
)
LOWORD
(
wParam32
);
*
plparam
=
(
LPARAM
)
SEGPTR_GET
(
cs
);
}
return
1
;
...
...
@@ -2253,8 +2249,6 @@ INT WINPROC_MapMsg32WTo16( HWND hwnd, UINT msg32, WPARAM wParam32,
{
LPSTR
str
=
SEGPTR_STRDUP_WtoA
(
(
LPWSTR
)
*
plparam
);
if
(
!
str
)
return
-
1
;
*
pmsg16
=
(
UINT16
)
msg32
;
*
pwparam16
=
(
WPARAM16
)
LOWORD
(
wParam32
);
*
plparam
=
(
LPARAM
)
SEGPTR_GET
(
str
);
}
return
1
;
...
...
@@ -2265,7 +2259,6 @@ INT WINPROC_MapMsg32WTo16( HWND hwnd, UINT msg32, WPARAM wParam32,
LPSTR
str
=
(
LPSTR
)
SEGPTR_ALLOC
(
256
);
/* fixme: fixed sized buffer */
if
(
!
str
)
return
-
1
;
*
pmsg16
=
(
msg32
==
LB_GETTEXT
)
?
LB_GETTEXT16
:
CB_GETLBTEXT16
;
*
pwparam16
=
(
WPARAM16
)
LOWORD
(
wParam32
);
*
plparam
=
(
LPARAM
)
SEGPTR_GET
(
str
);
}
return
1
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment