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
bbb5fb7e
Commit
bbb5fb7e
authored
Aug 12, 2022
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Nov 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uxtheme: Use atomic functions for reference counting.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
parent
113eca09
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
msstyles.c
dlls/uxtheme/msstyles.c
+8
-5
msstyles.h
dlls/uxtheme/msstyles.h
+1
-1
No files found.
dlls/uxtheme/msstyles.c
View file @
bbb5fb7e
...
...
@@ -171,7 +171,7 @@ HRESULT MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile, LPCWSTR pszColorName, LPCWST
(
*
tf
)
->
pszAvailSizes
=
pszSizes
;
(
*
tf
)
->
pszSelectedColor
=
pszSelectedColor
;
(
*
tf
)
->
pszSelectedSize
=
pszSelectedSize
;
(
*
tf
)
->
dwRefC
ount
=
1
;
(
*
tf
)
->
refc
ount
=
1
;
return
S_OK
;
invalid_theme:
...
...
@@ -187,9 +187,12 @@ invalid_theme:
*/
void
MSSTYLES_CloseThemeFile
(
PTHEME_FILE
tf
)
{
LONG
refcount
;
if
(
tf
)
{
tf
->
dwRefCount
--
;
if
(
!
tf
->
dwRefCount
)
{
refcount
=
InterlockedDecrement
(
&
tf
->
refcount
);
if
(
!
refcount
)
{
if
(
tf
->
hTheme
)
FreeLibrary
(
tf
->
hTheme
);
if
(
tf
->
classes
)
{
while
(
tf
->
classes
)
{
...
...
@@ -235,7 +238,7 @@ HRESULT MSSTYLES_SetActiveTheme(PTHEME_FILE tf, BOOL setMetrics)
tfActiveTheme
=
tf
;
if
(
tfActiveTheme
)
{
tfActiveTheme
->
dwRefCount
++
;
InterlockedIncrement
(
&
tfActiveTheme
->
refcount
)
;
if
(
!
tfActiveTheme
->
classes
)
MSSTYLES_ParseThemeIni
(
tfActiveTheme
,
setMetrics
);
}
...
...
@@ -1061,7 +1064,7 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList, U
if
(
cls
)
{
TRACE
(
"Opened app %s, class %s from list %s
\n
"
,
debugstr_w
(
cls
->
szAppName
),
debugstr_w
(
cls
->
szClassName
),
debugstr_w
(
pszClassList
));
cls
->
tf
=
tfActiveTheme
;
cls
->
tf
->
dwRefCount
++
;
InterlockedIncrement
(
&
cls
->
tf
->
refcount
)
;
InterlockedIncrement
(
&
cls
->
refcount
);
cls
->
dpi
=
dpi
;
}
...
...
dlls/uxtheme/msstyles.h
View file @
bbb5fb7e
...
...
@@ -71,7 +71,7 @@ typedef struct _THEME_IMAGE {
}
THEME_IMAGE
,
*
PTHEME_IMAGE
;
typedef
struct
_THEME_FILE
{
DWORD
dwRefC
ount
;
LONG
refc
ount
;
HMODULE
hTheme
;
WCHAR
szThemeFile
[
MAX_PATH
];
LPWSTR
pszAvailColors
;
...
...
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