ReactOS 0.4.16-dev-197-g92996da
NtGdiFlushUserBatch.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 NtGdiFlushUserBatch
5 * PROGRAMMERS:
6 */
7
8#include "../win32nt.h"
9
11(NTAPI
12*pNtGdiFlushUserBatch)(VOID);
13
15{
16 PVOID pRet;
17 PTEB pTeb;
18
19 pNtGdiFlushUserBatch = (PVOID)GetProcAddress(g_hModule, "NtGdiFlushUserBatch");
20 if (pNtGdiFlushUserBatch == NULL)
21 return APISTATUS_NOT_FOUND;
22
23 pTeb = NtCurrentTeb();
24 ok(pTeb != NULL, "pTeb was NULL.\n");
25
26 pRet = (PVOID)pNtGdiFlushUserBatch();
27
28 ok(pRet != NULL, "pRet was NULL.\n");
29 ok_ptr(pRet, &pTeb->RealClientId);
30
31 ok_long(pTeb->GdiBatchCount, 0);
32 ok_long(pTeb->GdiTebBatch.Offset, 0);
33 ok_ptr(pTeb->GdiTebBatch.HDC, NULL);
34
35 /* Set up some bullshit */
36 pTeb->InDbgPrint = 1;
37 pTeb->GdiBatchCount = 12;
38 pTeb->GdiTebBatch.Offset = 21;
39 pTeb->GdiTebBatch.HDC = (HDC)123;
40
41 pRet = (PVOID)pNtGdiFlushUserBatch();
42 ok_ptr(pRet, &pTeb->RealClientId);
43
44 ok_int(pTeb->InDbgPrint, 0);
45 ok_long(pTeb->GdiBatchCount, 12);
46 ok_long(pTeb->GdiTebBatch.Offset, 0);
47 ok_ptr(pTeb->GdiTebBatch.HDC, NULL);
48}
HMODULE g_hModule
Definition: ACPPage.cpp:12
#define VOID
Definition: acefi.h:82
#define ok_long(expression, result)
Definition: atltest.h:133
#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 ok_ptr(expression, result)
Definition: atltest.h:108
#define NULL
Definition: types.h:112
#define NTSTATUS
Definition: precomp.h:21
#define GetProcAddress(x, y)
Definition: compat.h:753
NTSTATUS APIENTRY NtGdiFlushUserBatch(VOID)
Definition: gdibatch.c:487
#define NtCurrentTeb
static HDC
Definition: imagelist.c:88
HANDLE HDC
Definition: compat.h:832
ULONG Offset
Definition: compat.h:831
Definition: compat.h:836
GDI_TEB_BATCH GdiTebBatch
Definition: compat.h:857
ULONG GdiBatchCount
Definition: compat.h:887
CLIENT_ID RealClientId
Definition: compat.h:861
#define NTAPI
Definition: typedefs.h:36
void * PVOID
Definition: typedefs.h:50