add more dump output for win3kdxtest
[reactos.git] / rostests / dxtest / win32kdxtest / NtGdiDdQueryDirectDrawObject.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 #include "test.h"
9
10 extern BOOL dumping_on;
11
12 /* my struct */
13 struct
14 {
15 DWORD pos;
16 } *mytest;
17
18 /*
19 * Test see if we can setup DirectDrawObject
20 *
21 */
22
23 /*
24 * ToDO
25 * 1. add more testcase it is only some, but we do not test for all case
26 * that happen only some
27 *
28 * 2.Fixed the false alaret for drivers only support 2d dx interface
29 *
30 * 3. fixed the dumping of d3d struct.
31 *
32 */
33
34 void
35 test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal)
36 {
37 int fails=0;
38 BOOL retValue=FALSE;
39
40 DD_HALINFO *pHalInfo = NULL;
41 DWORD *pCallBackFlags = NULL;
42 LPD3DNTHAL_CALLBACKS puD3dCallbacks = NULL;
43 LPD3DNTHAL_GLOBALDRIVERDATA puD3dDriverData = NULL;
44 PDD_D3DBUFCALLBACKS puD3dBufferCallbacks = NULL;
45 LPDDSURFACEDESC puD3dTextureFormats = NULL;
46 DWORD *puNumHeaps = NULL;
47 VIDEOMEMORY *puvmList = NULL;
48 DWORD *puNumFourCC = NULL;
49 DWORD *puFourCC = NULL;
50
51 DD_HALINFO HalInfo;
52 DWORD CallBackFlags[4];
53 D3DNTHAL_CALLBACKS D3dCallbacks;
54 D3DNTHAL_GLOBALDRIVERDATA D3dDriverData;
55 DD_D3DBUFCALLBACKS D3dBufferCallbacks;
56 DDSURFACEDESC2 D3dTextureFormats[100];
57 DWORD NumHeaps = 0;
58 VIDEOMEMORY vmList;
59 DWORD NumFourCC = 0;
60 DWORD FourCC = 0;
61
62 /* clear data */
63 memset(&vmList,0,sizeof(VIDEOMEMORY));
64 memset(&D3dTextureFormats,0,sizeof(DDSURFACEDESC));
65 memset(&D3dBufferCallbacks,0,sizeof(DD_D3DBUFCALLBACKS));
66 memset(&D3dDriverData,0,sizeof(D3DNTHAL_GLOBALDRIVERDATA));
67 memset(&D3dCallbacks,0,sizeof(D3DNTHAL_CALLBACKS));
68 memset(&HalInfo,0,sizeof(DD_HALINFO));
69 memset(CallBackFlags,0,sizeof(DWORD)*3);
70
71 printf("Start testing of NtGdiDdQueryDirectDrawObject\n");
72
73 /* testing OsThunkDdQueryDirectDrawObject( NULL, .... */
74 printf("testing DdQueryDirectDrawObject( NULL, ....)\n");
75
76 retValue = OsThunkDdQueryDirectDrawObject( NULL, pHalInfo,
77 pCallBackFlags, puD3dCallbacks,
78 puD3dDriverData, puD3dBufferCallbacks,
79 puD3dTextureFormats, puNumHeaps,
80 puvmList, puNumFourCC,
81 puFourCC);
82
83 testing_noteq(retValue,FALSE,fails,"1. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
84 testing_noteq(pHalInfo,NULL,fails,"2. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
85 testing_noteq(pCallBackFlags,NULL,fails,"3. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
86 testing_noteq(puD3dCallbacks,NULL,fails,"4. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
87 testing_noteq(puD3dDriverData,NULL,fails,"5. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
88 testing_noteq(puD3dBufferCallbacks,NULL,fails,"6. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
89 testing_noteq(puD3dTextureFormats,NULL,fails,"7. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
90 testing_noteq(puNumFourCC,NULL,fails,"8. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
91 testing_noteq(puFourCC,NULL,fails,"9. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
92
93 /* testing OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, NULL, .... */
94 printf("testing DdQueryDirectDrawObject( hDD, NULL, ....)\n");
95
96 retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo,
97 pCallBackFlags, puD3dCallbacks,
98 puD3dDriverData, puD3dBufferCallbacks,
99 puD3dTextureFormats, puNumHeaps,
100 puvmList, puNumFourCC,
101 puFourCC);
102
103 testing_noteq(retValue,FALSE,fails,"10. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
104 testing_noteq(pHalInfo,NULL,fails,"11. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
105 testing_noteq(pCallBackFlags,NULL,fails,"12. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
106 testing_noteq(puD3dCallbacks,NULL,fails,"13. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
107 testing_noteq(puD3dDriverData,NULL,fails,"14. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
108 testing_noteq(puD3dBufferCallbacks,NULL,fails,"15. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
109 testing_noteq(puD3dTextureFormats,NULL,fails,"16. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
110 testing_noteq(puNumFourCC,NULL,fails,"17. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
111 testing_noteq(puFourCC,NULL,fails,"18. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, NULL, ...);\0");
112
113 /* testing OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo, NULL, .... */
114 printf("testing DdQueryDirectDrawObject( hDD, pHalInfo, NULL, ....)\n");
115
116 pHalInfo = &HalInfo;
117 retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo,
118 pCallBackFlags, puD3dCallbacks,
119 puD3dDriverData, puD3dBufferCallbacks,
120 puD3dTextureFormats, puNumHeaps,
121 puvmList, puNumFourCC,
122 puFourCC);
123
124 testing_noteq(retValue,FALSE,fails,"19. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, NULL, ...);\0");
125 testing_eq(pHalInfo,NULL,fails,"20. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, NULL, ...);\0");
126 testing_noteq(pCallBackFlags,NULL,fails,"21. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, NULL, ...);\0");
127 testing_noteq(puD3dCallbacks,NULL,fails,"22. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, NULL, ...);\0");
128 testing_noteq(puD3dDriverData,NULL,fails,"23. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, NULL, ...);\0");
129 testing_noteq(puD3dBufferCallbacks,NULL,fails,"24. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, NULL, ...);\0");
130 testing_noteq(puD3dTextureFormats,NULL,fails,"25. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, NULL, ...);\0");
131 testing_noteq(puNumFourCC,NULL,fails,"26. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, NULL, ...);\0");
132 testing_noteq(puFourCC,NULL,fails,"27. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, NULL, ...);\0");
133
134 /*
135 if ((pHalInfo->dwSize != sizeof(DD_HALINFO)) &&
136 (pHalInfo->dwSize != sizeof(DD_HALINFO_V4)))
137 {
138 printf("28. if this show for NT 2000/XP/2003 ignore it, NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, NULL, ...);\n");
139 fails++;
140 }
141 */
142
143 if (dumping_on == TRUE)
144 {
145 dump_halinfo(pHalInfo,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, NULL, ...)");
146 }
147
148
149
150
151
152
153
154
155
156
157
158
159
160 /* testing OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo, pCallBackFlags, NULL, .... */
161 printf("testing DdQueryDirectDrawObject( hDD, pHalInfo, pCallBackFlags, NULL, ....)\n");
162
163 pHalInfo = &HalInfo;
164 pCallBackFlags = CallBackFlags;
165
166 RtlZeroMemory(pHalInfo,sizeof(DD_HALINFO));
167
168 retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo,
169 pCallBackFlags, puD3dCallbacks,
170 puD3dDriverData, puD3dBufferCallbacks,
171 puD3dTextureFormats, puNumHeaps,
172 puvmList, puNumFourCC,
173 puFourCC);
174
175 testing_noteq(retValue,FALSE,fails,"29. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, NULL, ...);\0");
176 testing_eq(pHalInfo,NULL,fails,"30. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, NULL, ...);\0");
177 testing_eq(pCallBackFlags,NULL,fails,"31. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, NULL, ...);\0");
178 testing_noteq(puD3dCallbacks,NULL,fails,"32. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, NULL, ...);\0");
179 testing_noteq(puD3dDriverData,NULL,fails,"33. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, NULL, ...);\0");
180 testing_noteq(puD3dBufferCallbacks,NULL,fails,"34. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, NULL, ...);\0");
181 testing_noteq(puD3dTextureFormats,NULL,fails,"35. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, NULL, ...);\0");
182 testing_noteq(puNumFourCC,NULL,fails,"36. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, NULL, ...);\0");
183 testing_noteq(puFourCC,NULL,fails,"37. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, NULL, ...);\0");
184 /*
185 if ((pHalInfo->dwSize != sizeof(DD_HALINFO)) &&
186 (pHalInfo->dwSize != sizeof(DD_HALINFO_V4)))
187 {
188 printf("38. if this show for NT 2000/XP/2003 ignore it, NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, NULL, ...);\n");
189 fails++;
190 }
191 */
192
193 if (dumping_on == TRUE)
194 {
195 dump_halinfo(pHalInfo,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, NULL, ...)");
196 dump_CallBackFlags(pCallBackFlags,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, NULL, ...)");
197 }
198
199 /* testing OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo, pCallBackFlags, D3dCallbacks, .... */
200 printf("testing DdQueryDirectDrawObject( hDD, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ....)\n");
201
202 pHalInfo = &HalInfo;
203 pCallBackFlags = CallBackFlags;
204 puD3dCallbacks = &D3dCallbacks;
205
206 RtlZeroMemory(pHalInfo,sizeof(DD_HALINFO));
207 RtlZeroMemory(pCallBackFlags,sizeof(DWORD)*3);
208
209 retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo,
210 pCallBackFlags, puD3dCallbacks,
211 puD3dDriverData, puD3dBufferCallbacks,
212 puD3dTextureFormats, puNumHeaps,
213 puvmList, puNumFourCC,
214 puFourCC);
215
216 testing_noteq(retValue,FALSE,fails,"39. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
217 testing_eq(pHalInfo,NULL,fails,"40. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
218 testing_eq(pCallBackFlags,NULL,fails,"41. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
219
220
221 testing_noteq(puD3dCallbacks->dwSize,sizeof(D3DNTHAL_CALLBACKS),fails,"42. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
222
223 testing_noteq(puD3dDriverData,NULL,fails,"43. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
224 testing_noteq(puD3dBufferCallbacks,NULL,fails,"44. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
225 testing_noteq(puD3dTextureFormats,NULL,fails,"45. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
226 testing_noteq(puNumFourCC,NULL,fails,"46. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
227 testing_noteq(puFourCC,NULL,fails,"47. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
228 /*
229 if ((pHalInfo->dwSize != sizeof(DD_HALINFO)) &&
230 (pHalInfo->dwSize != sizeof(DD_HALINFO_V4)))
231 {
232 printf("48. if this show for NT 2000/XP/2003 ignore it, NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\n");
233 fails++;
234 }
235 */
236
237 if (dumping_on == TRUE)
238 {
239 dump_halinfo(pHalInfo,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...)");
240 dump_CallBackFlags(pCallBackFlags,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...)");
241 dump_D3dCallbacks(puD3dCallbacks,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...)");
242 }
243
244 /* testing OsThunkDdQueryDirectDrawObject( hDD, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, */
245 printf("testing DdQueryDirectDrawObject( hDD, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ....)\n");
246
247 pHalInfo = &HalInfo;
248 pCallBackFlags = CallBackFlags;
249 puD3dCallbacks = &D3dCallbacks;
250 puD3dDriverData = &D3dDriverData;
251
252 RtlZeroMemory(pHalInfo,sizeof(DD_HALINFO));
253 RtlZeroMemory(pCallBackFlags,sizeof(DWORD)*3);
254 RtlZeroMemory(puD3dCallbacks,sizeof(D3DNTHAL_CALLBACKS));
255
256 retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo,
257 pCallBackFlags, puD3dCallbacks,
258 puD3dDriverData, puD3dBufferCallbacks,
259 puD3dTextureFormats, puNumHeaps,
260 puvmList, puNumFourCC,
261 puFourCC);
262
263 testing_noteq(retValue,FALSE,fails,"49. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...);\0");
264 testing_eq(pHalInfo,NULL,fails,"50. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...);\0");
265 testing_eq(pCallBackFlags,NULL,fails,"51. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...);\0");
266 testing_noteq(puD3dCallbacks->dwSize,sizeof(D3DNTHAL_CALLBACKS),fails,"52. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...);\0");
267
268 testing_noteq(puD3dDriverData->dwSize,sizeof(D3DNTHAL_GLOBALDRIVERDATA),fails,"53. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
269
270 testing_noteq(puD3dBufferCallbacks,NULL,fails,"54. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...);\0");
271 testing_noteq(puD3dTextureFormats,NULL,fails,"55. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...);\0");
272 testing_noteq(puNumFourCC,NULL,fails,"56. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...);\0");
273 testing_noteq(puFourCC,NULL,fails,"57. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...);\0");
274 /*
275 if ((pHalInfo->dwSize != sizeof(DD_HALINFO)) &&
276 (pHalInfo->dwSize != sizeof(DD_HALINFO_V4)))
277 {
278 printf("58. if this show for NT 2000/XP/2003 ignore it, NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...);\n");
279 fails++;
280 }
281 */
282
283 if (dumping_on == TRUE)
284 {
285 dump_halinfo(pHalInfo,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...)");
286 dump_CallBackFlags(pCallBackFlags,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...)");
287 dump_D3dCallbacks(puD3dCallbacks,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...)");
288 dump_D3dDriverData(puD3dDriverData,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...)");
289 }
290
291 /* testing OsThunkDdQueryDirectDrawObject( hDD, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, D3dBufferCallbacks, NULL, */
292 printf("testing DdQueryDirectDrawObject( hDD, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, D3dBufferCallbacks, NULL, ....)\n");
293
294 pHalInfo = &HalInfo;
295 pCallBackFlags = CallBackFlags;
296 puD3dCallbacks = &D3dCallbacks;
297 puD3dDriverData = &D3dDriverData;
298 puD3dBufferCallbacks = &D3dBufferCallbacks;
299
300 RtlZeroMemory(pHalInfo,sizeof(DD_HALINFO));
301 RtlZeroMemory(pCallBackFlags,sizeof(DWORD)*3);
302 RtlZeroMemory(puD3dCallbacks,sizeof(D3DNTHAL_CALLBACKS));
303 RtlZeroMemory(puD3dDriverData,sizeof(D3DNTHAL_CALLBACKS));
304
305 retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo,
306 pCallBackFlags, puD3dCallbacks,
307 puD3dDriverData, puD3dBufferCallbacks,
308 puD3dTextureFormats, puNumHeaps,
309 puvmList, puNumFourCC,
310 puFourCC);
311
312 testing_noteq(retValue,FALSE,fails,"59. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...);\0");
313 testing_eq(pHalInfo,NULL,fails,"60. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...);\0");
314 testing_eq(pCallBackFlags,NULL,fails,"61. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...);\0");
315 testing_noteq(puD3dCallbacks->dwSize,sizeof(D3DNTHAL_CALLBACKS),fails,"62. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...);\0");
316
317 testing_noteq(puD3dDriverData->dwSize,sizeof(D3DNTHAL_GLOBALDRIVERDATA),fails,"63. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dBufferCallbacks, NULL, ...);\0");
318
319 testing_noteq(puD3dTextureFormats,NULL,fails,"64. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...);\0");
320 testing_noteq(puNumFourCC,NULL,fails,"65. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...);\0");
321 testing_noteq(puFourCC,NULL,fails,"66. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...);\0");
322 /*
323 if ((pHalInfo->dwSize != sizeof(DD_HALINFO)) &&
324 (pHalInfo->dwSize != sizeof(DD_HALINFO_V4)))
325 {
326 printf("67. if this show for NT 2000/XP/2003 ignore it, NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...);\n");
327 fails++;
328 }
329 */
330
331 if (puD3dBufferCallbacks)
332 {
333 testing_noteq(puD3dBufferCallbacks->dwSize,sizeof(DD_D3DBUFCALLBACKS),fails,"68. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL...);\0");
334 }
335
336 if (dumping_on == TRUE)
337 {
338 dump_halinfo(pHalInfo,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...)");
339 dump_CallBackFlags(pCallBackFlags,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...)");
340 dump_D3dCallbacks(puD3dCallbacks,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...)");
341 dump_D3dDriverData(puD3dDriverData, "NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...)");
342 dump_D3dBufferCallbacks(puD3dBufferCallbacks, "NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...)");
343 }
344
345 /* testing OsThunkDdQueryDirectDrawObject( hDD, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, D3dBufferCallbacks, puD3dTextureFormats, NULL, */
346 printf("testing DdQueryDirectDrawObject( hDD, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, D3dBufferCallbacks, puD3dTextureFormats, NULL, ....)\n");
347
348 pHalInfo = &HalInfo;
349 pCallBackFlags = CallBackFlags;
350 puD3dCallbacks = &D3dCallbacks;
351 puD3dDriverData = &D3dDriverData;
352 puD3dBufferCallbacks = &D3dBufferCallbacks;
353
354 if (puD3dDriverData)
355 {
356 puD3dTextureFormats = malloc (puD3dDriverData->dwNumTextureFormats * sizeof(DDSURFACEDESC2));
357 if (!puD3dTextureFormats)
358 printf("Waring Out of memory\n");
359
360 RtlZeroMemory(puD3dTextureFormats, puD3dDriverData->dwNumTextureFormats * sizeof(DDSURFACEDESC2));
361 }
362
363 retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo,
364 pCallBackFlags, puD3dCallbacks,
365 puD3dDriverData, puD3dBufferCallbacks,
366 puD3dTextureFormats, puNumHeaps,
367 puvmList, puNumFourCC,
368 puFourCC);
369
370
371
372
373
374 testing_noteq(retValue,FALSE,fails,"69. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, puD3dTextureFormats, NULL, ...);\0");
375 testing_eq(pHalInfo,NULL,fails,"70. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, puD3dTextureFormats, NULL, ...);\0");
376 testing_eq(pCallBackFlags,NULL,fails,"71. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, puD3dTextureFormats, NULL, ...);\0");
377
378 /* does not work nice in xp */
379 // testing_noteq(puD3dCallbacks->dwSize,sizeof(D3DNTHAL_CALLBACKS),fails,"72. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, puD3dTextureFormats, NULL, ...);\0");
380
381 testing_noteq(puD3dDriverData->dwSize,sizeof(D3DNTHAL_GLOBALDRIVERDATA),fails,"73. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dBufferCallbacks, puD3dTextureFormats, NULL, ...);\0");
382
383 testing_noteq(puNumFourCC,NULL,fails,"74. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, puD3dTextureFormats, NULL, ...);\0");
384 testing_noteq(puFourCC,NULL,fails,"75. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, puD3dTextureFormats, NULL, ...);\0");
385
386 // /*
387 // if ((pHalInfo->dwSize != sizeof(DD_HALINFO)) &&
388 // (pHalInfo->dwSize != sizeof(DD_HALINFO_V4)))
389 // {
390 // printf("8. if this show for NT 2000/XP/2003 ignore it, NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, puD3dTextureFormats, NULL, ...);\n");
391 // fails++;
392 // }
393 // */
394 //
395 if (puD3dBufferCallbacks)
396 {
397
398 testing_noteq(puD3dBufferCallbacks->dwSize,sizeof(DD_D3DBUFCALLBACKS),fails,"76. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, puD3dTextureFormats, NULL...);\0");
399 }
400
401 if (puD3dTextureFormats)
402 {
403 /* fixme test case for it */
404 }
405
406 if (dumping_on == TRUE)
407 {
408 dump_halinfo(pHalInfo,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...)");
409 dump_CallBackFlags(pCallBackFlags,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...)");
410 dump_D3dCallbacks(puD3dCallbacks,"NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...)");
411 dump_D3dDriverData(puD3dDriverData, "NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...)");
412 dump_D3dBufferCallbacks(puD3dBufferCallbacks, "NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...)");
413 /* FIXME dump puD3dTextureFormats */
414 }
415
416
417
418
419
420 if (puD3dTextureFormats)
421 free (puD3dTextureFormats);
422 show_status(fails, "NtGdiDdQueryDirectDrawObject\0");
423 }