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
c2f4e2b3
Commit
c2f4e2b3
authored
Mar 01, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Make GetWindowLong() fail for some values on 64-bit.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d00ed8e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
+26
-6
win.c
dlls/user32/tests/win.c
+0
-4
win.c
dlls/user32/win.c
+26
-2
No files found.
dlls/user32/tests/win.c
View file @
c2f4e2b3
...
...
@@ -6346,7 +6346,6 @@ static void test_set_window_long_size(void)
/* GWLP_WNDPROC */
SetLastError
(
0xdeadbeef
);
wnd_proc
=
(
WNDPROC
)(
LONG_PTR
)
GetWindowLongA
(
hwnd
,
GWLP_WNDPROC
);
todo_wine
ok
(
!
wnd_proc
&&
GetLastError
()
==
ERROR_INVALID_INDEX
,
"Unexpected window proc.
\n
"
);
wnd_proc
=
(
WNDPROC
)
GetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
);
...
...
@@ -6427,12 +6426,10 @@ todo_wine
SetLastError
(
0xdeadbeef
);
ret
=
GetWindowLongA
(
hwnd
,
GWLP_HINSTANCE
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_INDEX
,
"Unexpected instance %#x.
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
GetWindowLongW
(
hwnd
,
GWLP_HINSTANCE
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_INDEX
,
"Unexpected instance %#x.
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
...
...
@@ -6451,7 +6448,6 @@ todo_wine
/* GWLP_HWNDPARENT */
SetLastError
(
0xdeadbeef
);
ret
=
GetWindowLongA
(
hwnd
,
GWLP_HWNDPARENT
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_INDEX
,
"Unexpected parent window %#x.
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
...
...
dlls/user32/win.c
View file @
c2f4e2b3
...
...
@@ -2690,7 +2690,19 @@ WORD WINAPI GetWindowWord( HWND hwnd, INT offset )
*/
LONG
WINAPI
GetWindowLongA
(
HWND
hwnd
,
INT
offset
)
{
return
WIN_GetWindowLong
(
hwnd
,
offset
,
sizeof
(
LONG
),
FALSE
);
switch
(
offset
)
{
#ifdef _WIN64
case
GWLP_WNDPROC
:
case
GWLP_HINSTANCE
:
case
GWLP_HWNDPARENT
:
WARN
(
"Invalid offset %d
\n
"
,
offset
);
SetLastError
(
ERROR_INVALID_INDEX
);
return
0
;
#endif
default:
return
WIN_GetWindowLong
(
hwnd
,
offset
,
sizeof
(
LONG
),
FALSE
);
}
}
...
...
@@ -2699,7 +2711,19 @@ LONG WINAPI GetWindowLongA( HWND hwnd, INT offset )
*/
LONG
WINAPI
GetWindowLongW
(
HWND
hwnd
,
INT
offset
)
{
return
WIN_GetWindowLong
(
hwnd
,
offset
,
sizeof
(
LONG
),
TRUE
);
switch
(
offset
)
{
#ifdef _WIN64
case
GWLP_WNDPROC
:
case
GWLP_HINSTANCE
:
case
GWLP_HWNDPARENT
:
WARN
(
"Invalid offset %d
\n
"
,
offset
);
SetLastError
(
ERROR_INVALID_INDEX
);
return
0
;
#endif
default:
return
WIN_GetWindowLong
(
hwnd
,
offset
,
sizeof
(
LONG
),
TRUE
);
}
}
...
...
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