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 #include "test.h"
9 
10 
11 /*
12  * Test see if we getting a DirectDrawObject from win32k
13  *
14  */
15 HANDLE
test_NtGdiDdCreateDirectDrawObject()16 test_NtGdiDdCreateDirectDrawObject()
17 {
18     HANDLE retValue=0;
19     int fails=0;
20     HDC hdc=CreateDCW(L"Display",NULL,NULL,NULL);
21 
22     if (hdc == NULL)
23     {
24         printf("No hdc was created with Display, trying now with DISPLAY\n");
25         hdc=CreateDCW(L"DISPLAY",NULL,NULL,NULL);
26         if (hdc == NULL)
27         {
28             printf("No hdc was created with DISPLAY, trying now with NULL\n");
29             hdc=CreateDCW(NULL,NULL,NULL,NULL);
30         }
31     }
32 
33     if (hdc == NULL)
34     {
35         printf("No hdc was created at all perpare all test will fail\n");
36         return NULL;
37     }
38 
39     printf("Start testing of NtGdiDdCreateDirectDrawObject\n");
40 
41     retValue = OsThunkDdCreateDirectDrawObject(NULL);
42     testing_noteq(retValue,NULL,fails,"NtGdiDdCreateDirectDrawObject(NULL);\0");
43 
44     retValue = OsThunkDdCreateDirectDrawObject(hdc);
45     testing_eq(retValue,NULL,fails,"NtGdiDdCreateDirectDrawObject(hdc);\0");
46 
47     show_status(fails, "NtGdiDdCreateDirectDrawObject\0");
48 
49     return retValue;
50 }
51