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
bb6769f4
Commit
bb6769f4
authored
Jun 18, 2010
by
Paul Chitescu
Committed by
Alexandre Julliard
Jun 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Use a safer method of freeing user handles to prevent zeroing out a newly allocated handle.
parent
e4a4065b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
win.c
dlls/user32/win.c
+7
-7
No files found.
dlls/user32/win.c
View file @
bb6769f4
...
...
@@ -107,7 +107,7 @@ HANDLE alloc_user_handle( struct user_object *ptr, enum user_obj_type type )
assert
(
index
<
NB_USER_HANDLES
);
ptr
->
handle
=
handle
;
ptr
->
type
=
type
;
user_handles
[
index
]
=
ptr
;
InterlockedExchangePointer
(
&
user_handles
[
index
],
ptr
)
;
}
return
handle
;
}
...
...
@@ -161,8 +161,8 @@ void *free_user_handle( HANDLE handle, enum user_obj_type type )
SERVER_START_REQ
(
free_user_handle
)
{
req
->
handle
=
wine_server_user_handle
(
handle
);
if
(
!
wine_server_call
(
req
))
user_handles
[
index
]
=
NULL
;
else
ptr
=
NULL
;
if
(
wine_server_call
(
req
))
ptr
=
NULL
;
else
InterlockedCompareExchangePointer
(
&
user_handles
[
index
],
NULL
,
ptr
)
;
}
SERVER_END_REQ
;
release_user_handle_ptr
(
ptr
);
...
...
@@ -243,7 +243,6 @@ static WND *create_window_handle( HWND parent, HWND owner, LPCWSTR name,
index
=
USER_HANDLE_TO_INDEX
(
handle
);
assert
(
index
<
NB_USER_HANDLES
);
user_handles
[
index
]
=
win
;
win
->
obj
.
handle
=
handle
;
win
->
obj
.
type
=
USER_WINDOW
;
win
->
parent
=
full_parent
;
...
...
@@ -251,6 +250,7 @@ static WND *create_window_handle( HWND parent, HWND owner, LPCWSTR name,
win
->
class
=
class
;
win
->
winproc
=
get_class_winproc
(
class
);
win
->
cbWndExtra
=
extra_bytes
;
InterlockedExchangePointer
(
&
user_handles
[
index
],
win
);
if
(
WINPROC_IsUnicode
(
win
->
winproc
,
unicode
))
win
->
flags
|=
WIN_ISUNICODE
;
return
win
;
}
...
...
@@ -271,8 +271,8 @@ static void free_window_handle( HWND hwnd )
SERVER_START_REQ
(
destroy_window
)
{
req
->
handle
=
wine_server_user_handle
(
hwnd
);
if
(
!
wine_server_call_err
(
req
))
user_handles
[
index
]
=
NULL
;
else
ptr
=
NULL
;
if
(
wine_server_call_err
(
req
))
ptr
=
NULL
;
else
InterlockedCompareExchangePointer
(
&
user_handles
[
index
],
NULL
,
ptr
)
;
}
SERVER_END_REQ
;
release_user_handle_ptr
(
ptr
);
...
...
@@ -815,7 +815,7 @@ static void destroy_thread_window( HWND hwnd )
if
((
wndPtr
->
dwStyle
&
(
WS_CHILD
|
WS_POPUP
))
!=
WS_CHILD
)
menu
=
(
HMENU
)
wndPtr
->
wIDmenu
;
sys_menu
=
wndPtr
->
hSysMenu
;
free_dce
(
wndPtr
->
dce
,
hwnd
);
user_handles
[
index
]
=
NULL
;
InterlockedCompareExchangePointer
(
&
user_handles
[
index
],
NULL
,
wndPtr
)
;
}
USER_Unlock
();
...
...
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