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
d7ed2457
Commit
d7ed2457
authored
Sep 07, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Make sure the bitmap of the brush pattern is owned by x11drv before getting its pixmap.
parent
ac0a7b64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
14 deletions
+29
-14
brush.c
dlls/winex11.drv/brush.c
+29
-14
No files found.
dlls/winex11.drv/brush.c
View file @
d7ed2457
...
...
@@ -252,14 +252,40 @@ static BOOL BRUSH_SelectPatternBrush( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
/***********************************************************************
* BRUSH_SelectDIBPatternBrush
*/
static
BOOL
BRUSH_SelectDIBPatternBrush
(
X11DRV_PDEVICE
*
physDev
,
HGLOBAL
mem
)
{
BOOL
ret
;
HDC
memdc
;
BITMAPINFO
*
info
=
GlobalLock
(
mem
);
HBITMAP
bitmap
=
CreateDIBitmap
(
physDev
->
dev
.
hdc
,
&
info
->
bmiHeader
,
CBM_INIT
,
(
LPBYTE
)
info
+
bitmap_info_size
(
info
,
DIB_RGB_COLORS
),
info
,
DIB_RGB_COLORS
);
/* make sure it's owned by x11drv */
memdc
=
CreateCompatibleDC
(
physDev
->
dev
.
hdc
);
SelectObject
(
memdc
,
bitmap
);
DeleteDC
(
memdc
);
if
((
ret
=
BRUSH_SelectPatternBrush
(
physDev
,
bitmap
)))
{
X_PHYSBITMAP
*
physBitmap
=
X11DRV_get_phys_bitmap
(
bitmap
);
physBitmap
->
pixmap
=
0
;
/* so it doesn't get freed */
}
DeleteObject
(
bitmap
);
GlobalUnlock
(
mem
);
return
ret
;
}
/***********************************************************************
* SelectBrush (X11DRV.@)
*/
HBRUSH
X11DRV_SelectBrush
(
PHYSDEV
dev
,
HBRUSH
hbrush
)
{
X11DRV_PDEVICE
*
physDev
=
get_x11drv_dev
(
dev
);
LOGBRUSH
logbrush
;
HBITMAP
hBitmap
;
BITMAPINFO
*
bmpInfo
;
if
(
!
GetObjectA
(
hbrush
,
sizeof
(
logbrush
),
&
logbrush
))
return
0
;
...
...
@@ -304,18 +330,7 @@ HBRUSH X11DRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
case
BS_DIBPATTERN
:
TRACE
(
"BS_DIBPATTERN
\n
"
);
if
((
bmpInfo
=
GlobalLock
(
(
HGLOBAL
)
logbrush
.
lbHatch
)))
{
int
size
=
bitmap_info_size
(
bmpInfo
,
logbrush
.
lbColor
);
hBitmap
=
CreateDIBitmap
(
dev
->
hdc
,
&
bmpInfo
->
bmiHeader
,
CBM_INIT
,
((
char
*
)
bmpInfo
)
+
size
,
bmpInfo
,
(
WORD
)
logbrush
.
lbColor
);
BRUSH_SelectPatternBrush
(
physDev
,
hBitmap
);
DeleteObject
(
hBitmap
);
GlobalUnlock
(
(
HGLOBAL
)
logbrush
.
lbHatch
);
}
if
(
!
BRUSH_SelectDIBPatternBrush
(
physDev
,
(
HGLOBAL
)
logbrush
.
lbHatch
))
return
0
;
break
;
}
return
hbrush
;
...
...
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