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
18717435
Commit
18717435
authored
Jun 13, 2007
by
Hans Leidekker
Committed by
Alexandre Julliard
Jun 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add some tests for BITMAPINFOHEADER biSize checks.
parent
b668c528
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
92 additions
and
0 deletions
+92
-0
bitmap.c
dlls/gdi32/tests/bitmap.c
+92
-0
No files found.
dlls/gdi32/tests/bitmap.c
View file @
18717435
...
...
@@ -1700,6 +1700,97 @@ static void test_CreateBitmap(void)
DeleteObject
(
bm
);
}
static
void
test_bitmapinfoheadersize
(
void
)
{
HBITMAP
hdib
;
BITMAPINFO
bmi
;
BITMAPCOREINFO
bci
;
HDC
hdc
=
GetDC
(
0
);
memset
(
&
bmi
,
0
,
sizeof
(
BITMAPINFO
));
bmi
.
bmiHeader
.
biHeight
=
100
;
bmi
.
bmiHeader
.
biWidth
=
512
;
bmi
.
bmiHeader
.
biBitCount
=
24
;
bmi
.
bmiHeader
.
biPlanes
=
1
;
bmi
.
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
)
-
1
;
hdib
=
CreateDIBSection
(
hdc
,
&
bmi
,
0
,
NULL
,
NULL
,
0
);
ok
(
hdib
==
NULL
,
"CreateDIBSection succeeded
\n
"
);
bmi
.
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
SetLastError
(
0xdeadbeef
);
hdib
=
CreateDIBSection
(
hdc
,
&
bmi
,
0
,
NULL
,
NULL
,
0
);
ok
(
hdib
!=
NULL
,
"CreateDIBSection error %d
\n
"
,
GetLastError
());
DeleteObject
(
hdib
);
bmi
.
bmiHeader
.
biSize
++
;
SetLastError
(
0xdeadbeef
);
hdib
=
CreateDIBSection
(
hdc
,
&
bmi
,
0
,
NULL
,
NULL
,
0
);
ok
(
hdib
!=
NULL
,
"CreateDIBSection error %d
\n
"
,
GetLastError
());
DeleteObject
(
hdib
);
bmi
.
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFO
);
SetLastError
(
0xdeadbeef
);
hdib
=
CreateDIBSection
(
hdc
,
&
bmi
,
0
,
NULL
,
NULL
,
0
);
ok
(
hdib
!=
NULL
,
"CreateDIBSection error %d
\n
"
,
GetLastError
());
DeleteObject
(
hdib
);
bmi
.
bmiHeader
.
biSize
++
;
SetLastError
(
0xdeadbeef
);
hdib
=
CreateDIBSection
(
hdc
,
&
bmi
,
0
,
NULL
,
NULL
,
0
);
ok
(
hdib
!=
NULL
,
"CreateDIBSection error %d
\n
"
,
GetLastError
());
DeleteObject
(
hdib
);
bmi
.
bmiHeader
.
biSize
=
sizeof
(
BITMAPV4HEADER
);
SetLastError
(
0xdeadbeef
);
hdib
=
CreateDIBSection
(
hdc
,
&
bmi
,
0
,
NULL
,
NULL
,
0
);
ok
(
hdib
!=
NULL
,
"CreateDIBSection error %d
\n
"
,
GetLastError
());
DeleteObject
(
hdib
);
bmi
.
bmiHeader
.
biSize
=
sizeof
(
BITMAPV5HEADER
);
SetLastError
(
0xdeadbeef
);
hdib
=
CreateDIBSection
(
hdc
,
&
bmi
,
0
,
NULL
,
NULL
,
0
);
ok
(
hdib
!=
NULL
,
"CreateDIBSection error %d
\n
"
,
GetLastError
());
DeleteObject
(
hdib
);
memset
(
&
bci
,
0
,
sizeof
(
BITMAPCOREINFO
));
bci
.
bmciHeader
.
bcHeight
=
100
;
bci
.
bmciHeader
.
bcWidth
=
512
;
bci
.
bmciHeader
.
bcBitCount
=
24
;
bci
.
bmciHeader
.
bcPlanes
=
1
;
bci
.
bmciHeader
.
bcSize
=
sizeof
(
BITMAPCOREHEADER
)
-
1
;
hdib
=
CreateDIBSection
(
hdc
,
(
BITMAPINFO
*
)
&
bci
,
0
,
NULL
,
NULL
,
0
);
ok
(
hdib
==
NULL
,
"CreateDIBSection succeeded
\n
"
);
bci
.
bmciHeader
.
bcSize
=
sizeof
(
BITMAPCOREHEADER
);
SetLastError
(
0xdeadbeef
);
hdib
=
CreateDIBSection
(
hdc
,
(
BITMAPINFO
*
)
&
bci
,
0
,
NULL
,
NULL
,
0
);
ok
(
hdib
!=
NULL
,
"CreateDIBSection error %d
\n
"
,
GetLastError
());
DeleteObject
(
hdib
);
bci
.
bmciHeader
.
bcSize
++
;
hdib
=
CreateDIBSection
(
hdc
,
(
BITMAPINFO
*
)
&
bci
,
0
,
NULL
,
NULL
,
0
);
ok
(
hdib
==
NULL
,
"CreateDIBSection succeeded
\n
"
);
bci
.
bmciHeader
.
bcSize
=
sizeof
(
BITMAPCOREINFO
);
hdib
=
CreateDIBSection
(
hdc
,
(
BITMAPINFO
*
)
&
bci
,
0
,
NULL
,
NULL
,
0
);
ok
(
hdib
==
NULL
,
"CreateDIBSection succeeded
\n
"
);
ReleaseDC
(
0
,
hdc
);
}
START_TEST
(
bitmap
)
{
is_win9x
=
GetWindowLongPtrW
(
GetDesktopWindow
(),
GWLP_WNDPROC
)
==
0
;
...
...
@@ -1717,4 +1808,5 @@ START_TEST(bitmap)
test_GetDIBits
();
test_select_object
();
test_CreateBitmap
();
test_bitmapinfoheadersize
();
}
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