ReactOS
0.4.17-dev-683-g0dafdc5
NtUserSBGetParms.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 NtUserSBGetParms
5
* COPYRIGHT: Copyright 2026 Max Korostil <mrmks04@yandex.ru>
6
*/
7
8
#include <
apitest.h
>
9
#include <
wincon.h
>
10
11
#include "../win32nt.h"
12
13
START_TEST
(
NtUserSBGetParms
)
14
{
15
BOOL
ret
;
16
DWORD
error
;
17
SBDATA
sbData;
18
SCROLLINFO
si
;
19
HWND
hWnd
=
GetConsoleWindow
();
20
21
// 1
22
SetLastError
(0);
23
ret
=
NtUserSBGetParms
(
hWnd
,
SB_CTL
, &sbData, &
si
);
24
error
=
GetLastError
();
25
26
ok_int
(
ret
,
TRUE
);
27
ok_int
(
error
,
ERROR_SUCCESS
);
28
29
// 2
30
SetLastError
(0);
31
ret
=
NtUserSBGetParms
(
hWnd
,
SB_CTL
, &sbData,
NULL
);
32
error
=
GetLastError
();
33
34
ok_int
(
ret
,
FALSE
);
35
ok_int
(
error
,
ERROR_NOACCESS
);
36
37
// 3
38
SetLastError
(0);
39
ret
=
NtUserSBGetParms
(
hWnd
,
SB_CTL
, &sbData, (
LPSCROLLINFO
)(
ULONG_PTR
)0xDEADBEEF);
40
error
=
GetLastError
();
41
42
ok_int
(
ret
,
FALSE
);
43
ok_int
(
error
,
ERROR_NOACCESS
);
44
45
// 4
46
SetLastError
(0);
47
ret
=
NtUserSBGetParms
(
hWnd
,
SB_CTL
,
NULL
, &
si
);
48
error
=
GetLastError
();
49
50
ok_int
(
ret
,
FALSE
);
51
ok_int
(
error
,
ERROR_NOACCESS
);
52
53
// 5
54
SetLastError
(0);
55
ret
=
NtUserSBGetParms
(
hWnd
,
SB_CTL
, (
PSBDATA
)(
ULONG_PTR
)0xDEADBEEF, &
si
);
56
error
=
GetLastError
();
57
58
ok_int
(
ret
,
FALSE
);
59
ok_int
(
error
,
ERROR_NOACCESS
);
60
61
// 6
62
SetLastError
(0);
63
ret
=
NtUserSBGetParms
(
NULL
,
SB_CTL
, &sbData, &
si
);
64
error
=
GetLastError
();
65
66
ok_int
(
ret
,
FALSE
);
67
ok_int
(
error
,
ERROR_INVALID_WINDOW_HANDLE
);
68
69
// 7
70
ret
=
NtUserSBGetParms
(
hWnd
,
SB_CTL
, &sbData, (
LPSCROLLINFO
)
MAXULONG_PTR
);
71
error
=
GetLastError
();
72
73
ok_int
(
ret
,
FALSE
);
74
ok_int
(
error
,
ERROR_NOACCESS
);
75
76
// 8
77
ret
=
NtUserSBGetParms
(
hWnd
,
SB_CTL
, (
PSBDATA
)(
ULONG_PTR
)
MAXULONG_PTR
, &
si
);
78
error
=
GetLastError
();
79
80
ok_int
(
ret
,
FALSE
);
81
ok_int
(
error
,
ERROR_NOACCESS
);
82
}
apitest.h
START_TEST
#define START_TEST(x)
Definition:
atltest.h:75
ok_int
#define ok_int(expression, result)
Definition:
atltest.h:134
hWnd
HWND hWnd
Definition:
settings.c:17
MAXULONG_PTR
#define MAXULONG_PTR
Definition:
basetsd.h:97
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
SetLastError
#define SetLastError(x)
Definition:
compat.h:752
GetConsoleWindow
HWND WINAPI GetConsoleWindow(void)
Definition:
console.c:1102
ret
return ret
Definition:
mutex.c:147
BOOL
unsigned int BOOL
Definition:
ntddk_ex.h:94
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
NtUserSBGetParms
BOOL NTAPI NtUserSBGetParms(HWND hwnd, int fnBar, PSBDATA pSBData, LPSCROLLINFO lpsi)
Definition:
scrollbar.c:1193
void
Definition:
nsiface.idl:2307
error
#define error(str)
Definition:
mkdosfs.c:1605
si
static SYSTEM_INFO si
Definition:
virtual.c:39
tagSBDATA
Definition:
ntuser.h:504
tagSCROLLINFO
Definition:
winuser.h:3386
ULONG_PTR
uint32_t ULONG_PTR
Definition:
typedefs.h:65
GetLastError
DWORD WINAPI GetLastError(void)
Definition:
except.c:1042
wincon.h
ERROR_INVALID_WINDOW_HANDLE
#define ERROR_INVALID_WINDOW_HANDLE
Definition:
winerror.h:1226
ERROR_NOACCESS
#define ERROR_NOACCESS
Definition:
winerror.h:902
SB_CTL
#define SB_CTL
Definition:
winuser.h:554
modules
rostests
apitests
win32u
ntuser
NtUserSBGetParms.c
Generated on Fri Aug 21 2026 06:11:20 for ReactOS by
1.9.6