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
7297a8e6
Commit
7297a8e6
authored
Mar 11, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Introduce new next_process_user_handle_ptr helper.
And use it instead of next_thread_window_ptr.
parent
8dab5e32
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
29 deletions
+25
-29
ntuser_private.h
dlls/win32u/ntuser_private.h
+1
-5
window.c
dlls/win32u/window.c
+24
-24
No files found.
dlls/win32u/ntuser_private.h
View file @
7297a8e6
...
...
@@ -52,11 +52,6 @@ struct user_object
#define OBJ_OTHER_PROCESS ((void *)1)
/* returned by get_user_handle_ptr on unknown handles */
HANDLE
alloc_user_handle
(
struct
user_object
*
ptr
,
unsigned
int
type
)
DECLSPEC_HIDDEN
;
void
*
get_user_handle_ptr
(
HANDLE
handle
,
unsigned
int
type
)
DECLSPEC_HIDDEN
;
void
release_user_handle_ptr
(
void
*
ptr
)
DECLSPEC_HIDDEN
;
void
*
free_user_handle
(
HANDLE
handle
,
unsigned
int
type
)
DECLSPEC_HIDDEN
;
typedef
struct
tagWND
{
struct
user_object
obj
;
/* object header */
...
...
@@ -246,6 +241,7 @@ HANDLE alloc_user_handle( struct user_object *ptr, unsigned int type ) DECLSPEC_
void
*
free_user_handle
(
HANDLE
handle
,
unsigned
int
type
)
DECLSPEC_HIDDEN
;
void
*
get_user_handle_ptr
(
HANDLE
handle
,
unsigned
int
type
)
DECLSPEC_HIDDEN
;
void
release_user_handle_ptr
(
void
*
ptr
)
DECLSPEC_HIDDEN
;
void
*
next_process_user_handle_ptr
(
HANDLE
*
handle
,
unsigned
int
type
)
DECLSPEC_HIDDEN
;
UINT
win_set_flags
(
HWND
hwnd
,
UINT
set_mask
,
UINT
clear_mask
)
DECLSPEC_HIDDEN
;
static
inline
UINT
win_get_flags
(
HWND
hwnd
)
...
...
dlls/win32u/window.c
View file @
7297a8e6
...
...
@@ -102,6 +102,26 @@ void *get_user_handle_ptr( HANDLE handle, unsigned int type )
}
/***********************************************************************
* next_process_user_handle_ptr
*
* user_lock must be held by caller.
*/
void
*
next_process_user_handle_ptr
(
HANDLE
*
handle
,
unsigned
int
type
)
{
struct
user_object
*
ptr
;
WORD
index
=
*
handle
?
USER_HANDLE_TO_INDEX
(
*
handle
)
+
1
:
0
;
while
(
index
<
NB_USER_HANDLES
)
{
if
(
!
(
ptr
=
user_handles
[
index
++
]))
continue
;
/* OBJ_OTHER_PROCESS */
if
(
ptr
->
type
!=
type
)
continue
;
*
handle
=
ptr
->
handle
;
return
ptr
;
}
return
NULL
;
}
/***********************************************************************
* set_user_handle_ptr
*/
static
void
set_user_handle_ptr
(
HANDLE
handle
,
struct
user_object
*
ptr
)
...
...
@@ -142,27 +162,6 @@ void *free_user_handle( HANDLE handle, unsigned int type )
return
ptr
;
}
/***********************************************************************
* next_thread_window
*/
static
WND
*
next_thread_window_ptr
(
HWND
*
hwnd
)
{
struct
user_object
*
ptr
;
WND
*
win
;
WORD
index
=
*
hwnd
?
USER_HANDLE_TO_INDEX
(
*
hwnd
)
+
1
:
0
;
while
(
index
<
NB_USER_HANDLES
)
{
if
(
!
(
ptr
=
user_handles
[
index
++
]))
continue
;
if
(
ptr
->
type
!=
NTUSER_OBJ_WINDOW
)
continue
;
win
=
(
WND
*
)
ptr
;
if
(
win
->
tid
!=
GetCurrentThreadId
())
continue
;
*
hwnd
=
ptr
->
handle
;
return
win
;
}
return
NULL
;
}
/*******************************************************************
* get_hwnd_message_parent
*
...
...
@@ -4846,13 +4845,14 @@ BOOL WINAPI NtUserDestroyWindow( HWND hwnd )
void
destroy_thread_windows
(
void
)
{
WND
*
win
,
*
free_list
=
NULL
;
H
WND
hwnd
=
0
;
H
ANDLE
handle
=
0
;
user_lock
();
while
((
win
=
next_
thread_window_ptr
(
&
hwnd
)))
while
((
win
=
next_
process_user_handle_ptr
(
&
handle
,
NTUSER_OBJ_WINDOW
)))
{
if
(
win
->
tid
!=
GetCurrentThreadId
())
continue
;
free_dce
(
win
->
dce
,
win
->
obj
.
handle
);
set_user_handle_ptr
(
h
wnd
,
NULL
);
set_user_handle_ptr
(
h
andle
,
NULL
);
win
->
obj
.
handle
=
free_list
;
free_list
=
win
;
}
...
...
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