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
9ab004d5
Commit
9ab004d5
authored
Mar 01, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: GetObject() should return the DIB's absolute height in dsBmih.biHeight.
parent
96e4a33b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
bitmap.c
dlls/gdi32/bitmap.c
+3
-1
bitmap.c
dlls/gdi32/tests/bitmap.c
+12
-4
No files found.
dlls/gdi32/bitmap.c
View file @
9ab004d5
...
...
@@ -678,7 +678,9 @@ static INT BITMAP_GetObject( HGDIOBJ handle, INT count, LPVOID buffer )
{
if
(
count
>=
sizeof
(
DIBSECTION
))
{
memcpy
(
buffer
,
bmp
->
dib
,
sizeof
(
DIBSECTION
)
);
DIBSECTION
*
dib
=
buffer
;
*
dib
=
*
bmp
->
dib
;
dib
->
dsBmih
.
biHeight
=
abs
(
dib
->
dsBmih
.
biHeight
);
ret
=
sizeof
(
DIBSECTION
);
}
else
/* if (count >= sizeof(BITMAP)) */
...
...
dlls/gdi32/tests/bitmap.c
View file @
9ab004d5
...
...
@@ -301,7 +301,7 @@ static void test_dib_info(HBITMAP hbm, const void *bits, const BITMAPINFOHEADER
ok
(
bm
.
bmType
==
0
,
"wrong bm.bmType %d
\n
"
,
bm
.
bmType
);
ok
(
bm
.
bmWidth
==
bmih
->
biWidth
,
"wrong bm.bmWidth %d
\n
"
,
bm
.
bmWidth
);
ok
(
bm
.
bmHeight
==
bmih
->
biHeight
,
"wrong bm.bmHeight %d
\n
"
,
bm
.
bmHeight
);
ok
(
bm
.
bmHeight
==
abs
(
bmih
->
biHeight
)
,
"wrong bm.bmHeight %d
\n
"
,
bm
.
bmHeight
);
dib_width_bytes
=
DIB_GetWidthBytes
(
bm
.
bmWidth
,
bm
.
bmBitsPixel
);
bm_width_bytes
=
BITMAP_GetWidthBytes
(
bm
.
bmWidth
,
bm
.
bmBitsPixel
);
if
(
bm
.
bmWidthBytes
!=
dib_width_bytes
)
/* Win2k bug */
...
...
@@ -332,7 +332,7 @@ static void test_dib_info(HBITMAP hbm, const void *bits, const BITMAPINFOHEADER
ret
=
GetObject
(
hbm
,
sizeof
(
*
bma
)
*
2
,
bma
);
ok
(
ret
==
sizeof
(
*
bma
)
||
broken
(
ret
==
sizeof
(
*
bma
)
*
2
/* Win9x */
),
"wrong size %d
\n
"
,
ret
);
ok
(
bm
.
bmWidth
==
bmih
->
biWidth
,
"wrong bm.bmWidth %d
\n
"
,
bm
.
bmWidth
);
ok
(
bm
.
bmHeight
==
bmih
->
biHeight
,
"wrong bm.bmHeight %d
\n
"
,
bm
.
bmHeight
);
ok
(
bm
.
bmHeight
==
abs
(
bmih
->
biHeight
)
,
"wrong bm.bmHeight %d
\n
"
,
bm
.
bmHeight
);
ok
(
bm
.
bmBits
==
bits
,
"wrong bm.bmBits %p != %p
\n
"
,
bm
.
bmBits
,
bits
);
ret
=
GetObject
(
hbm
,
sizeof
(
bm
)
/
2
,
&
bm
);
...
...
@@ -364,7 +364,7 @@ static void test_dib_info(HBITMAP hbm, const void *bits, const BITMAPINFOHEADER
ok
(
ds
.
dsBmih
.
biSize
==
bmih
->
biSize
,
"%u != %u
\n
"
,
ds
.
dsBmih
.
biSize
,
bmih
->
biSize
);
ok
(
ds
.
dsBmih
.
biWidth
==
bmih
->
biWidth
,
"%d != %d
\n
"
,
ds
.
dsBmih
.
biWidth
,
bmih
->
biWidth
);
ok
(
ds
.
dsBmih
.
biHeight
==
bmih
->
biHeight
,
"%d != %d
\n
"
,
ds
.
dsBmih
.
biHeight
,
bmih
->
biHeight
);
ok
(
ds
.
dsBmih
.
biHeight
==
abs
(
bmih
->
biHeight
),
"%d != %d
\n
"
,
ds
.
dsBmih
.
biHeight
,
abs
(
bmih
->
biHeight
)
);
ok
(
ds
.
dsBmih
.
biPlanes
==
bmih
->
biPlanes
,
"%u != %u
\n
"
,
ds
.
dsBmih
.
biPlanes
,
bmih
->
biPlanes
);
ok
(
ds
.
dsBmih
.
biBitCount
==
bmih
->
biBitCount
,
"%u != %u
\n
"
,
ds
.
dsBmih
.
biBitCount
,
bmih
->
biBitCount
);
ok
(
ds
.
dsBmih
.
biCompression
==
bmih
->
biCompression
,
"%u != %u
\n
"
,
ds
.
dsBmih
.
biCompression
,
bmih
->
biCompression
);
...
...
@@ -376,7 +376,7 @@ static void test_dib_info(HBITMAP hbm, const void *bits, const BITMAPINFOHEADER
ret
=
GetObject
(
hbm
,
sizeof
(
ds
)
-
4
,
&
ds
);
ok
(
ret
==
sizeof
(
ds
.
dsBm
)
||
broken
(
ret
==
(
sizeof
(
ds
)
-
4
)
/* Win9x */
),
"wrong size %d
\n
"
,
ret
);
ok
(
ds
.
dsBm
.
bmWidth
==
bmih
->
biWidth
,
"%d != %d
\n
"
,
ds
.
dsBmih
.
biWidth
,
bmih
->
biWidth
);
ok
(
ds
.
dsBm
.
bmHeight
==
bmih
->
biHeight
,
"%d != %d
\n
"
,
ds
.
dsBmih
.
biHeight
,
bmih
->
biHeight
);
ok
(
ds
.
dsBm
.
bmHeight
==
abs
(
bmih
->
biHeight
),
"%d != %d
\n
"
,
ds
.
dsBmih
.
biHeight
,
abs
(
bmih
->
biHeight
)
);
ok
(
ds
.
dsBm
.
bmBits
==
bits
,
"%p != %p
\n
"
,
ds
.
dsBm
.
bmBits
,
bits
);
ret
=
GetObject
(
hbm
,
0
,
&
ds
);
...
...
@@ -525,6 +525,14 @@ static void test_dibsections(void)
test_dib_info
(
hdib
,
bits
,
&
pbmi
->
bmiHeader
);
DeleteObject
(
hdib
);
/* Test a top-down DIB. */
pbmi
->
bmiHeader
.
biHeight
=
-
100
;
hdib
=
CreateDIBSection
(
hdc
,
pbmi
,
DIB_RGB_COLORS
,
(
void
**
)
&
bits
,
NULL
,
0
);
ok
(
hdib
!=
NULL
,
"CreateDIBSection error %d
\n
"
,
GetLastError
());
test_dib_info
(
hdib
,
bits
,
&
pbmi
->
bmiHeader
);
DeleteObject
(
hdib
);
pbmi
->
bmiHeader
.
biHeight
=
100
;
pbmi
->
bmiHeader
.
biBitCount
=
8
;
pbmi
->
bmiHeader
.
biCompression
=
BI_RLE8
;
SetLastError
(
0xdeadbeef
);
...
...
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