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
421fb1c8
Commit
421fb1c8
authored
Jul 29, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Introduce NtUserGetChildRect.
And use it in CalcChildScroll.
parent
98128a65
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
10 additions
and
212 deletions
+10
-212
class.c
dlls/user32/class.c
+0
-38
controls.h
dlls/user32/controls.h
+0
-2
mdi.c
dlls/user32/mdi.c
+1
-1
user_private.h
dlls/user32/user_private.h
+0
-3
win.c
dlls/user32/win.c
+0
-160
win.h
dlls/user32/win.h
+0
-4
sysparams.c
dlls/win32u/sysparams.c
+0
-3
window.c
dlls/win32u/window.c
+3
-0
ntuser.h
include/ntuser.h
+6
-1
No files found.
dlls/user32/class.c
View file @
421fb1c8
...
...
@@ -718,44 +718,6 @@ BOOL WINAPI GetClassInfoExW( HINSTANCE hInstance, LPCWSTR name, WNDCLASSEXW *wc
}
#if 0 /* toolhelp is in kernel, so this cannot work */
/***********************************************************************
* ClassFirst (TOOLHELP.69)
*/
BOOL16 WINAPI ClassFirst16( CLASSENTRY *pClassEntry )
{
TRACE("%p\n",pClassEntry);
pClassEntry->wNext = 1;
return ClassNext16( pClassEntry );
}
/***********************************************************************
* ClassNext (TOOLHELP.70)
*/
BOOL16 WINAPI ClassNext16( CLASSENTRY *pClassEntry )
{
int i;
CLASS *class = firstClass;
TRACE("%p\n",pClassEntry);
if (!pClassEntry->wNext) return FALSE;
for (i = 1; (i < pClassEntry->wNext) && class; i++) class = class->next;
if (!class)
{
pClassEntry->wNext = 0;
return FALSE;
}
pClassEntry->hInst = class->hInstance;
pClassEntry->wNext++;
GlobalGetAtomNameA( class->atomName, pClassEntry->szClassName,
sizeof(pClassEntry->szClassName) );
return TRUE;
}
#endif
#ifdef _WIN64
/* 64bit versions */
...
...
dlls/user32/controls.h
View file @
421fb1c8
...
...
@@ -101,8 +101,6 @@ extern LRESULT ScrollBarWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HI
extern
LRESULT
StaticWndProc_common
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
)
DECLSPEC_HIDDEN
;
/* Class functions */
struct
tagCLASS
;
/* opaque structure */
struct
tagWND
;
extern
ATOM
get_int_atom_value
(
UNICODE_STRING
*
name
)
DECLSPEC_HIDDEN
;
extern
void
register_desktop_class
(
void
)
DECLSPEC_HIDDEN
;
...
...
dlls/user32/mdi.c
View file @
421fb1c8
...
...
@@ -1688,7 +1688,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
if
(
style
&
WS_VISIBLE
)
{
RECT
rect
;
WIN_GetRectangles
(
list
[
i
],
COORDS_PARENT
,
&
rect
,
NULL
);
NtUserGetChildRect
(
list
[
i
],
&
rect
);
UnionRect
(
&
childRect
,
&
rect
,
&
childRect
);
}
}
...
...
dlls/user32/user_private.h
View file @
421fb1c8
...
...
@@ -54,9 +54,6 @@ static inline struct user_thread_info *get_user_thread_info(void)
extern
HMODULE
user32_module
DECLSPEC_HIDDEN
;
struct
dce
;
struct
tagWND
;
extern
BOOL
post_dde_message
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
,
DWORD
dest_tid
,
DWORD
type
)
DECLSPEC_HIDDEN
;
extern
BOOL
unpack_dde_message
(
HWND
hwnd
,
UINT
message
,
WPARAM
*
wparam
,
LPARAM
*
lparam
,
...
...
dlls/user32/win.c
View file @
421fb1c8
...
...
@@ -122,31 +122,6 @@ BOOL is_desktop_window( HWND hwnd )
/***********************************************************************
* WIN_GetPtr
*
* Return a pointer to the WND structure if local to the process,
* or WND_OTHER_PROCESS if handle may be valid in other process.
* If ret value is a valid pointer, it must be released with WIN_ReleasePtr.
*/
static
WND
*
WIN_GetPtr
(
HWND
hwnd
)
{
WND
*
ptr
=
(
void
*
)
NtUserCallTwoParam
(
HandleToUlong
(
hwnd
),
NTUSER_OBJ_WINDOW
,
NtUserGetHandlePtr
);
if
(
ptr
==
WND_OTHER_PROCESS
&&
is_desktop_window
(
hwnd
))
ptr
=
WND_DESKTOP
;
return
ptr
;
}
/***********************************************************************
* WIN_ReleasePtr
*/
static
void
WIN_ReleasePtr
(
WND
*
ptr
)
{
assert
(
ptr
&&
ptr
!=
OBJ_OTHER_PROCESS
);
NtUserCallOneParam
(
1
,
NtUserLock
);
}
/***********************************************************************
* WIN_IsCurrentProcess
*
* Check whether a given window belongs to the current process (and return the full handle).
...
...
@@ -194,141 +169,6 @@ ULONG WIN_SetStyle( HWND hwnd, ULONG set_bits, ULONG clear_bits )
/***********************************************************************
* WIN_GetRectangles
*
* Get the window and client rectangles.
*/
BOOL
WIN_GetRectangles
(
HWND
hwnd
,
enum
coords_relative
relative
,
RECT
*
rectWindow
,
RECT
*
rectClient
)
{
WND
*
win
=
WIN_GetPtr
(
hwnd
);
BOOL
ret
=
TRUE
;
if
(
!
win
)
{
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
FALSE
;
}
if
(
win
==
WND_DESKTOP
)
{
RECT
rect
;
rect
.
left
=
rect
.
top
=
0
;
if
(
hwnd
==
get_hwnd_message_parent
())
{
rect
.
right
=
100
;
rect
.
bottom
=
100
;
rect
=
rect_win_to_thread_dpi
(
hwnd
,
rect
);
}
else
{
rect
=
get_primary_monitor_rect
();
}
if
(
rectWindow
)
*
rectWindow
=
rect
;
if
(
rectClient
)
*
rectClient
=
rect
;
return
TRUE
;
}
if
(
win
!=
WND_OTHER_PROCESS
)
{
RECT
window_rect
=
win
->
window_rect
,
client_rect
=
win
->
client_rect
;
switch
(
relative
)
{
case
COORDS_CLIENT
:
OffsetRect
(
&
window_rect
,
-
win
->
client_rect
.
left
,
-
win
->
client_rect
.
top
);
OffsetRect
(
&
client_rect
,
-
win
->
client_rect
.
left
,
-
win
->
client_rect
.
top
);
if
(
win
->
dwExStyle
&
WS_EX_LAYOUTRTL
)
mirror_rect
(
&
win
->
client_rect
,
&
window_rect
);
break
;
case
COORDS_WINDOW
:
OffsetRect
(
&
window_rect
,
-
win
->
window_rect
.
left
,
-
win
->
window_rect
.
top
);
OffsetRect
(
&
client_rect
,
-
win
->
window_rect
.
left
,
-
win
->
window_rect
.
top
);
if
(
win
->
dwExStyle
&
WS_EX_LAYOUTRTL
)
mirror_rect
(
&
win
->
window_rect
,
&
client_rect
);
break
;
case
COORDS_PARENT
:
if
(
win
->
parent
)
{
WND
*
parent
=
WIN_GetPtr
(
win
->
parent
);
if
(
parent
==
WND_DESKTOP
)
break
;
if
(
!
parent
||
parent
==
WND_OTHER_PROCESS
)
{
WIN_ReleasePtr
(
win
);
goto
other_process
;
}
if
(
parent
->
flags
&
WIN_CHILDREN_MOVED
)
{
WIN_ReleasePtr
(
parent
);
WIN_ReleasePtr
(
win
);
goto
other_process
;
}
if
(
parent
->
dwExStyle
&
WS_EX_LAYOUTRTL
)
{
mirror_rect
(
&
parent
->
client_rect
,
&
window_rect
);
mirror_rect
(
&
parent
->
client_rect
,
&
client_rect
);
}
WIN_ReleasePtr
(
parent
);
}
break
;
case
COORDS_SCREEN
:
while
(
win
->
parent
)
{
WND
*
parent
=
WIN_GetPtr
(
win
->
parent
);
if
(
parent
==
WND_DESKTOP
)
break
;
if
(
!
parent
||
parent
==
WND_OTHER_PROCESS
)
{
WIN_ReleasePtr
(
win
);
goto
other_process
;
}
WIN_ReleasePtr
(
win
);
if
(
parent
->
flags
&
WIN_CHILDREN_MOVED
)
{
WIN_ReleasePtr
(
parent
);
goto
other_process
;
}
win
=
parent
;
if
(
win
->
parent
)
{
OffsetRect
(
&
window_rect
,
win
->
client_rect
.
left
,
win
->
client_rect
.
top
);
OffsetRect
(
&
client_rect
,
win
->
client_rect
.
left
,
win
->
client_rect
.
top
);
}
}
break
;
}
if
(
rectWindow
)
*
rectWindow
=
rect_win_to_thread_dpi
(
hwnd
,
window_rect
);
if
(
rectClient
)
*
rectClient
=
rect_win_to_thread_dpi
(
hwnd
,
client_rect
);
WIN_ReleasePtr
(
win
);
return
TRUE
;
}
other_process:
SERVER_START_REQ
(
get_window_rectangles
)
{
req
->
handle
=
wine_server_user_handle
(
hwnd
);
req
->
relative
=
relative
;
req
->
dpi
=
get_thread_dpi
();
if
((
ret
=
!
wine_server_call_err
(
req
)))
{
if
(
rectWindow
)
{
rectWindow
->
left
=
reply
->
window
.
left
;
rectWindow
->
top
=
reply
->
window
.
top
;
rectWindow
->
right
=
reply
->
window
.
right
;
rectWindow
->
bottom
=
reply
->
window
.
bottom
;
}
if
(
rectClient
)
{
rectClient
->
left
=
reply
->
client
.
left
;
rectClient
->
top
=
reply
->
client
.
top
;
rectClient
->
right
=
reply
->
client
.
right
;
rectClient
->
bottom
=
reply
->
client
.
bottom
;
}
}
}
SERVER_END_REQ
;
return
ret
;
}
/***********************************************************************
* dump_window_styles
*/
static
void
dump_window_styles
(
DWORD
style
,
DWORD
exstyle
)
...
...
dlls/user32/win.h
View file @
421fb1c8
...
...
@@ -30,9 +30,6 @@
#include "user_private.h"
#include "wine/server_protocol.h"
struct
tagCLASS
;
struct
tagDIALOGINFO
;
/* Window functions */
extern
HWND
get_hwnd_message_parent
(
void
)
DECLSPEC_HIDDEN
;
extern
BOOL
is_desktop_window
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
...
...
@@ -40,7 +37,6 @@ extern HWND WIN_GetFullHandle( HWND hwnd ) DECLSPEC_HIDDEN;
extern
HWND
WIN_IsCurrentProcess
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
HWND
WIN_IsCurrentThread
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
ULONG
WIN_SetStyle
(
HWND
hwnd
,
ULONG
set_bits
,
ULONG
clear_bits
)
DECLSPEC_HIDDEN
;
extern
BOOL
WIN_GetRectangles
(
HWND
hwnd
,
enum
coords_relative
relative
,
RECT
*
rectWindow
,
RECT
*
rectClient
)
DECLSPEC_HIDDEN
;
extern
HWND
WIN_CreateWindowEx
(
CREATESTRUCTW
*
cs
,
LPCWSTR
className
,
HINSTANCE
module
,
BOOL
unicode
)
DECLSPEC_HIDDEN
;
extern
HWND
*
WIN_ListChildren
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
void
MDI_CalcDefaultChildPos
(
HWND
hwndClient
,
INT
total
,
LPPOINT
lpPos
,
INT
delta
,
UINT
*
id
)
DECLSPEC_HIDDEN
;
...
...
dlls/win32u/sysparams.c
View file @
421fb1c8
...
...
@@ -5080,9 +5080,6 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code
case
NtUserAllocWinProc
:
return
(
UINT_PTR
)
alloc_winproc
(
(
WNDPROC
)
arg1
,
arg2
);
case
NtUserGetHandlePtr
:
return
(
UINT_PTR
)
get_user_handle_ptr
(
UlongToHandle
(
arg1
),
arg2
);
default:
FIXME
(
"invalid code %u
\n
"
,
code
);
return
0
;
...
...
dlls/win32u/window.c
View file @
421fb1c8
...
...
@@ -5473,6 +5473,9 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code )
case
NtUserCallHwndParam_EnableWindow
:
return
enable_window
(
hwnd
,
param
);
case
NtUserCallHwndParam_GetChildRect
:
return
get_window_rects
(
hwnd
,
COORDS_PARENT
,
(
RECT
*
)
param
,
NULL
,
get_thread_dpi
()
);
case
NtUserCallHwndParam_GetClassLongA
:
return
get_class_long
(
hwnd
,
param
,
TRUE
);
...
...
include/ntuser.h
View file @
421fb1c8
...
...
@@ -1047,7 +1047,6 @@ enum
NtUserCallTwoParam_UnhookWindowsHook
,
/* temporary exports */
NtUserAllocWinProc
,
NtUserGetHandlePtr
,
};
static
inline
BOOL
NtUserGetMenuInfo
(
HMENU
menu
,
MENUINFO
*
info
)
...
...
@@ -1210,6 +1209,7 @@ enum
{
NtUserCallHwndParam_ClientToScreen
,
NtUserCallHwndParam_EnableWindow
,
NtUserCallHwndParam_GetChildRect
,
NtUserCallHwndParam_GetClassLongA
,
NtUserCallHwndParam_GetClassLongW
,
NtUserCallHwndParam_GetClassLongPtrA
,
...
...
@@ -1253,6 +1253,11 @@ static inline BOOL NtUserEnableWindow( HWND hwnd, BOOL enable )
return
NtUserCallHwndParam
(
hwnd
,
enable
,
NtUserCallHwndParam_EnableWindow
);
}
static
inline
BOOL
NtUserGetChildRect
(
HWND
hwnd
,
RECT
*
rect
)
{
return
NtUserCallHwndParam
(
hwnd
,
(
UINT_PTR
)
rect
,
NtUserCallHwndParam_GetChildRect
);
}
static
inline
DWORD
NtUserGetClassLongA
(
HWND
hwnd
,
INT
offset
)
{
return
NtUserCallHwndParam
(
hwnd
,
offset
,
NtUserCallHwndParam_GetClassLongA
);
...
...
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