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
a2c2b602
Commit
a2c2b602
authored
Jul 13, 2007
by
Jeremy White
Committed by
Alexandre Julliard
Jul 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Added a test for the case where lpvBits in GetDIBits is NULL and the bitcount is 0.
parent
fa239446
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
bitmap.c
dlls/gdi32/tests/bitmap.c
+41
-0
No files found.
dlls/gdi32/tests/bitmap.c
View file @
a2c2b602
...
...
@@ -1791,6 +1791,46 @@ static void test_bitmapinfoheadersize(void)
ReleaseDC
(
0
,
hdc
);
}
static
void
test_get16dibits
(
void
)
{
BYTE
bits
[
4
*
(
16
/
sizeof
(
BYTE
))];
HBITMAP
hbmp
;
HDC
screen_dc
=
GetDC
(
NULL
);
int
ret
;
BITMAPINFO
*
info
;
int
info_len
=
sizeof
(
BITMAPINFOHEADER
)
+
1024
;
BYTE
*
p
;
int
overwritten_bytes
=
0
;
memset
(
bits
,
0
,
sizeof
(
bits
));
hbmp
=
CreateBitmap
(
2
,
2
,
1
,
16
,
bits
);
ok
(
hbmp
!=
NULL
,
"CreateBitmap failed
\n
"
);
info
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
info_len
);
assert
(
info
);
memset
(
info
,
'!'
,
info_len
);
memset
(
info
,
0
,
sizeof
(
info
->
bmiHeader
));
info
->
bmiHeader
.
biSize
=
sizeof
(
info
->
bmiHeader
);
info
->
bmiHeader
.
biWidth
=
2
;
info
->
bmiHeader
.
biHeight
=
2
;
info
->
bmiHeader
.
biPlanes
=
1
;
info
->
bmiHeader
.
biCompression
=
BI_RGB
;
ret
=
GetDIBits
(
screen_dc
,
hbmp
,
0
,
0
,
NULL
,
info
,
0
);
ok
(
ret
!=
0
,
"GetDIBits failed
\n
"
);
for
(
p
=
((
BYTE
*
)
info
)
+
sizeof
(
info
->
bmiHeader
);
(
p
-
((
BYTE
*
)
info
))
<
info_len
;
p
++
)
if
(
*
p
!=
'!'
)
overwritten_bytes
++
;
ok
(
overwritten_bytes
==
0
,
"GetDIBits wrote past the buffer given
\n
"
);
DeleteObject
(
hbmp
);
ReleaseDC
(
NULL
,
screen_dc
);
}
START_TEST
(
bitmap
)
{
is_win9x
=
GetWindowLongPtrW
(
GetDesktopWindow
(),
GWLP_WNDPROC
)
==
0
;
...
...
@@ -1809,4 +1849,5 @@ START_TEST(bitmap)
test_select_object
();
test_CreateBitmap
();
test_bitmapinfoheadersize
();
test_get16dibits
();
}
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