ReactOS 0.4.15-dev-7842-g558ab78
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/*
11BOOL
12APIENTRY
13NtGdiExtTextOutW(
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;
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,
39 NULL, NULL, hinst, 0);
40 hDC = GetDC(hWnd);
41
42 lpstr = L"Hallo";
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, 0);
58}
static HDC hDC
Definition: 3dtext.c:33
#define START_TEST(x)
Definition: atltest.h:75
#define ok_int(expression, result)
Definition: atltest.h:134
HWND hWnd
Definition: settings.c:17
#define NULL
Definition: types.h:112
#define lstrlenW
Definition: compat.h:750
unsigned int BOOL
Definition: ntddk_ex.h:94
GLenum GLsizei len
Definition: glext.h:6722
static HINSTANCE hinst
Definition: edit.c:551
static HDC
Definition: imagelist.c:92
static LPCSTR lpstr
Definition: font.c:51
__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)
#define L(x)
Definition: ntvdm.h:50
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_VISIBLE
Definition: pedump.c:620
& rect
Definition: startmenu.cpp:1413
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
int ret
#define GetModuleHandle
Definition: winbase.h:3762
#define ETO_PDY
Definition: wingdi.h:657
HDC WINAPI GetDC(_In_opt_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4316
#define CW_USEDEFAULT
Definition: winuser.h:225
WCHAR * LPWSTR
Definition: xmlstorage.h:184