ReactOS  0.4.15-dev-2103-g9dff498
NtGdiExtTextOutW.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 NtGdiExtTextOutW
5  * PROGRAMMERS:
6  */
7 
8 #include <win32nt.h>
9 
10 /*
11 BOOL
12 APIENTRY
13 NtGdiExtTextOutW(
14  IN HDC hDC,
15  IN INT XStart,
16  IN INT YStart,
17  IN UINT fuOptions,
18  IN OPTIONAL LPRECT UnsafeRect,
19  IN LPWSTR UnsafeString,
20  IN INT Count,
21  IN OPTIONAL LPINT UnsafeDx,
22  IN DWORD dwCodePage)
23 */
24 
26 {
28  HWND hWnd;
29  HDC hDC;
30  RECT rect;
31  LPWSTR lpstr;
32  BOOL ret;
33  ULONG len;
34  INT Dx[10] = {10, -5, 10, 5, 10, -10, 10, 5, 10, 5};
35 
36  /* Create a window */
37  hWnd = CreateWindowW(L"BUTTON", L"TestWindow", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
38  CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,
39  NULL, NULL, hinst, 0);
40  hDC = GetDC(hWnd);
41 
42  lpstr = L"Hallo";
43  len = lstrlenW(lpstr);
44 
45  ret = NtGdiExtTextOutW(hDC, 0, 0, 0, &rect, lpstr, len, Dx, 0);
46  ok_int(ret, 1);
47 
48  ret = NtGdiExtTextOutW(hDC, 0, 0, ETO_PDY, &rect, lpstr, len, Dx, 0);
49  ok_int(ret, 1);
50 
51  /* Test invalid lpDx */
52  ret = NtGdiExtTextOutW(hDC, 0, 0, 0, 0, lpstr, len, (INT*)((ULONG_PTR)-1), 0);
53  ok_int(ret, 0);
54 
55  /* Test alignment requirement for lpDx */
56  ret = NtGdiExtTextOutW(hDC, 0, 0, 0, 0, lpstr, len, (INT*)((ULONG_PTR)Dx + 1), 0);
57  ok_int(ret, 1);
58 }
HDC WINAPI GetDC(_In_opt_ HWND)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiExtTextOutW(_In_ HDC hdc, _In_ INT x, _In_ INT y, _In_ UINT flOpts, _In_opt_ LPRECT prcl, _In_reads_opt_(cwc) LPWSTR pwsz, _In_range_(0, 0xffff) INT cwc, _In_reads_opt_(_Inexpressible_(cwc)) LPINT pdx, _In_ DWORD dwCodePage)
static HDC
Definition: imagelist.c:92
HWND hWnd
Definition: settings.c:17
#define lstrlenW
Definition: compat.h:609
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4291
int32_t INT
Definition: typedefs.h:58
& rect
Definition: startmenu.cpp:1413
uint32_t ULONG_PTR
Definition: typedefs.h:65
unsigned int BOOL
Definition: ntddk_ex.h:94
#define CW_USEDEFAULT
Definition: winuser.h:225
#define ok_int(expression, result)
Definition: atltest.h:134
int ret
static const WCHAR L[]
Definition: oid.c:1250
GLenum GLsizei len
Definition: glext.h:6722
static HDC hDC
Definition: 3dtext.c:33
#define GetModuleHandle
Definition: winbase.h:3683
#define NULL
Definition: types.h:112
#define ETO_PDY
Definition: wingdi.h:656
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
unsigned int ULONG
Definition: retypes.h:1
static HINSTANCE hinst
Definition: edit.c:551
static LPCSTR lpstr
Definition: font.c:51
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define WS_VISIBLE
Definition: pedump.c:620
START_TEST(NtGdiExtTextOutW)