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
975bff62
Commit
975bff62
authored
Oct 08, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Convert the icon cache to a standard Wine list.
parent
990842a3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
14 deletions
+8
-14
cursoricon.c
dlls/user32/cursoricon.c
+8
-14
No files found.
dlls/user32/cursoricon.c
View file @
975bff62
...
...
@@ -38,6 +38,7 @@
#include "wine/server.h"
#include "controls.h"
#include "user_private.h"
#include "wine/list.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
cursor
);
...
...
@@ -76,15 +77,10 @@ static const WCHAR DISPLAYW[] = {'D','I','S','P','L','A','Y',0};
/**********************************************************************
* ICONCACHE for cursors/icons loaded with LR_SHARED.
*
* FIXME: This should not be allocated on the system heap, but on a
* subsystem-global heap (i.e. one for all Win16 processes,
* and one for each Win32 process).
*/
typedef
struct
tagICONCACHE
{
struct
tagICONCACHE
*
next
;
struct
list
entry
;
HMODULE
hModule
;
HRSRC
hRsrc
;
HRSRC
hGroupRsrc
;
...
...
@@ -94,7 +90,7 @@ typedef struct tagICONCACHE
}
ICONCACHE
;
static
ICONCACHE
*
IconAnchor
=
NULL
;
static
struct
list
icon_cache
=
LIST_INIT
(
icon_cache
)
;
static
CRITICAL_SECTION
IconCrst
;
static
CRITICAL_SECTION_DEBUG
critsect_debug
=
...
...
@@ -413,7 +409,7 @@ static HICON CURSORICON_FindSharedIcon( HMODULE hModule, HRSRC hRsrc )
EnterCriticalSection
(
&
IconCrst
);
for
(
ptr
=
IconAnchor
;
ptr
;
ptr
=
ptr
->
next
)
LIST_FOR_EACH_ENTRY
(
ptr
,
&
icon_cache
,
ICONCACHE
,
entry
)
if
(
ptr
->
hModule
==
hModule
&&
ptr
->
hRsrc
==
hRsrc
)
{
ptr
->
count
++
;
...
...
@@ -443,16 +439,15 @@ static ICONCACHE* CURSORICON_FindCache(HICON hIcon)
{
ICONCACHE
*
ptr
;
ICONCACHE
*
pRet
=
NULL
;
BOOL
IsFound
=
FALSE
;
EnterCriticalSection
(
&
IconCrst
);
for
(
ptr
=
IconAnchor
;
ptr
!=
NULL
&&
!
IsFound
;
ptr
=
ptr
->
next
)
LIST_FOR_EACH_ENTRY
(
ptr
,
&
icon_cache
,
ICONCACHE
,
entry
)
{
if
(
hIcon
==
ptr
->
hIcon
)
{
IsFound
=
TRUE
;
pRet
=
ptr
;
break
;
}
}
...
...
@@ -476,8 +471,7 @@ static void CURSORICON_AddSharedIcon( HMODULE hModule, HRSRC hRsrc, HRSRC hGroup
ptr
->
count
=
1
;
EnterCriticalSection
(
&
IconCrst
);
ptr
->
next
=
IconAnchor
;
IconAnchor
=
ptr
;
list_add_head
(
&
icon_cache
,
&
ptr
->
entry
);
LeaveCriticalSection
(
&
IconCrst
);
}
...
...
@@ -491,7 +485,7 @@ static INT CURSORICON_DelSharedIcon( HICON hIcon )
EnterCriticalSection
(
&
IconCrst
);
for
(
ptr
=
IconAnchor
;
ptr
;
ptr
=
ptr
->
next
)
LIST_FOR_EACH_ENTRY
(
ptr
,
&
icon_cache
,
ICONCACHE
,
entry
)
if
(
ptr
->
hIcon
==
hIcon
)
{
if
(
ptr
->
count
>
0
)
ptr
->
count
--
;
...
...
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