ReactOS
0.4.16-dev-1041-g8b6907f
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
NtGdiGetBitmapBits.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS api tests
3
* LICENSE: GPL - See COPYING in the top level directory
4
* PURPOSE: Test for NtGdiGetBitmapBits
5
* PROGRAMMERS:
6
*/
7
8
#include "../win32nt.h"
9
10
START_TEST
(
NtGdiGetBitmapBits
)
11
{
12
BYTE
Bits[50] = {0,1,2,3,4,5,6,7,8,9};
13
HBITMAP
hBitmap
;
14
15
SetLastError
(
ERROR_SUCCESS
);
16
ok_long
(
NtGdiGetBitmapBits
(0, 0, 0), 0);
17
ok_long
(
GetLastError
(),
ERROR_INVALID_HANDLE
);
18
19
/* Test NULL bitmap handle */
20
SetLastError
(
ERROR_SUCCESS
);
21
ok_long
(
NtGdiGetBitmapBits
(0, 5, Bits), 0);
22
ok_long
(
GetLastError
(),
ERROR_INVALID_HANDLE
);
23
24
/* Test invalid bitmap handle */
25
hBitmap
= (
HBITMAP
)
CreatePen
(
PS_SOLID
, 1,
RGB
(1,2,3));
26
SetLastError
(
ERROR_SUCCESS
);
27
ok_long
(
NtGdiGetBitmapBits
(
hBitmap
, 5, Bits), 0);
28
ok_long
(
GetLastError
(),
ERROR_INVALID_HANDLE
);
29
DeleteObject
(
hBitmap
);
30
31
hBitmap
=
CreateBitmap
(3, 3, 1, 8,
NULL
);
32
SetLastError
(
ERROR_SUCCESS
);
33
34
/* test NULL pointer and count buffer size != 0 */
35
ok_long
(
NtGdiGetBitmapBits
(
hBitmap
, 5,
NULL
), 12);
36
37
/* test NULL pointer and buffer size == 0*/
38
ok_long
(
NtGdiGetBitmapBits
(
hBitmap
, 0,
NULL
), 12);
39
40
/* test bad pointer */
41
ok_long
(
NtGdiGetBitmapBits
(
hBitmap
, 5, (
PBYTE
)0x500), 0);
42
43
/* Test if we can set a number of bytes between lines */
44
ok_long
(
NtGdiGetBitmapBits
(
hBitmap
, 5, Bits), 5);
45
46
/* Test alignment */
47
ok_long
(
NtGdiGetBitmapBits
(
hBitmap
, 4, Bits+1), 4);
48
49
/* Test 1 byte too much */
50
ok_long
(
NtGdiGetBitmapBits
(
hBitmap
, 10, Bits), 10);
51
52
/* Test one row too much */
53
ok_long
(
NtGdiGetBitmapBits
(
hBitmap
, 12, Bits), 12);
54
55
ok_long
(
NtGdiGetBitmapBits
(
hBitmap
, 13, Bits), 12);
56
57
ok_long
(
NtGdiGetBitmapBits
(
hBitmap
, 100, Bits), 12);
58
59
/* Test huge bytes count */
60
ok_long
(
NtGdiGetBitmapBits
(
hBitmap
, 12345678, Bits), 12);
61
62
/* Test negative bytes count */
63
ok_long
(
NtGdiGetBitmapBits
(
hBitmap
, -5, Bits), 12);
64
65
ok_long
(
GetLastError
(),
ERROR_SUCCESS
);
66
67
DeleteObject
(
hBitmap
);
68
}
ok_long
#define ok_long(expression, result)
Definition:
atltest.h:133
START_TEST
#define START_TEST(x)
Definition:
atltest.h:75
ERROR_SUCCESS
#define ERROR_SUCCESS
Definition:
deptool.c:10
NULL
#define NULL
Definition:
types.h:112
hBitmap
static HBITMAP hBitmap
Definition:
timezone.c:26
SetLastError
#define SetLastError(x)
Definition:
compat.h:752
ERROR_INVALID_HANDLE
#define ERROR_INVALID_HANDLE
Definition:
compat.h:98
RGB
#define RGB(r, g, b)
Definition:
precomp.h:71
DeleteObject
pKey DeleteObject()
HBITMAP
static HBITMAP
Definition:
button.c:44
NtGdiGetBitmapBits
__kernel_entry W32KAPI LONG APIENTRY NtGdiGetBitmapBits(_In_ HBITMAP hbm, _In_ ULONG cjMax, _Out_writes_bytes_opt_(cjMax) PBYTE pjOut)
PBYTE
BYTE * PBYTE
Definition:
pedump.c:66
GetLastError
DWORD WINAPI GetLastError(void)
Definition:
except.c:1042
CreateBitmap
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
CreatePen
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
PS_SOLID
#define PS_SOLID
Definition:
wingdi.h:586
BYTE
unsigned char BYTE
Definition:
xxhash.c:193
modules
rostests
apitests
win32nt
ntgdi
NtGdiGetBitmapBits.c
Generated on Sat Apr 26 2025 06:08:27 for ReactOS by
1.9.6