ReactOS 0.4.15-dev-7654-g6bc40d3
NtUserGetClassInfo.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 NtUserGetClassInfo
5 * PROGRAMMERS:
6 */
7
8#include "../win32nt.h"
9
11{
13 WNDCLASSEXW wclex, wclex2 = {0};
15 PWSTR pwstr = NULL;
16
17#ifdef _M_AMD64
18 skip("Test is broken on x64.\n");
19 return;
20#endif
21
22 us.Length = 8;
23 us.MaximumLength = 8;
24 us.Buffer = L"test";
25
26 wclex.cbSize = sizeof(WNDCLASSEXW);
27 wclex.style = 0;
28 wclex.lpfnWndProc = NULL;
29 wclex.cbClsExtra = 2;
30 wclex.cbWndExtra = 4;
31 wclex.hInstance = hinst;
32 wclex.hIcon = NULL;
33 wclex.hCursor = NULL;
34 wclex.hbrBackground = CreateSolidBrush(RGB(4,7,5));
35 wclex.lpszMenuName = L"MyMenu";
36 wclex.lpszClassName = us.Buffer;
37 wclex.hIconSm = NULL;
38
39 ASSERT(RegisterClassExW(&wclex) != 0);
40
41 TEST(GetClassInfoExW(hinst, us.Buffer, &wclex) != 0);
42 wclex2.cbSize = sizeof(WNDCLASSEXW);
43 TEST(NtUserGetClassInfo(hinst, &us, &wclex2, &pwstr, 0) != 0);
44
45 TEST(pwstr == wclex.lpszMenuName);
46 TEST(wclex2.cbSize == wclex.cbSize);
47 TEST(wclex2.style == wclex.style);
48 TEST(wclex2.lpfnWndProc == wclex.lpfnWndProc);
49 TEST(wclex2.cbClsExtra == wclex.cbClsExtra);
50 TEST(wclex2.cbWndExtra == wclex.cbWndExtra);
51 TEST(wclex2.hInstance == wclex.hInstance);
52 TEST(wclex2.hIcon == wclex.hIcon);
53 TEST(wclex2.hCursor == wclex.hCursor);
54 TEST(wclex2.hbrBackground == wclex.hbrBackground);
55 TEST(wclex2.lpszMenuName == 0);
56 TEST(wclex2.lpszClassName == 0);
57 TEST(wclex2.hIconSm == wclex.hIconSm);
58
59}
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
#define NULL
Definition: types.h:112
#define RGB(r, g, b)
Definition: precomp.h:62
BOOL NTAPI NtUserGetClassInfo(HINSTANCE hInstance, PUNICODE_STRING ClassName, LPWNDCLASSEXW wcex, LPWSTR *ppszMenuName, BOOL Ansi)
Definition: class.c:2731
#define ASSERT(a)
Definition: mode.c:44
#define TEST(x)
Definition: precomp.h:20
static HINSTANCE hinst
Definition: edit.c:551
static const BYTE us[]
Definition: encode.c:689
#define L(x)
Definition: ntvdm.h:50
LPCWSTR lpszClassName
Definition: winuser.h:3225
LPCWSTR lpszMenuName
Definition: winuser.h:3224
HBRUSH hbrBackground
Definition: winuser.h:3223
WNDPROC lpfnWndProc
Definition: winuser.h:3217
UINT cbSize
Definition: winuser.h:3215
int cbWndExtra
Definition: winuser.h:3219
HCURSOR hCursor
Definition: winuser.h:3222
HICON hIconSm
Definition: winuser.h:3226
HINSTANCE hInstance
Definition: winuser.h:3220
UINT style
Definition: winuser.h:3216
int cbClsExtra
Definition: winuser.h:3218
HICON hIcon
Definition: winuser.h:3221
uint16_t * PWSTR
Definition: typedefs.h:56
#define GetModuleHandle
Definition: winbase.h:3762
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI GetClassInfoExW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _Out_ LPWNDCLASSEXW)
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
struct _WNDCLASSEXW WNDCLASSEXW