[UFFS]
[reactos.git] / rostests / dxtest / win32kdxtest / NtGdiDdCanCreateSurface.c
1
2 #include <stdio.h>
3 /* SDK/DDK/NDK Headers. */
4 #include <windows.h>
5 #include <wingdi.h>
6 #include <winddi.h>
7 #include <d3dnthal.h>
8 #include <dll/directx/d3d8thk.h>
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_NtGdiDdCanCreateSurface(HANDLE hDirectDrawLocal)
18 {
19 int fails=0;
20 BOOL retValue=FALSE;
21 DDHAL_CANCREATESURFACEDATA pCanCreateSurface;
22 DDSURFACEDESC2 desc;
23
24 RtlZeroMemory(&pCanCreateSurface,sizeof(DDHAL_CANCREATESURFACEDATA));
25 RtlZeroMemory(&desc,sizeof(DDSURFACEDESC2));
26
27 /* crash in windows 2000 */
28 retValue = OsThunkDdCanCreateSurface(NULL,NULL);
29 testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"1. NtGdiDdCanCreateSurface(NULL,NULL);\0");
30
31 retValue = OsThunkDdCanCreateSurface(hDirectDrawLocal,NULL);
32 testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"2. NtGdiDdCanCreateSurface(hDirectDrawLocal,NULL);\0");
33
34 retValue = OsThunkDdCanCreateSurface(hDirectDrawLocal,(PDD_CANCREATESURFACEDATA)&pCanCreateSurface);
35 testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"3. NtGdiDdCanCreateSurface(hDirectDrawLocal,pCanCreateSurface);\0");
36
37 pCanCreateSurface.lpDDSurfaceDesc = (DDSURFACEDESC*)&desc;
38 desc.dwSize = sizeof(DDSURFACEDESC2);
39
40 retValue = OsThunkDdCanCreateSurface(hDirectDrawLocal,(PDD_CANCREATESURFACEDATA)&pCanCreateSurface);
41 testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"4. NtGdiDdCanCreateSurface(hDirectDrawLocal,pCanCreateSurface);\0");
42
43 }
44
45