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
0d07420e
Commit
0d07420e
authored
Dec 24, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Use a standard critical section instead of a syslevel for the GDI lock.
parent
20a50f30
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
15 deletions
+19
-15
gdiobj.c
dlls/gdi32/gdiobj.c
+19
-15
No files found.
dlls/gdi32/gdiobj.c
View file @
0d07420e
...
...
@@ -67,14 +67,14 @@ static const LOGPEN DCPen = { PS_SOLID, { 0, 0 }, RGB(0,0,0) };
static
HGDIOBJ
stock_objects
[
NB_STOCK_OBJECTS
];
static
SYSLEVEL
GDI_level
;
static
CRITICAL_SECTION
gdi_section
;
static
CRITICAL_SECTION_DEBUG
critsect_debug
=
{
0
,
0
,
&
GDI_level
.
crst
,
0
,
0
,
&
gdi_section
,
{
&
critsect_debug
.
ProcessLocksList
,
&
critsect_debug
.
ProcessLocksList
},
0
,
0
,
{
(
DWORD_PTR
)(
__FILE__
":
GDI_level
"
)
}
0
,
0
,
{
(
DWORD_PTR
)(
__FILE__
":
gdi_section
"
)
}
};
static
SYSLEVEL
GDI_level
=
{
{
&
critsect_debug
,
-
1
,
0
,
0
,
0
,
0
},
3
};
static
CRITICAL_SECTION
gdi_section
=
{
&
critsect_debug
,
-
1
,
0
,
0
,
0
,
0
};
/****************************************************************************
...
...
@@ -649,18 +649,18 @@ HGDIOBJ alloc_gdi_handle( GDIOBJHDR *obj, WORD type, const struct gdi_obj_funcs
obj
->
funcs
=
funcs
;
obj
->
hdcs
=
NULL
;
_EnterSysLevel
(
&
GDI_level
);
EnterCriticalSection
(
&
gdi_section
);
for
(
i
=
next_large_handle
+
1
;
i
<
MAX_LARGE_HANDLES
;
i
++
)
if
(
!
large_handles
[
i
])
goto
found
;
for
(
i
=
0
;
i
<=
next_large_handle
;
i
++
)
if
(
!
large_handles
[
i
])
goto
found
;
_LeaveSysLevel
(
&
GDI_level
);
LeaveCriticalSection
(
&
gdi_section
);
return
0
;
found:
large_handles
[
i
]
=
obj
;
next_large_handle
=
i
;
_LeaveSysLevel
(
&
GDI_level
);
LeaveCriticalSection
(
&
gdi_section
);
return
(
HGDIOBJ
)(
ULONG_PTR
)((
i
+
FIRST_LARGE_HANDLE
)
<<
2
);
}
...
...
@@ -678,10 +678,10 @@ void *free_gdi_handle( HGDIOBJ handle )
i
=
((
ULONG_PTR
)
handle
>>
2
)
-
FIRST_LARGE_HANDLE
;
if
(
i
>=
0
&&
i
<
MAX_LARGE_HANDLES
)
{
_EnterSysLevel
(
&
GDI_level
);
EnterCriticalSection
(
&
gdi_section
);
object
=
large_handles
[
i
];
large_handles
[
i
]
=
NULL
;
_LeaveSysLevel
(
&
GDI_level
);
LeaveCriticalSection
(
&
gdi_section
);
}
if
(
object
)
{
...
...
@@ -704,7 +704,7 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD type )
GDIOBJHDR
*
ptr
=
NULL
;
int
i
;
_EnterSysLevel
(
&
GDI_level
);
EnterCriticalSection
(
&
gdi_section
);
i
=
((
UINT_PTR
)
handle
>>
2
)
-
FIRST_LARGE_HANDLE
;
if
(
i
>=
0
&&
i
<
MAX_LARGE_HANDLES
)
...
...
@@ -715,10 +715,10 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD type )
if
(
!
ptr
)
{
_LeaveSysLevel
(
&
GDI_level
);
LeaveCriticalSection
(
&
gdi_section
);
WARN
(
"Invalid handle %p
\n
"
,
handle
);
}
else
TRACE
(
"(%p): enter %d
\n
"
,
handle
,
GDI_level
.
crst
.
RecursionCount
);
else
TRACE
(
"(%p): enter %d
\n
"
,
handle
,
gdi_section
.
RecursionCount
);
return
ptr
;
}
...
...
@@ -730,8 +730,8 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD type )
*/
void
GDI_ReleaseObj
(
HGDIOBJ
handle
)
{
TRACE
(
"(%p): leave %d
\n
"
,
handle
,
GDI_level
.
crst
.
RecursionCount
);
_LeaveSysLevel
(
&
GDI_level
);
TRACE
(
"(%p): leave %d
\n
"
,
handle
,
gdi_section
.
RecursionCount
);
LeaveCriticalSection
(
&
gdi_section
);
}
...
...
@@ -740,7 +740,11 @@ void GDI_ReleaseObj( HGDIOBJ handle )
*/
void
GDI_CheckNotLock
(
void
)
{
_CheckNotSysLevel
(
&
GDI_level
);
if
(
gdi_section
.
OwningThread
==
ULongToHandle
(
GetCurrentThreadId
())
&&
gdi_section
.
RecursionCount
)
{
ERR
(
"BUG: holding GDI lock
\n
"
);
DebugBreak
();
}
}
...
...
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