Create a branch for Thomas Faber's work on creating a kernel mode test suite for...
[reactos.git] / apitests / w32knapi / ntuser / NtUserGetClassInfo.c
1 BOOL
2 NTAPI
3 NtUserGetClassInfo2(
4 HINSTANCE hInstance,
5 PUNICODE_STRING ClassName,
6 LPWNDCLASSEXW wcex,
7 LPWSTR *ppwstr,
8 BOOL Ansi)
9 {
10 return (BOOL)Syscall(L"NtUserGetClassInfo", 5, &hInstance);
11 }
12
13 INT
14 Test_NtUserGetClassInfo(PTESTINFO pti)
15 {
16 WNDCLASSEXW wclex, wclex2 = {0};
17 UNICODE_STRING us;
18 PWSTR pwstr;
19
20 us.Length = 8;
21 us.MaximumLength = 8;
22 us.Buffer = L"test";
23
24 wclex.cbSize = sizeof(WNDCLASSEXW);
25 wclex.style = 0;
26 wclex.lpfnWndProc = NULL;
27 wclex.cbClsExtra = 2;
28 wclex.cbWndExtra = 4;
29 wclex.hInstance = g_hInstance;
30 wclex.hIcon = NULL;
31 wclex.hCursor = NULL;
32 wclex.hbrBackground = CreateSolidBrush(RGB(4,7,5));
33 wclex.lpszMenuName = L"MyMenu";
34 wclex.lpszClassName = us.Buffer;
35 wclex.hIconSm = NULL;
36
37 ASSERT(RegisterClassExW(&wclex) != 0);
38
39 TEST(GetClassInfoExW(g_hInstance, us.Buffer, &wclex) != 0);
40 wclex2.cbSize = sizeof(WNDCLASSEXW);
41 TEST(NtUserGetClassInfo2(g_hInstance, &us, &wclex2, &pwstr, 0) != 0);
42
43 TEST(pwstr == wclex.lpszMenuName);
44 TEST(wclex2.cbSize == wclex.cbSize);
45 TEST(wclex2.style == wclex.style);
46 TEST(wclex2.lpfnWndProc == wclex.lpfnWndProc);
47 TEST(wclex2.cbClsExtra == wclex.cbClsExtra);
48 TEST(wclex2.cbWndExtra == wclex.cbWndExtra);
49 TEST(wclex2.hInstance == wclex.hInstance);
50 TEST(wclex2.hIcon == wclex.hIcon);
51 TEST(wclex2.hCursor == wclex.hCursor);
52 TEST(wclex2.hbrBackground == wclex.hbrBackground);
53 TEST(wclex2.lpszMenuName == 0);
54 TEST(wclex2.lpszClassName == 0);
55 TEST(wclex2.hIconSm == wclex.hIconSm);
56
57 return APISTATUS_NORMAL;
58 }