ReactOS 0.4.16-dev-340-g0540c21
NtGdiDdWaitForVerticalBlank.c
Go to the documentation of this file.
1#include <stdio.h>
2/* SDK/DDK/NDK Headers. */
3#include <windows.h>
4#include <wingdi.h>
5#include <winddi.h>
6#include <d3dnthal.h>
8
9#include <ddrawi.h>
10#include "test.h"
11
12/*
13 * Test see if we can delete a DirectDrawObject from win32k
14 *
15 */
16void
18{
19 int fails=0;
20 BOOL retValue=FALSE;
21 DDHAL_WAITFORVERTICALBLANKDATA pDdWaitForVerticalBlankData;
22
23 RtlZeroMemory(&pDdWaitForVerticalBlankData,sizeof(DDHAL_WAITFORVERTICALBLANKDATA));
24
26 testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"1. NtGdiDdWaitForVerticalBlank(NULL,NULL);\0");
27
28 retValue = OsThunkDdWaitForVerticalBlank(hDirectDrawLocal,NULL);
29 testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"2. NtGdiDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\0");
30
31 retValue = OsThunkDdWaitForVerticalBlank(hDirectDrawLocal,(PDD_WAITFORVERTICALBLANKDATA)&pDdWaitForVerticalBlankData);
32 testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"3. NtGdiDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\0");
33 testing_eq(pDdWaitForVerticalBlankData.ddRVal, DD_OK,fails,"4. NtGdiDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\0");
34
35 RtlZeroMemory(&pDdWaitForVerticalBlankData,sizeof(DDHAL_WAITFORVERTICALBLANKDATA));
36 pDdWaitForVerticalBlankData.dwFlags = DDWAITVB_I_TESTVB;
37 retValue = OsThunkDdWaitForVerticalBlank(hDirectDrawLocal,(PDD_WAITFORVERTICALBLANKDATA)&pDdWaitForVerticalBlankData);
38
39 testing_eq(retValue, DDHAL_DRIVER_NOTHANDLED,fails,"5. NtGdiDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\0");
40 testing_noteq(pDdWaitForVerticalBlankData.ddRVal, DD_OK,fails,"6. NtGdiDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\0");
41
42 retValue = OsThunkDdWaitForVerticalBlank(hDirectDrawLocal,(PDD_WAITFORVERTICALBLANKDATA)&pDdWaitForVerticalBlankData);
43
44 show_status(fails, "NtGdiDdWaitForVerticalBlank\0");
45}
46
void test_NtGdiDdWaitForVerticalBlank(HANDLE hDirectDrawLocal)
DWORD WINAPI OsThunkDdWaitForVerticalBlank(HANDLE hDirectDraw, PDD_WAITFORVERTICALBLANKDATA puWaitForVerticalBlankData)
#define DDHAL_DRIVER_HANDLED
Definition: ddrawi.h:321
#define DDWAITVB_I_TESTVB
Definition: ddrawi.h:1623
#define DDHAL_DRIVER_NOTHANDLED
Definition: ddrawi.h:320
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define testing_eq(input, value, counter, text)
Definition: test.h:24
#define show_status(counter, text)
Definition: test.h:40
#define testing_noteq(input, value, counter, text)
Definition: test.h:32
#define DD_OK
Definition: ddraw.h:186
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262