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