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
d69dd564
Commit
d69dd564
authored
Sep 26, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: BS_DIBPATTERN brushes use a 32-bit handle in 32-bit mode.
parent
f3b9fb55
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
12 deletions
+17
-12
brush.c
dlls/gdi32/brush.c
+8
-8
objects.c
dlls/gdi32/enhmfdrv/objects.c
+2
-2
objects.c
dlls/gdi32/mfdrv/objects.c
+7
-2
No files found.
dlls/gdi32/brush.c
View file @
d69dd564
...
...
@@ -53,10 +53,10 @@ static const struct gdi_obj_funcs brush_funcs =
BRUSH_DeleteObject
/* pDeleteObject */
};
static
HGLOBAL
16
dib_copy
(
const
BITMAPINFO
*
info
,
UINT
coloruse
)
static
HGLOBAL
dib_copy
(
const
BITMAPINFO
*
info
,
UINT
coloruse
)
{
BITMAPINFO
*
newInfo
;
HGLOBAL
16
hmem
;
HGLOBAL
hmem
;
INT
size
;
if
(
info
->
bmiHeader
.
biCompression
!=
BI_RGB
&&
info
->
bmiHeader
.
biCompression
!=
BI_BITFIELDS
)
...
...
@@ -67,13 +67,13 @@ static HGLOBAL16 dib_copy(const BITMAPINFO *info, UINT coloruse)
info
->
bmiHeader
.
biBitCount
);
size
+=
bitmap_info_size
(
info
,
coloruse
);
if
(
!
(
hmem
=
GlobalAlloc
16
(
GMEM_MOVEABLE
,
size
)))
if
(
!
(
hmem
=
GlobalAlloc
(
GMEM_MOVEABLE
,
size
)))
{
return
0
;
}
newInfo
=
GlobalLock
16
(
hmem
);
newInfo
=
GlobalLock
(
hmem
);
memcpy
(
newInfo
,
info
,
size
);
GlobalUnlock
16
(
hmem
);
GlobalUnlock
(
hmem
);
return
hmem
;
}
...
...
@@ -133,7 +133,7 @@ HBRUSH WINAPI CreateBrushIndirect( const LOGBRUSH * brush )
ptr
->
logbrush
.
lbStyle
=
BS_DIBPATTERN
;
if
(
!
(
bmi
=
GlobalLock
(
h
)))
goto
error
;
ptr
->
logbrush
.
lbHatch
=
dib_copy
(
bmi
,
ptr
->
logbrush
.
lbColor
);
ptr
->
logbrush
.
lbHatch
=
(
ULONG_PTR
)
dib_copy
(
bmi
,
ptr
->
logbrush
.
lbColor
);
GlobalUnlock
(
h
);
if
(
!
ptr
->
logbrush
.
lbHatch
)
goto
error
;
break
;
...
...
@@ -156,7 +156,7 @@ HBRUSH WINAPI CreateBrushIndirect( const LOGBRUSH * brush )
if
(
ptr
->
logbrush
.
lbStyle
==
BS_PATTERN
)
DeleteObject
(
(
HGDIOBJ
)
ptr
->
logbrush
.
lbHatch
);
else
if
(
ptr
->
logbrush
.
lbStyle
==
BS_DIBPATTERN
)
GlobalFree
16
(
(
HGLOBAL16
)
ptr
->
logbrush
.
lbHatch
);
GlobalFree
(
(
HGLOBAL
)
ptr
->
logbrush
.
lbHatch
);
}
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
return
0
;
...
...
@@ -423,7 +423,7 @@ static BOOL BRUSH_DeleteObject( HGDIOBJ handle )
DeleteObject
(
(
HGDIOBJ
)
brush
->
logbrush
.
lbHatch
);
break
;
case
BS_DIBPATTERN
:
GlobalFree
16
(
(
HGLOBAL16
)
brush
->
logbrush
.
lbHatch
);
GlobalFree
(
(
HGLOBAL
)
brush
->
logbrush
.
lbHatch
);
break
;
}
return
HeapFree
(
GetProcessHeap
(),
0
,
brush
);
...
...
dlls/gdi32/enhmfdrv/objects.c
View file @
d69dd564
...
...
@@ -166,7 +166,7 @@ DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush )
{
EMRCREATEDIBPATTERNBRUSHPT
*
emr
;
DWORD
bmSize
,
biSize
,
size
;
BITMAPINFO
*
info
=
GlobalLock
16
(
logbrush
.
lbHatch
);
BITMAPINFO
*
info
=
GlobalLock
(
(
HGLOBAL
)
logbrush
.
lbHatch
);
if
(
info
->
bmiHeader
.
biCompression
)
bmSize
=
info
->
bmiHeader
.
biSizeImage
;
...
...
@@ -192,7 +192,7 @@ DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush )
if
(
!
EMFDRV_WriteRecord
(
dev
,
&
emr
->
emr
))
index
=
0
;
HeapFree
(
GetProcessHeap
(),
0
,
emr
);
GlobalUnlock
16
(
logbrush
.
lbHatch
);
GlobalUnlock
(
(
HGLOBAL
)
logbrush
.
lbHatch
);
}
break
;
...
...
dlls/gdi32/mfdrv/objects.c
View file @
d69dd564
...
...
@@ -300,7 +300,7 @@ INT16 MFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush )
BITMAPINFO
*
info
;
DWORD
bmSize
,
biSize
;
info
=
GlobalLock
16
((
HGLOBAL16
)
logbrush
.
lbHatch
);
info
=
GlobalLock
(
(
HGLOBAL
)
logbrush
.
lbHatch
);
if
(
info
->
bmiHeader
.
biCompression
)
bmSize
=
info
->
bmiHeader
.
biSizeImage
;
else
...
...
@@ -310,12 +310,17 @@ INT16 MFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush )
biSize
=
bitmap_info_size
(
info
,
LOWORD
(
logbrush
.
lbColor
));
size
=
sizeof
(
METARECORD
)
+
biSize
+
bmSize
+
2
;
mr
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
(
!
mr
)
goto
done
;
if
(
!
mr
)
{
GlobalUnlock
(
(
HGLOBAL
)
logbrush
.
lbHatch
);
goto
done
;
}
mr
->
rdFunction
=
META_DIBCREATEPATTERNBRUSH
;
mr
->
rdSize
=
size
/
2
;
*
(
mr
->
rdParm
)
=
logbrush
.
lbStyle
;
*
(
mr
->
rdParm
+
1
)
=
LOWORD
(
logbrush
.
lbColor
);
memcpy
(
mr
->
rdParm
+
2
,
info
,
biSize
+
bmSize
);
GlobalUnlock
(
(
HGLOBAL
)
logbrush
.
lbHatch
);
break
;
}
default:
...
...
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