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
f0387109
Commit
f0387109
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 DeleteObject method for GDI objects.
parent
b4255d29
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
53 additions
and
29 deletions
+53
-29
bitmap.c
dlls/gdi32/bitmap.c
+6
-4
brush.c
dlls/gdi32/brush.c
+5
-4
dc.c
dlls/gdi32/dc.c
+2
-3
font.c
dlls/gdi32/font.c
+4
-2
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-1
gdiobj.c
dlls/gdi32/gdiobj.c
+7
-4
palette.c
dlls/gdi32/palette.c
+5
-2
pen.c
dlls/gdi32/pen.c
+14
-1
region.c
dlls/gdi32/region.c
+9
-8
No files found.
dlls/gdi32/bitmap.c
View file @
f0387109
...
...
@@ -35,7 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(bitmap);
static
HGDIOBJ
BITMAP_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
);
static
INT
BITMAP_GetObject
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
static
BOOL
BITMAP_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
);
static
BOOL
BITMAP_DeleteObject
(
HGDIOBJ
handle
);
static
const
struct
gdi_obj_funcs
bitmap_funcs
=
{
...
...
@@ -624,9 +624,11 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc )
/***********************************************************************
* BITMAP_DeleteObject
*/
static
BOOL
BITMAP_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
)
static
BOOL
BITMAP_DeleteObject
(
HGDIOBJ
handle
)
{
BITMAPOBJ
*
bmp
=
obj
;
BITMAPOBJ
*
bmp
=
GDI_GetObjPtr
(
handle
,
BITMAP_MAGIC
);
if
(
!
bmp
)
return
FALSE
;
if
(
bmp
->
funcs
&&
bmp
->
funcs
->
pDeleteBitmap
)
bmp
->
funcs
->
pDeleteBitmap
(
handle
);
...
...
@@ -661,7 +663,7 @@ static BOOL BITMAP_DeleteObject( HGDIOBJ handle, void *obj )
}
HeapFree
(
GetProcessHeap
(),
0
,
bmp
->
color_table
);
}
return
GDI_FreeObject
(
handle
,
obj
);
return
GDI_FreeObject
(
handle
,
bmp
);
}
...
...
dlls/gdi32/brush.c
View file @
f0387109
...
...
@@ -44,7 +44,7 @@ typedef struct
static
HGDIOBJ
BRUSH_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
);
static
INT
BRUSH_GetObject
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
static
BOOL
BRUSH_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
);
static
BOOL
BRUSH_DeleteObject
(
HGDIOBJ
handle
);
static
const
struct
gdi_obj_funcs
brush_funcs
=
{
...
...
@@ -405,10 +405,11 @@ static HGDIOBJ BRUSH_SelectObject( HGDIOBJ handle, HDC hdc )
/***********************************************************************
* BRUSH_DeleteObject
*/
static
BOOL
BRUSH_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
)
static
BOOL
BRUSH_DeleteObject
(
HGDIOBJ
handle
)
{
BRUSHOBJ
*
brush
=
obj
;
BRUSHOBJ
*
brush
=
GDI_GetObjPtr
(
handle
,
BRUSH_MAGIC
)
;
if
(
!
brush
)
return
FALSE
;
switch
(
brush
->
logbrush
.
lbStyle
)
{
case
BS_PATTERN
:
...
...
@@ -418,7 +419,7 @@ static BOOL BRUSH_DeleteObject( HGDIOBJ handle, void *obj )
GlobalFree16
(
(
HGLOBAL16
)
brush
->
logbrush
.
lbHatch
);
break
;
}
return
GDI_FreeObject
(
handle
,
obj
);
return
GDI_FreeObject
(
handle
,
brush
);
}
...
...
dlls/gdi32/dc.c
View file @
f0387109
...
...
@@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dc);
static
const
WCHAR
displayW
[]
=
{
'd'
,
'i'
,
's'
,
'p'
,
'l'
,
'a'
,
'y'
,
0
};
static
BOOL
DC_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
);
static
BOOL
DC_DeleteObject
(
HGDIOBJ
handle
);
static
const
struct
gdi_obj_funcs
dc_funcs
=
{
...
...
@@ -224,9 +224,8 @@ void update_dc( DC *dc )
/***********************************************************************
* DC_DeleteObject
*/
static
BOOL
DC_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
)
static
BOOL
DC_DeleteObject
(
HGDIOBJ
handle
)
{
GDI_ReleaseObj
(
handle
);
return
DeleteDC
(
handle
);
}
...
...
dlls/gdi32/font.c
View file @
f0387109
...
...
@@ -89,7 +89,7 @@ static inline INT INTERNAL_YWSTODS(DC *dc, INT height)
static
HGDIOBJ
FONT_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
);
static
INT
FONT_GetObjectA
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
static
INT
FONT_GetObjectW
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
static
BOOL
FONT_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
);
static
BOOL
FONT_DeleteObject
(
HGDIOBJ
handle
);
static
const
struct
gdi_obj_funcs
font_funcs
=
{
...
...
@@ -545,8 +545,10 @@ static INT FONT_GetObjectW( HGDIOBJ handle, void *obj, INT count, LPVOID buffer
/***********************************************************************
* FONT_DeleteObject
*/
static
BOOL
FONT_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
)
static
BOOL
FONT_DeleteObject
(
HGDIOBJ
handle
)
{
FONTOBJ
*
obj
=
GDI_GetObjPtr
(
handle
,
FONT_MAGIC
);
/* to grab the GDI lock (FIXME) */
if
(
!
obj
)
return
FALSE
;
WineEngDestroyFontInstance
(
handle
);
return
GDI_FreeObject
(
handle
,
obj
);
}
...
...
dlls/gdi32/gdi_private.h
View file @
f0387109
...
...
@@ -75,7 +75,7 @@ struct gdi_obj_funcs
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
(
*
pDeleteObject
)(
HGDIOBJ
handle
,
void
*
obj
);
BOOL
(
*
pDeleteObject
)(
HGDIOBJ
handle
);
};
struct
hdc_list
...
...
dlls/gdi32/gdiobj.c
View file @
f0387109
...
...
@@ -809,7 +809,9 @@ BOOL WINAPI DeleteObject( HGDIOBJ obj )
/* Check if object is valid */
struct
hdc_list
*
hdcs_head
;
const
struct
gdi_obj_funcs
*
funcs
;
GDIOBJHDR
*
header
;
if
(
HIWORD
(
obj
))
return
FALSE
;
if
(
!
(
header
=
GDI_GetObjPtr
(
obj
,
MAGIC_DONTCARE
)))
return
FALSE
;
...
...
@@ -855,11 +857,12 @@ BOOL WINAPI DeleteObject( HGDIOBJ obj )
/* Delete object */
if
(
header
->
funcs
&&
header
->
funcs
->
pDeleteObject
)
return
header
->
funcs
->
pDeleteObject
(
obj
,
header
);
funcs
=
header
->
funcs
;
GDI_ReleaseObj
(
obj
);
return
FALSE
;
if
(
funcs
&&
funcs
->
pDeleteObject
)
return
funcs
->
pDeleteObject
(
obj
);
else
return
FALSE
;
}
/***********************************************************************
...
...
dlls/gdi32/palette.c
View file @
f0387109
...
...
@@ -47,7 +47,7 @@ typedef struct tagPALETTEOBJ
static
INT
PALETTE_GetObject
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
static
BOOL
PALETTE_UnrealizeObject
(
HGDIOBJ
handle
,
void
*
obj
);
static
BOOL
PALETTE_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
);
static
BOOL
PALETTE_DeleteObject
(
HGDIOBJ
handle
);
static
const
struct
gdi_obj_funcs
palette_funcs
=
{
...
...
@@ -668,8 +668,11 @@ static BOOL PALETTE_UnrealizeObject( HGDIOBJ handle, void *obj )
/***********************************************************************
* PALETTE_DeleteObject
*/
static
BOOL
PALETTE_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
)
static
BOOL
PALETTE_DeleteObject
(
HGDIOBJ
handle
)
{
PALETTEOBJ
*
obj
=
GDI_GetObjPtr
(
handle
,
PALETTE_MAGIC
);
if
(
!
obj
)
return
FALSE
;
PALETTE_UnrealizeObject
(
handle
,
obj
);
return
GDI_FreeObject
(
handle
,
obj
);
}
...
...
dlls/gdi32/pen.c
View file @
f0387109
...
...
@@ -43,6 +43,7 @@ typedef struct
static
HGDIOBJ
PEN_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
);
static
INT
PEN_GetObject
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
static
BOOL
PEN_DeleteObject
(
HGDIOBJ
handle
);
static
const
struct
gdi_obj_funcs
pen_funcs
=
{
...
...
@@ -50,7 +51,7 @@ static const struct gdi_obj_funcs pen_funcs =
PEN_GetObject
,
/* pGetObjectA */
PEN_GetObject
,
/* pGetObjectW */
NULL
,
/* pUnrealizeObject */
GDI_FreeObject
/* pDeleteObject */
PEN_DeleteObject
/* pDeleteObject */
};
...
...
@@ -251,6 +252,18 @@ static HGDIOBJ PEN_SelectObject( HGDIOBJ handle, HDC hdc )
/***********************************************************************
* PEN_DeleteObject
*/
static
BOOL
PEN_DeleteObject
(
HGDIOBJ
handle
)
{
PENOBJ
*
pen
=
GDI_GetObjPtr
(
handle
,
MAGIC_DONTCARE
);
if
(
!
pen
)
return
FALSE
;
return
GDI_FreeObject
(
handle
,
pen
);
}
/***********************************************************************
* PEN_GetObject
*/
static
INT
PEN_GetObject
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
)
...
...
dlls/gdi32/region.c
View file @
f0387109
...
...
@@ -121,7 +121,7 @@ typedef struct
static
HGDIOBJ
REGION_SelectObject
(
HGDIOBJ
handle
,
HDC
hdc
);
static
BOOL
REGION_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
);
static
BOOL
REGION_DeleteObject
(
HGDIOBJ
handle
);
static
const
struct
gdi_obj_funcs
region_funcs
=
{
...
...
@@ -535,14 +535,13 @@ static void REGION_DestroyWineRegion( WINEREGION* pReg )
/***********************************************************************
* REGION_DeleteObject
*/
static
BOOL
REGION_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
)
static
BOOL
REGION_DeleteObject
(
HGDIOBJ
handle
)
{
RGNOBJ
*
rgn
=
obj
;
TRACE
(
" %p
\n
"
,
handle
);
RGNOBJ
*
rgn
=
GDI_GetObjPtr
(
handle
,
REGION_MAGIC
);
if
(
!
rgn
)
return
FALSE
;
REGION_DestroyWineRegion
(
rgn
->
rgn
);
return
GDI_FreeObject
(
handle
,
obj
);
return
GDI_FreeObject
(
handle
,
rgn
);
}
/***********************************************************************
...
...
@@ -2815,7 +2814,8 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count,
total
+=
Count
[
poly
];
if
(
!
(
pETEs
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
EdgeTableEntry
)
*
total
)))
{
REGION_DeleteObject
(
hrgn
,
obj
);
REGION_DestroyWineRegion
(
region
);
GDI_FreeObject
(
hrgn
,
obj
);
return
0
;
}
pts
=
FirstPtBlock
.
pts
;
...
...
@@ -2905,7 +2905,8 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count,
sizeof
(
POINTBLOCK
)
);
if
(
!
tmpPtBlock
)
{
WARN
(
"Can't alloc tPB
\n
"
);
REGION_DeleteObject
(
hrgn
,
obj
);
REGION_DestroyWineRegion
(
region
);
GDI_FreeObject
(
hrgn
,
obj
);
HeapFree
(
GetProcessHeap
(),
0
,
pETEs
);
return
0
;
}
...
...
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