reactos/rostests/apitests/win32nt/ntgdi/NtGdiExtTextOutW.c
Timo Kreuzer 7ad21a4425 [APOTESTS]
- Convert win32k native api test to actual wine style api-tests
- Hack around a bit with the win32k dlls, some renaming, etc.
- Delete old apitest stuff

svn path=/trunk/; revision=70458
2015-12-28 20:31:10 +00:00

61 lines
1.4 KiB
C

/*
* PROJECT: ReactOS api tests
* LICENSE: GPL - See COPYING in the top level directory
* PURPOSE: Test for NtGdiExtTextOutW
* PROGRAMMERS:
*/
#include <win32nt.h>
/*
BOOL
APIENTRY
NtGdiExtTextOutW(
IN HDC hDC,
IN INT XStart,
IN INT YStart,
IN UINT fuOptions,
IN OPTIONAL LPRECT UnsafeRect,
IN LPWSTR UnsafeString,
IN INT Count,
IN OPTIONAL LPINT UnsafeDx,
IN DWORD dwCodePage)
*/
START_TEST(NtGdiExtTextOutW)
{
HINSTANCE hinst = GetModuleHandle(NULL);
HWND hWnd;
HDC hDC;
RECT rect;
LPWSTR lpstr;
BOOL ret;
ULONG len;
INT Dx[10] = {10, -5, 10, 5, 10, -10, 10, 5, 10, 5};
/* Create a window */
hWnd = CreateWindowW(L"BUTTON", L"TestWindow", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,
NULL, NULL, hinst, 0);
hDC = GetDC(hWnd);
lpstr = L"Hallo";
len = wcslen(lpstr);
ret = NtGdiExtTextOutW(hDC, 0, 0, 0, &rect, lpstr, len, Dx, 0);
TEST(ret == 1);
ret = NtGdiExtTextOutW(hDC, 0, 0, ETO_PDY, &rect, lpstr, len, Dx, 0);
TEST(ret == 1);
/* Test invalid lpDx */
ret = NtGdiExtTextOutW(hDC, 0, 0, 0, 0, lpstr, len, (INT*)((ULONG_PTR)-1), 0);
TEST(ret == 0);
/* Test alignment requirement for lpDx */
ret = NtGdiExtTextOutW(hDC, 0, 0, 0, 0, lpstr, len, (INT*)((ULONG_PTR)Dx + 1), 0);
TEST(ret == 1);
}