ReactOS
0.4.16-dev-2104-gb84fa49
NtUserGetCursorInfo.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS API tests
3
* LICENSE: MIT (https://spdx.org/licenses/MIT)
4
* PURPOSE: Test for NtUserCreateAcceleratorTable
5
* COPYRIGHT: Copyright 2025 Max Korostil <mrmks04@yandex.ru>
6
*/
7
8
#include "../win32nt.h"
9
10
START_TEST
(
NtUserGetCursorInfo
)
11
{
12
CURSORINFO
cursor
;
13
DWORD
error
;
14
BOOL
res
;
15
16
/* 1. NULL pointer */
17
SetLastError
(0);
18
res
=
NtUserGetCursorInfo
(
NULL
);
19
error
=
GetLastError
();
20
21
ok_int
(
res
,
FALSE
);
22
ok_int
(
error
,
ERROR_NOACCESS
);
23
24
/* 2. Hardcoded invalid pointer */
25
SetLastError
(0);
26
res
=
NtUserGetCursorInfo
((
PCURSORINFO
)(
ULONG_PTR
)0xDEADBEEF);
27
error
=
GetLastError
();
28
29
ok_int
(
res
,
FALSE
);
30
ok_int
(
error
,
ERROR_NOACCESS
);
31
32
/* 3. Invalid cbSize */
33
SetLastError
(0);
34
cursor
.cbSize = 0;
35
res
=
NtUserGetCursorInfo
(&
cursor
);
36
error
=
GetLastError
();
37
38
ok_int
(
res
,
FALSE
);
39
ok_int
(
error
,
ERROR_INVALID_PARAMETER
);
40
41
/* 4. Single CURSORINFO pointer */
42
SetLastError
(0);
43
cursor
.cbSize =
sizeof
(
cursor
);
44
res
=
NtUserGetCursorInfo
(&
cursor
);
45
error
=
GetLastError
();
46
47
ok_int
(
res
,
TRUE
);
48
ok_int
(
error
,
ERROR_SUCCESS
);
49
50
/* 5. Double CURSORINFO pointer */
51
SetLastError
(0);
52
cursor
.cbSize =
sizeof
(
cursor
) * 2;
53
res
=
NtUserGetCursorInfo
(&
cursor
);
54
error
=
GetLastError
();
55
56
ok_int
(
res
,
FALSE
);
57
ok_int
(
error
,
ERROR_INVALID_PARAMETER
);
58
}
START_TEST
#define START_TEST(x)
Definition:
atltest.h:75
ok_int
#define ok_int(expression, result)
Definition:
atltest.h:134
ERROR_SUCCESS
#define ERROR_SUCCESS
Definition:
deptool.c:10
NULL
#define NULL
Definition:
types.h:112
TRUE
#define TRUE
Definition:
types.h:120
FALSE
#define FALSE
Definition:
types.h:117
ERROR_INVALID_PARAMETER
#define ERROR_INVALID_PARAMETER
Definition:
compat.h:101
SetLastError
#define SetLastError(x)
Definition:
compat.h:752
BOOL
unsigned int BOOL
Definition:
ntddk_ex.h:94
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
res
GLuint res
Definition:
glext.h:9613
cursor
const char cursor[]
Definition:
icontest.c:13
NtUserGetCursorInfo
BOOL NTAPI NtUserGetCursorInfo(PCURSORINFO pci)
Definition:
cursoricon.c:649
error
#define error(str)
Definition:
mkdosfs.c:1605
tagCURSORINFO
Definition:
winuser.h:3820
ULONG_PTR
uint32_t ULONG_PTR
Definition:
typedefs.h:65
GetLastError
DWORD WINAPI GetLastError(void)
Definition:
except.c:1042
ERROR_NOACCESS
#define ERROR_NOACCESS
Definition:
winerror.h:902
modules
rostests
apitests
win32u
ntuser
NtUserGetCursorInfo.c
Generated on Tue Jan 6 2026 06:13:07 for ReactOS by
1.9.6