fix include file case
[reactos.git] / rosapps / dxtest / win32kdxtest / main.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
9
10
11
12 #include "test.h"
13
14 /* which syscall table shall we use WIndows or ReactOS */
15
16 /* Windows 2000 sp4 syscall table for win32k */
17 #include "Windows2000Sp4.h"
18
19 /* Windows syscall code */
20 #include "windowsos.h"
21
22 /* ReactOS syscall code */
23 #include "sysreactos.h"
24
25
26 /*
27 #define DdQueryDirectDrawObject GdiEntry2
28
29 #define DdCreateSurfaceObject GdiEntry4
30 #define DdDeleteSurfaceObject GdiEntry5
31 #define DdResetVisrgn GdiEntry6
32 #define DdGetDC GdiEntry7
33 #define DdReleaseDC GdiEntry8
34 #define DdCreateDIBSection GdiEntry9
35 #define DdReenableDirectDrawObject GdiEntry10
36 #define DdAttachSurface GdiEntry11
37 #define DdUnattachSurface GdiEntry12
38 #define DdQueryDisplaySettingsUniqueness GdiEntry13
39 #define DdGetDxHandle GdiEntry14
40 #define DdSetGammaRamp GdiEntry15
41 #define DdSwapTextureHandles GdiEntry16
42 */
43 int main(int argc, char **argv)
44 {
45 HANDLE hDirectDrawLocal;
46
47 hDirectDrawLocal = test_NtGdiDdCreateDirectDrawObject();
48
49 test_NtGdiDdQueryDirectDrawObject(hDirectDrawLocal);
50
51 test_NtGdiDdDeleteDirectDrawObject(hDirectDrawLocal);
52 return 0;
53 }
54
55 /*
56 * Test see if we getting a DirectDrawObject from win32k
57 *
58 */
59 HANDLE
60 test_NtGdiDdCreateDirectDrawObject()
61 {
62 HANDLE retValue=0;
63 int fails=0;
64 HDC hdc=CreateDCW(L"Display",NULL,NULL,NULL);
65
66 printf("Start testing of NtGdiDdCreateDirectDrawObject\n");
67
68 retValue = sysNtGdiDdCreateDirectDrawObject(NULL);
69 testing_noteq(retValue,NULL,fails,"NtGdiDdCreateDirectDrawObject(NULL);\0");
70
71 retValue = sysNtGdiDdCreateDirectDrawObject(hdc);
72 testing_eq(retValue,NULL,fails,"NtGdiDdCreateDirectDrawObject(hdc);\0");
73
74 show_status(fails, "NtGdiDdCreateDirectDrawObject\0");
75
76 return retValue;
77 }
78
79 /*
80 * Test see if we can setup DirectDrawObject
81 *
82 */
83 void
84 test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal)
85 {
86 int fails=0;
87 BOOL retValue=FALSE;
88
89 DD_HALINFO *pHalInfo = NULL;
90 DWORD *pCallBackFlags = NULL;
91 LPD3DNTHAL_CALLBACKS puD3dCallbacks = NULL;
92 LPD3DNTHAL_GLOBALDRIVERDATA puD3dDriverData = NULL;
93 PDD_D3DBUFCALLBACKS puD3dBufferCallbacks = NULL;
94 LPDDSURFACEDESC puD3dTextureFormats = NULL;
95 DWORD *puNumHeaps = NULL;
96 VIDEOMEMORY *puvmList = NULL;
97 DWORD *puNumFourCC = NULL;
98 DWORD *puFourCC = NULL;
99
100 printf("Start testing of NtGdiDdQueryDirectDrawObject\n");
101
102 /* testing NULL */
103 retValue = sysNtGdiDdQueryDirectDrawObject( NULL, pHalInfo,
104 pCallBackFlags, puD3dCallbacks,
105 puD3dDriverData, puD3dBufferCallbacks,
106 puD3dTextureFormats, puNumHeaps,
107 puvmList, puNumFourCC,
108 puFourCC);
109 testing_noteq(retValue,0,fails,"1. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
110 testing_noteq(pHalInfo,NULL,fails,"2. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
111 testing_noteq(pCallBackFlags,NULL,fails,"3. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
112 testing_noteq(puD3dCallbacks,NULL,fails,"4. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
113 testing_noteq(puD3dDriverData,NULL,fails,"5. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
114 testing_noteq(puD3dBufferCallbacks,NULL,fails,"6. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
115 testing_noteq(puD3dTextureFormats,NULL,fails,"7. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
116 testing_noteq(puNumFourCC,NULL,fails,"8. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
117 testing_noteq(puFourCC,NULL,fails,"9. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
118
119 retValue = sysNtGdiDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo,
120 pCallBackFlags, puD3dCallbacks,
121 puD3dDriverData, puD3dBufferCallbacks,
122 puD3dTextureFormats, puNumHeaps,
123 puvmList, puNumFourCC,
124 puFourCC);
125
126 testing_noteq(retValue,0,fails,"1. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
127 testing_noteq(pHalInfo,NULL,fails,"2. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
128 testing_noteq(pCallBackFlags,NULL,fails,"3. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
129 testing_noteq(puD3dCallbacks,NULL,fails,"4. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
130 testing_noteq(puD3dDriverData,NULL,fails,"5. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
131 testing_noteq(puD3dBufferCallbacks,NULL,fails,"6. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
132 testing_noteq(puD3dTextureFormats,NULL,fails,"7. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
133 testing_noteq(puNumFourCC,NULL,fails,"8. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
134 testing_noteq(puFourCC,NULL,fails,"9. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
135
136
137
138
139 show_status(fails, "NtGdiDdQueryDirectDrawObject\0");
140 }
141
142 /*
143 * Test see if we can delete a DirectDrawObject from win32k
144 *
145 */
146 void
147 test_NtGdiDdDeleteDirectDrawObject(HANDLE hDirectDrawLocal)
148 {
149 int fails=0;
150 BOOL retValue=FALSE;
151 printf("Start testing of NtGdiDdDeleteDirectDrawObject\n");
152
153 retValue = sysNtGdiDdDeleteDirectDrawObject(hDirectDrawLocal);
154 testing_eq(retValue,FALSE,fails,"NtGdiDdDeleteDirectDrawObject(hDirectDrawLocal);\0");
155
156 retValue = sysNtGdiDdDeleteDirectDrawObject(NULL);
157 testing_eq(retValue,TRUE,fails,"NtGdiDdDeleteDirectDrawObject(NULL);\0");
158
159 show_status(fails, "NtGdiDdDeleteDirectDrawObject\0");
160 }
161
162
163
164
165
166
167