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
db8f6437
Commit
db8f6437
authored
Jun 07, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Don't call CopyImage with user lock in set_class_long.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
40cda880
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
15 deletions
+47
-15
class.c
dlls/win32u/class.c
+47
-15
No files found.
dlls/win32u/class.c
View file @
db8f6437
...
...
@@ -647,6 +647,7 @@ static BOOL set_server_info( HWND hwnd, INT offset, LONG_PTR newval, UINT size )
static
ULONG_PTR
set_class_long
(
HWND
hwnd
,
INT
offset
,
LONG_PTR
newval
,
UINT
size
,
BOOL
ansi
)
{
ULONG_PTR
retval
=
0
;
HICON
small_icon
=
0
;
CLASS
*
class
;
if
(
!
(
class
=
get_class_ptr
(
hwnd
,
TRUE
)))
return
0
;
...
...
@@ -696,31 +697,62 @@ static ULONG_PTR set_class_long( HWND hwnd, INT offset, LONG_PTR newval, UINT si
break
;
case
GCLP_HICON
:
retval
=
(
ULONG_PTR
)
class
->
hIcon
;
if
(
class
->
hIconSmIntern
)
if
(
retval
==
newval
)
break
;
if
(
newval
&&
!
class
->
hIconSm
)
{
NtUserDestroyCursor
(
class
->
hIconSmIntern
,
0
);
class
->
hIconSmIntern
=
NULL
;
release_class_ptr
(
class
);
small_icon
=
CopyImage
(
(
HICON
)
newval
,
IMAGE_ICON
,
get_system_metrics
(
SM_CXSMICON
),
get_system_metrics
(
SM_CYSMICON
),
LR_COPYFROMRESOURCE
);
if
(
!
(
class
=
get_class_ptr
(
hwnd
,
TRUE
)))
{
NtUserDestroyCursor
(
small_icon
,
0
);
return
0
;
}
if
(
retval
!=
HandleToUlong
(
class
->
hIcon
)
||
class
->
hIconSm
)
{
/* someone beat us, restart */
release_class_ptr
(
class
);
NtUserDestroyCursor
(
small_icon
,
0
);
return
set_class_long
(
hwnd
,
offset
,
newval
,
size
,
ansi
);
}
}
if
(
newval
&&
!
class
->
hIconSm
)
class
->
hIconSmIntern
=
CopyImage
(
(
HICON
)
newval
,
IMAGE_ICON
,
get_system_metrics
(
SM_CXSMICON
),
get_system_metrics
(
SM_CYSMICON
),
LR_COPYFROMRESOURCE
);
if
(
class
->
hIconSmIntern
)
NtUserDestroyCursor
(
class
->
hIconSmIntern
,
0
);
class
->
hIcon
=
(
HICON
)
newval
;
class
->
hIconSmIntern
=
small_icon
;
break
;
case
GCLP_HICONSM
:
retval
=
(
ULONG_PTR
)
class
->
hIconSm
;
if
(
retval
==
newval
)
break
;
if
(
retval
&&
!
newval
&&
class
->
hIcon
)
class
->
hIconSmIntern
=
CopyImage
(
class
->
hIcon
,
IMAGE_ICON
,
get_system_metrics
(
SM_CXSMICON
),
get_system_metrics
(
SM_CYSMICON
),
LR_COPYFROMRESOURCE
);
else
if
(
newval
&&
class
->
hIconSmIntern
)
{
NtUserDestroyCursor
(
class
->
hIconSmIntern
,
0
);
class
->
hIconSmIntern
=
NULL
;
HICON
icon
=
class
->
hIcon
;
release_class_ptr
(
class
);
small_icon
=
CopyImage
(
icon
,
IMAGE_ICON
,
get_system_metrics
(
SM_CXSMICON
),
get_system_metrics
(
SM_CYSMICON
),
LR_COPYFROMRESOURCE
);
if
(
!
(
class
=
get_class_ptr
(
hwnd
,
TRUE
)))
{
NtUserDestroyCursor
(
small_icon
,
0
);
return
0
;
}
if
(
class
->
hIcon
!=
icon
||
!
class
->
hIconSm
)
{
/* someone beat us, restart */
release_class_ptr
(
class
);
NtUserDestroyCursor
(
small_icon
,
0
);
return
set_class_long
(
hwnd
,
offset
,
newval
,
size
,
ansi
);
}
}
if
(
class
->
hIconSmIntern
)
NtUserDestroyCursor
(
class
->
hIconSmIntern
,
0
);
class
->
hIconSm
=
(
HICON
)
newval
;
class
->
hIconSmIntern
=
small_icon
;
break
;
case
GCL_STYLE
:
if
(
!
set_server_info
(
hwnd
,
offset
,
newval
,
size
))
break
;
...
...
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