ReactOS 0.4.15-dev-8222-g9164419
NtUserGetKeyboardLayoutName.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
4 * PURPOSE: Test for NtUserGetKeyboardLayoutName
5 * COPYRIGHT: Copyright 2022 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#include "../win32nt.h"
9#include <pseh/pseh2.h>
10
12
14{
16 UNICODE_STRING ustr;
17 WCHAR szBuff[MAX_PATH];
18 BOOL bHung, ret;
19
20 /* Try NULL */
22
23 /* Try szBuff */
24 ret = bHung = FALSE;
25 RtlZeroMemory(szBuff, sizeof(szBuff));
27 {
28 ret = fn(szBuff);
29 }
31 {
32 bHung = TRUE;
33 }
35
36 ok_int(bHung, FALSE);
37 //ok_int(ret, FALSE); // XP:TRUE, 2k3:FALSE
38 ok(szBuff[0] == 0, "szBuff[0] was %d\n", szBuff[0]);
39
40 /* Try ustr */
41 RtlZeroMemory(szBuff, sizeof(szBuff));
42 ustr.Buffer = szBuff;
43 ustr.Length = 0;
44 ustr.MaximumLength = RTL_NUMBER_OF(szBuff) * sizeof(WCHAR);
45 ret = bHung = FALSE;
47 {
48 ret = fn(&ustr);
49 }
51 {
52 bHung = TRUE;
53 }
55
56 ok_int(bHung, FALSE);
57 ok_int(ret, TRUE);
58 ok(szBuff[0] != 0, "szBuff[0] was %d\n", szBuff[0]);
59 trace("szBuff: %S\n", szBuff);
60}
BOOL(APIENTRY * FN_NtUserGetKeyboardLayoutName)(PVOID)
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#define ok_int(expression, result)
Definition: atltest.h:134
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define APIENTRY
Definition: api.h:79
#define MAX_PATH
Definition: compat.h:34
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
unsigned int BOOL
Definition: ntddk_ex.h:94
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
BOOL NTAPI NtUserGetKeyboardLayoutName(_Inout_ PUNICODE_STRING pustrName)
Definition: kbdlayout.c:1129
#define BOOL
Definition: nt_native.h:43
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
USHORT MaximumLength
Definition: env_spec_w32.h:370
void * PVOID
Definition: typedefs.h:50
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
int ret
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
__wchar_t WCHAR
Definition: xmlstorage.h:180