Index: ddraw/ddraw.cpp |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | */
|
51 | 51 | bool IsBadReadPointer(void *ptr)
|
52 | 52 | {
|
53 | | - TRACE_ENTER("IsBadReadPointer",1,14,ptr);
|
| 53 | + TRACE_ENTER(1,14,ptr);
|
54 | 54 | char a;
|
55 | 55 | try
|
56 | 56 | {
|
— | — | @@ -56,18 +56,18 @@ |
57 | 57 | a = *(char*)ptr;
|
58 | 58 | if(a == *(char*)ptr)
|
59 | 59 | {
|
60 | | - TRACE_EXIT("IsBadReadPointer",21,0);
|
| 60 | + TRACE_EXIT(21,0);
|
61 | 61 | return false;
|
62 | 62 | }
|
63 | 63 | else
|
64 | 64 | {
|
65 | | - TRACE_EXIT("IsBadReadPointer",21,(void*)1);
|
| 65 | + TRACE_EXIT(21,1);
|
66 | 66 | return true;
|
67 | 67 | }
|
68 | 68 | }
|
69 | 69 | catch(...)
|
70 | 70 | {
|
71 | | - TRACE_EXIT("IsBadReadPointer",21,(void*)1);
|
| 71 | + TRACE_EXIT(21,1);
|
72 | 72 | return true;
|
73 | 73 | }
|
74 | 74 | }
|
— | — | @@ -74,69 +74,69 @@ |
75 | 75 |
|
76 | 76 | void InitGL(int width, int height, int bpp, bool fullscreen, HWND hWnd, glDirectDraw7 *glDD7)
|
77 | 77 | {
|
78 | | - TRACE_ENTER("InitGL",6,11,width,11,height,11,bpp,21,fullscreen,13,hWnd,14,glDD7);
|
| 78 | + TRACE_ENTER(6,11,width,11,height,11,bpp,21,fullscreen,13,hWnd,14,glDD7);
|
79 | 79 | if(!renderer) renderer = new glRenderer(width,height,bpp,fullscreen,hWnd,glDD7);
|
80 | 80 | else renderer->SetWnd(width,height,bpp,fullscreen,hWnd);
|
81 | | - TRACE_EXIT("InitGL",0,0);
|
| 81 | + TRACE_EXIT(0,0);
|
82 | 82 | }
|
83 | 83 |
|
84 | 84 | /// Stub for function found in system ddraw.dll
|
85 | 85 | DDRAW_API void WINAPI AcquireDDThreadLock()
|
86 | 86 | {
|
87 | | - TRACE_ENTER("AcquireDDThreadLock",0);
|
| 87 | + TRACE_ENTER(0);
|
88 | 88 | // FIXME: Add thread lock
|
89 | 89 | FIXME("AcquireDDThreadLock: stub\n");
|
90 | | - TRACE_EXIT("AcquireDDThreadLock",0,0);
|
| 90 | + TRACE_EXIT(0,0);
|
91 | 91 | }
|
92 | 92 |
|
93 | 93 | /// Stub for function found in system ddraw.dll
|
94 | 94 | DDRAW_API void WINAPI CompleteCreateSystemSurface()
|
95 | 95 | {
|
96 | | - TRACE_ENTER("CompleteCreateSystemSurface",0);
|
| 96 | + TRACE_ENTER(0);
|
97 | 97 | FIXME("CompleteCreateSystemSurface: stub\n");
|
98 | | - TRACE_EXIT("CompleteCreateSystemSurface",0,0);
|
| 98 | + TRACE_EXIT(0,0);
|
99 | 99 | }
|
100 | 100 |
|
101 | 101 | /// Stub for function found in system ddraw.dll
|
102 | 102 | DDRAW_API void WINAPI D3DParseUnknownCommand()
|
103 | 103 | {
|
104 | | - TRACE_ENTER("D3DParseUnknownCommand",0);
|
| 104 | + TRACE_ENTER(0);
|
105 | 105 | FIXME("D3DParseUnknownCommand: stub\n");
|
106 | | - TRACE_EXIT("D3DParseUnknownCommand",0,0);
|
| 106 | + TRACE_EXIT(0,0);
|
107 | 107 | }
|
108 | 108 |
|
109 | 109 | /// Stub for function found in system ddraw.dll
|
110 | 110 | DDRAW_API void WINAPI DDGetAttachedSurfaceLcl()
|
111 | 111 | {
|
112 | | - TRACE_ENTER("DDGetAttachedSurfaceLcl",0);
|
| 112 | + TRACE_ENTER(0);
|
113 | 113 | FIXME("DDGetAttachedSurfaceLcl: stub\n");
|
114 | | - TRACE_EXIT("DDGetAttachedSurfaceLcl",0,0);
|
| 114 | + TRACE_EXIT(0,0);
|
115 | 115 | }
|
116 | 116 |
|
117 | 117 | /// Stub for function found in system ddraw.dll
|
118 | 118 | DDRAW_API void WINAPI DDInternalLock()
|
119 | 119 | {
|
120 | | - TRACE_ENTER("DDInternalLock",0);
|
| 120 | + TRACE_ENTER(0);
|
121 | 121 | //FIXME: Add locking code
|
122 | 122 | FIXME("DDInternalLock: stub\n");
|
123 | | - TRACE_EXIT("DDInternalLock",0,0);
|
| 123 | + TRACE_EXIT(0,0);
|
124 | 124 | }
|
125 | 125 |
|
126 | 126 | /// Stub for function found in system ddraw.dll
|
127 | 127 | DDRAW_API void WINAPI DDInternalUnlock()
|
128 | 128 | {
|
129 | | - TRACE_ENTER("DDInternalUnlock",0);
|
| 129 | + TRACE_ENTER(0);
|
130 | 130 | //FIXME: Add unlocking code
|
131 | 131 | FIXME("DDInternalUnlock: stub\n");
|
132 | | - TRACE_EXIT("DDInternalUnlock",0,0);
|
| 132 | + TRACE_EXIT(0,0);
|
133 | 133 | }
|
134 | 134 |
|
135 | 135 | /// Stub for function found in system ddraw.dll
|
136 | 136 | DDRAW_API void WINAPI DSoundHelp()
|
137 | 137 | {
|
138 | | - TRACE_ENTER("DSoundHelp",0);
|
| 138 | + TRACE_ENTER(0);
|
139 | 139 | FIXME("DSoundHelp: stub\n");
|
140 | | - TRACE_EXIT("DSoundHelp",0,0);
|
| 140 | + TRACE_EXIT(0,0);
|
141 | 141 | }
|
142 | 142 |
|
143 | 143 | /**
|
— | — | @@ -152,7 +152,7 @@ |
153 | 153 | */
|
154 | 154 | BOOL IsCallerOpenGL(void *returnaddress)
|
155 | 155 | {
|
156 | | - TRACE_ENTER("IsCallerOpenGL",1,14,returnaddress);
|
| 156 | + TRACE_ENTER(1,14,returnaddress);
|
157 | 157 | int isgl = 0;
|
158 | 158 | MODULEENTRY32 modentry = {0};
|
159 | 159 | HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,0);
|
— | — | @@ -168,7 +168,7 @@ |
169 | 169 | }
|
170 | 170 | } while(Module32Next(hSnapshot,&modentry));
|
171 | 171 | CloseHandle(hSnapshot);
|
172 | | - TRACE_EXIT("IsCallerOpenGL",22,(void*)isgl);
|
| 172 | + TRACE_EXIT(22,isgl);
|
173 | 173 | return isgl;
|
174 | 174 | }
|
175 | 175 |
|
— | — | @@ -189,7 +189,7 @@ |
190 | 190 | */
|
191 | 191 | HRESULT WINAPI DirectDrawCreate(GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter)
|
192 | 192 | {
|
193 | | - TRACE_ENTER("DirectDrawCreate",3,24,lpGUID,14,lplpDD,14,pUnkOuter);
|
| 193 | + TRACE_ENTER(3,24,lpGUID,14,lplpDD,14,pUnkOuter);
|
194 | 194 | HRESULT ret;
|
195 | 195 | if(gllock || IsCallerOpenGL(_ReturnAddress()))
|
196 | 196 | {
|
— | — | @@ -201,7 +201,7 @@ |
202 | 202 | sysddraw = LoadLibraryA(buffer);
|
203 | 203 | if(!sysddraw)
|
204 | 204 | {
|
205 | | - TRACE_EXIT("DirectDrawCreate",23,(void*)DDERR_GENERIC);
|
| 205 | + TRACE_EXIT(23,DDERR_GENERIC);
|
206 | 206 | ERR(DDERR_GENERIC);
|
207 | 207 | }
|
208 | 208 | }
|
— | — | @@ -210,18 +210,18 @@ |
211 | 211 | sysddrawcreate = (HRESULT(WINAPI *)(GUID FAR*,LPDIRECTDRAW FAR*, IUnknown FAR*))GetProcAddress(sysddraw,"DirectDrawCreate");
|
212 | 212 | if(!sysddrawcreate)
|
213 | 213 | {
|
214 | | - TRACE_EXIT("DirectDrawCreate",23,(void*)DDERR_GENERIC);
|
| 214 | + TRACE_EXIT(23,DDERR_GENERIC);
|
215 | 215 | ERR(DDERR_GENERIC);
|
216 | 216 | }
|
217 | 217 | }
|
218 | 218 | ret = sysddrawcreate(lpGUID,lplpDD,pUnkOuter);
|
219 | | - TRACE_VAR("DirectDrawCreate","lplpDD",14,*lplpDD);
|
220 | | - TRACE_EXIT("DirectDrawCreate",23,(void*)ret);
|
| 219 | + TRACE_VAR("*lplpDD",14,*lplpDD);
|
| 220 | + TRACE_EXIT(23,ret);
|
221 | 221 | return ret;
|
222 | 222 | }
|
223 | 223 | if(dxglinterface)
|
224 | 224 | {
|
225 | | - TRACE_EXIT("DirectDrawCreate",23,(void*)DDERR_DIRECTDRAWALREADYCREATED);
|
| 225 | + TRACE_EXIT(23,DDERR_DIRECTDRAWALREADYCREATED);
|
226 | 226 | return DDERR_DIRECTDRAWALREADYCREATED;
|
227 | 227 | }
|
228 | 228 | GetCurrentConfig(&dxglcfg);
|
— | — | @@ -233,14 +233,14 @@ |
234 | 234 | if(error != DD_OK)
|
235 | 235 | {
|
236 | 236 | delete myddraw7;
|
237 | | - TRACE_EXIT("DirectDrawCreate",23,(void*)error);
|
| 237 | + TRACE_EXIT(23,error);
|
238 | 238 | return error;
|
239 | 239 | }
|
240 | 240 | myddraw7->QueryInterface(IID_IDirectDraw,(VOID**)&myddraw);
|
241 | 241 | myddraw7->Release();
|
242 | 242 | *lplpDD = (LPDIRECTDRAW)myddraw;
|
243 | | - TRACE_VAR("DirectDrawCreate","*lplpDD",14,*lplpDD);
|
244 | | - TRACE_EXIT("DirectDrawCreate",23,(void*)error);
|
| 243 | + TRACE_VAR("*lplpDD",14,*lplpDD);
|
| 244 | + TRACE_EXIT(23,error);
|
245 | 245 | return error;
|
246 | 246 | }
|
247 | 247 |
|
— | — | @@ -259,15 +259,15 @@ |
260 | 260 | */
|
261 | 261 | HRESULT WINAPI DirectDrawCreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter)
|
262 | 262 | {
|
263 | | - TRACE_ENTER("DirectDrawCreateClipper",3,9,dwFlags,14,lplpDDClipper,14,pUnkOuter);
|
| 263 | + TRACE_ENTER(3,9,dwFlags,14,lplpDDClipper,14,pUnkOuter);
|
264 | 264 | *lplpDDClipper = new glDirectDrawClipper(dwFlags,NULL);
|
265 | 265 | if(!lplpDDClipper)
|
266 | 266 | {
|
267 | | - TRACE_EXIT("DirectDrawCreateClipper",23,(void*)DDERR_OUTOFMEMORY);
|
| 267 | + TRACE_EXIT(23,DDERR_OUTOFMEMORY);
|
268 | 268 | return DDERR_OUTOFMEMORY;
|
269 | 269 | }
|
270 | | - TRACE_VAR("DirectDrawCreateClipper","*lplpDDClipper",14,*lplpDDClipper);
|
271 | | - TRACE_EXIT("DirectDrawCreateClipper",23,(void*)DD_OK);
|
| 270 | + TRACE_VAR("*lplpDDClipper",14,*lplpDDClipper);
|
| 271 | + TRACE_EXIT(23,DD_OK);
|
272 | 272 | return DD_OK;
|
273 | 273 | }
|
274 | 274 |
|
— | — | @@ -290,10 +290,10 @@ |
291 | 291 | */
|
292 | 292 | HRESULT WINAPI DirectDrawCreateEx(GUID FAR *lpGUID, LPVOID *lplpDD, REFIID iid, IUnknown FAR *pUnkOuter)
|
293 | 293 | {
|
294 | | - TRACE_ENTER("DirectDrawCreateEx",4,24,lpGUID,14,lplpDD,24,&iid,14,pUnkOuter);
|
| 294 | + TRACE_ENTER(4,24,lpGUID,14,lplpDD,24,&iid,14,pUnkOuter);
|
295 | 295 | if(dxglinterface)
|
296 | 296 | {
|
297 | | - TRACE_EXIT("DirectDrawCreateEx",23,(void*)DDERR_DIRECTDRAWALREADYCREATED);
|
| 297 | + TRACE_EXIT(23,DDERR_DIRECTDRAWALREADYCREATED);
|
298 | 298 | return DDERR_DIRECTDRAWALREADYCREATED;
|
299 | 299 | }
|
300 | 300 | GetCurrentConfig(&dxglcfg);
|
— | — | @@ -301,7 +301,7 @@ |
302 | 302 | HRESULT error;
|
303 | 303 | if(iid != IID_IDirectDraw7)
|
304 | 304 | {
|
305 | | - TRACE_EXIT("DirectDrawCreateEx",23,(void*)DDERR_INVALIDPARAMS);
|
| 305 | + TRACE_EXIT(23,DDERR_INVALIDPARAMS);
|
306 | 306 | return DDERR_INVALIDPARAMS;
|
307 | 307 | }
|
308 | 308 | myddraw = new glDirectDraw7(lpGUID,pUnkOuter);
|
— | — | @@ -309,12 +309,12 @@ |
310 | 310 | if(error != DD_OK)
|
311 | 311 | {
|
312 | 312 | delete myddraw;
|
313 | | - TRACE_EXIT("DirectDrawCreateEx",23,(void*)error);
|
| 313 | + TRACE_EXIT(23,error);
|
314 | 314 | return error;
|
315 | 315 | }
|
316 | 316 | *lplpDD = (LPDIRECTDRAW7)myddraw;
|
317 | | - TRACE_VAR("DirectDrawCreateEx","*lplpDD",14,*lplpDD);
|
318 | | - TRACE_EXIT("DirectDrawCreateEx",23,(void*)error);
|
| 317 | + TRACE_VAR("*lplpDD",14,*lplpDD);
|
| 318 | + TRACE_EXIT(23,error);
|
319 | 319 | return error;
|
320 | 320 | }
|
321 | 321 |
|
— | — | @@ -321,11 +321,11 @@ |
322 | 322 | /// Callback wrapper for DirectDrawEnumerateA
|
323 | 323 | BOOL WINAPI DDEnumA(GUID FAR *guid, LPSTR lpDriverDescription, LPSTR lpDriverName, LPVOID lpContext, HMONITOR hMonitor)
|
324 | 324 | {
|
325 | | - TRACE_ENTER("DDEnumA",5,24,guid,15,lpDriverDescription,15,lpDriverName,14,lpContext,13,hMonitor);
|
| 325 | + TRACE_ENTER(5,24,guid,15,lpDriverDescription,15,lpDriverName,14,lpContext,13,hMonitor);
|
326 | 326 | int *context = (int *)lpContext;
|
327 | 327 | LPDDENUMCALLBACKA callback = (LPDDENUMCALLBACKA)context[0];
|
328 | 328 | BOOL ret = callback(guid,lpDriverDescription,lpDriverName,(LPVOID)context[1]);
|
329 | | - TRACE_EXIT("DDEnumA",22,(void*)ret);
|
| 329 | + TRACE_EXIT(22,ret);
|
330 | 330 | return ret;
|
331 | 331 | }
|
332 | 332 |
|
— | — | @@ -342,10 +342,10 @@ |
343 | 343 | */
|
344 | 344 | HRESULT WINAPI DirectDrawEnumerateA(LPDDENUMCALLBACKA lpCallback, LPVOID lpContext)
|
345 | 345 | {
|
346 | | - TRACE_ENTER("DirectDrawEnumerateA",2,14,lpCallback,14,lpContext);
|
| 346 | + TRACE_ENTER(2,14,lpCallback,14,lpContext);
|
347 | 347 | if(IsBadReadPointer(lpCallback))
|
348 | 348 | {
|
349 | | - TRACE_EXIT("DirectDrawEnumerateA",23,(void*)DDERR_INVALIDPARAMS);
|
| 349 | + TRACE_EXIT(23,DDERR_INVALIDPARAMS);
|
350 | 350 | return DDERR_INVALIDPARAMS;
|
351 | 351 | }
|
352 | 352 | LPVOID context[2];
|
— | — | @@ -352,7 +352,7 @@ |
353 | 353 | context[0] = (LPVOID) lpCallback;
|
354 | 354 | context[1] = lpContext;
|
355 | 355 | HRESULT ret = DirectDrawEnumerateExA(DDEnumA,&context,0);
|
356 | | - TRACE_EXIT("DirectDrawEnumerateA",23,(void*)ret);
|
| 356 | + TRACE_EXIT(23,ret);
|
357 | 357 | return ret;
|
358 | 358 | }
|
359 | 359 |
|
— | — | @@ -359,11 +359,11 @@ |
360 | 360 | /// Callback wrapper for DirectDrawEnumerateW
|
361 | 361 | BOOL WINAPI DDEnumW(GUID FAR *guid, LPWSTR lpDriverDescription, LPWSTR lpDriverName, LPVOID lpContext, HMONITOR hMonitor)
|
362 | 362 | {
|
363 | | - TRACE_ENTER("DDEnumW",5,24,guid,16,lpDriverDescription,16,lpDriverName,14,lpContext,13,hMonitor);
|
| 363 | + TRACE_ENTER(5,24,guid,16,lpDriverDescription,16,lpDriverName,14,lpContext,13,hMonitor);
|
364 | 364 | int *context = (int *)lpContext;
|
365 | 365 | LPDDENUMCALLBACKW callback = (LPDDENUMCALLBACKW)context[0];
|
366 | 366 | BOOL ret = callback(guid,lpDriverDescription,lpDriverName,(LPVOID)context[1]);
|
367 | | - TRACE_EXIT("DDEnumW",22,(void*)ret);
|
| 367 | + TRACE_EXIT(22,ret);
|
368 | 368 | return ret;
|
369 | 369 | }
|
370 | 370 |
|
— | — | @@ -380,10 +380,10 @@ |
381 | 381 | */
|
382 | 382 | HRESULT WINAPI DirectDrawEnumerateW(LPDDENUMCALLBACKW lpCallback, LPVOID lpContext)
|
383 | 383 | {
|
384 | | - TRACE_ENTER("DirectDrawEnumerateW",2,14,lpCallback,14,lpContext);
|
| 384 | + TRACE_ENTER(2,14,lpCallback,14,lpContext);
|
385 | 385 | if(IsBadReadPointer(lpCallback))
|
386 | 386 | {
|
387 | | - TRACE_EXIT("DirectDrawEnumerateW",23,(void*)DDERR_INVALIDPARAMS);
|
| 387 | + TRACE_EXIT(23,DDERR_INVALIDPARAMS);
|
388 | 388 | return DDERR_INVALIDPARAMS;
|
389 | 389 | }
|
390 | 390 | LPVOID context[2];
|
— | — | @@ -390,7 +390,7 @@ |
391 | 391 | context[0] = (LPVOID) lpCallback;
|
392 | 392 | context[1] = lpContext;
|
393 | 393 | HRESULT ret = DirectDrawEnumerateExW(DDEnumW,&context,0);
|
394 | | - TRACE_EXIT("DirectDrawEnumerateW",23,(void*)ret);
|
| 394 | + TRACE_EXIT(23,ret);
|
395 | 395 | return ret;
|
396 | 396 | }
|
397 | 397 |
|
— | — | @@ -398,7 +398,7 @@ |
399 | 399 | /// Converts Unicode strings to ANSI.
|
400 | 400 | BOOL WINAPI DDEnumExA(GUID FAR *guid, LPWSTR lpDriverDescription, LPWSTR lpDriverName, LPVOID lpContext, HMONITOR hMonitor)
|
401 | 401 | {
|
402 | | - TRACE_ENTER("DDEnumExA",5,24,guid,16,lpDriverDescription,16,lpDriverName,14,lpContext,13,hMonitor);
|
| 402 | + TRACE_ENTER(5,24,guid,16,lpDriverDescription,16,lpDriverName,14,lpContext,13,hMonitor);
|
403 | 403 | int *context = (int *)lpContext;
|
404 | 404 | LPDDENUMCALLBACKEXA callback = (LPDDENUMCALLBACKEXA)context[0];
|
405 | 405 | CHAR desc[MAX_PATH];
|
— | — | @@ -406,7 +406,7 @@ |
407 | 407 | WideCharToMultiByte(CP_ACP,0,lpDriverDescription,-1,desc,MAX_PATH,NULL,NULL);
|
408 | 408 | WideCharToMultiByte(CP_ACP,0,lpDriverName,-1,driver,MAX_PATH,NULL,NULL);
|
409 | 409 | BOOL ret = callback(guid,desc,driver,(LPVOID)context[1],hMonitor);
|
410 | | - TRACE_EXIT("DDEnumExA",22,(void*)ret);
|
| 410 | + TRACE_EXIT(22,ret);
|
411 | 411 | return ret;
|
412 | 412 | }
|
413 | 413 |
|
— | — | @@ -426,10 +426,10 @@ |
427 | 427 | */
|
428 | 428 | HRESULT WINAPI DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags)
|
429 | 429 | {
|
430 | | - TRACE_ENTER("DirectDrawEnumerateExA",3,14,lpCallback,14,lpContext,9,dwFlags);
|
| 430 | + TRACE_ENTER(3,14,lpCallback,14,lpContext,9,dwFlags);
|
431 | 431 | if(IsBadReadPointer(lpCallback))
|
432 | 432 | {
|
433 | | - TRACE_EXIT("DirectDrawEnumerateExA",23,(void*)DDERR_INVALIDPARAMS);
|
| 433 | + TRACE_EXIT(23,DDERR_INVALIDPARAMS);
|
434 | 434 | return DDERR_INVALIDPARAMS;
|
435 | 435 | }
|
436 | 436 | LPVOID context[2];
|
— | — | @@ -436,7 +436,7 @@ |
437 | 437 | context[0] = (LPVOID) lpCallback;
|
438 | 438 | context[1] = lpContext;
|
439 | 439 | HRESULT ret = DirectDrawEnumerateExW(DDEnumExA,&context,dwFlags);
|
440 | | - TRACE_EXIT("DirectDrawEnumerateExA",23,(void*)ret);
|
| 440 | + TRACE_EXIT(23,ret);
|
441 | 441 | return ret;
|
442 | 442 | }
|
443 | 443 |
|
— | — | @@ -450,7 +450,7 @@ |
451 | 451 | */
|
452 | 452 | BOOL CALLBACK MonitorEnum(HMONITOR hMonitor, HDC unused, LPRECT unused2, LPARAM ptr)
|
453 | 453 | {
|
454 | | - TRACE_ENTER("MonitorEnum",4,13,hMonitor,13,unused,26,unused2,13,ptr);
|
| 454 | + TRACE_ENTER(4,13,hMonitor,13,unused,26,unused2,13,ptr);
|
455 | 455 | int * monitors = *(int**)ptr;
|
456 | 456 | if(!monitors)
|
457 | 457 | {
|
— | — | @@ -457,7 +457,7 @@ |
458 | 458 | monitors = (int*)malloc(256*sizeof(int));
|
459 | 459 | if(!monitors)
|
460 | 460 | {
|
461 | | - TRACE_EXIT("MonitorEnum",22,(void*)FALSE);
|
| 461 | + TRACE_EXIT(22,FALSE);
|
462 | 462 | return FALSE;
|
463 | 463 | }
|
464 | 464 | monitors[0] = 1;
|
— | — | @@ -468,7 +468,8 @@ |
469 | 469 | BOOL ret;
|
470 | 470 | if(monitors[0] == 255) ret = FALSE;
|
471 | 471 | else ret = TRUE;
|
472 | | - TRACE_EXIT("MonitorEnum",22,(void*)ret);
|
| 472 | + TRACE_EXIT(22,ret);
|
| 473 | + return ret;
|
473 | 474 | }
|
474 | 475 |
|
475 | 476 | /**
|
— | — | @@ -486,10 +487,10 @@ |
487 | 488 | */
|
488 | 489 | HRESULT WINAPI DirectDrawEnumerateExW(LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags)
|
489 | 490 | {
|
490 | | - TRACE_ENTER("DirectDrawEnumerateExW",3,14,lpCallback,14,lpContext,9,dwFlags);
|
| 491 | + TRACE_ENTER(3,14,lpCallback,14,lpContext,9,dwFlags);
|
491 | 492 | if(IsBadReadPointer(lpCallback))
|
492 | 493 | {
|
493 | | - TRACE_EXIT("DirectDrawEnumerateExW",23,(void*)DDERR_GENERIC);
|
| 494 | + TRACE_EXIT(23,DDERR_GENERIC);
|
494 | 495 | return DDERR_INVALIDPARAMS;
|
495 | 496 | }
|
496 | 497 | int *monitors = NULL;
|
— | — | @@ -504,7 +505,7 @@ |
505 | 506 | EnumDisplayMonitors(NULL,NULL,MonitorEnum,(LPARAM)&monitors);
|
506 | 507 | if(!monitors)
|
507 | 508 | {
|
508 | | - TRACE_EXIT("DirectDrawEnumerateExW",23,(void*)DDERR_OUTOFMEMORY);
|
| 509 | + TRACE_EXIT(23,DDERR_OUTOFMEMORY);
|
509 | 510 | return DDERR_OUTOFMEMORY;
|
510 | 511 | }
|
511 | 512 | for(int i = 1; i < monitors[0]; i++)
|
— | — | @@ -517,7 +518,7 @@ |
518 | 519 | }
|
519 | 520 | free(monitors);
|
520 | 521 | }
|
521 | | - TRACE_EXIT("DirectDrawEnumerateExW",23,(void*)DDERR_OUTOFMEMORY);
|
| 522 | + TRACE_EXIT(23,DD_OK);
|
522 | 523 | return DD_OK;
|
523 | 524 | }
|
524 | 525 |
|
— | — | @@ -529,8 +530,8 @@ |
530 | 531 | */
|
531 | 532 | HRESULT WINAPI DllCanUnloadNow()
|
532 | 533 | {
|
533 | | - TRACE_ENTER("DllCanUnloadNow",0);
|
534 | | - TRACE_EXIT("DllCanUnloadNow",23,(void*)S_FALSE);
|
| 534 | + TRACE_ENTER(0);
|
| 535 | + TRACE_EXIT(23,S_FALSE);
|
535 | 536 | return S_FALSE;
|
536 | 537 | }
|
537 | 538 |
|
— | — | @@ -548,11 +549,11 @@ |
549 | 550 | */
|
550 | 551 | HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
551 | 552 | {
|
552 | | - TRACE_ENTER("DllGetClassObject",3,24,&rclsid,24,&riid,14,ppv);
|
| 553 | + TRACE_ENTER(3,24,&rclsid,24,&riid,14,ppv);
|
553 | 554 | if((rclsid != CLSID_DirectDraw) && (rclsid != CLSID_DirectDraw7) &&
|
554 | 555 | (rclsid != CLSID_DirectDrawClipper))
|
555 | 556 | {
|
556 | | - TRACE_EXIT("DllGetClassObject",23,(void*)CLASS_E_CLASSNOTAVAILABLE);
|
| 557 | + TRACE_EXIT(23,CLASS_E_CLASSNOTAVAILABLE);
|
557 | 558 | return CLASS_E_CLASSNOTAVAILABLE;
|
558 | 559 | }
|
559 | 560 | GetCurrentConfig(&dxglcfg);
|
— | — | @@ -559,13 +560,13 @@ |
560 | 561 | glClassFactory *factory = new glClassFactory;
|
561 | 562 | if(factory == NULL)
|
562 | 563 | {
|
563 | | - TRACE_EXIT("DllGetClassObject",23,(void*)E_OUTOFMEMORY);
|
| 564 | + TRACE_EXIT(23,E_OUTOFMEMORY);
|
564 | 565 | return E_OUTOFMEMORY;
|
565 | 566 | }
|
566 | 567 | HRESULT result = factory->QueryInterface(riid,ppv);
|
567 | | - TRACE_VAR("DllGetClassObject","*ppv",14,*ppv);
|
| 568 | + TRACE_VAR("*ppv",14,*ppv);
|
568 | 569 | factory->Release();
|
569 | | - TRACE_EXIT("DllGetClassObject",23,(void*)result);
|
| 570 | + TRACE_EXIT(23,result);
|
570 | 571 | return result;
|
571 | 572 | }
|
572 | 573 |
|
— | — | @@ -572,8 +573,8 @@ |
573 | 574 | /// Stub for function found in system ddraw.dll
|
574 | 575 | DDRAW_API void WINAPI GetDDSurfaceLocal()
|
575 | 576 | {
|
576 | | - TRACE_ENTER("GetDDSurfaceLocal",0);
|
577 | | - TRACE_EXIT("GetDDSurfaceLocal",0,0);
|
| 577 | + TRACE_ENTER(0);
|
| 578 | + TRACE_EXIT(0,0);
|
578 | 579 | FIXME("GetDDSurfaceLocal: stub\n");
|
579 | 580 | }
|
580 | 581 |
|
— | — | @@ -581,8 +582,8 @@ |
582 | 583 | /// This function gets called by the fnddraw.exe test application.
|
583 | 584 | DDRAW_API HANDLE WINAPI GetOLEThunkData(int i1)
|
584 | 585 | {
|
585 | | - TRACE_ENTER("GetOLEThunkData",1,9,i1);
|
586 | | - TRACE_EXIT("GetOleThunkData",14,NULL);
|
| 586 | + TRACE_ENTER(1,9,i1);
|
| 587 | + TRACE_EXIT(14,NULL);
|
587 | 588 | DEBUG("GetOleThunkData: stub\n");
|
588 | 589 | return 0;
|
589 | 590 | }
|
— | — | @@ -591,11 +592,11 @@ |
592 | 593 | /// Function import is GetSurfaceFromDC
|
593 | 594 | DDRAW_API HRESULT WINAPI GlobalGetSurfaceFromDC(LPDIRECTDRAW7 lpDD, HDC hdc, LPDIRECTDRAWSURFACE7 *lpDDS)
|
594 | 595 | {
|
595 | | - TRACE_ENTER("GetSurfaceFromDC",3,14,lpDD,9,hdc,14,lpDDS);
|
| 596 | + TRACE_ENTER(3,14,lpDD,9,hdc,14,lpDDS);
|
596 | 597 | FIXME("GetSurfaceFromDC: Verify proper referencing for LPDIRECTDRAW7\n");
|
597 | 598 | HRESULT ret = lpDD->GetSurfaceFromDC(hdc,lpDDS);
|
598 | | - TRACE_VAR("GetSurfaceFromDC","*lpDDS",14,*lpDDS);
|
599 | | - TRACE_EXIT("GetSurfaceFromDC",23,(void*)ret);
|
| 599 | + TRACE_VAR("*lpDDS",14,*lpDDS);
|
| 600 | + TRACE_EXIT(23,ret);
|
600 | 601 | return ret;
|
601 | 602 | }
|
602 | 603 |
|
— | — | @@ -602,25 +603,25 @@ |
603 | 604 | /// Stub for function found in system ddraw.dll
|
604 | 605 | DDRAW_API void WINAPI RegisterSpecialCase()
|
605 | 606 | {
|
606 | | - TRACE_ENTER("RegisterSpecialCase",0);
|
| 607 | + TRACE_ENTER(0);
|
607 | 608 | FIXME("RegisterSpecialCase: stub\n");
|
608 | | - TRACE_EXIT("RegisterSpecialCase",0,0);
|
| 609 | + TRACE_EXIT(0,0);
|
609 | 610 | }
|
610 | 611 |
|
611 | 612 | /// Stub for function found in system ddraw.dll
|
612 | 613 | DDRAW_API void WINAPI ReleaseDDThreadLock()
|
613 | 614 | {
|
614 | | - TRACE_ENTER("ReleaseDDThreadLock",0);
|
| 615 | + TRACE_ENTER(0);
|
615 | 616 | FIXME("ReleaseDDThreadLock: stub\n");
|
616 | | - TRACE_EXIT("ReleaseDDThreadLock",0,0);
|
| 617 | + TRACE_EXIT(0,0);
|
617 | 618 | }
|
618 | 619 |
|
619 | 620 | /// Stub for function found in system ddraw.dll
|
620 | 621 | DDRAW_API void WINAPI SetAppCompatData()
|
621 | 622 | {
|
622 | | - TRACE_ENTER("SetAppCompatData",0);
|
| 623 | + TRACE_ENTER(0);
|
623 | 624 | FIXME("SetAppCompatData: stub\n");
|
624 | | - TRACE_EXIT("SetAppCompatData",0,0);
|
| 625 | + TRACE_EXIT(0,0);
|
625 | 626 | }
|
626 | 627 |
|
627 | 628 | /**
|
— | — | @@ -636,7 +637,7 @@ |
637 | 638 |
|
638 | 639 | DDRAW_API BOOL IsDXGLDDraw()
|
639 | 640 | {
|
640 | | - TRACE_ENTER("IsDXGLDDraw",0);
|
641 | | - TRACE_EXIT("IsDXGLDDraw",0,0);
|
| 641 | + TRACE_ENTER(0);
|
| 642 | + TRACE_EXIT(0,0);
|
642 | 643 | return TRUE;
|
643 | 644 | }
|
Index: ddraw/glDirectDraw.cpp |
— | — | @@ -551,6 +551,7 @@ |
552 | 552 |
|
553 | 553 | glDirectDraw7::glDirectDraw7()
|
554 | 554 | {
|
| 555 | + TRACE_ENTER(1,14,this);
|
555 | 556 | glDD1 = NULL;
|
556 | 557 | glDD2 = NULL;
|
557 | 558 | glDD4 = NULL;
|
— | — | @@ -560,24 +561,29 @@ |
561 | 562 | initialized = false;
|
562 | 563 | devid.liDriverVersion.QuadPart = DXGLVERQWORD;
|
563 | 564 | refcount = 1;
|
| 565 | + TRACE_EXIT(-1,0);
|
564 | 566 | }
|
565 | 567 |
|
566 | 568 | glDirectDraw7::glDirectDraw7(GUID FAR* lpGUID, IUnknown FAR* pUnkOuter)
|
567 | 569 | {
|
| 570 | + TRACE_ENTER(3,14,this,24,lpGUID,14,pUnkOuter);
|
568 | 571 | dxglinterface = this;
|
569 | 572 | initialized = false;
|
570 | 573 | if(pUnkOuter)
|
571 | 574 | {
|
572 | 575 | error = DDERR_INVALIDPARAMS ;
|
| 576 | + TRACE_EXIT(-1,0);
|
573 | 577 | return;
|
574 | 578 | }
|
575 | 579 | devid.liDriverVersion.QuadPart = DXGLVERQWORD;
|
576 | 580 | error = glDirectDraw7::Initialize(lpGUID);
|
577 | 581 | refcount = 1;
|
| 582 | + TRACE_EXIT(-1,0);
|
578 | 583 | }
|
579 | 584 |
|
580 | 585 | glDirectDraw7::~glDirectDraw7()
|
581 | 586 | {
|
| 587 | + TRACE_ENTER(1,14,this);
|
582 | 588 | dxglinterface = NULL;
|
583 | 589 | if(glD3D7) glD3D7->Release();
|
584 | 590 | RestoreDisplayMode();
|
— | — | @@ -601,16 +607,20 @@ |
602 | 608 | }
|
603 | 609 | if(renderer) delete renderer;
|
604 | 610 | renderer = NULL;
|
| 611 | + TRACE_EXIT(-1,0);
|
605 | 612 | }
|
606 | 613 |
|
607 | 614 | HRESULT WINAPI glDirectDraw7::QueryInterface(REFIID riid, void** ppvObj)
|
608 | 615 | {
|
609 | | - if(!this) return DDERR_INVALIDPARAMS;
|
610 | | - if(!ppvObj) return DDERR_INVALIDPARAMS;
|
| 616 | + TRACE_ENTER(3,this,24,riid,14,ppvObj);
|
| 617 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 618 | + if(!ppvObj) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
611 | 619 | if(riid == IID_IUnknown)
|
612 | 620 | {
|
613 | 621 | this->AddRef();
|
614 | 622 | *ppvObj = this;
|
| 623 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 624 | + TRACE_EXIT(23,DD_OK);
|
615 | 625 | return DD_OK;
|
616 | 626 | }
|
617 | 627 | if(riid == IID_IDirectDraw)
|
— | — | @@ -619,6 +629,8 @@ |
620 | 630 | {
|
621 | 631 | *ppvObj = glDD1;
|
622 | 632 | glDD1->AddRef();
|
| 633 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 634 | + TRACE_EXIT(23,DD_OK);
|
623 | 635 | return DD_OK;
|
624 | 636 | }
|
625 | 637 | else
|
— | — | @@ -627,6 +639,8 @@ |
628 | 640 | this->AddRef();
|
629 | 641 | *ppvObj = new glDirectDraw1(this);
|
630 | 642 | glDD1 = (glDirectDraw1*)*ppvObj;
|
| 643 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 644 | + TRACE_EXIT(23,DD_OK);
|
631 | 645 | return DD_OK;
|
632 | 646 | }
|
633 | 647 | }
|
— | — | @@ -636,6 +650,8 @@ |
637 | 651 | {
|
638 | 652 | *ppvObj = glDD2;
|
639 | 653 | glDD2->AddRef();
|
| 654 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 655 | + TRACE_EXIT(23,DD_OK);
|
640 | 656 | return DD_OK;
|
641 | 657 | }
|
642 | 658 | else
|
— | — | @@ -644,6 +660,8 @@ |
645 | 661 | this->AddRef();
|
646 | 662 | *ppvObj = new glDirectDraw2(this);
|
647 | 663 | glDD2 = (glDirectDraw2*)*ppvObj;
|
| 664 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 665 | + TRACE_EXIT(23,DD_OK);
|
648 | 666 | return DD_OK;
|
649 | 667 | }
|
650 | 668 | }
|
— | — | @@ -653,6 +671,8 @@ |
654 | 672 | {
|
655 | 673 | *ppvObj = glDD4;
|
656 | 674 | glDD4->AddRef();
|
| 675 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 676 | + TRACE_EXIT(23,DD_OK);
|
657 | 677 | return DD_OK;
|
658 | 678 | }
|
659 | 679 | else
|
— | — | @@ -661,6 +681,8 @@ |
662 | 682 | this->AddRef();
|
663 | 683 | *ppvObj = new glDirectDraw4(this);
|
664 | 684 | glDD4 = (glDirectDraw4*)*ppvObj;
|
| 685 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 686 | + TRACE_EXIT(23,DD_OK);
|
665 | 687 | return DD_OK;
|
666 | 688 | }
|
667 | 689 | }
|
— | — | @@ -669,6 +691,8 @@ |
670 | 692 | // Probably non-DX compliant, but give a copy of the IDirectDraw7 interface
|
671 | 693 | this->AddRef();
|
672 | 694 | *ppvObj = this;
|
| 695 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 696 | + TRACE_EXIT(23,DD_OK);
|
673 | 697 | return DD_OK;
|
674 | 698 | }
|
675 | 699 | if(riid == IID_IDirect3D)
|
— | — | @@ -676,6 +700,8 @@ |
677 | 701 | glDirect3D7 *tmp = new glDirect3D7(this);
|
678 | 702 | tmp->QueryInterface(IID_IDirect3D,ppvObj);
|
679 | 703 | tmp->Release();
|
| 704 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 705 | + TRACE_EXIT(23,DD_OK);
|
680 | 706 | return DD_OK;
|
681 | 707 | }
|
682 | 708 | if(riid == IID_IDirect3D2)
|
— | — | @@ -683,6 +709,8 @@ |
684 | 710 | glDirect3D7 *tmp = new glDirect3D7(this);
|
685 | 711 | tmp->QueryInterface(IID_IDirect3D2,ppvObj);
|
686 | 712 | tmp->Release();
|
| 713 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 714 | + TRACE_EXIT(23,DD_OK);
|
687 | 715 | return DD_OK;
|
688 | 716 | }
|
689 | 717 | if(riid == IID_IDirect3D3)
|
— | — | @@ -690,16 +718,21 @@ |
691 | 719 | glDirect3D7 *tmp = new glDirect3D7(this);
|
692 | 720 | tmp->QueryInterface(IID_IDirect3D3,ppvObj);
|
693 | 721 | tmp->Release();
|
| 722 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 723 | + TRACE_EXIT(23,DD_OK);
|
694 | 724 | return DD_OK;
|
695 | 725 | }
|
696 | 726 | if(riid == IID_IDirect3D7)
|
697 | 727 | {
|
698 | 728 | *ppvObj = new glDirect3D7(this);
|
| 729 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 730 | + TRACE_EXIT(23,DD_OK);
|
699 | 731 | return DD_OK;
|
700 | 732 | }
|
701 | 733 | if(riid == IID_IDirectDrawGammaControl)
|
702 | 734 | {
|
703 | 735 | FIXME("Add gamma control\n");
|
| 736 | + TRACE_EXIT(23,DDERR_GENERIC);
|
704 | 737 | ERR(DDERR_GENERIC);
|
705 | 738 | }
|
706 | 739 | /*if(riid == IID_IDDVideoPortContainer)
|
— | — | @@ -706,39 +739,48 @@ |
707 | 740 | {
|
708 | 741 | ERR(DDERR_GENERIC);
|
709 | 742 | }*/
|
| 743 | + TRACE_EXIT(23,E_NOINTERFACE);
|
710 | 744 | ERR(E_NOINTERFACE);
|
711 | 745 | }
|
712 | 746 | ULONG WINAPI glDirectDraw7::AddRef()
|
713 | 747 | {
|
714 | | - if(!this) return 0;
|
| 748 | + TRACE_ENTER(1,14,this);
|
| 749 | + if(!this) TRACE_RET(8,0);
|
715 | 750 | refcount++;
|
| 751 | + TRACE_EXIT(8,refcount);
|
716 | 752 | return refcount;
|
717 | 753 | }
|
718 | 754 | ULONG WINAPI glDirectDraw7::Release()
|
719 | 755 | {
|
720 | | - if(!this) return 0;
|
| 756 | + TRACE_ENTER(1,14,this);
|
| 757 | + if(!this) TRACE_RET(8,0);
|
721 | 758 | ULONG ret;
|
722 | 759 | refcount--;
|
723 | 760 | ret = refcount;
|
724 | 761 | if(refcount == 0)
|
725 | 762 | delete this;
|
| 763 | + TRACE_EXIT(8,ret);
|
726 | 764 | return ret;
|
727 | 765 | }
|
728 | 766 | HRESULT WINAPI glDirectDraw7::Compact()
|
729 | 767 | {
|
730 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 768 | + TRACE_ENTER(1,14,this);
|
| 769 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 770 | + TRACE_EXIT(23,DD_OK);
|
731 | 771 | return DD_OK;
|
732 | 772 | }
|
733 | 773 | HRESULT WINAPI glDirectDraw7::CreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter)
|
734 | 774 | {
|
735 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 775 | + TRACE_ENTER(4,14,this,9,dwFlags,14,lplpDDClipper,14,pUnkOuter);
|
| 776 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 777 | + if(!lplpDDClipper) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 778 | + if(pUnkOuter) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
736 | 779 | clippercount++;
|
737 | 780 | if(clippercount > clippercountmax)
|
738 | 781 | {
|
739 | 782 | glDirectDrawClipper **clippers2;
|
740 | 783 | clippers2 = (glDirectDrawClipper **)realloc(clippers,(clippercountmax+1024)*sizeof(glDirectDrawClipper *));
|
741 | | - if(!clippers2)
|
742 | | - ERR(DDERR_OUTOFMEMORY);
|
| 784 | + if(!clippers2) TRACE_RET(23,DDERR_OUTOFMEMORY);
|
743 | 785 | clippers = clippers2;
|
744 | 786 | ZeroMemory(&clippers[clippercountmax],1024*sizeof(glDirectDrawClipper *));
|
745 | 787 | clippercountmax += 1024;
|
— | — | @@ -745,18 +787,27 @@ |
746 | 788 | }
|
747 | 789 | clippers[clippercount-1] = new glDirectDrawClipper(dwFlags,this);
|
748 | 790 | *lplpDDClipper = clippers[clippercount-1];
|
| 791 | + TRACE_VAR("*lplpDDClipper",14,*lplpDDClipper);
|
| 792 | + TRACE_EXIT(23,DD_OK);
|
749 | 793 | return DD_OK;
|
750 | 794 | }
|
751 | 795 | HRESULT WINAPI glDirectDraw7::CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR *lplpDDPalette, IUnknown FAR *pUnkOuter)
|
752 | 796 | {
|
753 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 797 | + TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDColorArray,14,lplpDDPalette,14,pUnkOuter);
|
| 798 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 799 | + if(!lplpDDPalette) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 800 | + if(pUnkOuter) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
754 | 801 | glDirectDrawPalette *pal = new glDirectDrawPalette(dwFlags,lpDDColorArray,lplpDDPalette);
|
| 802 | + TRACE_VAR("*lplpDDPalette",14,*lplpDDPalette);
|
| 803 | + TRACE_EXIT(23,DD_OK);
|
755 | 804 | return DD_OK;
|
756 | 805 | }
|
757 | 806 | HRESULT WINAPI glDirectDraw7::CreateSurface(LPDDSURFACEDESC2 lpDDSurfaceDesc2, LPDIRECTDRAWSURFACE7 FAR *lplpDDSurface, IUnknown FAR *pUnkOuter)
|
758 | 807 | {
|
759 | | - if(!this) return DDERR_INVALIDPARAMS;
|
760 | | - if(!lpDDSurfaceDesc2) return DDERR_INVALIDPARAMS;
|
| 808 | + TRACE_ENTER(4,14,this,14,lpDDSurfaceDesc2,14,lplpDDSurface,14,pUnkOuter);
|
| 809 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 810 | + if(!lpDDSurfaceDesc2) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 811 | + if(pUnkOuter) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
761 | 812 | if(primary && (lpDDSurfaceDesc2->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) && (renderer->hRC == primary->hRC) )
|
762 | 813 | {
|
763 | 814 | if(primarylost)
|
— | — | @@ -764,9 +815,10 @@ |
765 | 816 | primary->Restore();
|
766 | 817 | *lplpDDSurface = primary;
|
767 | 818 | primarylost = false;
|
| 819 | + TRACE_EXIT(23,DD_OK);
|
768 | 820 | return DD_OK;
|
769 | 821 | }
|
770 | | - else return DDERR_PRIMARYSURFACEALREADYEXISTS;
|
| 822 | + else TRACE_RET(23,DDERR_PRIMARYSURFACEALREADYEXISTS);
|
771 | 823 | }
|
772 | 824 | surfacecount++;
|
773 | 825 | if(surfacecount > surfacecountmax)
|
— | — | @@ -773,8 +825,7 @@ |
774 | 826 | {
|
775 | 827 | glDirectDrawSurface7 **surfaces2;
|
776 | 828 | surfaces2 = (glDirectDrawSurface7 **)realloc(surfaces,(surfacecountmax+1024)*sizeof(glDirectDrawSurface7 *));
|
777 | | - if(!surfaces2)
|
778 | | - ERR(DDERR_OUTOFMEMORY);
|
| 829 | + if(!surfaces2) TRACE_RET(23,DDERR_OUTOFMEMORY);
|
779 | 830 | surfaces = surfaces2;
|
780 | 831 | ZeroMemory(&surfaces[surfacecountmax],1024*sizeof(glDirectDrawSurface7 *));
|
781 | 832 | surfacecountmax += 1024;
|
— | — | @@ -787,28 +838,44 @@ |
788 | 839 | primarylost = false;
|
789 | 840 | }
|
790 | 841 | *lplpDDSurface = surfaces[surfacecount-1];
|
| 842 | + TRACE_VAR("*lplpDDSurface",14,*lplpDDSurface);
|
| 843 | + TRACE_EXIT(23,error);
|
791 | 844 | return error;
|
792 | 845 | }
|
793 | 846 | HRESULT WINAPI glDirectDraw7::DuplicateSurface(LPDIRECTDRAWSURFACE7 lpDDSurface, LPDIRECTDRAWSURFACE7 FAR *lplpDupDDSurface)
|
794 | 847 | {
|
795 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 848 | + TRACE_ENTER(3,14,this,14,lpDDSurface,14,lplpDupDDSurface);
|
| 849 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 850 | + if(!lpDDSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 851 | + if(!lplpDupDDSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
796 | 852 | FIXME("IDirectDraw::DuplicateSurface: stub\n");
|
| 853 | + TRACE_EXIT(23,DDERR_GENERIC);
|
797 | 854 | ERR(DDERR_GENERIC);
|
798 | 855 | }
|
799 | 856 | HRESULT WINAPI glDirectDraw7::EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC2 lpDDSurfaceDesc2, LPVOID lpContext, LPDDENUMMODESCALLBACK2 lpEnumModesCallback)
|
800 | 857 | {
|
801 | | - if(!this) return DDERR_INVALIDPARAMS;
|
802 | | - return ::EnumDisplayModes(dwFlags,lpDDSurfaceDesc2,lpContext,lpEnumModesCallback);
|
| 858 | + TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSurfaceDesc2,14,lpContext,14,lpEnumModesCallback);
|
| 859 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 860 | + if(!lpDDSurfaceDesc2) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 861 | + if(!lpEnumModesCallback) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 862 | + HRESULT ret = ::EnumDisplayModes(dwFlags,lpDDSurfaceDesc2,lpContext,lpEnumModesCallback);
|
| 863 | + TRACE_EXIT(23,ret);
|
| 864 | + return ret;
|
803 | 865 | }
|
804 | 866 | HRESULT WINAPI glDirectDraw7::EnumSurfaces(DWORD dwFlags, LPDDSURFACEDESC2 lpDDSD2, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback)
|
805 | 867 | {
|
806 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 868 | + TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSD2,14,lpContext,14,lpEnumSurfacesCallback);
|
| 869 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 870 | + if(!lpDDSD2) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 871 | + if(!lpEnumSurfacesCallback) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
807 | 872 | FIXME("IDirectDraw::EnumSurfaces: stub\n");
|
| 873 | + TRACE_EXIT(23,DDERR_GENERIC);
|
808 | 874 | ERR(DDERR_GENERIC);
|
809 | 875 | }
|
810 | 876 | HRESULT WINAPI glDirectDraw7::FlipToGDISurface()
|
811 | 877 | {
|
812 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 878 | + TRACE_ENTER(1,14,this);
|
| 879 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
813 | 880 | HRESULT error = DD_OK;
|
814 | 881 | if(primary)
|
815 | 882 | {
|
— | — | @@ -820,19 +887,21 @@ |
821 | 888 | if(error != DD_OK) break;
|
822 | 889 | }
|
823 | 890 | }
|
| 891 | + TRACE_EXIT(23,error);
|
824 | 892 | return(error);
|
825 | 893 | }
|
826 | | - else ERR(DDERR_NOTFOUND);
|
| 894 | + else TRACE_RET(23,DDERR_NOTFOUND);
|
827 | 895 | }
|
828 | 896 | HRESULT WINAPI glDirectDraw7::GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps)
|
829 | 897 | {
|
830 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 898 | + TRACE_ENTER(3,14,this,14,lpDDDriverCaps,14,lpDDHELCaps);
|
| 899 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
831 | 900 | //TODO: Fill in as implemented.
|
832 | 901 | DDCAPS_DX7 ddCaps;
|
833 | 902 | ZeroMemory(&ddCaps,sizeof(DDCAPS_DX7));
|
834 | 903 | if(lpDDDriverCaps) ddCaps.dwSize = lpDDDriverCaps->dwSize;
|
835 | 904 | else if(lpDDHELCaps) ddCaps.dwSize = lpDDHELCaps->dwSize;
|
836 | | - else return DDERR_INVALIDPARAMS;
|
| 905 | + else TRACE_RET(23,DDERR_INVALIDPARAMS);
|
837 | 906 | if(ddCaps.dwSize > sizeof(DDCAPS_DX7)) ddCaps.dwSize = sizeof(DDCAPS_DX7);
|
838 | 907 | ddCaps.dwCaps = DDCAPS_BLT | DDCAPS_BLTCOLORFILL | DDCAPS_BLTSTRETCH |
|
839 | 908 | DDCAPS_COLORKEY | DDCAPS_GDI | DDCAPS_PALETTE | DDCAPS_CANBLTSYSMEM |
|
— | — | @@ -857,12 +926,14 @@ |
858 | 927 | if(lpDDHELCaps->dwSize > sizeof(DDCAPS_DX7)) lpDDHELCaps->dwSize = sizeof(DDCAPS_DX7);
|
859 | 928 | memcpy(lpDDHELCaps,&ddCaps,lpDDHELCaps->dwSize);
|
860 | 929 | }
|
| 930 | + TRACE_EXIT(23,DD_OK);
|
861 | 931 | return DD_OK;
|
862 | 932 | }
|
863 | 933 | HRESULT WINAPI glDirectDraw7::GetDisplayMode(LPDDSURFACEDESC2 lpDDSurfaceDesc2)
|
864 | 934 | {
|
865 | | - if(!this) return DDERR_INVALIDPARAMS;
|
866 | | - if(!lpDDSurfaceDesc2) return DDERR_INVALIDPARAMS;
|
| 935 | + TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc2);
|
| 936 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 937 | + if(!lpDDSurfaceDesc2) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
867 | 938 | DDSURFACEDESC2 ddsdMode;
|
868 | 939 | ZeroMemory(&ddsdMode, sizeof(DDSURFACEDESC2));
|
869 | 940 | ddsdMode.dwSize = sizeof(DDSURFACEDESC2);
|
— | — | @@ -909,6 +980,7 @@ |
910 | 981 | if(lpDDSurfaceDesc2->dwSize > sizeof(DDSURFACEDESC2))
|
911 | 982 | lpDDSurfaceDesc2->dwSize = sizeof(DDSURFACEDESC2);
|
912 | 983 | memcpy(lpDDSurfaceDesc2,&ddsdMode,lpDDSurfaceDesc2->dwSize);
|
| 984 | + TRACE_EXIT(23,DD_OK);
|
913 | 985 | return DD_OK;
|
914 | 986 | }
|
915 | 987 | EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&currmode);
|
— | — | @@ -945,53 +1017,69 @@ |
946 | 1018 | if(currmode.dmBitsPerPel == 15) ddsdMode.lPitch = currmode.dmPelsWidth * 2;
|
947 | 1019 | else if(currmode.dmBitsPerPel == 4) ddsdMode.lPitch = currmode.dmPelsWidth / 2;
|
948 | 1020 | else ddsdMode.lPitch = currmode.dmPelsWidth * (currmode.dmBitsPerPel / 8);
|
949 | | - if(lpDDSurfaceDesc2->dwSize < sizeof(DDSURFACEDESC)) ERR(DDERR_INVALIDPARAMS);
|
| 1021 | + if(lpDDSurfaceDesc2->dwSize < sizeof(DDSURFACEDESC)) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
950 | 1022 | if(lpDDSurfaceDesc2->dwSize > sizeof(DDSURFACEDESC2))
|
951 | 1023 | lpDDSurfaceDesc2->dwSize = sizeof(DDSURFACEDESC2);
|
952 | 1024 | memcpy(lpDDSurfaceDesc2,&ddsdMode,lpDDSurfaceDesc2->dwSize);
|
| 1025 | + TRACE_EXIT(23,DD_OK);
|
953 | 1026 | return DD_OK;
|
954 | 1027 | }
|
955 | 1028 | HRESULT WINAPI glDirectDraw7::GetFourCCCodes(LPDWORD lpNumCodes, LPDWORD lpCodes)
|
956 | 1029 | {
|
957 | | - if(!this) return DDERR_INVALIDPARAMS;
|
958 | | - if(!lpNumCodes) return DDERR_INVALIDPARAMS;
|
959 | | - if(!lpCodes) return DDERR_INVALIDPARAMS;
|
| 1030 | + TRACE_ENTER(3,14,this,14,lpNumCodes,14,lpCodes);
|
| 1031 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1032 | + if(!lpNumCodes) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 1033 | + if(!lpCodes) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
960 | 1034 | FIXME("IDirectDraw::GetFourCCCodes: stub\n");
|
| 1035 | + TRACE_EXIT(23,DDERR_GENERIC);
|
961 | 1036 | ERR(DDERR_GENERIC);
|
962 | 1037 | }
|
963 | 1038 | HRESULT WINAPI glDirectDraw7::GetGDISurface(LPDIRECTDRAWSURFACE7 FAR *lplpGDIDDSurface)
|
964 | 1039 | {
|
965 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1040 | + TRACE_ENTER(2,14,this,14,lplpGDIDDSurface);
|
| 1041 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1042 | + if(!lplpGDIDDSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
966 | 1043 | FIXME("IDirectDraw::GetGDISurface: stub\n");
|
| 1044 | + TRACE_EXIT(23,DDERR_GENERIC);
|
967 | 1045 | ERR(DDERR_GENERIC);
|
968 | 1046 | }
|
969 | 1047 | HRESULT WINAPI glDirectDraw7::GetMonitorFrequency(LPDWORD lpdwFrequency)
|
970 | 1048 | {
|
971 | | - if(!this) return DDERR_INVALIDPARAMS;
|
972 | | - if(!lpdwFrequency) return DDERR_INVALIDPARAMS;
|
| 1049 | + TRACE_ENTER(2,14,this,14,lpdwFrequency);
|
| 1050 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1051 | + if(!lpdwFrequency) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
973 | 1052 | DEBUG("IDirectDraw::GetMonitorFrequency: support multi-monitor\n");
|
974 | 1053 | DEVMODE devmode;
|
975 | 1054 | devmode.dmSize = sizeof(DEVMODE);
|
976 | 1055 | EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&devmode);
|
977 | 1056 | *lpdwFrequency = devmode.dmDisplayFrequency;
|
| 1057 | + TRACE_VAR("*lpdwFrequency",8,*lpdwFrequency);
|
| 1058 | + TRACE_EXIT(23,DD_OK);
|
978 | 1059 | return DD_OK;
|
979 | 1060 | }
|
980 | 1061 | HRESULT WINAPI glDirectDraw7::GetScanLine(LPDWORD lpdwScanLine)
|
981 | 1062 | {
|
982 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1063 | + TRACE_ENTER(2,14,this,14,lpdwScanLine);
|
| 1064 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1065 | + if(!lpdwScanLine) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
983 | 1066 | FIXME("IDirectDraw::GetScanLine: stub\n");
|
| 1067 | + TRACE_EXIT(23,DDERR_GENERIC);
|
984 | 1068 | ERR(DDERR_GENERIC);
|
985 | 1069 | }
|
986 | 1070 | HRESULT WINAPI glDirectDraw7::GetVerticalBlankStatus(LPBOOL lpbIsInVB)
|
987 | 1071 | {
|
988 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1072 | + TRACE_ENTER(2,14,this,14,lpbIsInVB);
|
| 1073 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1074 | + if(!lpbIsInVB) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
989 | 1075 | FIXME("IDirectDraw::GetVerticalBlankStatus: stub\n");
|
| 1076 | + TRACE_EXIT(23,DDERR_GENERIC);
|
990 | 1077 | ERR(DDERR_GENERIC);
|
991 | 1078 | }
|
992 | 1079 | HRESULT WINAPI glDirectDraw7::Initialize(GUID FAR *lpGUID)
|
993 | 1080 | {
|
994 | | - if(!this) return DDERR_INVALIDPARAMS;
|
995 | | - if(initialized) return DDERR_ALREADYINITIALIZED;
|
| 1081 | + TRACE_ENTER(2,14,this,24,lpGUID);
|
| 1082 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1083 | + if(initialized) TRACE_RET(23,DDERR_ALREADYINITIALIZED);
|
996 | 1084 | primarylost = true;
|
997 | 1085 | glD3D7 = NULL;
|
998 | 1086 | glDD1 = NULL;
|
— | — | @@ -1007,12 +1095,12 @@ |
1008 | 1096 | timer = timeGetTime();
|
1009 | 1097 | ZeroMemory(&oldmode,sizeof(DEVMODE));
|
1010 | 1098 | surfaces = (glDirectDrawSurface7 **)malloc(1024*sizeof(glDirectDrawSurface7 *));
|
1011 | | - if(!surfaces) return DDERR_OUTOFMEMORY;
|
| 1099 | + if(!surfaces) TRACE_RET(23,DDERR_OUTOFMEMORY);
|
1012 | 1100 | ZeroMemory(surfaces,1024*sizeof(glDirectDrawSurface7 *));
|
1013 | 1101 | surfacecount = 0;
|
1014 | 1102 | surfacecountmax = 1024;
|
1015 | 1103 | clippers = (glDirectDrawClipper **)malloc(1024*sizeof(glDirectDrawClipper *));
|
1016 | | - if(!clippers) return DDERR_OUTOFMEMORY;
|
| 1104 | + if(!clippers) TRACE_RET(23,DDERR_OUTOFMEMORY);
|
1017 | 1105 | ZeroMemory(clippers,1024*sizeof(glDirectDrawClipper *));
|
1018 | 1106 | clippercount = 0;
|
1019 | 1107 | clippercountmax = 1024;
|
— | — | @@ -1032,20 +1120,24 @@ |
1033 | 1121 | DEBUG("Display GUIDs not yet supported, using primary.\n");
|
1034 | 1122 | }
|
1035 | 1123 | initialized = true;
|
| 1124 | + TRACE_EXIT(23,DD_OK);
|
1036 | 1125 | return DD_OK;
|
1037 | 1126 | }
|
1038 | 1127 | HRESULT WINAPI glDirectDraw7::RestoreDisplayMode()
|
1039 | 1128 | {
|
1040 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1129 | + TRACE_ENTER(1,14,this);
|
| 1130 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1041 | 1131 | if(oldmode.dmSize != 0)
|
1042 | 1132 | {
|
1043 | 1133 | ChangeDisplaySettingsEx(NULL,&oldmode,NULL,0,NULL);
|
1044 | 1134 | }
|
| 1135 | + TRACE_EXIT(23,DD_OK);
|
1045 | 1136 | return DD_OK;
|
1046 | 1137 | }
|
1047 | 1138 | HRESULT WINAPI glDirectDraw7::SetCooperativeLevel(HWND hWnd, DWORD dwFlags)
|
1048 | 1139 | {
|
1049 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1140 | + TRACE_ENTER(3,14,this,13,hWnd,9,dwFlags);
|
| 1141 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1050 | 1142 | this->hWnd = hWnd;
|
1051 | 1143 | winstyle = GetWindowLongPtrA(hWnd,GWL_STYLE);
|
1052 | 1144 | winstyleex = GetWindowLongPtrA(hWnd,GWL_EXSTYLE);
|
— | — | @@ -1070,7 +1162,7 @@ |
1071 | 1163 | fullscreen = true;
|
1072 | 1164 | else fullscreen = false;
|
1073 | 1165 | if(exclusive)
|
1074 | | - if(!fullscreen) ERR(DDERR_INVALIDPARAMS);
|
| 1166 | + if(!fullscreen) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
1075 | 1167 | if(dwFlags & DDSCL_FPUPRESERVE)
|
1076 | 1168 | fpupreserve = true;
|
1077 | 1169 | else fpupreserve = false;
|
— | — | @@ -1081,7 +1173,7 @@ |
1082 | 1174 | threadsafe = true;
|
1083 | 1175 | else threadsafe = false;
|
1084 | 1176 | if(dwFlags & DDSCL_NORMAL)
|
1085 | | - if(exclusive) ERR(DDERR_INVALIDPARAMS);
|
| 1177 | + if(exclusive) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
1086 | 1178 | if(dwFlags & DDSCL_NOWINDOWCHANGES)
|
1087 | 1179 | nowindowchanges = true;
|
1088 | 1180 | else nowindowchanges = false;
|
— | — | @@ -1113,6 +1205,7 @@ |
1114 | 1206 | bpp = devmode.dmBitsPerPel;
|
1115 | 1207 | primarybpp = bpp;
|
1116 | 1208 | InitGL(x,y,bpp,fullscreen,hWnd,this);
|
| 1209 | + TRACE_EXIT(23,DD_OK);
|
1117 | 1210 | return DD_OK;
|
1118 | 1211 | }
|
1119 | 1212 |
|
— | — | @@ -1181,7 +1274,8 @@ |
1182 | 1275 |
|
1183 | 1276 | HRESULT WINAPI glDirectDraw7::SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
|
1184 | 1277 | {
|
1185 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1278 | + TRACE_ENTER(6,14,this,8,dwWidth,8,dwHeight,8,dwBPP,8,dwRefreshRate,9,dwFlags);
|
| 1279 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1186 | 1280 | DEBUG("IDirectDraw::SetDisplayMode: implement multiple monitors\n");
|
1187 | 1281 | DEVMODE newmode,newmode2;
|
1188 | 1282 | DEVMODE currmode;
|
— | — | @@ -1223,25 +1317,26 @@ |
1224 | 1318 | else internalrefresh = primaryrefresh = screenrefresh = currmode.dmDisplayFrequency;
|
1225 | 1319 | InitGL(screenx,screeny,screenbpp,true,hWnd,this);
|
1226 | 1320 | primarylost = true;
|
| 1321 | + TRACE_EXIT(23,DD_OK);
|
1227 | 1322 | return DD_OK;
|
1228 | 1323 | case DISP_CHANGE_BADMODE:
|
1229 | | - ERR(DDERR_INVALIDMODE);
|
| 1324 | + TRACE_RET(23,DDERR_INVALIDMODE);
|
1230 | 1325 | case DISP_CHANGE_BADFLAGS:
|
1231 | | - ERR(DDERR_INVALIDPARAMS);
|
| 1326 | + TRACE_RET(23,DDERR_INVALIDPARAMS);
|
1232 | 1327 | case DISP_CHANGE_BADDUALVIEW:
|
1233 | | - ERR(DDERR_GENERIC);
|
| 1328 | + TRACE_RET(23,DDERR_GENERIC);
|
1234 | 1329 | case DISP_CHANGE_BADPARAM:
|
1235 | | - ERR(DDERR_INVALIDPARAMS);
|
| 1330 | + TRACE_RET(23,DDERR_INVALIDPARAMS);
|
1236 | 1331 | case DISP_CHANGE_FAILED:
|
1237 | | - ERR(DDERR_GENERIC);
|
| 1332 | + TRACE_RET(23,DDERR_GENERIC);
|
1238 | 1333 | case DISP_CHANGE_NOTUPDATED:
|
1239 | | - ERR(DDERR_GENERIC);
|
| 1334 | + TRACE_RET(23,DDERR_GENERIC);
|
1240 | 1335 | case DISP_CHANGE_RESTART:
|
1241 | | - ERR(DDERR_UNSUPPORTEDMODE);
|
| 1336 | + TRACE_RET(23,DDERR_UNSUPPORTEDMODE);
|
1242 | 1337 | default:
|
1243 | | - ERR(DDERR_GENERIC);
|
| 1338 | + TRACE_RET(23,DDERR_GENERIC);
|
1244 | 1339 | }
|
1245 | | - ERR(DDERR_GENERIC);
|
| 1340 | + TRACE_RET(23,DDERR_GENERIC);
|
1246 | 1341 | break;
|
1247 | 1342 | case 1: // Stretch to screen
|
1248 | 1343 | primaryx = dwWidth;
|
— | — | @@ -1253,6 +1348,7 @@ |
1254 | 1349 | primarybpp = dwBPP;
|
1255 | 1350 | InitGL(screenx,screeny,screenbpp,true,hWnd,this);
|
1256 | 1351 | primarylost = true;
|
| 1352 | + TRACE_EXIT(23,DD_OK);
|
1257 | 1353 | return DD_OK;
|
1258 | 1354 | break;
|
1259 | 1355 | case 2: // Scale to screen
|
— | — | @@ -1278,6 +1374,7 @@ |
1279 | 1375 | primarybpp = dwBPP;
|
1280 | 1376 | InitGL(screenx,screeny,screenbpp,true,hWnd,this);
|
1281 | 1377 | primarylost = true;
|
| 1378 | + TRACE_EXIT(23,DD_OK);
|
1282 | 1379 | return DD_OK;
|
1283 | 1380 | break;
|
1284 | 1381 | case 3: // Center image
|
— | — | @@ -1289,6 +1386,8 @@ |
1290 | 1387 | if(dxglcfg.colormode) internalbpp = screenbpp = dwBPP;
|
1291 | 1388 | else internalbpp = screenbpp = currmode.dmBitsPerPel;
|
1292 | 1389 | InitGL(screenx,screeny,screenbpp,true,hWnd,this);
|
| 1390 | + TRACE_EXIT(23,DD_OK);
|
| 1391 | + return DD_OK;
|
1293 | 1392 | break;
|
1294 | 1393 | case 4: // Switch then stretch
|
1295 | 1394 | case 5: // Switch then scale
|
— | — | @@ -1324,6 +1423,7 @@ |
1325 | 1424 | primarybpp = dwBPP;
|
1326 | 1425 | InitGL(screenx,screeny,screenbpp,true,hWnd,this);
|
1327 | 1426 | primarylost = true;
|
| 1427 | + TRACE_EXIT(23,DD_OK);
|
1328 | 1428 | return DD_OK;
|
1329 | 1429 | break;
|
1330 | 1430 | case 5:
|
— | — | @@ -1349,6 +1449,7 @@ |
1350 | 1450 | primarybpp = dwBPP;
|
1351 | 1451 | InitGL(screenx,screeny,screenbpp,true,hWnd,this);
|
1352 | 1452 | primarylost = true;
|
| 1453 | + TRACE_EXIT(23,DD_OK);
|
1353 | 1454 | return DD_OK;
|
1354 | 1455 | break;
|
1355 | 1456 | case 6:
|
— | — | @@ -1362,29 +1463,38 @@ |
1363 | 1464 | else internalbpp = screenbpp = newmode2.dmBitsPerPel;
|
1364 | 1465 | InitGL(screenx,screeny,screenbpp,true,hWnd,this);
|
1365 | 1466 | primarylost = true;
|
| 1467 | + TRACE_EXIT(23,DD_OK);
|
1366 | 1468 | return DD_OK;
|
1367 | 1469 | break;
|
1368 | 1470 | }
|
1369 | 1471 | break;
|
1370 | 1472 | }
|
| 1473 | + TRACE_EXIT(23,DDERR_GENERIC);
|
1371 | 1474 | ERR(DDERR_GENERIC);
|
1372 | 1475 | }
|
1373 | 1476 | HRESULT WINAPI glDirectDraw7::WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent)
|
1374 | 1477 | {
|
1375 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1376 | | - if(dwFlags & DDWAITVB_BLOCKBEGINEVENT) return DDERR_UNSUPPORTED;
|
| 1478 | + TRACE_ENTER(3,14,this,9,dwFlags,14,hEvent);
|
| 1479 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1480 | + if(dwFlags & DDWAITVB_BLOCKBEGINEVENT)
|
| 1481 | + TRACE_RET(23,DDERR_UNSUPPORTED);
|
1377 | 1482 | swapinterval=1;
|
1378 | 1483 | primary->RenderScreen(primary->texture,primary);
|
1379 | 1484 | swapinterval=0;
|
| 1485 | + TRACE_EXIT(23,DD_OK);
|
1380 | 1486 | return DD_OK;
|
1381 | 1487 | }
|
1382 | 1488 | HRESULT WINAPI glDirectDraw7::GetAvailableVidMem(LPDDSCAPS2 lpDDSCaps2, LPDWORD lpdwTotal, LPDWORD lpdwFree)
|
1383 | 1489 | {
|
1384 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1490 | + TRACE_ENTER(4,14,this,14,lpDDSCaps2,14,lpdwTotal,14,lpdwFree);
|
| 1491 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1385 | 1492 | if(GLEXT_NVX_gpu_memory_info)
|
1386 | 1493 | {
|
1387 | 1494 | if(lpdwTotal) glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX,(GLint*)lpdwTotal);
|
1388 | 1495 | if(lpdwFree) glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX,(GLint*)lpdwFree);
|
| 1496 | + TRACE_VAR("*lpdwTotal",8,*lpdwTotal);
|
| 1497 | + TRACE_VAR("*lpdwFree",8,*lpdwFree);
|
| 1498 | + TRACE_EXIT(23,DD_OK);
|
1389 | 1499 | return DD_OK;
|
1390 | 1500 | }
|
1391 | 1501 | else
|
— | — | @@ -1393,46 +1503,59 @@ |
1394 | 1504 | GlobalMemoryStatus(&memstat);
|
1395 | 1505 | if(lpdwTotal) *lpdwTotal = memstat.dwTotalVirtual;
|
1396 | 1506 | if(lpdwFree) *lpdwFree = memstat.dwAvailVirtual;
|
| 1507 | + TRACE_VAR("*lpdwTotal",8,*lpdwTotal);
|
| 1508 | + TRACE_VAR("*lpdwFree",8,*lpdwFree);
|
| 1509 | + TRACE_EXIT(23,DD_OK);
|
1397 | 1510 | return DD_OK;
|
1398 | 1511 | }
|
1399 | 1512 | }
|
1400 | 1513 | HRESULT WINAPI glDirectDraw7::GetSurfaceFromDC(HDC hdc, LPDIRECTDRAWSURFACE7 *lpDDS)
|
1401 | 1514 | {
|
1402 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1515 | + TRACE_ENTER(3,14,this,13,hdc,14,lpDDS);
|
| 1516 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1403 | 1517 | FIXME("IDirectDraw::GetSurfaceFromDC: stub\n");
|
| 1518 | + TRACE_EXIT(23,DDERR_GENERIC);
|
1404 | 1519 | ERR(DDERR_GENERIC);
|
1405 | 1520 | }
|
1406 | 1521 | HRESULT WINAPI glDirectDraw7::RestoreAllSurfaces()
|
1407 | 1522 | {
|
1408 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1523 | + TRACE_ENTER(1,14,this);
|
| 1524 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1409 | 1525 | FIXME("IDirectDraw::RestoreAllSurfaces: stub\n");
|
| 1526 | + TRACE_EXIT(23,DDERR_GENERIC);
|
1410 | 1527 | ERR(DDERR_GENERIC);
|
1411 | 1528 | }
|
1412 | 1529 | HRESULT WINAPI glDirectDraw7::TestCooperativeLevel()
|
1413 | 1530 | {
|
| 1531 | + TRACE_ENTER(1,14,this);
|
| 1532 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1533 | + TRACE_EXIT(23,DD_OK);
|
1414 | 1534 | return DD_OK;
|
1415 | | - /*if(!this) return DDERR_INVALIDOBJECT;
|
1416 | | - if(fullscreen) return DDERR_EXCLUSIVEMODEALREADYSET;
|
1417 | | - return DDERR_NOEXCLUSIVEMODE;*/
|
1418 | 1535 | }
|
1419 | 1536 | HRESULT WINAPI glDirectDraw7::GetDeviceIdentifier(LPDDDEVICEIDENTIFIER2 lpdddi, DWORD dwFlags)
|
1420 | 1537 | {
|
1421 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1422 | | - if(!lpdddi) return DDERR_INVALIDPARAMS;
|
| 1538 | + TRACE_ENTER(3,14,this,14,lpdddi,9,dwFlags);
|
| 1539 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1540 | + if(!lpdddi) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
1423 | 1541 | devid.guidDeviceIdentifier = device_template;
|
1424 | 1542 | memcpy(lpdddi,&devid,sizeof(DDDEVICEIDENTIFIER2));
|
| 1543 | + TRACE_EXIT(23,DD_OK);
|
1425 | 1544 | return DD_OK;
|
1426 | 1545 | }
|
1427 | 1546 | HRESULT WINAPI glDirectDraw7::StartModeTest(LPSIZE lpModesToTest, DWORD dwNumEntries, DWORD dwFlags)
|
1428 | 1547 | {
|
1429 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1548 | + TRACE_ENTER(4,14,this,25,lpModesToTest,8,dwNumEntries,9,dwFlags);
|
| 1549 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1430 | 1550 | FIXME("IDirectDraw::StartModeTest: stub\n");
|
| 1551 | + TRACE_EXIT(23,DDERR_GENERIC);
|
1431 | 1552 | ERR(DDERR_GENERIC);
|
1432 | 1553 | }
|
1433 | 1554 | HRESULT WINAPI glDirectDraw7::EvaluateMode(DWORD dwFlags, DWORD *pSecondsUntilTimeout)
|
1434 | 1555 | {
|
1435 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1556 | + TRACE_ENTER(3,14,this,9,dwFlags,14,pSecondsUntilTimeout);
|
| 1557 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1436 | 1558 | FIXME("IDirectDraw::EvaluateMode: stub\n");
|
| 1559 | + TRACE_EXIT(23,DDERR_GENERIC);
|
1437 | 1560 | ERR(DDERR_GENERIC);
|
1438 | 1561 | }
|
1439 | 1562 |
|
— | — | @@ -1448,72 +1571,93 @@ |
1449 | 1572 |
|
1450 | 1573 | void glDirectDraw7::DeleteSurface(glDirectDrawSurface7 *surface)
|
1451 | 1574 | {
|
| 1575 | + TRACE_ENTER(2,14,this,14,surface);
|
1452 | 1576 | for(int i = 0; i < surfacecount; i++)
|
1453 | 1577 | if(surfaces[i] == surface) surfaces[i] = NULL;
|
1454 | 1578 | if(surface == primary) primary = NULL;
|
| 1579 | + TRACE_EXIT(0,0);
|
1455 | 1580 | }
|
1456 | 1581 |
|
1457 | 1582 | void glDirectDraw7::DeleteClipper(glDirectDrawClipper *clipper)
|
1458 | 1583 | {
|
| 1584 | + TRACE_ENTER(2,14,this,clipper);
|
1459 | 1585 | for(int i = 0; i < clippercount; i++)
|
1460 | 1586 | if(clippers[i] == clipper) clippers[i] = NULL;
|
| 1587 | + TRACE_EXIT(0,0);
|
1461 | 1588 | }
|
1462 | 1589 |
|
1463 | 1590 | // DDRAW1 wrapper
|
1464 | 1591 | glDirectDraw1::glDirectDraw1(glDirectDraw7 *gl_DD7)
|
1465 | 1592 | {
|
| 1593 | + TRACE_ENTER(2,14,this,14,gl_DD7);
|
1466 | 1594 | glDD7 = gl_DD7;
|
1467 | 1595 | refcount = 1;
|
| 1596 | + TRACE_EXIT(-1,0);
|
1468 | 1597 | }
|
1469 | 1598 | glDirectDraw1::~glDirectDraw1()
|
1470 | 1599 | {
|
| 1600 | + TRACE_ENTER(1,14,this);
|
1471 | 1601 | glDD7->glDD1 = NULL;
|
1472 | 1602 | glDD7->Release();
|
| 1603 | + TRACE_EXIT(-1,0);
|
1473 | 1604 | }
|
1474 | 1605 | HRESULT WINAPI glDirectDraw1::QueryInterface(REFIID riid, void** ppvObj)
|
1475 | 1606 | {
|
1476 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1607 | + TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
|
| 1608 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1477 | 1609 | if(riid == IID_IUnknown)
|
1478 | 1610 | {
|
1479 | 1611 | this->AddRef();
|
1480 | 1612 | *ppvObj = this;
|
| 1613 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
1481 | 1614 | return DD_OK;
|
1482 | 1615 | }
|
1483 | | - return glDD7->QueryInterface(riid,ppvObj);
|
| 1616 | + HRESULT ret = glDD7->QueryInterface(riid,ppvObj);
|
| 1617 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 1618 | + TRACE_EXIT(23,ret);
|
| 1619 | + return ret;
|
1484 | 1620 | }
|
1485 | 1621 | ULONG WINAPI glDirectDraw1::AddRef()
|
1486 | 1622 | {
|
1487 | | - if(!this) return 0;
|
| 1623 | + TRACE_ENTER(1,14,this);
|
| 1624 | + if(!this) TRACE_RET(8,0);
|
1488 | 1625 | refcount++;
|
| 1626 | + TRACE_EXIT(8,refcount);
|
1489 | 1627 | return refcount;
|
1490 | 1628 | }
|
1491 | 1629 | ULONG WINAPI glDirectDraw1::Release()
|
1492 | 1630 | {
|
1493 | | - if(!this) return 0;
|
| 1631 | + TRACE_ENTER(1,14,this);
|
| 1632 | + if(!this) TRACE_RET(8,0);
|
1494 | 1633 | ULONG ret;
|
1495 | 1634 | refcount--;
|
1496 | 1635 | ret = refcount;
|
1497 | 1636 | if(refcount == 0) delete this;
|
| 1637 | + TRACE_EXIT(8,ret);
|
1498 | 1638 | return ret;
|
1499 | 1639 | }
|
1500 | 1640 | HRESULT WINAPI glDirectDraw1::Compact()
|
1501 | 1641 | {
|
1502 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1503 | | - return glDD7->Compact();
|
| 1642 | + TRACE_ENTER(1,14,this);
|
| 1643 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1644 | + TRACE_RET(23,glDD7->Compact());
|
1504 | 1645 | }
|
1505 | 1646 | HRESULT WINAPI glDirectDraw1::CreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter)
|
1506 | 1647 | {
|
1507 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1508 | | - return glDD7->CreateClipper(dwFlags,lplpDDClipper,pUnkOuter);
|
| 1648 | + TRACE_ENTER(4,14,this,9,dwFlags,14,lplpDDClipper,14,pUnkOuter);
|
| 1649 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1650 | + TRACE_RET(23,glDD7->CreateClipper(dwFlags,lplpDDClipper,pUnkOuter));
|
1509 | 1651 | }
|
1510 | 1652 | HRESULT WINAPI glDirectDraw1::CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR *lplpDDPalette, IUnknown FAR *pUnkOuter)
|
1511 | 1653 | {
|
1512 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1513 | | - return glDD7->CreatePalette(dwFlags,lpDDColorArray,lplpDDPalette,pUnkOuter);
|
| 1654 | + TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDColorArray,14,lplpDDPalette,14,pUnkOuter);
|
| 1655 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1656 | + TRACE_RET(23,glDD7->CreatePalette(dwFlags,lpDDColorArray,lplpDDPalette,pUnkOuter));
|
1514 | 1657 | }
|
1515 | 1658 | HRESULT WINAPI glDirectDraw1::CreateSurface(LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE FAR *lplpDDSurface, IUnknown FAR *pUnkOuter)
|
1516 | 1659 | {
|
1517 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1660 | + TRACE_ENTER(4,14,this,14,lpDDSurfaceDesc,14,lplpDDSurface,14,pUnkOuter);
|
| 1661 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1518 | 1662 | LPDIRECTDRAWSURFACE7 lpDDS7;
|
1519 | 1663 | HRESULT err = glDD7->CreateSurface((LPDDSURFACEDESC2)lpDDSurfaceDesc,&lpDDS7,pUnkOuter);
|
1520 | 1664 | if(err == DD_OK)
|
— | — | @@ -1520,149 +1664,186 @@ |
1521 | 1665 | {
|
1522 | 1666 | lpDDS7->QueryInterface(IID_IDirectDrawSurface,(LPVOID*) lplpDDSurface);
|
1523 | 1667 | lpDDS7->Release();
|
| 1668 | + TRACE_VAR("*lplpDDSurface",14,lplpDDSurface);
|
| 1669 | + TRACE_EXIT(23,DD_OK);
|
1524 | 1670 | return DD_OK;
|
1525 | 1671 | }
|
| 1672 | + TRACE_EXIT(23,err);
|
1526 | 1673 | return err;
|
1527 | 1674 | }
|
1528 | 1675 | HRESULT WINAPI glDirectDraw1::DuplicateSurface(LPDIRECTDRAWSURFACE lpDDSurface, LPDIRECTDRAWSURFACE FAR *lplpDupDDSurface)
|
1529 | 1676 | {
|
1530 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1677 | + TRACE_ENTER(3,14,this,14,lpDDSurface,14,lplpDupDDSurface);
|
| 1678 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1531 | 1679 | FIXME("glDirectDraw1::DuplicateSurface: stub\n");
|
| 1680 | + TRACE_EXIT(23,DDERR_GENERIC);
|
1532 | 1681 | ERR(DDERR_GENERIC);
|
1533 | 1682 | }
|
1534 | 1683 | HRESULT WINAPI glDirectDraw1::EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback)
|
1535 | 1684 | {
|
1536 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1537 | | - return ::EnumDisplayModes(dwFlags,lpDDSurfaceDesc,lpContext,lpEnumModesCallback);
|
| 1685 | + TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSurfaceDesc,14,lpContext,14,lpEnumModesCallback);
|
| 1686 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1687 | + TRACE_RET(23,::EnumDisplayModes(dwFlags,lpDDSurfaceDesc,lpContext,lpEnumModesCallback));
|
1538 | 1688 | }
|
1539 | 1689 | HRESULT WINAPI glDirectDraw1::EnumSurfaces(DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
|
1540 | 1690 | {
|
1541 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1691 | + TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSD,14,lpContext,14,lpEnumSurfacesCallback);
|
| 1692 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1542 | 1693 | FIXME("glDirectDraw1::EnumSurfaces: stub\n");
|
| 1694 | + TRACE_EXIT(23,DDERR_GENERIC);
|
1543 | 1695 | ERR(DDERR_GENERIC);
|
1544 | 1696 | }
|
1545 | 1697 | HRESULT WINAPI glDirectDraw1::FlipToGDISurface()
|
1546 | 1698 | {
|
1547 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1548 | | - return glDD7->FlipToGDISurface();
|
| 1699 | + TRACE_ENTER(1,14,this);
|
| 1700 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1701 | + TRACE_RET(23,glDD7->FlipToGDISurface());
|
1549 | 1702 | }
|
1550 | 1703 | HRESULT WINAPI glDirectDraw1::GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps)
|
1551 | 1704 | {
|
1552 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1553 | | - return glDD7->GetCaps(lpDDDriverCaps,lpDDHELCaps);
|
| 1705 | + TRACE_ENTER(3,14,this,14,lpDDDriverCaps,14,lpDDHELCaps);
|
| 1706 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1707 | + TRACE_RET(23,glDD7->GetCaps(lpDDDriverCaps,lpDDHELCaps));
|
1554 | 1708 | }
|
1555 | 1709 | HRESULT WINAPI glDirectDraw1::GetDisplayMode(LPDDSURFACEDESC lpDDSurfaceDesc)
|
1556 | 1710 | {
|
1557 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1558 | | - return glDD7->GetDisplayMode((LPDDSURFACEDESC2)lpDDSurfaceDesc);
|
| 1711 | + TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc);
|
| 1712 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1713 | + TRACE_RET(23,glDD7->GetDisplayMode((LPDDSURFACEDESC2)lpDDSurfaceDesc));
|
1559 | 1714 | }
|
1560 | 1715 | HRESULT WINAPI glDirectDraw1::GetFourCCCodes(LPDWORD lpNumCodes, LPDWORD lpCodes)
|
1561 | 1716 | {
|
1562 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1563 | | - return glDD7->GetFourCCCodes(lpNumCodes,lpCodes);
|
| 1717 | + TRACE_ENTER(3,14,this,14,lpNumCodes,14,lpCodes);
|
| 1718 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1719 | + TRACE_RET(23,glDD7->GetFourCCCodes(lpNumCodes,lpCodes));
|
1564 | 1720 | }
|
1565 | 1721 | HRESULT WINAPI glDirectDraw1::GetGDISurface(LPDIRECTDRAWSURFACE FAR *lplpGDIDDSurface)
|
1566 | 1722 | {
|
1567 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1723 | + TRACE_ENTER(2,14,this,14,lplpGDIDDSurface);
|
| 1724 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1568 | 1725 | FIXME("glDirectDraw1::GetGDISurface: stub\n");
|
| 1726 | + TRACE_EXIT(23,DDERR_GENERIC);
|
1569 | 1727 | ERR(DDERR_GENERIC);
|
1570 | 1728 | }
|
1571 | 1729 | HRESULT WINAPI glDirectDraw1::GetMonitorFrequency(LPDWORD lpdwFrequency)
|
1572 | 1730 | {
|
1573 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1574 | | - return glDD7->GetMonitorFrequency(lpdwFrequency);
|
| 1731 | + TRACE_ENTER(2,14,this,14,lpdwFrequency);
|
| 1732 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1733 | + TRACE_RET(23,glDD7->GetMonitorFrequency(lpdwFrequency));
|
1575 | 1734 | }
|
1576 | 1735 | HRESULT WINAPI glDirectDraw1::GetScanLine(LPDWORD lpdwScanLine)
|
1577 | 1736 | {
|
1578 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1579 | | - return glDD7->GetScanLine(lpdwScanLine);
|
| 1737 | + TRACE_ENTER(2,14,this,14,lpdwScanLine);
|
| 1738 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1739 | + TRACE_RET(23,glDD7->GetScanLine(lpdwScanLine));
|
1580 | 1740 | }
|
1581 | 1741 | HRESULT WINAPI glDirectDraw1::GetVerticalBlankStatus(LPBOOL lpbIsInVB)
|
1582 | 1742 | {
|
1583 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1584 | | - return glDD7->GetVerticalBlankStatus(lpbIsInVB);
|
| 1743 | + TRACE_ENTER(2,14,this,14,lpbIsInVB);
|
| 1744 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1745 | + TRACE_RET(23,glDD7->GetVerticalBlankStatus(lpbIsInVB));
|
1585 | 1746 | }
|
1586 | 1747 | HRESULT WINAPI glDirectDraw1::Initialize(GUID FAR *lpGUID)
|
1587 | 1748 | {
|
1588 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1589 | | - return glDD7->Initialize(lpGUID);
|
| 1749 | + TRACE_ENTER(2,14,this,24,lpGUID);
|
| 1750 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1751 | + TRACE_RET(23,glDD7->Initialize(lpGUID));
|
1590 | 1752 | }
|
1591 | 1753 | HRESULT WINAPI glDirectDraw1::RestoreDisplayMode()
|
1592 | 1754 | {
|
1593 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1594 | | - return glDD7->RestoreDisplayMode();
|
| 1755 | + TRACE_ENTER(1,14,this);
|
| 1756 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1757 | + TRACE_RET(23,glDD7->RestoreDisplayMode());
|
1595 | 1758 | }
|
1596 | 1759 | HRESULT WINAPI glDirectDraw1::SetCooperativeLevel(HWND hWnd, DWORD dwFlags)
|
1597 | 1760 | {
|
1598 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1599 | | - return glDD7->SetCooperativeLevel(hWnd,dwFlags);
|
| 1761 | + TRACE_ENTER(3,14,this,13,hWnd,9,dwFlags);
|
| 1762 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1763 | + TRACE_RET(23,glDD7->SetCooperativeLevel(hWnd,dwFlags));
|
1600 | 1764 | }
|
1601 | 1765 | HRESULT WINAPI glDirectDraw1::SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP)
|
1602 | 1766 | {
|
1603 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1604 | | - return glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,0,0);
|
| 1767 | + TRACE_ENTER(4,14,this,8,dwWidth,8,dwHeight,8,dwBPP);
|
| 1768 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1769 | + TRACE_RET(23,glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,0,0));
|
1605 | 1770 | }
|
1606 | 1771 | HRESULT WINAPI glDirectDraw1::WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent)
|
1607 | 1772 | {
|
1608 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1609 | | - return glDD7->WaitForVerticalBlank(dwFlags,hEvent);
|
| 1773 | + TRACE_ENTER(3,14,this,9,dwFlags,14,hEvent);
|
| 1774 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1775 | + TRACE_RET(23,glDD7->WaitForVerticalBlank(dwFlags,hEvent));
|
1610 | 1776 | }
|
1611 | 1777 | // DDRAW2 wrapper
|
1612 | 1778 | glDirectDraw2::glDirectDraw2(glDirectDraw7 *gl_DD7)
|
1613 | 1779 | {
|
| 1780 | + TRACE_ENTER(2,14,this,14,gl_DD7);
|
1614 | 1781 | glDD7 = gl_DD7;
|
1615 | 1782 | refcount = 1;
|
| 1783 | + TRACE_EXIT(-1,0);
|
1616 | 1784 | }
|
1617 | 1785 | glDirectDraw2::~glDirectDraw2()
|
1618 | 1786 | {
|
| 1787 | + TRACE_ENTER(1,14,this);
|
1619 | 1788 | glDD7->glDD2 = NULL;
|
1620 | 1789 | glDD7->Release();
|
| 1790 | + TRACE_EXIT(-1,0);
|
1621 | 1791 | }
|
1622 | 1792 | HRESULT WINAPI glDirectDraw2::QueryInterface(REFIID riid, void** ppvObj)
|
1623 | 1793 | {
|
1624 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1794 | + TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
|
| 1795 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1625 | 1796 | if(riid == IID_IUnknown)
|
1626 | 1797 | {
|
1627 | 1798 | this->AddRef();
|
1628 | 1799 | *ppvObj = this;
|
| 1800 | + TRACE_VAR("*ppvObject",14,*ppvObj);
|
| 1801 | + TRACE_EXIT(23,DD_OK);
|
1629 | 1802 | return DD_OK;
|
1630 | 1803 | }
|
1631 | | - return glDD7->QueryInterface(riid,ppvObj);
|
| 1804 | + TRACE_RET(23,glDD7->QueryInterface(riid,ppvObj));
|
1632 | 1805 | }
|
1633 | 1806 | ULONG WINAPI glDirectDraw2::AddRef()
|
1634 | 1807 | {
|
1635 | | - if(!this) return 0;
|
| 1808 | + TRACE_ENTER(1,14,this);
|
| 1809 | + if(!this) TRACE_RET(8,0);
|
1636 | 1810 | refcount++;
|
| 1811 | + TRACE_EXIT(8,refcount);
|
1637 | 1812 | return refcount;
|
1638 | 1813 | }
|
1639 | 1814 | ULONG WINAPI glDirectDraw2::Release()
|
1640 | 1815 | {
|
1641 | | - if(!this) return 0;
|
| 1816 | + TRACE_ENTER(1,14,this);
|
| 1817 | + if(!this) TRACE_RET(8,0);
|
1642 | 1818 | ULONG ret;
|
1643 | 1819 | refcount--;
|
1644 | 1820 | ret = refcount;
|
1645 | 1821 | if(refcount == 0) delete this;
|
| 1822 | + TRACE_EXIT(8,ret);
|
1646 | 1823 | return ret;
|
1647 | 1824 | }
|
1648 | 1825 | HRESULT WINAPI glDirectDraw2::Compact()
|
1649 | 1826 | {
|
1650 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1651 | | - return glDD7->Compact();
|
| 1827 | + TRACE_ENTER(1,14,this);
|
| 1828 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1829 | + TRACE_RET(23,glDD7->Compact());
|
1652 | 1830 | }
|
1653 | 1831 | HRESULT WINAPI glDirectDraw2::CreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter)
|
1654 | 1832 | {
|
1655 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1656 | | - return glDD7->CreateClipper(dwFlags,lplpDDClipper,pUnkOuter);
|
| 1833 | + TRACE_ENTER(4,14,this,9,dwFlags,14,lplpDDClipper,14,pUnkOuter);
|
| 1834 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1835 | + TRACE_RET(23,glDD7->CreateClipper(dwFlags,lplpDDClipper,pUnkOuter));
|
1657 | 1836 | }
|
1658 | 1837 | HRESULT WINAPI glDirectDraw2::CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR *lplpDDPalette, IUnknown FAR *pUnkOuter)
|
1659 | 1838 | {
|
1660 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1661 | | - return glDD7->CreatePalette(dwFlags,lpDDColorArray,lplpDDPalette,pUnkOuter);
|
| 1839 | + TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDColorArray,14,lplpDDPalette,14,pUnkOuter);
|
| 1840 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1841 | + TRACE_RET(23,glDD7->CreatePalette(dwFlags,lpDDColorArray,lplpDDPalette,pUnkOuter));
|
1662 | 1842 | }
|
1663 | 1843 | HRESULT WINAPI glDirectDraw2::CreateSurface(LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE FAR *lplpDDSurface, IUnknown FAR *pUnkOuter)
|
1664 | 1844 | {
|
1665 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1666 | | - if(!lplpDDSurface) return DDERR_INVALIDPARAMS;
|
| 1845 | + TRACE_ENTER(4,14,this,14,lpDDSurfaceDesc,14,lplpDDSurface,14,pUnkOuter);
|
| 1846 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1847 | + if(!lplpDDSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
1667 | 1848 | LPDIRECTDRAWSURFACE7 lpDDS7;
|
1668 | 1849 | HRESULT err = glDD7->CreateSurface((LPDDSURFACEDESC2)lpDDSurfaceDesc,&lpDDS7,pUnkOuter);
|
1669 | 1850 | if(err == DD_OK)
|
— | — | @@ -1669,158 +1850,209 @@ |
1670 | 1851 | {
|
1671 | 1852 | lpDDS7->QueryInterface(IID_IDirectDrawSurface,(LPVOID*) lplpDDSurface);
|
1672 | 1853 | lpDDS7->Release();
|
| 1854 | + TRACE_EXIT(23,DD_OK);
|
1673 | 1855 | return DD_OK;
|
1674 | 1856 | }
|
| 1857 | + TRACE_EXIT(23,err);
|
1675 | 1858 | return err;
|
1676 | 1859 | }
|
1677 | 1860 | HRESULT WINAPI glDirectDraw2::DuplicateSurface(LPDIRECTDRAWSURFACE lpDDSurface, LPDIRECTDRAWSURFACE FAR *lplpDupDDSurface)
|
1678 | 1861 | {
|
1679 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1862 | + TRACE_ENTER(3,14,this,14,lpDDSurface,14,lplpDupDDSurface);
|
| 1863 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1680 | 1864 | FIXME("glDirectDraw2::DuplicateSurface: stub\n");
|
| 1865 | + TRACE_EXIT(23,DDERR_GENERIC);
|
1681 | 1866 | ERR(DDERR_GENERIC);
|
1682 | 1867 | }
|
1683 | 1868 | HRESULT WINAPI glDirectDraw2::EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback)
|
1684 | 1869 | {
|
1685 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1686 | | - return ::EnumDisplayModes(dwFlags,lpDDSurfaceDesc,lpContext,lpEnumModesCallback);
|
| 1870 | + TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSurfaceDesc,14,lpContext,14,lpEnumModesCallback);
|
| 1871 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1872 | + TRACE_RET(23,::EnumDisplayModes(dwFlags,lpDDSurfaceDesc,lpContext,lpEnumModesCallback));
|
1687 | 1873 | }
|
1688 | 1874 | HRESULT WINAPI glDirectDraw2::EnumSurfaces(DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
|
1689 | 1875 | {
|
1690 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1876 | + TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSD,14,lpContext,14,lpEnumSurfacesCallback);
|
| 1877 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1691 | 1878 | FIXME("glDirectDraw2::EnumSurfaces: stub\n");
|
| 1879 | + TRACE_EXIT(23,DDERR_GENERIC);
|
1692 | 1880 | ERR(DDERR_GENERIC);
|
1693 | 1881 | }
|
1694 | 1882 | HRESULT WINAPI glDirectDraw2::FlipToGDISurface()
|
1695 | 1883 | {
|
1696 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1697 | | - return glDD7->FlipToGDISurface();
|
| 1884 | + TRACE_ENTER(1,14,this);
|
| 1885 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1886 | + TRACE_RET(23,glDD7->FlipToGDISurface());
|
1698 | 1887 | }
|
1699 | 1888 | HRESULT WINAPI glDirectDraw2::GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps)
|
1700 | 1889 | {
|
1701 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1702 | | - return glDD7->GetCaps(lpDDDriverCaps,lpDDHELCaps);
|
| 1890 | + TRACE_ENTER(3,14,this,14,lpDDDriverCaps,14,lpDDHELCaps);
|
| 1891 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1892 | + TRACE_RET(23,glDD7->GetCaps(lpDDDriverCaps,lpDDHELCaps));
|
1703 | 1893 | }
|
1704 | 1894 | HRESULT WINAPI glDirectDraw2::GetDisplayMode(LPDDSURFACEDESC lpDDSurfaceDesc)
|
1705 | 1895 | {
|
1706 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1707 | | - return glDD7->GetDisplayMode((LPDDSURFACEDESC2)lpDDSurfaceDesc);
|
| 1896 | + TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc);
|
| 1897 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1898 | + TRACE_RET(23,glDD7->GetDisplayMode((LPDDSURFACEDESC2)lpDDSurfaceDesc));
|
1708 | 1899 | }
|
1709 | 1900 | HRESULT WINAPI glDirectDraw2::GetFourCCCodes(LPDWORD lpNumCodes, LPDWORD lpCodes)
|
1710 | 1901 | {
|
1711 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1712 | | - return glDD7->GetFourCCCodes(lpNumCodes,lpCodes);
|
| 1902 | + TRACE_ENTER(3,14,this,14,lpNumCodes,14,lpCodes);
|
| 1903 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1904 | + TRACE_RET(23,glDD7->GetFourCCCodes(lpNumCodes,lpCodes));
|
1713 | 1905 | }
|
1714 | 1906 | HRESULT WINAPI glDirectDraw2::GetGDISurface(LPDIRECTDRAWSURFACE FAR *lplpGDIDDSurface)
|
1715 | 1907 | {
|
1716 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1908 | + TRACE_ENTER(2,14,this,14,lplpGDIDDSurface);
|
| 1909 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1717 | 1910 | FIXME("glDirectDraw2::GetGDISurface: stub\n");
|
| 1911 | + TRACE_EXIT(23,DDERR_GENERIC);
|
1718 | 1912 | ERR(DDERR_GENERIC);
|
1719 | 1913 | }
|
1720 | 1914 | HRESULT WINAPI glDirectDraw2::GetMonitorFrequency(LPDWORD lpdwFrequency)
|
1721 | 1915 | {
|
1722 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1723 | | - return glDD7->GetMonitorFrequency(lpdwFrequency);
|
| 1916 | + TRACE_ENTER(2,14,this,14,lpdwFrequency);
|
| 1917 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1918 | + TRACE_RET(23,glDD7->GetMonitorFrequency(lpdwFrequency));
|
1724 | 1919 | }
|
1725 | 1920 | HRESULT WINAPI glDirectDraw2::GetScanLine(LPDWORD lpdwScanLine)
|
1726 | 1921 | {
|
1727 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1728 | | - return glDD7->GetScanLine(lpdwScanLine);
|
| 1922 | + TRACE_ENTER(2,14,this,14,lpdwScanLine);
|
| 1923 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1924 | + TRACE_RET(23,glDD7->GetScanLine(lpdwScanLine));
|
1729 | 1925 | }
|
1730 | 1926 | HRESULT WINAPI glDirectDraw2::GetVerticalBlankStatus(LPBOOL lpbIsInVB)
|
1731 | 1927 | {
|
1732 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1733 | | - return glDD7->GetVerticalBlankStatus(lpbIsInVB);
|
| 1928 | + TRACE_ENTER(2,14,this,14,lpbIsInVB);
|
| 1929 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1930 | + TRACE_RET(23,glDD7->GetVerticalBlankStatus(lpbIsInVB));
|
1734 | 1931 | }
|
1735 | 1932 | HRESULT WINAPI glDirectDraw2::Initialize(GUID FAR *lpGUID)
|
1736 | 1933 | {
|
1737 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1738 | | - return glDD7->Initialize(lpGUID);
|
| 1934 | + TRACE_ENTER(2,14,this,24,lpGUID);
|
| 1935 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1936 | + TRACE_RET(23,glDD7->Initialize(lpGUID));
|
1739 | 1937 | }
|
1740 | 1938 | HRESULT WINAPI glDirectDraw2::RestoreDisplayMode()
|
1741 | 1939 | {
|
1742 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1743 | | - return glDD7->RestoreDisplayMode();
|
| 1940 | + TRACE_ENTER(1,14,this);
|
| 1941 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1942 | + TRACE_RET(23,glDD7->RestoreDisplayMode());
|
1744 | 1943 | }
|
1745 | 1944 | HRESULT WINAPI glDirectDraw2::SetCooperativeLevel(HWND hWnd, DWORD dwFlags)
|
1746 | 1945 | {
|
1747 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1748 | | - return glDD7->SetCooperativeLevel(hWnd,dwFlags);
|
| 1946 | + TRACE_ENTER(3,14,this,13,hWnd,9,dwFlags);
|
| 1947 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1948 | + TRACE_RET(23,glDD7->SetCooperativeLevel(hWnd,dwFlags));
|
1749 | 1949 | }
|
1750 | 1950 | HRESULT WINAPI glDirectDraw2::SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
|
1751 | 1951 | {
|
1752 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1753 | | - return glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,dwRefreshRate,dwFlags);
|
| 1952 | + TRACE_ENTER(6,14,this,8,dwWidth,8,dwHeight,8,dwBPP,8,dwRefreshRate,9,dwFlags);
|
| 1953 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1954 | + TRACE_RET(23,glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,dwRefreshRate,dwFlags));
|
1754 | 1955 | }
|
1755 | 1956 | HRESULT WINAPI glDirectDraw2::WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent)
|
1756 | 1957 | {
|
1757 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1758 | | - return glDD7->WaitForVerticalBlank(dwFlags,hEvent);
|
| 1958 | + TRACE_ENTER(3,14,this,9,dwFlags,14,hEvent);
|
| 1959 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1960 | + TRACE_RET(23,glDD7->WaitForVerticalBlank(dwFlags,hEvent));
|
1759 | 1961 | }
|
1760 | 1962 | HRESULT WINAPI glDirectDraw2::GetAvailableVidMem(LPDDSCAPS lpDDSCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree)
|
1761 | 1963 | {
|
1762 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1763 | | - MEMORYSTATUS memstatus;
|
1764 | | - memstatus.dwLength = sizeof(MEMORYSTATUS);
|
1765 | | - GlobalMemoryStatus(&memstatus);
|
1766 | | - if(lpdwTotal) *lpdwTotal = memstatus.dwTotalVirtual;
|
1767 | | - if(lpdwFree) *lpdwFree = memstatus.dwAvailVirtual;
|
1768 | | - return DD_OK;
|
| 1964 | + TRACE_ENTER(4,14,this,14,lpDDSCaps,14,lpdwTotal,14,lpdwFree);
|
| 1965 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 1966 | + if(GLEXT_NVX_gpu_memory_info)
|
| 1967 | + {
|
| 1968 | + if(lpdwTotal) glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX,(GLint*)lpdwTotal);
|
| 1969 | + if(lpdwFree) glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX,(GLint*)lpdwFree);
|
| 1970 | + TRACE_VAR("*lpdwTotal",8,*lpdwTotal);
|
| 1971 | + TRACE_VAR("*lpdwFree",8,*lpdwFree);
|
| 1972 | + TRACE_EXIT(23,DD_OK);
|
| 1973 | + return DD_OK;
|
| 1974 | + }
|
| 1975 | + else
|
| 1976 | + {
|
| 1977 | + MEMORYSTATUS memstat;
|
| 1978 | + GlobalMemoryStatus(&memstat);
|
| 1979 | + if(lpdwTotal) *lpdwTotal = memstat.dwTotalVirtual;
|
| 1980 | + if(lpdwFree) *lpdwFree = memstat.dwAvailVirtual;
|
| 1981 | + TRACE_VAR("*lpdwTotal",8,*lpdwTotal);
|
| 1982 | + TRACE_VAR("*lpdwFree",8,*lpdwFree);
|
| 1983 | + TRACE_EXIT(23,DD_OK);
|
| 1984 | + return DD_OK;
|
| 1985 | + }
|
1769 | 1986 | }
|
1770 | 1987 | // DDRAW4 wrapper
|
1771 | 1988 | glDirectDraw4::glDirectDraw4(glDirectDraw7 *gl_DD7)
|
1772 | 1989 | {
|
| 1990 | + TRACE_ENTER(2,14,this,14,gl_DD7);
|
1773 | 1991 | glDD7 = gl_DD7;
|
1774 | 1992 | refcount = 1;
|
| 1993 | + TRACE_EXIT(-1,0);
|
1775 | 1994 | }
|
1776 | 1995 | glDirectDraw4::~glDirectDraw4()
|
1777 | 1996 | {
|
| 1997 | + TRACE_ENTER(1,14,this);
|
1778 | 1998 | glDD7->glDD4 = NULL;
|
1779 | 1999 | glDD7->Release();
|
| 2000 | + TRACE_EXIT(-1,0);
|
1780 | 2001 | }
|
1781 | 2002 | HRESULT WINAPI glDirectDraw4::QueryInterface(REFIID riid, void** ppvObj)
|
1782 | 2003 | {
|
1783 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2004 | + TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
|
| 2005 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1784 | 2006 | if(riid == IID_IUnknown)
|
1785 | 2007 | {
|
1786 | 2008 | this->AddRef();
|
1787 | 2009 | *ppvObj = this;
|
| 2010 | + TRACE_EXIT(23,DD_OK);
|
1788 | 2011 | return DD_OK;
|
1789 | 2012 | }
|
1790 | | - return glDD7->QueryInterface(riid,ppvObj);
|
| 2013 | + TRACE_RET(23,glDD7->QueryInterface(riid,ppvObj));
|
1791 | 2014 | }
|
1792 | 2015 | ULONG WINAPI glDirectDraw4::AddRef()
|
1793 | 2016 | {
|
1794 | | - if(!this) return 0;
|
| 2017 | + TRACE_ENTER(1,14,this);
|
| 2018 | + if(!this) TRACE_RET(8,0);
|
1795 | 2019 | refcount++;
|
| 2020 | + TRACE_EXIT(8,refcount);
|
1796 | 2021 | return refcount;
|
1797 | 2022 | }
|
1798 | 2023 | ULONG WINAPI glDirectDraw4::Release()
|
1799 | 2024 | {
|
1800 | | - if(!this) return 0;
|
| 2025 | + TRACE_ENTER(1,14,this);
|
| 2026 | + if(!this) TRACE_RET(8,0);
|
1801 | 2027 | ULONG ret;
|
1802 | 2028 | refcount--;
|
1803 | 2029 | ret = refcount;
|
1804 | 2030 | if(refcount == 0) delete this;
|
| 2031 | + TRACE_RET(8,ret);
|
1805 | 2032 | return ret;
|
1806 | 2033 | }
|
1807 | 2034 | HRESULT WINAPI glDirectDraw4::Compact()
|
1808 | 2035 | {
|
1809 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1810 | | - return glDD7->Compact();
|
| 2036 | + TRACE_ENTER(1,14,this);
|
| 2037 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2038 | + TRACE_RET(23,glDD7->Compact());
|
1811 | 2039 | }
|
1812 | 2040 | HRESULT WINAPI glDirectDraw4::CreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter)
|
1813 | 2041 | {
|
1814 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1815 | | - return glDD7->CreateClipper(dwFlags,lplpDDClipper,pUnkOuter);
|
| 2042 | + TRACE_ENTER(4,14,this,9,dwFlags,14,lplpDDClipper,14,pUnkOuter);
|
| 2043 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2044 | + TRACE_RET(23,glDD7->CreateClipper(dwFlags,lplpDDClipper,pUnkOuter));
|
1816 | 2045 | }
|
1817 | 2046 | HRESULT WINAPI glDirectDraw4::CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR *lplpDDPalette, IUnknown FAR *pUnkOuter)
|
1818 | 2047 | {
|
1819 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1820 | | - return glDD7->CreatePalette(dwFlags,lpDDColorArray,lplpDDPalette,pUnkOuter);
|
| 2048 | + TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDColorArray,14,lplpDDPalette,14,pUnkOuter);
|
| 2049 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2050 | + TRACE_RET(23,glDD7->CreatePalette(dwFlags,lpDDColorArray,lplpDDPalette,pUnkOuter));
|
1821 | 2051 | }
|
1822 | 2052 | HRESULT WINAPI glDirectDraw4::CreateSurface(LPDDSURFACEDESC2 lpDDSurfaceDesc, LPDIRECTDRAWSURFACE4 FAR *lplpDDSurface, IUnknown FAR *pUnkOuter)
|
1823 | 2053 | {
|
1824 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2054 | + TRACE_ENTER(4,14,this,14,lpDDSurfaceDesc,14,lplpDDSurface,14,pUnkOuter);
|
| 2055 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2056 | + if(!lplpDDSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
1825 | 2057 | LPDIRECTDRAWSURFACE7 lpDDS7;
|
1826 | 2058 | HRESULT err = glDD7->CreateSurface((LPDDSURFACEDESC2)lpDDSurfaceDesc,&lpDDS7,pUnkOuter);
|
1827 | 2059 | if(err == DD_OK)
|
— | — | @@ -1827,119 +2059,147 @@ |
1828 | 2060 | {
|
1829 | 2061 | lpDDS7->QueryInterface(IID_IDirectDrawSurface4,(LPVOID*) lplpDDSurface);
|
1830 | 2062 | lpDDS7->Release();
|
| 2063 | + TRACE_EXIT(23,DD_OK);
|
1831 | 2064 | return DD_OK;
|
1832 | 2065 | }
|
1833 | | - return err;}
|
| 2066 | + TRACE_EXIT(23,err);
|
| 2067 | + return err;
|
| 2068 | +}
|
1834 | 2069 | HRESULT WINAPI glDirectDraw4::DuplicateSurface(LPDIRECTDRAWSURFACE4 lpDDSurface, LPDIRECTDRAWSURFACE4 FAR *lplpDupDDSurface)
|
1835 | 2070 | {
|
1836 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2071 | + TRACE_ENTER(3,14,this,14,lpDDSurface,14,lplpDupDDSurface);
|
| 2072 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1837 | 2073 | FIXME("glDirectDraw4::DuplicateSurface: stub\n");
|
| 2074 | + TRACE_EXIT(23,DDERR_GENERIC);
|
1838 | 2075 | ERR(DDERR_GENERIC);
|
1839 | 2076 | }
|
1840 | 2077 | HRESULT WINAPI glDirectDraw4::EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC2 lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK2 lpEnumModesCallback)
|
1841 | 2078 | {
|
1842 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1843 | | - return ::EnumDisplayModes(dwFlags,lpDDSurfaceDesc,lpContext,lpEnumModesCallback);
|
| 2079 | + TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSurfaceDesc,14,lpContext,14,lpEnumModesCallback);
|
| 2080 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2081 | + TRACE_RET(23,::EnumDisplayModes(dwFlags,lpDDSurfaceDesc,lpContext,lpEnumModesCallback));
|
1844 | 2082 | }
|
1845 | 2083 | HRESULT WINAPI glDirectDraw4::EnumSurfaces(DWORD dwFlags, LPDDSURFACEDESC2 lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpEnumSurfacesCallback)
|
1846 | 2084 | {
|
1847 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2085 | + TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSD,14,lpContext,14,lpEnumSurfacesCallback);
|
| 2086 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1848 | 2087 | FIXME("glDirectDraw4::EnumSurfaces: stub\n");
|
| 2088 | + TRACE_EXIT(23,DDERR_GENERIC);
|
1849 | 2089 | ERR(DDERR_GENERIC);
|
1850 | 2090 | }
|
1851 | 2091 | HRESULT WINAPI glDirectDraw4::FlipToGDISurface()
|
1852 | 2092 | {
|
1853 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1854 | | - return glDD7->FlipToGDISurface();
|
| 2093 | + TRACE_ENTER(1,14,this);
|
| 2094 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2095 | + TRACE_RET(23,glDD7->FlipToGDISurface());
|
1855 | 2096 | }
|
1856 | 2097 | HRESULT WINAPI glDirectDraw4::GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps)
|
1857 | 2098 | {
|
1858 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1859 | | - return glDD7->GetCaps(lpDDDriverCaps,lpDDHELCaps);
|
| 2099 | + TRACE_ENTER(3,14,this,14,lpDDDriverCaps,14,lpDDHELCaps);
|
| 2100 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2101 | + TRACE_RET(23,glDD7->GetCaps(lpDDDriverCaps,lpDDHELCaps));
|
1860 | 2102 | }
|
1861 | 2103 | HRESULT WINAPI glDirectDraw4::GetDisplayMode(LPDDSURFACEDESC2 lpDDSurfaceDesc2)
|
1862 | 2104 | {
|
1863 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1864 | | - return glDD7->GetDisplayMode(lpDDSurfaceDesc2);
|
| 2105 | + TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc2);
|
| 2106 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2107 | + TRACE_RET(23,glDD7->GetDisplayMode(lpDDSurfaceDesc2));
|
1865 | 2108 | }
|
1866 | 2109 | HRESULT WINAPI glDirectDraw4::GetFourCCCodes(LPDWORD lpNumCodes, LPDWORD lpCodes)
|
1867 | 2110 | {
|
1868 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1869 | | - return glDD7->GetFourCCCodes(lpNumCodes,lpCodes);
|
| 2111 | + TRACE_ENTER(3,14,this,14,lpNumCodes,14,lpCodes);
|
| 2112 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2113 | + TRACE_RET(23,glDD7->GetFourCCCodes(lpNumCodes,lpCodes));
|
1870 | 2114 | }
|
1871 | 2115 | HRESULT WINAPI glDirectDraw4::GetGDISurface(LPDIRECTDRAWSURFACE4 FAR *lplpGDIDDSurface)
|
1872 | 2116 | {
|
1873 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2117 | + TRACE_ENTER(2,14,this,14,lplpGDIDDSurface);
|
| 2118 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1874 | 2119 | FIXME("glDirectDraw4::GetGDISurface: stub\n");
|
| 2120 | + TRACE_EXIT(23,DDERR_GENERIC);
|
1875 | 2121 | ERR(DDERR_GENERIC);
|
1876 | 2122 | }
|
1877 | 2123 | HRESULT WINAPI glDirectDraw4::GetMonitorFrequency(LPDWORD lpdwFrequency)
|
1878 | 2124 | {
|
1879 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1880 | | - return glDD7->GetMonitorFrequency(lpdwFrequency);
|
| 2125 | + TRACE_ENTER(2,14,this,14,lpdwFrequency);
|
| 2126 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2127 | + TRACE_RET(23,glDD7->GetMonitorFrequency(lpdwFrequency));
|
1881 | 2128 | }
|
1882 | 2129 | HRESULT WINAPI glDirectDraw4::GetScanLine(LPDWORD lpdwScanLine)
|
1883 | 2130 | {
|
1884 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1885 | | - return glDD7->GetScanLine(lpdwScanLine);
|
| 2131 | + TRACE_ENTER(2,14,this,14,lpdwScanLine);
|
| 2132 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2133 | + TRACE_RET(23,glDD7->GetScanLine(lpdwScanLine));
|
1886 | 2134 | }
|
1887 | 2135 | HRESULT WINAPI glDirectDraw4::GetVerticalBlankStatus(LPBOOL lpbIsInVB)
|
1888 | 2136 | {
|
1889 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1890 | | - return glDD7->GetVerticalBlankStatus(lpbIsInVB);
|
| 2137 | + TRACE_ENTER(2,14,this,14,lpbIsInVB);
|
| 2138 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2139 | + TRACE_RET(23,glDD7->GetVerticalBlankStatus(lpbIsInVB));
|
1891 | 2140 | }
|
1892 | 2141 | HRESULT WINAPI glDirectDraw4::Initialize(GUID FAR *lpGUID)
|
1893 | 2142 | {
|
1894 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1895 | | - return glDD7->Initialize(lpGUID);
|
| 2143 | + TRACE_ENTER(2,14,this,24,lpGUID);
|
| 2144 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2145 | + TRACE_RET(23,glDD7->Initialize(lpGUID));
|
1896 | 2146 | }
|
1897 | 2147 | HRESULT WINAPI glDirectDraw4::RestoreDisplayMode()
|
1898 | 2148 | {
|
1899 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1900 | | - return glDD7->RestoreDisplayMode();
|
| 2149 | + TRACE_ENTER(1,14,this);
|
| 2150 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2151 | + TRACE_RET(23,glDD7->RestoreDisplayMode());
|
1901 | 2152 | }
|
1902 | 2153 | HRESULT WINAPI glDirectDraw4::SetCooperativeLevel(HWND hWnd, DWORD dwFlags)
|
1903 | 2154 | {
|
1904 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1905 | | - return glDD7->SetCooperativeLevel(hWnd,dwFlags);
|
| 2155 | + TRACE_ENTER(3,14,this,13,hWnd,9,dwFlags);
|
| 2156 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2157 | + TRACE_RET(23,glDD7->SetCooperativeLevel(hWnd,dwFlags));
|
1906 | 2158 | }
|
1907 | 2159 | HRESULT WINAPI glDirectDraw4::SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
|
1908 | 2160 | {
|
1909 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1910 | | - return glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,dwRefreshRate,dwFlags);
|
| 2161 | + TRACE_ENTER(6,14,this,8,dwWidth,8,dwHeight,8,dwBPP,8,dwRefreshRate,9,dwFlags);
|
| 2162 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2163 | + TRACE_RET(23,glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,dwRefreshRate,dwFlags));
|
1911 | 2164 | }
|
1912 | 2165 | HRESULT WINAPI glDirectDraw4::WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent)
|
1913 | 2166 | {
|
1914 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1915 | | - return glDD7->WaitForVerticalBlank(dwFlags,hEvent);
|
| 2167 | + TRACE_ENTER(3,14,this,9,dwFlags,14,hEvent);
|
| 2168 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2169 | + TRACE_RET(23,glDD7->WaitForVerticalBlank(dwFlags,hEvent));
|
1916 | 2170 | }
|
1917 | 2171 | HRESULT WINAPI glDirectDraw4::GetAvailableVidMem(LPDDSCAPS2 lpDDSCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree)
|
1918 | 2172 | {
|
1919 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1920 | | - FIXME("IDirectDraw4::GetAvailableVidMem: stub\n");
|
1921 | | - ERR(DDERR_GENERIC);
|
| 2173 | + TRACE_ENTER(4,14,this,14,lpDDSCaps,14,lpdwTotal,14,lpdwFree);
|
| 2174 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2175 | + TRACE_RET(23,glDD7->GetAvailableVidMem(lpDDSCaps,lpdwTotal,lpdwFree));
|
1922 | 2176 | }
|
1923 | 2177 | HRESULT WINAPI glDirectDraw4::GetSurfaceFromDC(HDC hdc, LPDIRECTDRAWSURFACE4 *lpDDS)
|
1924 | 2178 | {
|
1925 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2179 | + TRACE_ENTER(3,14,this,13,hdc,14,lpDDS);
|
| 2180 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
1926 | 2181 | FIXME("IDirectDraw4::GetSurfaceFromDC: stub\n");
|
| 2182 | + TRACE_EXIT(23,DDERR_GENERIC);
|
1927 | 2183 | ERR(DDERR_GENERIC);
|
1928 | 2184 | }
|
1929 | 2185 | HRESULT WINAPI glDirectDraw4::RestoreAllSurfaces()
|
1930 | 2186 | {
|
1931 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1932 | | - return glDD7->RestoreAllSurfaces();
|
| 2187 | + TRACE_ENTER(1,14,this);
|
| 2188 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2189 | + TRACE_RET(23,glDD7->RestoreAllSurfaces());
|
1933 | 2190 | }
|
1934 | 2191 | HRESULT WINAPI glDirectDraw4::TestCooperativeLevel()
|
1935 | 2192 | {
|
1936 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1937 | | - return glDD7->TestCooperativeLevel();
|
| 2193 | + TRACE_ENTER(1,14,this);
|
| 2194 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2195 | + TRACE_RET(23,glDD7->TestCooperativeLevel());
|
1938 | 2196 | }
|
1939 | 2197 | HRESULT WINAPI glDirectDraw4::GetDeviceIdentifier(LPDDDEVICEIDENTIFIER lpdddi, DWORD dwFlags)
|
1940 | 2198 | {
|
1941 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1942 | | - if(!lpdddi) return DDERR_INVALIDPARAMS;
|
| 2199 | + TRACE_ENTER(3,14,this,14,lpdddi,9,dwFlags);
|
| 2200 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 2201 | + if(!lpdddi) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
1943 | 2202 | devid.guidDeviceIdentifier = device_template;
|
1944 | 2203 | memcpy(lpdddi,&devid,sizeof(DDDEVICEIDENTIFIER));
|
| 2204 | + TRACE_EXIT(23,DD_OK);
|
1945 | 2205 | return DD_OK;
|
1946 | 2206 | } |
\ No newline at end of file |
Index: ddraw/trace.cpp |
— | — | @@ -18,6 +18,7 @@ |
19 | 19 | #include "common.h"
|
20 | 20 |
|
21 | 21 | /* Data types:
|
| 22 | +-1 - C++ constructor/destructor
|
22 | 23 | 0 - void
|
23 | 24 | 1 - 8-bit signed
|
24 | 25 | 2 - 8-bit unsigned
|
— | — | @@ -43,7 +44,7 @@ |
44 | 45 | 22 - int BOOL
|
45 | 46 | 23 - HRESULT
|
46 | 47 | 24 - GUID pointer
|
47 | | -25 -
|
| 48 | +25 - SIZE pointer
|
48 | 49 | 26 - RECT pointer
|
49 | 50 | */
|
50 | 51 |
|
— | — | @@ -277,6 +278,13 @@ |
278 | 279 | }
|
279 | 280 | WriteFile(outfile,str,strlen(str),&byteswritten,NULL);
|
280 | 281 | }
|
| 282 | +static void trace_decode_size(SIZE *size)
|
| 283 | +{
|
| 284 | + DWORD byteswritten;
|
| 285 | + char str[64];
|
| 286 | + sprintf(str,"{%d,%d}",size->cx,size->cy);
|
| 287 | + WriteFile(outfile,str,strlen(str),&byteswritten,NULL);
|
| 288 | +}
|
281 | 289 | static void trace_decode_rect(RECT *rect)
|
282 | 290 | {
|
283 | 291 | DWORD byteswritten;
|
— | — | @@ -309,6 +317,9 @@ |
310 | 318 | str[0] = 0;
|
311 | 319 | switch(type)
|
312 | 320 | {
|
| 321 | + case -1: // C++ constructor/destructor
|
| 322 | + // No return type in a constructor or destructor.
|
| 323 | + break;
|
313 | 324 | case 0: // void
|
314 | 325 | WriteFile(outfile,"void",4,&byteswritten,NULL);
|
315 | 326 | break;
|
— | — | @@ -368,8 +379,13 @@ |
369 | 380 | if(!arg) WriteFile(outfile,"NULL",4,&byteswritten,NULL);
|
370 | 381 | else
|
371 | 382 | {
|
| 383 | +#ifdef _M_X64
|
| 384 | + sprintf(str,"0x%016I64X",arg);
|
| 385 | + WriteFile(outfile,str,strlen(str),&byteswritten,NULL);
|
| 386 | +#else
|
372 | 387 | sprintf(str,"0x%08X",arg);
|
373 | 388 | WriteFile(outfile,str,strlen(str),&byteswritten,NULL);
|
| 389 | +#endif
|
374 | 390 | }
|
375 | 391 | break;
|
376 | 392 | case 15: // ASCII string
|
— | — | @@ -455,10 +471,13 @@ |
456 | 472 | break;
|
457 | 473 | case 24: // GUID pointer
|
458 | 474 | if(!arg) WriteFile(outfile,"NULL",4,&byteswritten,NULL);
|
| 475 | + else if(arg == (void*)DDCREATE_HARDWAREONLY) WriteFile(outfile,"DDCREATE_HARDWAREONLY",21,&byteswritten,NULL);
|
| 476 | + else if(arg == (void*)DDCREATE_EMULATIONONLY) WriteFile(outfile,"DDCREATE_EMULATIONONLY",22,&byteswritten,NULL);
|
459 | 477 | else trace_decode_guid((GUID*)arg);
|
460 | 478 | break;
|
461 | | - case 25: // reserved
|
462 | | - WriteFile(outfile,"Unknown type",12,&byteswritten,NULL);
|
| 479 | + case 25: // SIZE pointer
|
| 480 | + if(!arg) WriteFile(outfile,"NULL",4,&byteswritten,NULL);
|
| 481 | + else trace_decode_size((SIZE*)arg);
|
463 | 482 | break;
|
464 | 483 | case 26: // RECT pointer
|
465 | 484 | if(!arg) WriteFile(outfile,"NULL",4,&byteswritten,NULL);
|
— | — | @@ -469,7 +488,7 @@ |
470 | 489 | break;
|
471 | 490 | }
|
472 | 491 | }
|
473 | | -void TRACE_ENTER(const char *function, int paramcount, ...)
|
| 492 | +void trace_enter(const char *function, int paramcount, ...)
|
474 | 493 | {
|
475 | 494 | if(trace_fail) return;
|
476 | 495 | if(!trace_ready) init_trace();
|
— | — | @@ -491,7 +510,7 @@ |
492 | 511 | trace_depth++;
|
493 | 512 | LeaveCriticalSection(&trace_cs);
|
494 | 513 | }
|
495 | | -void TRACE_EXIT(const char *function, int argtype, void *arg)
|
| 514 | +void trace_exit(const char *function, int argtype, void *arg)
|
496 | 515 | {
|
497 | 516 | if(trace_fail) return;
|
498 | 517 | if(!trace_ready) init_trace();
|
— | — | @@ -506,7 +525,7 @@ |
507 | 526 | WriteFile(outfile,"\r\n",2,&byteswritten,NULL);
|
508 | 527 | LeaveCriticalSection(&trace_cs);
|
509 | 528 | }
|
510 | | -void TRACE_VAR(const char *function, const char *var, int argtype, void *arg)
|
| 529 | +void trace_var(const char *function, const char *var, int argtype, void *arg)
|
511 | 530 | {
|
512 | 531 | if(trace_fail) return;
|
513 | 532 | if(!trace_ready) init_trace();
|
Index: ddraw/trace.h |
— | — | @@ -21,12 +21,22 @@ |
22 | 22 |
|
23 | 23 |
|
24 | 24 | #ifdef _TRACE
|
25 | | -void TRACE_ENTER(const char *function, int paramcount, ...);
|
26 | | -void TRACE_EXIT(const char *function, int argtype, void *arg);
|
27 | | -void TRACE_VAR(const char *function, const char *var, int argtype, void *arg);
|
| 25 | +#define TRACE_ENTER(paramcount,...) trace_enter(__FUNCTION__,paramcount,__VA_ARGS__)
|
| 26 | +#define TRACE_EXIT(argtype,arg) trace_exit(__FUNCTION__,argtype,(void*)arg);
|
| 27 | +#define TRACE_VAR(var,argtype,arg) trace_var(__FUNCTION__,var,argtype,(void*)arg);
|
| 28 | +void trace_enter(const char *function, int paramcount, ...);
|
| 29 | +void trace_exit(const char *function, int argtype, void *arg);
|
| 30 | +void trace_var(const char *function, const char *var, int argtype, void *arg);
|
| 31 | +#define TRACE_RET(argtype, arg) \
|
| 32 | +{\
|
| 33 | + trace_exit(__FUNCTION__,argtype,(void*)arg);\
|
| 34 | + return arg;\
|
| 35 | +}
|
28 | 36 | #else
|
29 | 37 | #define TRACE_ENTER(a,...)
|
30 | | -#define TRACE_EXIT(a,b,c)
|
| 38 | +#define TRACE_EXIT(a,b)
|
| 39 | +#define TRACE_VAR(a,b,c)
|
| 40 | +#define TRACE_RET(argtype, arg) return arg;
|
31 | 41 | #endif
|
32 | 42 |
|
33 | 43 | #endif //_TRACE_H |
\ No newline at end of file |