ReactOS 0.4.15-dev-8422-g6219a1a
NtGdiDdCanCreateSurface.c
Go to the documentation of this file.
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>
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_CANCREATESURFACEDATA pCanCreateSurface;
23
24 RtlZeroMemory(&pCanCreateSurface,sizeof(DDHAL_CANCREATESURFACEDATA));
26
27 /* crash in windows 2000 */
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
void test_NtGdiDdCanCreateSurface(HANDLE hDirectDrawLocal)
DWORD WINAPI OsThunkDdCanCreateSurface(HANDLE hDirectDraw, PDD_CANCREATESURFACEDATA puCanCreateSurfaceData)
#define DDHAL_DRIVER_HANDLED
Definition: ddrawi.h:321
#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
static const WCHAR desc[]
Definition: protectdata.c:36
struct _DDSURFACEDESC2 DDSURFACEDESC2
LPDDSURFACEDESC lpDDSurfaceDesc
Definition: ddrawi.h:785
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262