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
9ff44b81
Commit
9ff44b81
authored
Jan 27, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Don't hold the GDI lock while calling the UnrealizeObject method for GDI objects.
parent
f0387109
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
23 deletions
+22
-23
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-1
gdiobj.c
dlls/gdi32/gdiobj.c
+10
-11
palette.c
dlls/gdi32/palette.c
+11
-11
No files found.
dlls/gdi32/gdi_private.h
View file @
9ff44b81
...
...
@@ -74,7 +74,7 @@ struct gdi_obj_funcs
HGDIOBJ
(
*
pSelectObject
)(
HGDIOBJ
handle
,
HDC
hdc
);
INT
(
*
pGetObjectA
)(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
INT
(
*
pGetObjectW
)(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
BOOL
(
*
pUnrealizeObject
)(
HGDIOBJ
handle
,
void
*
obj
);
BOOL
(
*
pUnrealizeObject
)(
HGDIOBJ
handle
);
BOOL
(
*
pDeleteObject
)(
HGDIOBJ
handle
);
};
...
...
dlls/gdi32/gdiobj.c
View file @
9ff44b81
...
...
@@ -1145,20 +1145,19 @@ HGDIOBJ WINAPI SelectObject( HDC hdc, HGDIOBJ hObj )
*/
BOOL
WINAPI
UnrealizeObject
(
HGDIOBJ
obj
)
{
BOOL
result
=
TRUE
;
/* Check if object is valid */
BOOL
result
=
FALSE
;
GDIOBJHDR
*
header
=
GDI_GetObjPtr
(
obj
,
MAGIC_DONTCARE
);
if
(
!
header
)
return
FALSE
;
TRACE
(
"%p
\n
"
,
obj
);
/* Unrealize object */
if
(
header
->
funcs
&&
header
->
funcs
->
pUnrealizeObject
)
result
=
header
->
funcs
->
pUnrealizeObject
(
obj
,
header
);
if
(
header
)
{
const
struct
gdi_obj_funcs
*
funcs
=
header
->
funcs
;
GDI_ReleaseObj
(
obj
);
GDI_ReleaseObj
(
obj
);
if
(
funcs
&&
funcs
->
pUnrealizeObject
)
result
=
header
->
funcs
->
pUnrealizeObject
(
obj
);
else
result
=
TRUE
;
}
return
result
;
}
...
...
dlls/gdi32/palette.c
View file @
9ff44b81
...
...
@@ -46,7 +46,7 @@ typedef struct tagPALETTEOBJ
}
PALETTEOBJ
;
static
INT
PALETTE_GetObject
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
static
BOOL
PALETTE_UnrealizeObject
(
HGDIOBJ
handle
,
void
*
obj
);
static
BOOL
PALETTE_UnrealizeObject
(
HGDIOBJ
handle
);
static
BOOL
PALETTE_DeleteObject
(
HGDIOBJ
handle
);
static
const
struct
gdi_obj_funcs
palette_funcs
=
...
...
@@ -374,12 +374,11 @@ BOOL WINAPI ResizePalette(
if
(
!
(
palPtr
=
GDI_ReallocObject
(
size
,
hPal
,
palPtr
)))
return
FALSE
;
PALETTE_UnrealizeObject
(
hPal
,
palPtr
);
if
(
cEntries
>
cPrevEnt
)
memset
(
(
BYTE
*
)
palPtr
+
prevsize
,
0
,
size
-
prevsize
);
palPtr
->
logpalette
.
palNumEntries
=
cEntries
;
palPtr
->
logpalette
.
palVersion
=
prevVer
;
GDI_ReleaseObj
(
hPal
);
PALETTE_UnrealizeObject
(
hPal
);
return
TRUE
;
}
...
...
@@ -647,15 +646,16 @@ static INT PALETTE_GetObject( HGDIOBJ handle, void *obj, INT count, LPVOID buffe
/***********************************************************************
* PALETTE_UnrealizeObject
*/
static
BOOL
PALETTE_UnrealizeObject
(
HGDIOBJ
handle
,
void
*
obj
)
static
BOOL
PALETTE_UnrealizeObject
(
HGDIOBJ
handle
)
{
PALETTEOBJ
*
palette
=
obj
;
PALETTEOBJ
*
palette
=
GDI_GetObjPtr
(
handle
,
PALETTE_MAGIC
)
;
if
(
palette
->
funcs
)
if
(
palette
)
{
if
(
palette
->
funcs
->
pUnrealizePalette
)
palette
->
funcs
->
pUnrealizePalette
(
handle
);
const
DC_FUNCTIONS
*
funcs
=
palette
->
funcs
;
palette
->
funcs
=
NULL
;
GDI_ReleaseObj
(
handle
);
if
(
funcs
&&
funcs
->
pUnrealizePalette
)
funcs
->
pUnrealizePalette
(
handle
);
}
if
(
InterlockedCompareExchangePointer
(
(
void
**
)
&
hLastRealizedPalette
,
0
,
handle
)
==
handle
)
...
...
@@ -670,10 +670,10 @@ static BOOL PALETTE_UnrealizeObject( HGDIOBJ handle, void *obj )
*/
static
BOOL
PALETTE_DeleteObject
(
HGDIOBJ
handle
)
{
PALETTEOBJ
*
obj
=
GDI_GetObjPtr
(
handle
,
PALETTE_MAGIC
)
;
PALETTEOBJ
*
obj
;
if
(
!
obj
)
return
FALSE
;
PALETTE_UnrealizeObject
(
handle
,
obj
)
;
PALETTE_UnrealizeObject
(
handle
)
;
if
(
!
(
obj
=
GDI_GetObjPtr
(
handle
,
PALETTE_MAGIC
)))
return
FALSE
;
return
GDI_FreeObject
(
handle
,
obj
);
}
...
...
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