b799078a53736fec13d70db84bf0c597da38bc03
[reactos.git] / modules / rostests / apitests / win32nt / ntgdi / NtGdiFlushUserBatch.c
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
10 NTSTATUS
11 (NTAPI
12 *pNtGdiFlushUserBatch)(VOID);
13
14 START_TEST(NtGdiFlushUserBatch)
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 ASSERT(pTeb);
25
26 pRet = (PVOID)pNtGdiFlushUserBatch();
27
28 TEST(pRet != 0);
29 TEST(pRet == &pTeb->RealClientId);
30
31 TEST(pTeb->GdiBatchCount == 0);
32 TEST(pTeb->GdiTebBatch.Offset == 0);
33 TEST(pTeb->GdiTebBatch.HDC == 0);
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 TEST(pRet == &pTeb->RealClientId);
43
44 TEST(pTeb->InDbgPrint == 0);
45 TEST(pTeb->GdiBatchCount == 12);
46 TEST(pTeb->GdiTebBatch.Offset == 0);
47 TEST(pTeb->GdiTebBatch.HDC == 0);
48
49 }