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
f6097f5b
Commit
f6097f5b
authored
May 09, 2006
by
Michael Kaufmann
Committed by
Alexandre Julliard
May 17, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi: Fix GetObject for bitmaps.
- GetObject(): Set the bmBits member of the BITMAP structure to NULL for device-dependent bitmaps. - New test case.
parent
6c233ef2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
6 deletions
+28
-6
bitmap.c
dlls/gdi/bitmap.c
+3
-1
gdi_private.h
dlls/gdi/gdi_private.h
+1
-1
bitmap.c
dlls/gdi/tests/bitmap.c
+20
-0
bitmap.c
dlls/x11drv/bitmap.c
+3
-3
winex11.drv.spec
dlls/x11drv/winex11.drv.spec
+1
-1
No files found.
dlls/gdi/bitmap.c
View file @
f6097f5b
...
...
@@ -528,7 +528,8 @@ BOOL BITMAP_SetOwnerDC( HBITMAP hbitmap, DC *dc )
ret
=
TRUE
;
if
(
!
bitmap
->
funcs
)
/* not owned by a DC yet */
{
if
(
dc
->
funcs
->
pCreateBitmap
)
ret
=
dc
->
funcs
->
pCreateBitmap
(
dc
->
physDev
,
hbitmap
);
if
(
dc
->
funcs
->
pCreateBitmap
)
ret
=
dc
->
funcs
->
pCreateBitmap
(
dc
->
physDev
,
hbitmap
,
bitmap
->
bitmap
.
bmBits
);
if
(
ret
)
bitmap
->
funcs
=
dc
->
funcs
;
}
else
if
(
bitmap
->
funcs
!=
dc
->
funcs
)
...
...
@@ -705,6 +706,7 @@ static INT BITMAP_GetObject( HGDIOBJ handle, void *obj, INT count, LPVOID buffer
else
{
memcpy
(
buffer
,
&
bmp
->
bitmap
,
sizeof
(
BITMAP
)
);
((
BITMAP
*
)
buffer
)
->
bmBits
=
NULL
;
return
sizeof
(
BITMAP
);
}
}
...
...
dlls/gdi/gdi_private.h
View file @
f6097f5b
...
...
@@ -72,7 +72,7 @@ typedef struct tagDC_FUNCS
INT
(
*
pChoosePixelFormat
)(
PHYSDEV
,
const
PIXELFORMATDESCRIPTOR
*
);
BOOL
(
*
pChord
)(
PHYSDEV
,
INT
,
INT
,
INT
,
INT
,
INT
,
INT
,
INT
,
INT
);
BOOL
(
*
pCloseFigure
)(
PHYSDEV
);
BOOL
(
*
pCreateBitmap
)(
PHYSDEV
,
HBITMAP
);
BOOL
(
*
pCreateBitmap
)(
PHYSDEV
,
HBITMAP
,
LPVOID
);
BOOL
(
*
pCreateDC
)(
HDC
,
PHYSDEV
*
,
LPCWSTR
,
LPCWSTR
,
LPCWSTR
,
const
DEVMODEW
*
);
HBITMAP
(
*
pCreateDIBSection
)(
PHYSDEV
,
HBITMAP
,
const
BITMAPINFO
*
,
UINT
);
BOOL
(
*
pDeleteBitmap
)(
HBITMAP
);
...
...
dlls/gdi/tests/bitmap.c
View file @
f6097f5b
...
...
@@ -1001,6 +1001,25 @@ static void test_bitmap(void)
DeleteDC
(
hdc
);
}
static
void
test_bmBits
(
void
)
{
BYTE
bits
[
4
];
HBITMAP
hbmp
;
BITMAP
bmp
;
memset
(
bits
,
0
,
sizeof
(
bits
));
hbmp
=
CreateBitmap
(
2
,
2
,
1
,
4
,
bits
);
ok
(
hbmp
!=
NULL
,
"CreateBitmap failed
\n
"
);
memset
(
&
bmp
,
0xFF
,
sizeof
(
bmp
));
ok
(
GetObject
(
hbmp
,
sizeof
(
bmp
),
&
bmp
)
==
sizeof
(
bmp
),
"GetObject failed or returned a wrong structure size
\n
"
);
ok
(
!
bmp
.
bmBits
,
"bmBits must be NULL for device-dependent bitmaps
\n
"
);
DeleteObject
(
hbmp
);
}
START_TEST
(
bitmap
)
{
is_win9x
=
GetWindowLongPtrW
(
GetDesktopWindow
(),
GWLP_WNDPROC
)
==
0
;
...
...
@@ -1009,4 +1028,5 @@ START_TEST(bitmap)
test_dibsections
();
test_mono_dibsection
();
test_bitmap
();
test_bmBits
();
}
dlls/x11drv/bitmap.c
View file @
f6097f5b
...
...
@@ -106,7 +106,7 @@ HBITMAP X11DRV_SelectBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
*
* Returns TRUE on success else FALSE
*/
BOOL
X11DRV_CreateBitmap
(
X11DRV_PDEVICE
*
physDev
,
HBITMAP
hbitmap
)
BOOL
X11DRV_CreateBitmap
(
X11DRV_PDEVICE
*
physDev
,
HBITMAP
hbitmap
,
LPVOID
bmBits
)
{
X_PHYSBITMAP
*
physBitmap
;
BITMAP
bitmap
;
...
...
@@ -145,9 +145,9 @@ BOOL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
return
FALSE
;
}
if
(
b
itmap
.
b
mBits
)
/* Set bitmap bits */
if
(
bmBits
)
/* Set bitmap bits */
{
X11DRV_SetBitmapBits
(
hbitmap
,
b
itmap
.
b
mBits
,
bitmap
.
bmHeight
*
bitmap
.
bmWidthBytes
);
X11DRV_SetBitmapBits
(
hbitmap
,
bmBits
,
bitmap
.
bmHeight
*
bitmap
.
bmWidthBytes
);
}
else
/* else clear the bitmap */
{
...
...
dlls/x11drv/winex11.drv.spec
View file @
f6097f5b
...
...
@@ -5,7 +5,7 @@
@ cdecl BitBlt(ptr long long long long ptr long long long) X11DRV_BitBlt
@ cdecl ChoosePixelFormat(ptr ptr) X11DRV_ChoosePixelFormat
@ cdecl Chord(ptr long long long long long long long long) X11DRV_Chord
@ cdecl CreateBitmap(ptr long) X11DRV_CreateBitmap
@ cdecl CreateBitmap(ptr long
ptr
) X11DRV_CreateBitmap
@ cdecl CreateDC(long ptr wstr wstr wstr ptr) X11DRV_CreateDC
@ cdecl CreateDIBSection(ptr long ptr long) X11DRV_CreateDIBSection
@ cdecl DeleteBitmap(long) X11DRV_DeleteBitmap
...
...
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