[UFFS]
[reactos.git] / rostests / dxtest / win32kdxtest / NtGdiDdWaitForVerticalBlank.c
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>
7 #include <dll/directx/d3d8thk.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 */
16 void
17 test_NtGdiDdWaitForVerticalBlank(HANDLE hDirectDrawLocal)
18 {
19 int fails=0;
20 BOOL retValue=FALSE;
21 DDHAL_WAITFORVERTICALBLANKDATA pDdWaitForVerticalBlankData;
22
23 RtlZeroMemory(&pDdWaitForVerticalBlankData,sizeof(DDHAL_WAITFORVERTICALBLANKDATA));
24
25 retValue = OsThunkDdWaitForVerticalBlank(NULL,NULL);
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