DXGL r347 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r346‎ | r347 | r348 >
Date:14:55, 16 March 2013
Author:admin
Status:new
Tags:
Comment:
Revert accidentally commented out function in r346.
Trace glDirectDrawSurface.cpp
Modified paths:
  • /ddraw/glDirectDrawPalette.h (modified) (history)
  • /ddraw/glDirectDrawSurface.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirectDrawPalette.h
@@ -34,7 +34,7 @@
3535 HRESULT WINAPI SetEntries(DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries);
3636
3737 // Internal function
38 - //LPPALETTEENTRY GetPalette(DWORD *flags);
 38+ LPPALETTEENTRY GetPalette(DWORD *flags);
3939 private:
4040 PALETTEENTRY palette[256];
4141 DWORD flags;
Index: ddraw/glDirectDrawSurface.cpp
@@ -39,6 +39,7 @@
4040 // DDRAW7 routines
4141 glDirectDrawSurface7::glDirectDrawSurface7(LPDIRECTDRAW7 lpDD7, LPDDSURFACEDESC2 lpDDSurfaceDesc2, LPDIRECTDRAWSURFACE7 *lplpDDSurface7, HRESULT *error, bool copysurface, glDirectDrawPalette *palettein)
4242 {
 43+ TRACE_ENTER(7,14,this,14,lpDD7,14,lpDDSurfaceDesc2,14,lplpDDSurface7,14,error,21,copysurface,14,palettein);
4344 hasstencil = false;
4445 dirty = 2;
4546 handle = 0;
@@ -69,6 +70,8 @@
7071 {
7172 FIXME("glDirectDrawSurface7::glDirectDrawSurface7: copy surface stub\n");
7273 *error = DDERR_GENERIC;
 74+ TRACE_VAR("*error",23,DDERR_GENERIC);
 75+ TRACE_EXIT(-1,0);
7376 return;
7477 }
7578 else
@@ -86,6 +89,8 @@
8790 || (ddsd.dwFlags & DDSD_PIXELFORMAT)) && !(ddsd.ddsCaps.dwCaps & DDSCAPS_BACKBUFFER))
8891 {
8992 *error = DDERR_INVALIDPARAMS;
 93+ TRACE_VAR("*error",23,DDERR_INVALIDPARAMS);
 94+ TRACE_EXIT(-1,0);
9095 return;
9196 }
9297 else
@@ -146,6 +151,8 @@
147152 else
148153 {
149154 *error = DDERR_INVALIDPARAMS;
 155+ TRACE_VAR("*error",23,DDERR_INVALIDPARAMS);
 156+ TRACE_EXIT(-1,0);
150157 return;
151158 }
152159 }
@@ -284,6 +291,8 @@
285292 break;
286293 default:
287294 *error = DDERR_INVALIDPIXELFORMAT;
 295+ TRACE_VAR("*error",23,DDERR_INVALIDPIXELFORMAT);
 296+ TRACE_EXIT(-1,0);
288297 return;
289298 }
290299 }
@@ -331,9 +340,13 @@
332341 else *error = DDERR_INVALIDPARAMS;
333342 }
334343 }
 344+ TRACE_VAR("*lplpDDSurface7",14,*lplpDDSurface7);
 345+ TRACE_VAR("*error",23,*error);
 346+ TRACE_EXIT(-1,0);
335347 }
336348 glDirectDrawSurface7::~glDirectDrawSurface7()
337349 {
 350+ TRACE_ENTER(1,14,this);
338351 AddRef();
339352 if(dds1) dds1->Release();
340353 if(dds2) dds2->Release();
@@ -357,15 +370,19 @@
358371 if(zbuffer) zbuffer->Release();
359372 if(device) device->Release();
360373 ddInterface->DeleteSurface(this);
 374+ TRACE_EXIT(-1,0);
361375 }
362376 HRESULT WINAPI glDirectDrawSurface7::QueryInterface(REFIID riid, void** ppvObj)
363377 {
364 - if(!this) return DDERR_INVALIDOBJECT;
365 - if(!ppvObj) return DDERR_INVALIDPARAMS;
 378+ TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
 379+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 380+ if(!ppvObj) TRACE_RET(23,DDERR_INVALIDPARAMS);
366381 if(riid == IID_IUnknown)
367382 {
368383 this->AddRef();
369384 *ppvObj = this;
 385+ TRACE_VAR("*ppvObj",14,*ppvObj);
 386+ TRACE_EXIT(23,DD_OK);
370387 return DD_OK;
371388 }
372389 if(riid == IID_IDirectDrawSurface7)
@@ -372,6 +389,8 @@
373390 {
374391 this->AddRef();
375392 *ppvObj = this;
 393+ TRACE_VAR("*ppvObj",14,*ppvObj);
 394+ TRACE_EXIT(23,DD_OK);
376395 return DD_OK;
377396 }
378397 if(riid == IID_IDirectDrawSurface4)
@@ -380,6 +399,8 @@
381400 {
382401 *ppvObj = dds4;
383402 dds4->AddRef();
 403+ TRACE_VAR("*ppvObj",14,*ppvObj);
 404+ TRACE_EXIT(23,DD_OK);
384405 return DD_OK;
385406 }
386407 else
@@ -387,6 +408,8 @@
388409 this->AddRef();
389410 *ppvObj = new glDirectDrawSurface4(this);
390411 dds4 = (glDirectDrawSurface4*)*ppvObj;
 412+ TRACE_VAR("*ppvObj",14,*ppvObj);
 413+ TRACE_EXIT(23,DD_OK);
391414 return DD_OK;
392415 }
393416 }
@@ -396,6 +419,8 @@
397420 {
398421 *ppvObj = dds3;
399422 dds3->AddRef();
 423+ TRACE_VAR("*ppvObj",14,*ppvObj);
 424+ TRACE_EXIT(23,DD_OK);
400425 return DD_OK;
401426 }
402427 else
@@ -403,6 +428,8 @@
404429 this->AddRef();
405430 *ppvObj = new glDirectDrawSurface3(this);
406431 dds3 = (glDirectDrawSurface3*)*ppvObj;
 432+ TRACE_VAR("*ppvObj",14,*ppvObj);
 433+ TRACE_EXIT(23,DD_OK);
407434 return DD_OK;
408435 }
409436 }
@@ -412,6 +439,8 @@
413440 {
414441 *ppvObj = dds2;
415442 dds2->AddRef();
 443+ TRACE_VAR("*ppvObj",14,*ppvObj);
 444+ TRACE_EXIT(23,DD_OK);
416445 return DD_OK;
417446 }
418447 else
@@ -419,6 +448,8 @@
420449 this->AddRef();
421450 *ppvObj = new glDirectDrawSurface2(this);
422451 dds2 = (glDirectDrawSurface2*)*ppvObj;
 452+ TRACE_VAR("*ppvObj",14,*ppvObj);
 453+ TRACE_EXIT(23,DD_OK);
423454 return DD_OK;
424455 }
425456 }
@@ -428,6 +459,8 @@
429460 {
430461 *ppvObj = dds1;
431462 dds1->AddRef();
 463+ TRACE_VAR("*ppvObj",14,*ppvObj);
 464+ TRACE_EXIT(23,DD_OK);
432465 return DD_OK;
433466 }
434467 else
@@ -435,6 +468,8 @@
436469 this->AddRef();
437470 *ppvObj = new glDirectDrawSurface1(this);
438471 dds1 = (glDirectDrawSurface1*)*ppvObj;
 472+ TRACE_VAR("*ppvObj",14,*ppvObj);
 473+ TRACE_EXIT(23,DD_OK);
439474 return DD_OK;
440475 }
441476 }
@@ -444,6 +479,8 @@
445480 {
446481 *ppvObj = d3dt2;
447482 d3dt2->AddRef();
 483+ TRACE_VAR("*ppvObj",14,*ppvObj);
 484+ TRACE_EXIT(23,DD_OK);
448485 return DD_OK;
449486 }
450487 else
@@ -451,6 +488,8 @@
452489 this->AddRef();
453490 *ppvObj = new glDirect3DTexture2(this);
454491 d3dt2 = (glDirect3DTexture2*)*ppvObj;
 492+ TRACE_VAR("*ppvObj",14,*ppvObj);
 493+ TRACE_EXIT(23,DD_OK);
455494 return DD_OK;
456495 }
457496 }
@@ -460,6 +499,8 @@
461500 {
462501 *ppvObj = d3dt1;
463502 d3dt1->AddRef();
 503+ TRACE_VAR("*ppvObj",14,*ppvObj);
 504+ TRACE_EXIT(23,DD_OK);
464505 return DD_OK;
465506 }
466507 else
@@ -467,6 +508,8 @@
468509 this->AddRef();
469510 *ppvObj = new glDirect3DTexture1(this);
470511 d3dt1 = (glDirect3DTexture1*)*ppvObj;
 512+ TRACE_VAR("*ppvObj",14,*ppvObj);
 513+ TRACE_EXIT(23,DD_OK);
471514 return DD_OK;
472515 }
473516 }
@@ -479,11 +522,12 @@
480523 glDirect3D7 *tmpd3d;
481524 glDirect3DDevice7 *tmpdev;
482525 ddInterface->QueryInterface(IID_IDirect3D7,(void**)&tmpd3d);
483 - if(!tmpd3d) return E_NOINTERFACE;
 526+ if(!tmpd3d) TRACE_RET(23,E_NOINTERFACE);
484527 tmpd3d->CreateDevice(riid,this,(LPDIRECT3DDEVICE7*)&tmpdev);
485528 if(!tmpdev)
486529 {
487530 tmpdev->Release();
 531+ TRACE_EXIT(23,E_NOINTERFACE);
488532 return E_NOINTERFACE;
489533 }
490534 HRESULT ret = tmpdev->QueryInterface(IID_IDirect3DDevice,ppvObj);
@@ -490,35 +534,46 @@
491535 tmpdev->SetRenderTarget(this,0);
492536 tmpdev->Release();
493537 tmpd3d->Release();
 538+ TRACE_VAR("*ppvObj",14,*ppvObj);
 539+ TRACE_EXIT(23,ret);
494540 return ret;
495541 }
496542 else
497543 {
498 - return device->QueryInterface(IID_IDirect3DDevice,ppvObj);
 544+ HRESULT ret = device->QueryInterface(IID_IDirect3DDevice,ppvObj);
 545+ TRACE_VAR("*ppvObj",14,*ppvObj);
 546+ TRACE_EXIT(23,ret);
 547+ return ret;
499548 }
500549 }
 550+ TRACE_EXIT(23,E_NOINTERFACE);
501551 return E_NOINTERFACE;
502552 }
503553 ULONG WINAPI glDirectDrawSurface7::AddRef()
504554 {
505 - if(!this) return 0;
 555+ TRACE_ENTER(1,14,this);
 556+ if(!this) TRACE_RET(8,0);
506557 refcount++;
 558+ TRACE_EXIT(8,refcount);
507559 return refcount;
508560 }
509561 ULONG WINAPI glDirectDrawSurface7::Release()
510562 {
511 - if(!this) return 0;
 563+ TRACE_ENTER(1,14,this);
 564+ if(!this) TRACE_RET(8,0);
512565 ULONG ret;
513566 refcount--;
514567 ret = refcount;
515568 if(refcount == 0) delete this;
 569+ TRACE_EXIT(23,ret);
516570 return ret;
517571 }
518572 HRESULT WINAPI glDirectDrawSurface7::AddAttachedSurface(LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface)
519573 {
520 - if(!this) return DDERR_INVALIDOBJECT;
521 - if(!lpDDSAttachedSurface) return DDERR_INVALIDPARAMS;
522 - if(zbuffer) ERR(DDERR_SURFACEALREADYATTACHED);
 574+ TRACE_ENTER(2,14,this,14,lpDDSAttachedSurface);
 575+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 576+ if(!lpDDSAttachedSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
 577+ if(zbuffer) TRACE_RET(23,DDERR_SURFACEALREADYATTACHED);
523578 glDirectDrawSurface7 *attached = (glDirectDrawSurface7 *)lpDDSAttachedSurface;
524579 DDSURFACEDESC2 ddsd;
525580 ddsd.dwSize = sizeof(DDSURFACEDESC2);
@@ -527,20 +582,24 @@
528583 {
529584 attached->AddRef();
530585 zbuffer = attached;
 586+ TRACE_EXIT(23,DD_OK);
531587 return DD_OK;
532588 }
533 - else return DDERR_CANNOTATTACHSURFACE;
 589+ else TRACE_RET(23,DDERR_CANNOTATTACHSURFACE);
534590 }
535591 HRESULT WINAPI glDirectDrawSurface7::AddOverlayDirtyRect(LPRECT lpRect)
536592 {
537 - if(!this) return DDERR_INVALIDOBJECT;
 593+ TRACE_ENTER(2,14,this,26,lpRect);
 594+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
538595 FIXME("glDirectDrawSurface7::AddOverlayDirtyRect: stub\n");
 596+ TRACE_EXIT(23,DDERR_GENERIC);
539597 ERR(DDERR_GENERIC);
540598 }
541599 HRESULT WINAPI glDirectDrawSurface7::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
542600 {
543 - if(!this) return DDERR_INVALIDOBJECT;
544 - if((dwFlags & DDBLT_COLORFILL) && !lpDDBltFx) return DDERR_INVALIDPARAMS;
 601+ TRACE_ENTER(6,14,this,26,lpDestRect,14,lpDDSrcSurface,26,lpSrcRect,9,dwFlags,14,lpDDBltFx);
 602+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 603+ if((dwFlags & DDBLT_COLORFILL) && !lpDDBltFx) TRACE_RET(23,DDERR_INVALIDPARAMS);
545604 glDirectDrawSurface7 *src = (glDirectDrawSurface7 *)lpDDSrcSurface;
546605 if(dirty & 1)
547606 {
@@ -557,17 +616,20 @@
558617 src->ddsd.ddpfPixelFormat.dwRGBBitCount);
559618 src->dirty &= ~1;
560619 }
561 - return renderer->Blt(lpDestRect,src,this,lpSrcRect,dwFlags,lpDDBltFx);
 620+ TRACE_RET(23,renderer->Blt(lpDestRect,src,this,lpSrcRect,dwFlags,lpDDBltFx));
562621 }
563622 HRESULT WINAPI glDirectDrawSurface7::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
564623 {
565 - if(!this) return DDERR_INVALIDOBJECT;
 624+ TRACE_ENTER(4,14,this,14,lpDDBltBatch,8,dwCount,9,dwFlags);
 625+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
566626 FIXME("glDirectDrawSurface7::BltBatch: stub\n");
 627+ TRACE_EXIT(23,DDERR_GENERIC);
567628 ERR(DDERR_GENERIC);
568629 }
569630 HRESULT WINAPI glDirectDrawSurface7::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
570631 {
571 - if(!this) return DDERR_INVALIDOBJECT;
 632+ TRACE_ENTER(6,14,this,8,dwX,8,dwY,14,lpDDSrcSurface,26,lpSrcRect,9,dwTrans);
 633+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
572634 DDSURFACEDESC2 ddsd;
573635 ddsd.dwSize = sizeof(DDSURFACEDESC2);
574636 lpDDSrcSurface->GetSurfaceDesc(&ddsd);
@@ -588,41 +650,50 @@
589651 if(dwTrans & DDBLTFAST_WAIT) flags |= DDBLT_WAIT;
590652 if(dwTrans & DDBLTFAST_DESTCOLORKEY) flags |= DDBLT_KEYDEST;
591653 if(dwTrans & DDBLTFAST_SRCCOLORKEY) flags |= DDBLT_KEYSRC;
592 - return this->Blt(&dest,lpDDSrcSurface,lpSrcRect,flags,NULL);
 654+ TRACE_RET(23,Blt(&dest,lpDDSrcSurface,lpSrcRect,flags,NULL));
593655 }
594656 HRESULT WINAPI glDirectDrawSurface7::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface)
595657 {
596 - if(!this) return DDERR_INVALIDOBJECT;
 658+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSAttachedSurface);
 659+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
597660 if(lpDDSAttachedSurface == (LPDIRECTDRAWSURFACE7)zbuffer)
598661 {
599662 zbuffer->Release();
600663 zbuffer = NULL;
 664+ TRACE_EXIT(23,DD_OK);
601665 return DD_OK;
602666 }
603 - else ERR(DDERR_SURFACENOTATTACHED);
 667+ else TRACE_RET(23,DDERR_SURFACENOTATTACHED);
604668 }
605669 HRESULT WINAPI glDirectDrawSurface7::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback)
606670 {
607 - if(!this) return DDERR_INVALIDOBJECT;
 671+ TRACE_ENTER(3,14,this,14,lpContext,14,lpEnumSurfacesCallback);
 672+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
608673 FIXME("glDirectDrawSurface7::EnumAttachedSurfaces: stub\n");
 674+ TRACE_EXIT(23,DDERR_GENERIC);
609675 ERR(DDERR_GENERIC);
610676 }
611677 HRESULT WINAPI glDirectDrawSurface7::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpfnCallback)
612678 {
613 - if(!this) return DDERR_INVALIDOBJECT;
 679+ TRACE_ENTER(4,14,this,9,dwFlags,14,lpContext,14,lpfnCallback);
 680+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
614681 FIXME("glDirectDrawSurface7::EnumOverlayZOrders: stub\n");
 682+ TRACE_EXIT(23,DDERR_GENERIC);
615683 ERR(DDERR_GENERIC);
616684 }
617685 HRESULT WINAPI glDirectDrawSurface7::Flip(LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverride, DWORD dwFlags)
618686 {
619 - if(!this) return DDERR_INVALIDOBJECT;
 687+ TRACE_ENTER(3,14,this,14,lpDDSurfaceTargetOverride,9,dwFlags);
 688+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
620689 HRESULT ret = Flip2(lpDDSurfaceTargetOverride,dwFlags);
621690 if(ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) RenderScreen(texture,this);
 691+ TRACE_EXIT(23,ret);
622692 return ret;
623693 }
624694 HRESULT glDirectDrawSurface7::Flip2(LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverride, DWORD dwFlags)
625695 {
626 - if(!this) return DDERR_INVALIDOBJECT;
 696+ TRACE_ENTER(3,14,this,14,lpDDSurfaceTargetOverride,9,dwFlags);
 697+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
627698 DWORD i;
628699 glDirectDrawSurface7 *tmp;
629700 if(dwFlags & DDFLIP_NOVSYNC) swapinterval=0;
@@ -637,7 +708,7 @@
638709 if(lpDDSurfaceTargetOverride)
639710 {
640711 bool success = false;
641 - if(lpDDSurfaceTargetOverride == this) return DD_OK;
 712+ if(lpDDSurfaceTargetOverride == this) TRACE_RET(23,DD_OK);
642713 tmp = this;
643714 for(i = 0; i < ddsd.dwBackBufferCount; i++)
644715 {
@@ -649,16 +720,16 @@
650721 break;
651722 }
652723 }
653 - if(!success) return DDERR_INVALIDPARAMS;
 724+ if(!success) TRACE_RET(23,DDERR_INVALIDPARAMS);
654725 for(DWORD x = 0; x < i; x++)
655726 {
656 - if(x == i-1) return Flip2(NULL,dwFlags);
 727+ if(x == i-1) {TRACE_RET(23,Flip2(NULL,dwFlags));}
657728 else Flip2(NULL,0);
658729 }
659730 }
660731 if(ddsd.ddsCaps.dwCaps & DDSCAPS_FLIP)
661732 {
662 - if(ddsd.ddsCaps.dwCaps & DDSCAPS_BACKBUFFER) return DDERR_INVALIDOBJECT;
 733+ if(ddsd.ddsCaps.dwCaps & DDSCAPS_BACKBUFFER) TRACE_RET(23,DDERR_INVALIDOBJECT);
663734 TEXTURE **textures = new TEXTURE*[ddsd.dwBackBufferCount+1];
664735 textures[0] = texture;
665736 tmp = this;
@@ -695,14 +766,16 @@
696767 }
697768 delete[] textures;
698769 }
699 - else return DDERR_NOTFLIPPABLE;
 770+ else TRACE_RET(23,DDERR_NOTFLIPPABLE);
700771 flipcount+=flips;
701772 if(flipcount > ddsd.dwBackBufferCount) flipcount -= (ddsd.dwBackBufferCount+1);
 773+ TRACE_EXIT(23,DD_OK);
702774 return DD_OK;
703775 }
704776 HRESULT WINAPI glDirectDrawSurface7::GetAttachedSurface(LPDDSCAPS2 lpDDSCaps, LPDIRECTDRAWSURFACE7 FAR *lplpDDAttachedSurface)
705777 {
706 - if(!this) return DDERR_INVALIDOBJECT;
 778+ TRACE_ENTER(3,14,this,14,lpDDSCaps,14,lplpDDAttachedSurface);
 779+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
707780 DDSCAPS2 ddsComp;
708781 backbuffer->GetCaps(&ddsComp);
709782 unsigned __int64 comp1,comp2;
@@ -712,6 +785,8 @@
713786 {
714787 *lplpDDAttachedSurface = backbuffer;
715788 backbuffer->AddRef();
 789+ TRACE_VAR("*lplpDDAttachedSurface",14,*lplpDDAttachedSurface);
 790+ TRACE_EXIT(23,DD_OK);
716791 return DD_OK;
717792 }
718793 else if(zbuffer)
@@ -723,42 +798,53 @@
724799 {
725800 *lplpDDAttachedSurface = zbuffer;
726801 zbuffer->AddRef();
 802+ TRACE_VAR("*lplpDDAttachedSurface",14,*lplpDDAttachedSurface);
 803+ TRACE_EXIT(23,DD_OK);
727804 return DD_OK;
728805 }
729806 }
 807+ TRACE_EXIT(23,DDERR_NOTFOUND);
730808 ERR(DDERR_NOTFOUND);
731809 }
732810 HRESULT WINAPI glDirectDrawSurface7::GetBltStatus(DWORD dwFlags)
733811 {
734 - if(!this) return DDERR_INVALIDOBJECT;
 812+ TRACE_ENTER(2,14,this,9,dwFlags);
 813+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
735814 FIXME("glDirectDrawSurface7::GetBltStatus: stub\n");
 815+ TRACE_EXIT(23,DDERR_GENERIC);
736816 ERR(DDERR_GENERIC);
737817 }
738818 HRESULT WINAPI glDirectDrawSurface7::GetCaps(LPDDSCAPS2 lpDDSCaps)
739819 {
740 - if(!this) return DDERR_INVALIDOBJECT;
741 - if(!lpDDSCaps) return DDERR_INVALIDPARAMS;
 820+ TRACE_ENTER(2,14,this,14,lpDDSCaps);
 821+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 822+ if(!lpDDSCaps) TRACE_RET(23,DDERR_INVALIDPARAMS);
742823 memcpy(lpDDSCaps,&ddsd.ddsCaps,sizeof(DDSCAPS2));
 824+ TRACE_EXIT(23,DD_OK);
743825 return DD_OK;
744826 }
745827 HRESULT WINAPI glDirectDrawSurface7::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
746828 {
747 - if(!this) return DDERR_INVALIDOBJECT;
 829+ TRACE_ENTER(2,14,this,14,lplpDDClipper);
 830+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
748831 FIXME("glDirectDrawSurface7::GetClipper: stub\n");
 832+ TRACE_EXIT(23,DDERR_GENERIC);
749833 ERR(DDERR_GENERIC);
750834 }
751835 HRESULT WINAPI glDirectDrawSurface7::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
752836 {
753 - if(!this) return DDERR_INVALIDOBJECT;
754 - if(!lpDDColorKey) return DDERR_INVALIDPARAMS;
 837+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
 838+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 839+ if(!lpDDColorKey) TRACE_RET(23,DDERR_INVALIDPARAMS);
755840 if(dwFlags == DDCKEY_SRCBLT)
756841 {
757842 if(colorkey[0].enabled)
758843 {
759844 memcpy(lpDDColorKey,&colorkey[0].key,sizeof(DDCOLORKEY));
 845+ TRACE_EXIT(23,DD_OK);
760846 return DD_OK;
761847 }
762 - else return DDERR_NOCOLORKEY;
 848+ else TRACE_RET(23,DDERR_NOCOLORKEY);
763849 }
764850 if(dwFlags == DDCKEY_DESTBLT)
765851 {
@@ -765,9 +851,10 @@
766852 if(colorkey[1].enabled)
767853 {
768854 memcpy(lpDDColorKey,&colorkey[1].key,sizeof(DDCOLORKEY));
 855+ TRACE_EXIT(23,DD_OK);
769856 return DD_OK;
770857 }
771 - else return DDERR_NOCOLORKEY;
 858+ else TRACE_RET(23,DDERR_NOCOLORKEY);
772859 }
773860 if(dwFlags == DDCKEY_SRCOVERLAY)
774861 {
@@ -774,9 +861,10 @@
775862 if(colorkey[2].enabled)
776863 {
777864 memcpy(lpDDColorKey,&colorkey[2].key,sizeof(DDCOLORKEY));
 865+ TRACE_EXIT(23,DD_OK);
778866 return DD_OK;
779867 }
780 - else return DDERR_NOCOLORKEY;
 868+ else TRACE_RET(23,DDERR_NOCOLORKEY);
781869 }
782870 if(dwFlags == DDCKEY_DESTOVERLAY)
783871 {
@@ -783,23 +871,26 @@
784872 if(colorkey[3].enabled)
785873 {
786874 memcpy(lpDDColorKey,&colorkey[3].key,sizeof(DDCOLORKEY));
 875+ TRACE_EXIT(23,DD_OK);
787876 return DD_OK;
788877 }
789 - else return DDERR_NOCOLORKEY;
 878+ else TRACE_RET(23,DDERR_NOCOLORKEY);
790879 }
 880+ TRACE_EXIT(23,DDERR_INVALIDPARAMS);
791881 return DDERR_INVALIDPARAMS;
792882 }
793883 HRESULT WINAPI glDirectDrawSurface7::GetDC(HDC FAR *lphDC)
794884 {
795 - if(!this) return DDERR_INVALIDOBJECT;
796 - if(!lphDC) return DDERR_INVALIDPARAMS;
797 - if(hdc) ERR(DDERR_DCALREADYCREATED);
 885+ TRACE_ENTER(2,14,this,14,lphDC);
 886+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 887+ if(!lphDC) TRACE_RET(23,DDERR_INVALIDPARAMS);
 888+ if(hdc) TRACE_RET(23,DDERR_DCALREADYCREATED);
798889 glDirectDrawPalette *pal;
799890 DWORD colors[256];
800891 HRESULT error;
801892 LPVOID surface;
802893 error = this->Lock(NULL,&ddsd,0,NULL);
803 - if(error != DD_OK) return error;
 894+ if(error != DD_OK) TRACE_RET(23,error);
804895 hdc = CreateCompatibleDC(NULL);
805896 bitmapinfo->bmiHeader.biWidth = ddsd.lPitch / (bitmapinfo->bmiHeader.biBitCount / 8);
806897 if(ddsd.ddpfPixelFormat.dwRGBBitCount == 8)
@@ -818,29 +909,38 @@
819910 HGDIOBJ temp = SelectObject(hdc,hbitmap);
820911 DeleteObject(temp);
821912 *lphDC = hdc;
 913+ TRACE_VAR("*lphDC",14,*lphDC);
 914+ TRACE_EXIT(23,DD_OK);
822915 return DD_OK;
823916 }
824917 HRESULT WINAPI glDirectDrawSurface7::GetFlipStatus(DWORD dwFlags)
825918 {
826 - if(!this) return DDERR_INVALIDOBJECT;
 919+ TRACE_ENTER(2,14,this,9,dwFlags);
 920+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 921+ TRACE_EXIT(23,DD_OK);
827922 return DD_OK;
828923 FIXME("glDirectDrawSurface7::GetFlipStatus: stub\n");
 924+ TRACE_RET(23,DDERR_GENERIC);
829925 ERR(DDERR_GENERIC);
830926 }
831927 HRESULT WINAPI glDirectDrawSurface7::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
832928 {
833 - if(!this) return DDERR_INVALIDOBJECT;
 929+ TRACE_ENTER(3,14,this,14,lplX,14,lplY);
 930+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
834931 FIXME("glDirectDrawSurface7::GetOverlayPosition: stub\n");
 932+ TRACE_EXIT(23,DDERR_GENERIC);
835933 ERR(DDERR_GENERIC);
836934 }
837935 HRESULT WINAPI glDirectDrawSurface7::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
838936 {
839 - if(!this) return DDERR_INVALIDOBJECT;
 937+ TRACE_ENTER(2,14,this,14,lplpDDPalette);
 938+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
840939 HRESULT err;
841940 if(palette)
842941 {
843942 palette->AddRef();
844943 *lplpDDPalette = palette;
 944+ TRACE_EXIT(23,DD_OK);
845945 err = DD_OK;
846946 }
847947 else
@@ -847,44 +947,55 @@
848948 {
849949 err = DDERR_NOPALETTEATTACHED;
850950 *lplpDDPalette = NULL;
 951+ TRACE_VAR("*lplpDDPalette",14,*lplpDDPalette);
851952 }
 953+ TRACE_EXIT(23,err);
852954 return err;
853955 }
854956 HRESULT WINAPI glDirectDrawSurface7::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
855957 {
856 - if(!this) return DDERR_INVALIDOBJECT;
857 - if(!lpDDPixelFormat) return DDERR_INVALIDPARAMS;
 958+ TRACE_ENTER(2,14,this,14,lpDDPixelFormat);
 959+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 960+ if(!lpDDPixelFormat) TRACE_RET(23,DDERR_INVALIDPARAMS);
858961 *lpDDPixelFormat = ddsd.ddpfPixelFormat;
 962+ TRACE_EXIT(23,DD_OK);
859963 return DD_OK;
860964 }
861965 HRESULT WINAPI glDirectDrawSurface7::GetSurfaceDesc(LPDDSURFACEDESC2 lpDDSurfaceDesc)
862966 {
863 - if(!this) return DDERR_INVALIDOBJECT;
864 - if(!lpDDSurfaceDesc) return DDERR_INVALIDPARAMS;
 967+ TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc);
 968+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 969+ if(!lpDDSurfaceDesc) TRACE_RET(23,DDERR_INVALIDPARAMS);
865970 memcpy(lpDDSurfaceDesc,&ddsd,lpDDSurfaceDesc->dwSize);
 971+ TRACE_EXIT(23,DD_OK);
866972 return DD_OK;
867973 }
868974 HRESULT WINAPI glDirectDrawSurface7::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC2 lpDDSurfaceDesc)
869975 {
870 - if(!this) return DDERR_INVALIDOBJECT;
 976+ TRACE_ENTER(3,14,this,14,lpDD,14,lpDDSurfaceDesc);
 977+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 978+ TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
871979 return DDERR_ALREADYINITIALIZED;
872980 }
873981 HRESULT WINAPI glDirectDrawSurface7::IsLost()
874982 {
875 - if(!this) return DDERR_INVALIDOBJECT;
876 - if(hRC == renderer->hRC) return DD_OK;
877 - else return DDERR_SURFACELOST;
 983+ TRACE_ENTER(1,14,this);
 984+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 985+ if(hRC == renderer->hRC) {TRACE_RET(23,DD_OK);}
 986+ else TRACE_RET(23,DDERR_SURFACELOST);
878987 }
879988
880989 HRESULT WINAPI glDirectDrawSurface7::Lock(LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
881990 {
882 - if(!this) return DDERR_INVALIDOBJECT;
883 - if(locked) ERR(DDERR_SURFACEBUSY);
 991+ TRACE_ENTER(5,14,this,26,lpDestRect,14,lpDDSurfaceDesc,9,dwFlags,14,hEvent);
 992+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 993+ if(locked) TRACE_RET(23,DDERR_SURFACEBUSY);
884994 dirty |= 1;
885995 retry:
886996 switch(surfacetype)
887997 {
888998 default:
 999+ TRACE_EXIT(23,DDERR_GENERIC);
8891000 ERR(DDERR_GENERIC);
8901001 break;
8911002 case 0:
@@ -896,6 +1007,7 @@
8971008 break;
8981009 case 1:
8991010 FIXME("glDirectDrawSurface7::Lock: surface type 1 not supported yet");
 1011+ TRACE_EXIT(23,DDERR_GENERIC);
9001012 ERR(DDERR_UNSUPPORTED);
9011013 break;
9021014 case 2:
@@ -918,13 +1030,15 @@
9191031 }
9201032 memcpy(lpDDSurfaceDesc,&ddsd,lpDDSurfaceDesc->dwSize);
9211033 locked++;
 1034+ TRACE_EXIT(23,DD_OK);
9221035 return DD_OK;
9231036 }
9241037 HRESULT WINAPI glDirectDrawSurface7::ReleaseDC(HDC hDC)
9251038 {
926 - if(!this) return DDERR_INVALIDOBJECT;
927 - if(!hdc) return DDERR_INVALIDOBJECT;
928 - if(hDC != hdc) return DDERR_INVALIDOBJECT;
 1039+ TRACE_ENTER(2,14,this,14,hDC);
 1040+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1041+ if(!hdc) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1042+ if(hDC != hdc) TRACE_RET(23,DDERR_INVALIDPARAMS);
9291043 GetDIBits(hDC,hbitmap,0,ddsd.dwHeight,ddsd.lpSurface,bitmapinfo,DIB_RGB_COLORS);
9301044 Unlock(NULL);
9311045 DeleteObject(hbitmap);
@@ -931,10 +1045,12 @@
9321046 hbitmap = NULL;
9331047 DeleteDC(hdc);
9341048 hdc = NULL;
 1049+ TRACE_EXIT(23,DD_OK);
9351050 return DD_OK;
9361051 }
9371052 void glDirectDrawSurface7::Restore2()
9381053 {
 1054+ TRACE_ENTER(1,14,this);
9391055 LONG sizes[6];
9401056 if(hRC != renderer->hRC)
9411057 {
@@ -966,12 +1082,14 @@
9671083 if(paltex) renderer->MakeTexture(paltex,256,1);
9681084 renderer->MakeTexture(texture,fakex,fakey);
9691085 }
 1086+ TRACE_EXIT(0,0);
9701087 }
9711088 HRESULT WINAPI glDirectDrawSurface7::Restore()
9721089 {
973 - if(!this) return DDERR_INVALIDOBJECT;
 1090+ TRACE_ENTER(1,14,this);
 1091+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
9741092 LONG sizes[6];
975 - if(!renderer) return DDERR_INVALIDOBJECT;
 1093+ if(!renderer) TRACE_RET(23,DDERR_INVALIDOBJECT);
9761094 if(hRC != renderer->hRC)
9771095 {
9781096 if(ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
@@ -1009,22 +1127,26 @@
10101128 }
10111129 if(paltex) renderer->MakeTexture(paltex,256,1);
10121130 renderer->MakeTexture(texture,fakex,fakey);
 1131+ TRACE_EXIT(23,DD_OK);
10131132 return DD_OK;
10141133 }
1015 - else return DD_OK;
 1134+ else TRACE_RET(23,DD_OK);
10161135 }
10171136 HRESULT WINAPI glDirectDrawSurface7::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
10181137 {
1019 - if(!this) return DDERR_INVALIDOBJECT;
 1138+ TRACE_ENTER(2,14,this,14,lpDDClipper);
 1139+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
10201140 if(clipper) clipper->Release();
10211141 clipper = (glDirectDrawClipper *)lpDDClipper;
10221142 if(clipper)clipper->AddRef();
 1143+ TRACE_EXIT(23,DD_OK);
10231144 return DD_OK;
10241145 }
10251146 HRESULT WINAPI glDirectDrawSurface7::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
10261147 {
1027 - if(!this) return DDERR_INVALIDOBJECT;
1028 - if(!lpDDColorKey) ERR(DDERR_GENERIC);
 1148+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
 1149+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1150+ if(!lpDDColorKey) TRACE_RET(23,DDERR_INVALIDPARAMS);
10291151 CKEY key;
10301152 key.enabled = true;
10311153 if(dwFlags & DDCKEY_COLORSPACE) key.colorspace = true;
@@ -1050,17 +1172,21 @@
10511173 ddsd.dwFlags |= DDSD_CKDESTOVERLAY;
10521174 colorkey[3] = key;
10531175 }
 1176+ TRACE_EXIT(23,DD_OK);
10541177 return DD_OK;
10551178 }
10561179 HRESULT WINAPI glDirectDrawSurface7::SetOverlayPosition(LONG lX, LONG lY)
10571180 {
1058 - if(!this) return DDERR_INVALIDOBJECT;
 1181+ TRACE_ENTER(3,14,this,7,lX,7,lY);
 1182+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
10591183 FIXME("glDirectDrawSurface7::SetOverlayPosition: stub\n");
 1184+ TRACE_EXIT(23,DDERR_GENERIC);
10601185 ERR(DDERR_GENERIC);
10611186 }
10621187 HRESULT WINAPI glDirectDrawSurface7::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
10631188 {
1064 - if(!this) return DDERR_INVALIDOBJECT;
 1189+ TRACE_ENTER(2,14,this,14,lpDDPalette);
 1190+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
10651191 if(palette)
10661192 {
10671193 palette->Release();
@@ -1071,13 +1197,15 @@
10721198 palette = (glDirectDrawPalette *)lpDDPalette;
10731199 palette->AddRef();
10741200 }
 1201+ TRACE_EXIT(23,DD_OK);
10751202 return DD_OK;
10761203 }
10771204
10781205 HRESULT WINAPI glDirectDrawSurface7::Unlock(LPRECT lpRect)
10791206 {
1080 - if(!this) return DDERR_INVALIDOBJECT;
1081 - if(!locked) return DDERR_NOTLOCKED;
 1207+ TRACE_ENTER(2,14,this,26,lpRect);
 1208+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1209+ if(!locked) TRACE_RET(23,DDERR_NOTLOCKED);
10821210 locked--;
10831211 ddsd.lpSurface = NULL;
10841212 if(((ddsd.ddsCaps.dwCaps & (DDSCAPS_FRONTBUFFER)) &&
@@ -1084,122 +1212,160 @@
10851213 (ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)) ||
10861214 ((ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) &&
10871215 !(ddsd.ddsCaps.dwCaps & DDSCAPS_FLIP))) RenderScreen(texture,this);
 1216+ TRACE_EXIT(23,DD_OK);
10881217 return DD_OK;
10891218 }
10901219 HRESULT WINAPI glDirectDrawSurface7::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE7 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
10911220 {
1092 - if(!this) return DDERR_INVALIDOBJECT;
 1221+ TRACE_ENTER(6,14,this,26,lpSrcRect,14,lpDDDestSurface,26,lpDestRect,9,dwFlags,14,lpDDOverlayFx);
 1222+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
10931223 FIXME("glDirectDrawSurface7::UpdateOverlay: stub\n");
 1224+ TRACE_EXIT(23,DDERR_GENERIC);
10941225 ERR(DDERR_GENERIC);
10951226 }
10961227 HRESULT WINAPI glDirectDrawSurface7::UpdateOverlayDisplay(DWORD dwFlags)
10971228 {
1098 - if(!this) return DDERR_INVALIDOBJECT;
 1229+ TRACE_ENTER(2,14,this,9,dwFlags);
 1230+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
10991231 FIXME("glDirectDrawSurface7::UpdateOverlayDisplay: stub\n");
 1232+ TRACE_EXIT(23,DDERR_GENERIC);
11001233 ERR(DDERR_GENERIC);
11011234 }
11021235 HRESULT WINAPI glDirectDrawSurface7::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSReference)
11031236 {
1104 - if(!this) return DDERR_INVALIDOBJECT;
 1237+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSReference);
 1238+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
11051239 FIXME("glDirectDrawSurface7::UpdateOverlayZOrder: stub\n");
 1240+ TRACE_EXIT(23,DDERR_GENERIC);
11061241 ERR(DDERR_GENERIC);
11071242 }
11081243
11091244 void glDirectDrawSurface7::RenderScreen(TEXTURE *texture, glDirectDrawSurface7 *surface)
11101245 {
 1246+ TRACE_ENTER(3,14,this,14,texture,14,surface);
11111247 renderer->DrawScreen(texture,paltex,this,surface);
 1248+ TRACE_EXIT(0,0);
11121249 }
11131250 // ddraw 2+ api
11141251 HRESULT WINAPI glDirectDrawSurface7::GetDDInterface(LPVOID FAR *lplpDD)
11151252 {
1116 - if(!this) return DDERR_INVALIDOBJECT;
 1253+ TRACE_ENTER(2,14,this,14,lplpDD);
 1254+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
11171255 ddInterface->AddRef();
11181256 *lplpDD = ddInterface;
 1257+ TRACE_VAR("*lplpDD",14,*lplpDD);
 1258+ TRACE_EXIT(23,DD_OK);
11191259 return DD_OK;
11201260 }
11211261 HRESULT WINAPI glDirectDrawSurface7::PageLock(DWORD dwFlags)
11221262 {
1123 - if(!this) return DDERR_INVALIDOBJECT;
 1263+ TRACE_ENTER(2,14,this,9,dwFlags);
 1264+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
11241265 pagelocked++;
 1266+ TRACE_EXIT(23,DD_OK);
11251267 return DD_OK;
11261268 }
11271269 HRESULT WINAPI glDirectDrawSurface7::PageUnlock(DWORD dwFlags)
11281270 {
1129 - if(!this) return DDERR_INVALIDOBJECT;
1130 - if(!pagelocked) ERR(DDERR_NOTPAGELOCKED);
 1271+ TRACE_ENTER(2,14,this,9,dwFlags);
 1272+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1273+ if(!pagelocked) TRACE_RET(23,DDERR_NOTPAGELOCKED);
11311274 pagelocked--;
 1275+ TRACE_EXIT(23,DD_OK);
11321276 return DD_OK;
11331277 }
11341278 // ddraw 3+ api
11351279 HRESULT WINAPI glDirectDrawSurface7::SetSurfaceDesc(LPDDSURFACEDESC2 lpddsd2, DWORD dwFlags)
11361280 {
1137 - if(!this) return DDERR_INVALIDOBJECT;
 1281+ TRACE_ENTER(3,14,this,14,lpddsd2,9,dwFlags);
 1282+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
11381283 FIXME("glDirectDrawSurface7::SetSurfaceDesc: stub\n");
 1284+ TRACE_EXIT(23,DDERR_GENERIC);
11391285 ERR(DDERR_GENERIC);
11401286 }
11411287 // ddraw 4+ api
1142 -HRESULT WINAPI glDirectDrawSurface7::SetPrivateData(REFGUID guidTag, LPVOID lpData, DWORD cbSize, DWORD dwFlags)
 1288+HRESULT WINAPI glDirectDrawSurface7::SetPrivateData(REFGUID guidTag, LPVOID lpData, DWORD cbSize, DWORD dwFlags)
11431289 {
1144 - if(!this) return DDERR_INVALIDOBJECT;
 1290+ TRACE_ENTER(5,14,this,24,&guidTag,14,lpData,8,cbSize,9,dwFlags);
 1291+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
11451292 FIXME("glDirectDrawSurface7::SetPrivateData: stub\n");
 1293+ TRACE_EXIT(23,DDERR_GENERIC);
11461294 ERR(DDERR_GENERIC);
11471295 }
1148 -HRESULT WINAPI glDirectDrawSurface7::GetPrivateData(REFGUID guidTag, LPVOID lpBuffer, LPDWORD lpcbBufferSize)
 1296+HRESULT WINAPI glDirectDrawSurface7::GetPrivateData(REFGUID guidTag, LPVOID lpBuffer, LPDWORD lpcbBufferSize)
11491297 {
1150 - if(!this) return DDERR_INVALIDOBJECT;
 1298+ TRACE_ENTER(4,14,this,24,&guidTag,14,lpBuffer,14,lpcbBufferSize);
 1299+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
11511300 FIXME("glDirectDrawSurface7::GetPrivateData: stub\n");
 1301+ TRACE_EXIT(23,DDERR_GENERIC);
11521302 ERR(DDERR_GENERIC);
11531303 }
11541304 HRESULT WINAPI glDirectDrawSurface7::FreePrivateData(REFGUID guidTag)
11551305 {
1156 - if(!this) return DDERR_INVALIDOBJECT;
 1306+ TRACE_ENTER(2,14,this,24,&guidTag);
 1307+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
11571308 FIXME("glDirectDrawSurface7::FreePrivateData: stub\n");
 1309+ TRACE_EXIT(23,DDERR_GENERIC);
11581310 ERR(DDERR_GENERIC);
11591311 }
11601312 HRESULT WINAPI glDirectDrawSurface7::GetUniquenessValue(LPDWORD lpValue)
11611313 {
1162 - if(!this) return DDERR_INVALIDOBJECT;
 1314+ TRACE_ENTER(2,14,this,14,lpValue);
 1315+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
11631316 FIXME("glDirectDrawSurface7::GetUniquenessValue: stub\n");
 1317+ TRACE_EXIT(23,DDERR_GENERIC);
11641318 ERR(DDERR_GENERIC);
11651319 }
11661320 HRESULT WINAPI glDirectDrawSurface7::ChangeUniquenessValue()
11671321 {
1168 - if(!this) return DDERR_INVALIDOBJECT;
 1322+ TRACE_ENTER(1,14,this);
 1323+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
11691324 FIXME("glDirectDrawSurface7::ChangeUniquenessValue: stub\n");
 1325+ TRACE_EXIT(23,DDERR_GENERIC);
11701326 ERR(DDERR_GENERIC);
11711327 }
11721328 // ddraw 7 api
11731329 HRESULT WINAPI glDirectDrawSurface7::SetPriority(DWORD dwPriority)
11741330 {
1175 - if(!this) return DDERR_INVALIDOBJECT;
 1331+ TRACE_ENTER(2,14,this,8,dwPriority);
 1332+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
11761333 FIXME("glDirectDrawSurface7::SetPriority: stub\n");
 1334+ TRACE_EXIT(23,DDERR_GENERIC);
11771335 ERR(DDERR_GENERIC);
11781336 }
11791337 HRESULT WINAPI glDirectDrawSurface7::GetPriority(LPDWORD lpdwPriority)
11801338 {
1181 - if(!this) return DDERR_INVALIDOBJECT;
 1339+ TRACE_ENTER(2,14,this,14,lpdwPriority);
 1340+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
11821341 FIXME("glDirectDrawSurface7::GetPriority: stub\n");
 1342+ TRACE_EXIT(23,DDERR_GENERIC);
11831343 ERR(DDERR_GENERIC);
11841344 }
11851345 HRESULT WINAPI glDirectDrawSurface7::SetLOD(DWORD dwMaxLOD)
11861346 {
1187 - if(!this) return DDERR_INVALIDOBJECT;
 1347+ TRACE_ENTER(2,14,this,8,dwMaxLOD);
 1348+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
11881349 FIXME("glDirectDrawSurface7::SetLOD: stub\n");
 1350+ TRACE_EXIT(23,DDERR_GENERIC);
11891351 ERR(DDERR_GENERIC);
11901352 }
11911353 HRESULT WINAPI glDirectDrawSurface7::GetLOD(LPDWORD lpdwMaxLOD)
11921354 {
1193 - if(!this) return DDERR_INVALIDOBJECT;
 1355+ TRACE_ENTER(2,14,this,14,lpdwMaxLOD);
 1356+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
11941357 FIXME("glDirectDrawSurface7::GetLOD: stub\n");
 1358+ TRACE_EXIT(23,DDERR_GENERIC);
11951359 ERR(DDERR_GENERIC);
11961360 }
11971361 HRESULT WINAPI glDirectDrawSurface7::Unlock2(LPVOID lpSurfaceData)
11981362 {
1199 - if(!this) return DDERR_INVALIDOBJECT;
1200 - return Unlock((LPRECT)lpSurfaceData);
 1363+ TRACE_ENTER(2,14,this,14,lpSurfaceData);
 1364+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1365+ TRACE_RET(23,Unlock((LPRECT)lpSurfaceData));
12011366 }
12021367 void glDirectDrawSurface7::SetFilter(int level, GLint mag, GLint min)
12031368 {
 1369+ TRACE_ENTER(4,14,this,11,level,11,mag,11,min);
12041370 switch(dxglcfg.texfilter)
12051371 {
12061372 default:
@@ -1239,32 +1405,39 @@
12401406 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,min);
12411407 minfilter = min;
12421408 //}
 1409+ TRACE_EXIT(0,0);
12431410 }
12441411
12451412 HRESULT glDirectDrawSurface7::GetHandle(glDirect3DDevice7 *glD3DDev7, LPD3DTEXTUREHANDLE lpHandle)
12461413 {
1247 - if(!this) return DDERR_INVALIDOBJECT;
1248 - if(!glD3DDev7) return DDERR_INVALIDPARAMS;
 1414+ TRACE_ENTER(3,14,this,14,glD3DDev7,14,lpHandle);
 1415+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1416+ if(!glD3DDev7) TRACE_RET(23,DDERR_INVALIDPARAMS);
12491417 if(handle)
12501418 {
1251 - if(device != glD3DDev7) return DDERR_INVALIDOBJECT;
 1419+ if(device != glD3DDev7) TRACE_RET(23,DDERR_INVALIDOBJECT);
12521420 *lpHandle = handle;
 1421+ TRACE_EXIT(23,D3D_OK);
12531422 return D3D_OK;
12541423 }
12551424 device = glD3DDev7;
12561425 handle = device->AddTexture(this);
1257 - if(handle == -1) return DDERR_OUTOFMEMORY;
 1426+ if(handle == -1) TRACE_RET(23,DDERR_OUTOFMEMORY);
12581427 device->AddRef();
12591428 *lpHandle = handle;
 1429+ TRACE_VAR("*lpHandle",9,*lpHandle);
 1430+ TRACE_EXIT(23,D3D_OK);
12601431 return D3D_OK;
12611432 }
12621433
12631434 HRESULT glDirectDrawSurface7::Load(glDirectDrawSurface7 *src)
12641435 {
1265 - if(!this) return DDERR_INVALIDOBJECT;
1266 - if(!src) return DDERR_INVALIDPARAMS;
 1436+ TRACE_ENTER(2,14,this,14,src);
 1437+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1438+ if(!src) TRACE_RET(23,DDERR_INVALIDPARAMS);
12671439 this->Blt(NULL,src,NULL,DDBLT_WAIT,NULL);
12681440 ddsd.ddsCaps.dwCaps &= ~DDSCAPS_ALLOCONLOAD;
 1441+ TRACE_EXIT(23,D3D_OK);
12691442 return D3D_OK;
12701443 }
12711444
@@ -1272,93 +1445,114 @@
12731446 // DDRAW1 wrapper
12741447 glDirectDrawSurface1::glDirectDrawSurface1(glDirectDrawSurface7 *gl_DDS7)
12751448 {
 1449+ TRACE_ENTER(2,14,this,14,gl_DDS7);
12761450 glDDS7 = gl_DDS7;
12771451 refcount = 1;
 1452+ TRACE_EXIT(-1,0);
12781453 }
12791454 glDirectDrawSurface1::~glDirectDrawSurface1()
12801455 {
 1456+ TRACE_ENTER(1,14,this);
12811457 glDDS7->dds1 = NULL;
12821458 glDDS7->Release();
 1459+ TRACE_EXIT(-1,0);
12831460 }
12841461 HRESULT WINAPI glDirectDrawSurface1::QueryInterface(REFIID riid, void** ppvObj)
12851462 {
1286 - if(!this) return DDERR_INVALIDOBJECT;
 1463+ TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
 1464+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
12871465 if(riid == IID_IUnknown)
12881466 {
12891467 this->AddRef();
12901468 *ppvObj = this;
 1469+ TRACE_VAR("*ppvObj",14,*ppvObj);
 1470+ TRACE_EXIT(23,DD_OK);
12911471 return DD_OK;
12921472 }
1293 - return glDDS7->QueryInterface(riid,ppvObj);
 1473+ TRACE_RET(23,glDDS7->QueryInterface(riid,ppvObj));
12941474 }
12951475 ULONG WINAPI glDirectDrawSurface1::AddRef()
12961476 {
1297 - if(!this) return 0;
 1477+ TRACE_ENTER(1,14,this);
 1478+ if(!this) TRACE_RET(8,0);
12981479 refcount++;
 1480+ TRACE_EXIT(8,refcount);
12991481 return refcount;
13001482 }
13011483 ULONG WINAPI glDirectDrawSurface1::Release()
13021484 {
1303 - if(!this) return 0;
 1485+ TRACE_ENTER(1,14,this);
 1486+ if(!this) TRACE_RET(8,0);
13041487 ULONG ret;
13051488 refcount--;
13061489 ret = refcount;
13071490 if(refcount == 0) delete this;
 1491+ TRACE_EXIT(8,ret);
13081492 return ret;
13091493 }
13101494 HRESULT WINAPI glDirectDrawSurface1::AddAttachedSurface(LPDIRECTDRAWSURFACE lpDDSAttachedSurface)
13111495 {
1312 - if(!this) return DDERR_INVALIDOBJECT;
1313 - if(!lpDDSAttachedSurface) return DDERR_INVALIDPARAMS;
1314 - return glDDS7->AddAttachedSurface(((glDirectDrawSurface1*)lpDDSAttachedSurface)->GetDDS7());
 1496+ TRACE_ENTER(2,14,this,14,lpDDSAttachedSurface);
 1497+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1498+ if(!lpDDSAttachedSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1499+ TRACE_RET(23,glDDS7->AddAttachedSurface(((glDirectDrawSurface1*)lpDDSAttachedSurface)->GetDDS7()));
13151500 }
13161501 HRESULT WINAPI glDirectDrawSurface1::AddOverlayDirtyRect(LPRECT lpRect)
13171502 {
1318 - if(!this) return DDERR_INVALIDOBJECT;
1319 - return glDDS7->AddOverlayDirtyRect(lpRect);
 1503+ TRACE_ENTER(2,14,this,26,lpRect);
 1504+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1505+ TRACE_RET(23,glDDS7->AddOverlayDirtyRect(lpRect));
13201506 }
13211507 HRESULT WINAPI glDirectDrawSurface1::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
13221508 {
1323 - if(!this) return DDERR_INVALIDOBJECT;
1324 - if(lpDDSrcSurface) return glDDS7->Blt(lpDestRect,((glDirectDrawSurface1*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx);
1325 - else return glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx);
 1509+ TRACE_ENTER(6,14,this,26,lpDestRect,14,lpDDSrcSurface,14,lpSrcRect,9,dwFlags,14,lpDDBltFx);
 1510+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1511+ if(lpDDSrcSurface) {TRACE_RET(23,glDDS7->Blt(lpDestRect,((glDirectDrawSurface1*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx))}
 1512+ else TRACE_RET(23,glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx));
13261513 }
13271514 HRESULT WINAPI glDirectDrawSurface1::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
13281515 {
1329 - if(!this) return DDERR_INVALIDOBJECT;
1330 - return glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags);
 1516+ TRACE_ENTER(4,14,this,14,lpDDBltBatch,8,dwCount,9,dwFlags);
 1517+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1518+ TRACE_RET(23,glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags));
13311519 }
13321520 HRESULT WINAPI glDirectDrawSurface1::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
13331521 {
1334 - if(!this) return DDERR_INVALIDOBJECT;
1335 - return glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface1*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans);
 1522+ TRACE_ENTER(6,14,this,8,dwX,8,dwY,14,lpDDSrcSurface,26,lpSrcRect,9,dwTrans);
 1523+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1524+ TRACE_RET(23,glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface1*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans));
13361525 }
13371526 HRESULT WINAPI glDirectDrawSurface1::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSAttachedSurface)
13381527 {
1339 - if(!this) return DDERR_INVALIDOBJECT;
1340 - return glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
 1528+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSAttachedSurface);
 1529+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1530+ TRACE_RET(23,glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface));
13411531 }
13421532 HRESULT WINAPI glDirectDrawSurface1::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
13431533 {
1344 - if(!this) return DDERR_INVALIDOBJECT;
1345 - return glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback);
 1534+ TRACE_ENTER(3,14,this,14,lpContext,14,lpEnumSurfacesCallback);
 1535+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1536+ TRACE_RET(23,glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback));
13461537 }
13471538 HRESULT WINAPI glDirectDrawSurface1::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
13481539 {
1349 - if(!this) return DDERR_INVALIDOBJECT;
1350 - return glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback);
 1540+ TRACE_ENTER(4,14,this,9,dwFlags,14,lpContext,14,lpfnCallback);
 1541+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1542+ TRACE_RET(23,glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback));
13511543 }
13521544 HRESULT WINAPI glDirectDrawSurface1::Flip(LPDIRECTDRAWSURFACE lpDDSurfaceTargetOverride, DWORD dwFlags)
13531545 {
1354 - if(!this) return DDERR_INVALIDOBJECT;
 1546+ TRACE_ENTER(3,14,this,14,lpDDSurfaceTargetOverride,9,dwFlags);
 1547+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
13551548 if(lpDDSurfaceTargetOverride)
1356 - return glDDS7->Flip(((glDirectDrawSurface1*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags);
1357 - else return glDDS7->Flip(NULL,dwFlags);
 1549+ {TRACE_RET(23,glDDS7->Flip(((glDirectDrawSurface1*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags));}
 1550+ else TRACE_RET(23,glDDS7->Flip(NULL,dwFlags));
13581551 }
13591552 HRESULT WINAPI glDirectDrawSurface1::GetAttachedSurface(LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE FAR *lplpDDAttachedSurface)
13601553 {
1361 - if(!this) return DDERR_INVALIDOBJECT;
1362 - if(!lpDDSCaps) return DDERR_INVALIDPARAMS;
 1554+ TRACE_ENTER(3,14,this,14,lpDDSCaps,14,lplpDDAttachedSurface);
 1555+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1556+ if(!lpDDSCaps) TRACE_RET(23,DDERR_INVALIDPARAMS);
13631557 HRESULT error;
13641558 glDirectDrawSurface7 *attachedsurface;
13651559 glDirectDrawSurface1 *attached1;
@@ -1371,220 +1565,267 @@
13721566 attachedsurface->QueryInterface(IID_IDirectDrawSurface,(void **)&attached1);
13731567 attachedsurface->Release();
13741568 *lplpDDAttachedSurface = attached1;
 1569+ TRACE_VAR("*lplpDDAttachedSurface",14,*lplpDDAttachedSurface);
13751570 }
 1571+ TRACE_EXIT(23,error);
13761572 return error;
13771573 }
13781574 HRESULT WINAPI glDirectDrawSurface1::GetBltStatus(DWORD dwFlags)
13791575 {
1380 - if(!this) return DDERR_INVALIDOBJECT;
1381 - return glDDS7->GetBltStatus(dwFlags);
 1576+ TRACE_ENTER(2,14,this,9,dwFlags);
 1577+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1578+ TRACE_RET(23,glDDS7->GetBltStatus(dwFlags));
13821579 }
13831580 HRESULT WINAPI glDirectDrawSurface1::GetCaps(LPDDSCAPS lpDDSCaps)
13841581 {
1385 - if(!this) return DDERR_INVALIDOBJECT;
1386 - if(!lpDDSCaps) return DDERR_INVALIDPARAMS;
 1582+ TRACE_ENTER(2,14,this,14,lpDDSCaps);
 1583+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1584+ if(!lpDDSCaps) TRACE_RET(23,DDERR_INVALIDPARAMS);
13871585 HRESULT error;
13881586 DDSCAPS2 ddsCaps1;
13891587 error = glDDS7->GetCaps(&ddsCaps1);
13901588 ZeroMemory(&ddsCaps1,sizeof(DDSCAPS2));
13911589 memcpy(lpDDSCaps,&ddsCaps1,sizeof(DDSCAPS));
 1590+ TRACE_EXIT(23,error);
13921591 return error;
13931592 }
13941593 HRESULT WINAPI glDirectDrawSurface1::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
13951594 {
1396 - if(!this) return DDERR_INVALIDOBJECT;
1397 - return glDDS7->GetClipper(lplpDDClipper);
 1595+ TRACE_ENTER(2,14,this,14,lplpDDClipper);
 1596+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1597+ TRACE_RET(23,glDDS7->GetClipper(lplpDDClipper));
13981598 }
13991599 HRESULT WINAPI glDirectDrawSurface1::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
14001600 {
1401 - if(!this) return DDERR_INVALIDOBJECT;
1402 - return glDDS7->GetColorKey(dwFlags,lpDDColorKey);
 1601+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
 1602+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1603+ TRACE_RET(23,glDDS7->GetColorKey(dwFlags,lpDDColorKey));
14031604 }
14041605 HRESULT WINAPI glDirectDrawSurface1::GetDC(HDC FAR *lphDC)
14051606 {
1406 - if(!this) return DDERR_INVALIDOBJECT;
1407 - return glDDS7->GetDC(lphDC);
 1607+ TRACE_ENTER(2,14,this,14,lphDC);
 1608+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1609+ TRACE_RET(23,glDDS7->GetDC(lphDC));
14081610 }
14091611 HRESULT WINAPI glDirectDrawSurface1::GetFlipStatus(DWORD dwFlags)
14101612 {
1411 - if(!this) return DDERR_INVALIDOBJECT;
1412 - return glDDS7->GetFlipStatus(dwFlags);
 1613+ TRACE_ENTER(2,14,this,9,dwFlags);
 1614+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1615+ TRACE_RET(23,glDDS7->GetFlipStatus(dwFlags));
14131616 }
14141617 HRESULT WINAPI glDirectDrawSurface1::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
14151618 {
1416 - if(!this) return DDERR_INVALIDOBJECT;
1417 - return glDDS7->GetOverlayPosition(lplX,lplY);
 1619+ TRACE_ENTER(3,14,this,14,lplX,14,lplY);
 1620+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1621+ TRACE_RET(23,glDDS7->GetOverlayPosition(lplX,lplY));
14181622 }
14191623 HRESULT WINAPI glDirectDrawSurface1::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
14201624 {
1421 - if(!this) return DDERR_INVALIDOBJECT;
1422 - return glDDS7->GetPalette(lplpDDPalette);
 1625+ TRACE_ENTER(2,14,this,14,lplpDDPalette);
 1626+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1627+ TRACE_RET(23,glDDS7->GetPalette(lplpDDPalette));
14231628 }
14241629 HRESULT WINAPI glDirectDrawSurface1::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
14251630 {
1426 - if(!this) return DDERR_INVALIDOBJECT;
1427 - return glDDS7->GetPixelFormat(lpDDPixelFormat);
 1631+ TRACE_ENTER(2,14,this,14,lpDDPixelFormat);
 1632+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1633+ TRACE_RET(23,glDDS7->GetPixelFormat(lpDDPixelFormat));
14281634 }
14291635 HRESULT WINAPI glDirectDrawSurface1::GetSurfaceDesc(LPDDSURFACEDESC lpDDSurfaceDesc)
14301636 {
1431 - if(!this) return DDERR_INVALIDOBJECT;
1432 - return glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc);
 1637+ TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc);
 1638+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1639+ TRACE_RET(23,glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc));
14331640 }
14341641 HRESULT WINAPI glDirectDrawSurface1::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc)
14351642 {
1436 - if(!this) return DDERR_INVALIDOBJECT;
 1643+ TRACE_ENTER(3,14,this,14,lpDD,14,lpDDSurfaceDesc);
 1644+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1645+ TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
14371646 return DDERR_ALREADYINITIALIZED;
14381647 }
14391648 HRESULT WINAPI glDirectDrawSurface1::IsLost()
14401649 {
1441 - if(!this) return DDERR_INVALIDOBJECT;
1442 - return glDDS7->IsLost();
 1650+ TRACE_ENTER(1,14,this);
 1651+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1652+ TRACE_RET(23,glDDS7->IsLost());
14431653 }
14441654 HRESULT WINAPI glDirectDrawSurface1::Lock(LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
14451655 {
1446 - if(!this) return DDERR_INVALIDOBJECT;
1447 - return glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent);
 1656+ TRACE_ENTER(5,14,this,26,lpDestRect,14,lpDDSurfaceDesc,9,dwFlags,14,hEvent);
 1657+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1658+ TRACE_RET(23,glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent));
14481659 }
14491660 HRESULT WINAPI glDirectDrawSurface1::ReleaseDC(HDC hDC)
14501661 {
1451 - if(!this) return DDERR_INVALIDOBJECT;
1452 - return glDDS7->ReleaseDC(hDC);
 1662+ TRACE_ENTER(2,14,this,14,hDC);
 1663+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1664+ TRACE_RET(23,glDDS7->ReleaseDC(hDC));
14531665 }
14541666 HRESULT WINAPI glDirectDrawSurface1::Restore()
14551667 {
1456 - if(!this) return DDERR_INVALIDOBJECT;
1457 - return glDDS7->Restore();
 1668+ TRACE_ENTER(1,14,this);
 1669+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1670+ TRACE_RET(23,glDDS7->Restore());
14581671 }
14591672 HRESULT WINAPI glDirectDrawSurface1::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
14601673 {
1461 - if(!this) return DDERR_INVALIDOBJECT;
1462 - return glDDS7->SetClipper(lpDDClipper);
 1674+ TRACE_ENTER(2,14,this,14,lpDDClipper);
 1675+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1676+ TRACE_RET(23,glDDS7->SetClipper(lpDDClipper));
14631677 }
14641678 HRESULT WINAPI glDirectDrawSurface1::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
14651679 {
1466 - if(!this) return DDERR_INVALIDOBJECT;
1467 - return glDDS7->SetColorKey(dwFlags,lpDDColorKey);
 1680+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
 1681+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1682+ TRACE_RET(23,glDDS7->SetColorKey(dwFlags,lpDDColorKey));
14681683 }
14691684 HRESULT WINAPI glDirectDrawSurface1::SetOverlayPosition(LONG lX, LONG lY)
14701685 {
1471 - if(!this) return DDERR_INVALIDOBJECT;
1472 - return glDDS7->SetOverlayPosition(lX,lY);
 1686+ TRACE_ENTER(3,14,this,7,lX,7,lY);
 1687+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1688+ TRACE_RET(23,glDDS7->SetOverlayPosition(lX,lY));
14731689 }
14741690 HRESULT WINAPI glDirectDrawSurface1::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
14751691 {
1476 - if(!this) return DDERR_INVALIDOBJECT;
1477 - return glDDS7->SetPalette(lpDDPalette);
 1692+ TRACE_ENTER(2,14,this,14,lpDDPalette);
 1693+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1694+ TRACE_RET(23,glDDS7->SetPalette(lpDDPalette));
14781695 }
14791696 HRESULT WINAPI glDirectDrawSurface1::Unlock(LPVOID lpSurfaceData)
14801697 {
1481 - if(!this) return DDERR_INVALIDOBJECT;
1482 - return glDDS7->Unlock2(lpSurfaceData);
 1698+ TRACE_ENTER(2,14,this,14,lpSurfaceData);
 1699+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1700+ TRACE_RET(23,glDDS7->Unlock2(lpSurfaceData));
14831701 }
14841702 HRESULT WINAPI glDirectDrawSurface1::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
14851703 {
1486 - if(!this) return DDERR_INVALIDOBJECT;
1487 - return glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx);
 1704+ TRACE_ENTER(6,14,this,26,lpSrcRect,14,lpDDDestSurface,26,lpDestRect,9,dwFlags,14,lpDDOverlayFx);
 1705+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1706+ TRACE_RET(23,glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx));
14881707 }
14891708 HRESULT WINAPI glDirectDrawSurface1::UpdateOverlayDisplay(DWORD dwFlags)
14901709 {
1491 - if(!this) return DDERR_INVALIDOBJECT;
1492 - return glDDS7->UpdateOverlayDisplay(dwFlags);
 1710+ TRACE_ENTER(2,14,this,9,dwFlags);
 1711+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1712+ TRACE_RET(23,glDDS7->UpdateOverlayDisplay(dwFlags));
14931713 }
14941714 HRESULT WINAPI glDirectDrawSurface1::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSReference)
14951715 {
1496 - if(!this) return DDERR_INVALIDOBJECT;
1497 - return glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference);
 1716+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSReference);
 1717+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1718+ TRACE_RET(23,glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference));
14981719 }
14991720
15001721 // DDRAW2 wrapper
15011722 glDirectDrawSurface2::glDirectDrawSurface2(glDirectDrawSurface7 *gl_DDS7)
15021723 {
 1724+ TRACE_ENTER(2,14,this,14,gl_DDS7);
15031725 glDDS7 = gl_DDS7;
15041726 refcount = 1;
 1727+ TRACE_EXIT(-1,0);
15051728 }
15061729 glDirectDrawSurface2::~glDirectDrawSurface2()
15071730 {
 1731+ TRACE_ENTER(1,14,this);
15081732 glDDS7->dds2 = NULL;
15091733 glDDS7->Release();
 1734+ TRACE_EXIT(-1,0);
15101735 }
15111736 HRESULT WINAPI glDirectDrawSurface2::QueryInterface(REFIID riid, void** ppvObj)
15121737 {
1513 - if(!this) return DDERR_INVALIDOBJECT;
 1738+ TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
 1739+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
15141740 if(riid == IID_IUnknown)
15151741 {
15161742 this->AddRef();
15171743 *ppvObj = this;
 1744+ TRACE_EXIT(23,DD_OK);
15181745 return DD_OK;
15191746 }
1520 - return glDDS7->QueryInterface(riid,ppvObj);
 1747+ TRACE_RET(23,glDDS7->QueryInterface(riid,ppvObj));
15211748 }
15221749 ULONG WINAPI glDirectDrawSurface2::AddRef()
15231750 {
1524 - if(!this) return 0;
 1751+ TRACE_ENTER(1,14,this);
 1752+ if(!this) TRACE_RET(8,0);
15251753 refcount++;
 1754+ TRACE_EXIT(8,refcount);
15261755 return refcount;
15271756 }
15281757 ULONG WINAPI glDirectDrawSurface2::Release()
15291758 {
1530 - if(!this) return 0;
 1759+ TRACE_ENTER(1,14,this);
 1760+ if(!this) TRACE_RET(8,0);
15311761 ULONG ret;
15321762 refcount--;
15331763 ret = refcount;
15341764 if(refcount == 0) delete this;
 1765+ TRACE_EXIT(8,ret);
15351766 return ret;
15361767 }
15371768 HRESULT WINAPI glDirectDrawSurface2::AddAttachedSurface(LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface)
15381769 {
1539 - if(!this) return DDERR_INVALIDOBJECT;
1540 - if(!lpDDSAttachedSurface) return DDERR_INVALIDPARAMS;
1541 - return glDDS7->AddAttachedSurface(((glDirectDrawSurface2*)lpDDSAttachedSurface)->GetDDS7());
 1770+ TRACE_ENTER(2,14,this,14,lpDDSAttachedSurface);
 1771+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1772+ if(!lpDDSAttachedSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1773+ TRACE_RET(23,glDDS7->AddAttachedSurface(((glDirectDrawSurface2*)lpDDSAttachedSurface)->GetDDS7()));
15421774 }
15431775 HRESULT WINAPI glDirectDrawSurface2::AddOverlayDirtyRect(LPRECT lpRect)
15441776 {
1545 - if(!this) return DDERR_INVALIDOBJECT;
1546 - return glDDS7->AddOverlayDirtyRect(lpRect);
 1777+ TRACE_ENTER(2,14,this,26,lpRect);
 1778+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1779+ TRACE_RET(23,glDDS7->AddOverlayDirtyRect(lpRect));
15471780 }
15481781 HRESULT WINAPI glDirectDrawSurface2::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
15491782 {
1550 - if(!this) return DDERR_INVALIDOBJECT;
1551 - if(lpDDSrcSurface) return glDDS7->Blt(lpDestRect,((glDirectDrawSurface2*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx);
1552 - else return glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx);
 1783+ TRACE_ENTER(6,14,this,26,lpDestRect,14,lpDDSrcSurface,26,lpSrcRect,9,dwFlags,14,lpDDBltFx);
 1784+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1785+ if(lpDDSrcSurface) {TRACE_RET(23,glDDS7->Blt(lpDestRect,((glDirectDrawSurface2*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx));}
 1786+ else TRACE_RET(23,glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx));
15531787 }
15541788 HRESULT WINAPI glDirectDrawSurface2::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
15551789 {
1556 - if(!this) return DDERR_INVALIDOBJECT;
1557 - return glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags);
 1790+ TRACE_ENTER(4,14,this,14,lpDDBltBatch,8,dwCount,9,dwFlags);
 1791+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1792+ TRACE_RET(23,glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags));
15581793 }
15591794 HRESULT WINAPI glDirectDrawSurface2::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
15601795 {
1561 - if(!this) return DDERR_INVALIDOBJECT;
1562 - return glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface2*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans);
 1796+ TRACE_ENTER(6,14,this,8,dwX,8,dwY,4,lpDDSrcSurface,26,lpSrcRect,9,dwTrans);
 1797+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1798+ TRACE_RET(23,glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface2*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans));
15631799 }
15641800 HRESULT WINAPI glDirectDrawSurface2::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface)
15651801 {
1566 - if(!this) return DDERR_INVALIDOBJECT;
1567 - return glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
 1802+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSAttachedSurface);
 1803+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1804+ TRACE_RET(23,glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface));
15681805 }
15691806 HRESULT WINAPI glDirectDrawSurface2::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
15701807 {
1571 - if(!this) return DDERR_INVALIDOBJECT;
1572 - return glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback);
 1808+ TRACE_ENTER(3,14,this,14,lpContext,14,lpEnumSurfacesCallback);
 1809+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1810+ TRACE_RET(23,glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback));
15731811 }
15741812 HRESULT WINAPI glDirectDrawSurface2::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
15751813 {
1576 - if(!this) return DDERR_INVALIDOBJECT;
1577 - return glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback);
 1814+ TRACE_ENTER(4,14,this,9,dwFlags,14,lpContext,14,lpfnCallback);
 1815+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1816+ TRACE_RET(23,glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback));
15781817 }
15791818 HRESULT WINAPI glDirectDrawSurface2::Flip(LPDIRECTDRAWSURFACE2 lpDDSurfaceTargetOverride, DWORD dwFlags)
15801819 {
1581 - if(!this) return DDERR_INVALIDOBJECT;
 1820+ TRACE_ENTER(3,14,this,14,lpDDSurfaceTargetOverride,9,dwFlags);
 1821+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
15821822 if(lpDDSurfaceTargetOverride)
1583 - return glDDS7->Flip(((glDirectDrawSurface2*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags);
1584 - else return glDDS7->Flip(NULL,dwFlags);
 1823+ {TRACE_RET(23,glDDS7->Flip(((glDirectDrawSurface2*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags));}
 1824+ else TRACE_RET(23,glDDS7->Flip(NULL,dwFlags));
15851825 }
15861826 HRESULT WINAPI glDirectDrawSurface2::GetAttachedSurface(LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE2 FAR *lplpDDAttachedSurface)
15871827 {
1588 - if(!this) return DDERR_INVALIDOBJECT;
 1828+ TRACE_ENTER(3,14,this,14,lpDDSCaps,14,lplpDDAttachedSurface);
 1829+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
15891830 HRESULT error;
15901831 glDirectDrawSurface7 *attachedsurface;
15911832 glDirectDrawSurface2 *attached1;
@@ -1597,240 +1838,292 @@
15981839 attachedsurface->QueryInterface(IID_IDirectDrawSurface2,(void **)&attached1);
15991840 attachedsurface->Release();
16001841 *lplpDDAttachedSurface = attached1;
 1842+ TRACE_VAR("*lplpDDAttachedSurface",14,*lplpDDAttachedSurface);
16011843 }
 1844+ TRACE_EXIT(23,error);
16021845 return error;
16031846 }
16041847 HRESULT WINAPI glDirectDrawSurface2::GetBltStatus(DWORD dwFlags)
16051848 {
1606 - if(!this) return DDERR_INVALIDOBJECT;
1607 - return glDDS7->GetBltStatus(dwFlags);
 1849+ TRACE_ENTER(2,14,this,9,dwFlags);
 1850+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1851+ TRACE_RET(23,glDDS7->GetBltStatus(dwFlags));
16081852 }
16091853 HRESULT WINAPI glDirectDrawSurface2::GetCaps(LPDDSCAPS lpDDSCaps)
16101854 {
1611 - if(!this) return DDERR_INVALIDOBJECT;
1612 - if(!lpDDSCaps) return DDERR_INVALIDPARAMS;
 1855+ TRACE_ENTER(2,14,this,14,lpDDSCaps);
 1856+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1857+ if(!lpDDSCaps) TRACE_RET(23,DDERR_INVALIDPARAMS);
16131858 HRESULT error;
16141859 DDSCAPS2 ddsCaps1;
16151860 error = glDDS7->GetCaps(&ddsCaps1);
16161861 ZeroMemory(&ddsCaps1,sizeof(DDSCAPS2));
16171862 memcpy(lpDDSCaps,&ddsCaps1,sizeof(DDSCAPS));
 1863+ TRACE_EXIT(23,error);
16181864 return error;
16191865 }
16201866 HRESULT WINAPI glDirectDrawSurface2::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
16211867 {
1622 - if(!this) return DDERR_INVALIDOBJECT;
1623 - return glDDS7->GetClipper(lplpDDClipper);
 1868+ TRACE_ENTER(2,14,this,14,lplpDDClipper);
 1869+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1870+ TRACE_RET(23,glDDS7->GetClipper(lplpDDClipper));
16241871 }
16251872 HRESULT WINAPI glDirectDrawSurface2::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
16261873 {
1627 - if(!this) return DDERR_INVALIDOBJECT;
1628 - return glDDS7->GetColorKey(dwFlags,lpDDColorKey);
 1874+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
 1875+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1876+ TRACE_RET(23,glDDS7->GetColorKey(dwFlags,lpDDColorKey));
16291877 }
16301878 HRESULT WINAPI glDirectDrawSurface2::GetDC(HDC FAR *lphDC)
16311879 {
1632 - if(!this) return DDERR_INVALIDOBJECT;
1633 - return glDDS7->GetDC(lphDC);
 1880+ TRACE_ENTER(2,14,this,14,lphDC);
 1881+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1882+ TRACE_RET(23,glDDS7->GetDC(lphDC));
16341883 }
16351884 HRESULT WINAPI glDirectDrawSurface2::GetFlipStatus(DWORD dwFlags)
16361885 {
1637 - if(!this) return DDERR_INVALIDOBJECT;
1638 - return glDDS7->GetFlipStatus(dwFlags);
 1886+ TRACE_ENTER(2,14,this,9,dwFlags);
 1887+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1888+ TRACE_RET(23,glDDS7->GetFlipStatus(dwFlags));
16391889 }
16401890 HRESULT WINAPI glDirectDrawSurface2::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
16411891 {
1642 - if(!this) return DDERR_INVALIDOBJECT;
1643 - return glDDS7->GetOverlayPosition(lplX,lplY);
 1892+ TRACE_ENTER(3,14,this,14,lplX,14,lplY);
 1893+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1894+ TRACE_RET(23,glDDS7->GetOverlayPosition(lplX,lplY));
16441895 }
16451896 HRESULT WINAPI glDirectDrawSurface2::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
16461897 {
1647 - if(!this) return DDERR_INVALIDOBJECT;
1648 - return glDDS7->GetPalette(lplpDDPalette);
 1898+ TRACE_ENTER(2,14,this,14,lplpDDPalette);
 1899+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1900+ TRACE_RET(23,glDDS7->GetPalette(lplpDDPalette));
16491901 }
16501902 HRESULT WINAPI glDirectDrawSurface2::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
16511903 {
1652 - if(!this) return DDERR_INVALIDOBJECT;
1653 - return glDDS7->GetPixelFormat(lpDDPixelFormat);
 1904+ TRACE_ENTER(2,14,this,14,lpDDPixelFormat);
 1905+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1906+ TRACE_RET(23,glDDS7->GetPixelFormat(lpDDPixelFormat));
16541907 }
16551908 HRESULT WINAPI glDirectDrawSurface2::GetSurfaceDesc(LPDDSURFACEDESC lpDDSurfaceDesc)
16561909 {
1657 - if(!this) return DDERR_INVALIDOBJECT;
1658 - return glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc);
 1910+ TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc);
 1911+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1912+ TRACE_RET(23,glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc));
16591913 }
16601914 HRESULT WINAPI glDirectDrawSurface2::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc)
16611915 {
1662 - if(!this) return DDERR_INVALIDOBJECT;
 1916+ TRACE_ENTER(3,14,this,14,lpDD,14,lpDDSurfaceDesc);
 1917+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1918+ TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
16631919 return DDERR_ALREADYINITIALIZED;
16641920 }
16651921 HRESULT WINAPI glDirectDrawSurface2::IsLost()
16661922 {
1667 - if(!this) return DDERR_INVALIDOBJECT;
1668 - return glDDS7->IsLost();
 1923+ TRACE_ENTER(1,14,this);
 1924+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1925+ TRACE_RET(23,glDDS7->IsLost());
16691926 }
16701927 HRESULT WINAPI glDirectDrawSurface2::Lock(LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
16711928 {
1672 - if(!this) return DDERR_INVALIDOBJECT;
1673 - return glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent);
 1929+ TRACE_ENTER(5,14,this,26,lpDestRect,14,lpDDSurfaceDesc,9,dwFlags,14,hEvent);
 1930+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1931+ TRACE_RET(23,glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent));
16741932 }
16751933 HRESULT WINAPI glDirectDrawSurface2::ReleaseDC(HDC hDC)
16761934 {
1677 - if(!this) return DDERR_INVALIDOBJECT;
1678 - return glDDS7->ReleaseDC(hDC);
 1935+ TRACE_ENTER(2,14,this,14,hDC);
 1936+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1937+ TRACE_RET(23,glDDS7->ReleaseDC(hDC));
16791938 }
16801939 HRESULT WINAPI glDirectDrawSurface2::Restore()
16811940 {
1682 - if(!this) return DDERR_INVALIDOBJECT;
1683 - return glDDS7->Restore();
 1941+ TRACE_ENTER(1,14,this);
 1942+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1943+ TRACE_RET(23,glDDS7->Restore());
16841944 }
16851945 HRESULT WINAPI glDirectDrawSurface2::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
16861946 {
1687 - if(!this) return DDERR_INVALIDOBJECT;
1688 - return glDDS7->SetClipper(lpDDClipper);
 1947+ TRACE_ENTER(2,14,this,14,lpDDClipper);
 1948+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1949+ TRACE_RET(23,glDDS7->SetClipper(lpDDClipper));
16891950 }
16901951 HRESULT WINAPI glDirectDrawSurface2::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
16911952 {
1692 - if(!this) return DDERR_INVALIDOBJECT;
1693 - return glDDS7->SetColorKey(dwFlags,lpDDColorKey);
 1953+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
 1954+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1955+ TRACE_RET(23,glDDS7->SetColorKey(dwFlags,lpDDColorKey));
16941956 }
16951957 HRESULT WINAPI glDirectDrawSurface2::SetOverlayPosition(LONG lX, LONG lY)
16961958 {
1697 - if(!this) return DDERR_INVALIDOBJECT;
1698 - return glDDS7->SetOverlayPosition(lX,lY);
 1959+ TRACE_ENTER(3,14,this,7,lX,7,lY);
 1960+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1961+ TRACE_RET(23,glDDS7->SetOverlayPosition(lX,lY));
16991962 }
17001963 HRESULT WINAPI glDirectDrawSurface2::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
17011964 {
1702 - if(!this) return DDERR_INVALIDOBJECT;
1703 - return glDDS7->SetPalette(lpDDPalette);
 1965+ TRACE_ENTER(2,14,this,14,lpDDPalette);
 1966+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1967+ TRACE_RET(23,glDDS7->SetPalette(lpDDPalette));
17041968 }
17051969 HRESULT WINAPI glDirectDrawSurface2::Unlock(LPVOID lpSurfaceData)
17061970 {
1707 - if(!this) return DDERR_INVALIDOBJECT;
1708 - return glDDS7->Unlock2(lpSurfaceData);
 1971+ TRACE_ENTER(2,14,this,14,lpSurfaceData);
 1972+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1973+ TRACE_RET(23,glDDS7->Unlock2(lpSurfaceData));
17091974 }
17101975 HRESULT WINAPI glDirectDrawSurface2::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE2 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
17111976 {
1712 - if(!this) return DDERR_INVALIDOBJECT;
1713 - return glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx);
 1977+ TRACE_ENTER(6,14,this,26,lpSrcRect,14,lpDDDestSurface,26,lpDestRect,9,dwFlags,14,lpDDOverlayFx);
 1978+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1979+ TRACE_RET(23,glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx));
17141980 }
17151981 HRESULT WINAPI glDirectDrawSurface2::UpdateOverlayDisplay(DWORD dwFlags)
17161982 {
1717 - if(!this) return DDERR_INVALIDOBJECT;
1718 - return glDDS7->UpdateOverlayDisplay(dwFlags);
 1983+ TRACE_ENTER(2,14,this,9,dwFlags);
 1984+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1985+ TRACE_RET(23,glDDS7->UpdateOverlayDisplay(dwFlags));
17191986 }
17201987 HRESULT WINAPI glDirectDrawSurface2::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSReference)
17211988 {
1722 - if(!this) return DDERR_INVALIDOBJECT;
1723 - return glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference);
 1989+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSReference);
 1990+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1991+ TRACE_RET(23,glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference));
17241992 }
17251993 HRESULT WINAPI glDirectDrawSurface2::GetDDInterface(LPVOID FAR *lplpDD)
17261994 {
1727 - if(!this) return DDERR_INVALIDOBJECT;
 1995+ TRACE_ENTER(2,14,this,14,lplpDD);
 1996+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
17281997 glDirectDraw7 *glDD7;
17291998 HRESULT ret = glDDS7->GetDDInterface((void**)&glDD7);
1730 - if(ret != DD_OK) return ret;
 1999+ if(ret != DD_OK) TRACE_RET(23,ret);
17312000 glDD7->QueryInterface(IID_IDirectDraw,lplpDD);
17322001 glDD7->Release();
1733 - return ret;
 2002+ TRACE_VAR("*lplpDD",14,*lplpDD);
 2003+ TRACE_RET(23,ret);
17342004 }
17352005 HRESULT WINAPI glDirectDrawSurface2::PageLock(DWORD dwFlags)
17362006 {
1737 - if(!this) return DDERR_INVALIDOBJECT;
1738 - return glDDS7->PageLock(dwFlags);
 2007+ TRACE_ENTER(2,14,this,9,dwFlags);
 2008+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2009+ TRACE_RET(23,glDDS7->PageLock(dwFlags));
17392010 }
17402011 HRESULT WINAPI glDirectDrawSurface2::PageUnlock(DWORD dwFlags)
17412012 {
1742 - if(!this) return DDERR_INVALIDOBJECT;
1743 - return glDDS7->PageUnlock(dwFlags);
 2013+ TRACE_ENTER(2,14,this,9,dwFlags);
 2014+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2015+ TRACE_RET(23,glDDS7->PageUnlock(dwFlags));
17442016 }
17452017
17462018 // DDRAW3 wrapper
17472019 glDirectDrawSurface3::glDirectDrawSurface3(glDirectDrawSurface7 *gl_DDS7)
17482020 {
 2021+ TRACE_ENTER(2,14,this,14,gl_DDS7);
17492022 glDDS7 = gl_DDS7;
17502023 refcount = 1;
 2024+ TRACE_EXIT(-1,0);
17512025 }
17522026 glDirectDrawSurface3::~glDirectDrawSurface3()
17532027 {
 2028+ TRACE_ENTER(1,14,this);
17542029 glDDS7->dds3 = NULL;
17552030 glDDS7->Release();
 2031+ TRACE_EXIT(-1,0);
17562032 }
17572033 HRESULT WINAPI glDirectDrawSurface3::QueryInterface(REFIID riid, void** ppvObj)
17582034 {
1759 - if(!this) return DDERR_INVALIDOBJECT;
 2035+ TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
 2036+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
17602037 if(riid == IID_IUnknown)
17612038 {
17622039 this->AddRef();
17632040 *ppvObj = this;
 2041+ TRACE_VAR("*ppvObj",14,*ppvObj);
 2042+ TRACE_EXIT(23,DD_OK);
17642043 return DD_OK;
17652044 }
1766 - return glDDS7->QueryInterface(riid,ppvObj);
 2045+ TRACE_RET(23,glDDS7->QueryInterface(riid,ppvObj));
17672046 }
17682047 ULONG WINAPI glDirectDrawSurface3::AddRef()
17692048 {
 2049+ TRACE_ENTER(1,14,this);
17702050 if(!this) return 0;
17712051 refcount++;
 2052+ TRACE_EXIT(23,refcount);
17722053 return refcount;
17732054 }
17742055 ULONG WINAPI glDirectDrawSurface3::Release()
17752056 {
 2057+ TRACE_ENTER(1,14,this);
17762058 if(!this) return 0;
17772059 ULONG ret;
17782060 refcount--;
17792061 ret = refcount;
17802062 if(refcount == 0) delete this;
 2063+ TRACE_EXIT(23,ret);
17812064 return ret;
17822065 }
17832066 HRESULT WINAPI glDirectDrawSurface3::AddAttachedSurface(LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface)
17842067 {
1785 - if(!this) return DDERR_INVALIDOBJECT;
1786 - if(!lpDDSAttachedSurface) return DDERR_INVALIDPARAMS;
1787 - return glDDS7->AddAttachedSurface(((glDirectDrawSurface3*)lpDDSAttachedSurface)->GetDDS7());
 2068+ TRACE_ENTER(2,14,this,14,lpDDSAttachedSurface);
 2069+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2070+ if(!lpDDSAttachedSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
 2071+ TRACE_RET(23,glDDS7->AddAttachedSurface(((glDirectDrawSurface3*)lpDDSAttachedSurface)->GetDDS7()));
17882072 }
17892073 HRESULT WINAPI glDirectDrawSurface3::AddOverlayDirtyRect(LPRECT lpRect)
17902074 {
1791 - if(!this) return DDERR_INVALIDOBJECT;
1792 - return glDDS7->AddOverlayDirtyRect(lpRect);
 2075+ TRACE_ENTER(2,14,this,26,lpRect);
 2076+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2077+ TRACE_RET(23,glDDS7->AddOverlayDirtyRect(lpRect));
17932078 }
17942079 HRESULT WINAPI glDirectDrawSurface3::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
17952080 {
1796 - if(!this) return DDERR_INVALIDOBJECT;
1797 - if(lpDDSrcSurface) return glDDS7->Blt(lpDestRect,((glDirectDrawSurface3*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx);
1798 - else return glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx);
 2081+ TRACE_ENTER(6,14,this,26,lpDestRect,14,lpDDSrcSurface,26,lpSrcRect,9,dwFlags,14,lpDDBltFx);
 2082+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2083+ if(lpDDSrcSurface) {TRACE_RET(23,glDDS7->Blt(lpDestRect,((glDirectDrawSurface3*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx));}
 2084+ else TRACE_RET(23,glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx));
17992085 }
18002086 HRESULT WINAPI glDirectDrawSurface3::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
18012087 {
1802 - if(!this) return DDERR_INVALIDOBJECT;
1803 - return glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags);
 2088+ TRACE_ENTER(4,14,this,14,lpDDBltBatch,8,dwCount,9,dwFlags);
 2089+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2090+ TRACE_RET(23,glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags));
18042091 }
18052092 HRESULT WINAPI glDirectDrawSurface3::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
18062093 {
1807 - if(!this) return DDERR_INVALIDOBJECT;
1808 - return glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface3*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans);
 2094+ TRACE_ENTER(6,14,this,8,dwX,8,dwY,14,lpDDSrcSurface,26,lpSrcRect,9,dwTrans);
 2095+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2096+ TRACE_RET(23,glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface3*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans));
18092097 }
18102098 HRESULT WINAPI glDirectDrawSurface3::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface)
18112099 {
1812 - if(!this) return DDERR_INVALIDOBJECT;
1813 - return glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
 2100+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSAttachedSurface);
 2101+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2102+ TRACE_RET(23,glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface));
18142103 }
18152104 HRESULT WINAPI glDirectDrawSurface3::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
18162105 {
1817 - if(!this) return DDERR_INVALIDOBJECT;
1818 - return glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback);
 2106+ TRACE_ENTER(3,14,this,14,lpContext,14,lpEnumSurfacesCallback);
 2107+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2108+ TRACE_RET(23,glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback));
18192109 }
18202110 HRESULT WINAPI glDirectDrawSurface3::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
18212111 {
1822 - if(!this) return DDERR_INVALIDOBJECT;
1823 - return glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback);
 2112+ TRACE_ENTER(4,14,this,9,dwFlags,14,lpContext,14,lpfnCallback);
 2113+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2114+ TRACE_RET(23,glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback));
18242115 }
18252116 HRESULT WINAPI glDirectDrawSurface3::Flip(LPDIRECTDRAWSURFACE3 lpDDSurfaceTargetOverride, DWORD dwFlags)
18262117 {
1827 - if(!this) return DDERR_INVALIDOBJECT;
 2118+ TRACE_ENTER(3,14,this,14,lpDDSurfaceTargetOverride,9,dwFlags);
 2119+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
18282120 if(lpDDSurfaceTargetOverride)
1829 - return glDDS7->Flip(((glDirectDrawSurface3*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags);
1830 - else return glDDS7->Flip(NULL,dwFlags);
 2121+ {TRACE_RET(23,glDDS7->Flip(((glDirectDrawSurface3*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags));}
 2122+ else TRACE_RET(23,glDDS7->Flip(NULL,dwFlags));
18312123 }
18322124 HRESULT WINAPI glDirectDrawSurface3::GetAttachedSurface(LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE3 FAR *lplpDDAttachedSurface)
18332125 {
1834 - if(!this) return DDERR_INVALIDOBJECT;
 2126+ TRACE_ENTER(3,14,this,14,lpDDSCaps,14,lplpDDAttachedSurface);
 2127+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
18352128 HRESULT error;
18362129 glDirectDrawSurface7 *attachedsurface;
18372130 glDirectDrawSurface3 *attached1;
@@ -1843,244 +2136,298 @@
18442137 attachedsurface->QueryInterface(IID_IDirectDrawSurface3,(void **)&attached1);
18452138 attachedsurface->Release();
18462139 *lplpDDAttachedSurface = attached1;
 2140+ TRACE_VAR("*lplpDDAttachedSurface",14,*lplpDDAttachedSurface);
18472141 }
 2142+ TRACE_EXIT(23,error);
18482143 return error;
18492144 }
18502145 HRESULT WINAPI glDirectDrawSurface3::GetBltStatus(DWORD dwFlags)
18512146 {
1852 - if(!this) return DDERR_INVALIDOBJECT;
1853 - return glDDS7->GetBltStatus(dwFlags);
 2147+ TRACE_ENTER(2,14,this,9,dwFlags);
 2148+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2149+ TRACE_RET(23,glDDS7->GetBltStatus(dwFlags));
18542150 }
18552151 HRESULT WINAPI glDirectDrawSurface3::GetCaps(LPDDSCAPS lpDDSCaps)
18562152 {
1857 - if(!this) return DDERR_INVALIDOBJECT;
1858 - if(!lpDDSCaps) return DDERR_INVALIDPARAMS;
 2153+ TRACE_ENTER(2,14,this,14,lpDDSCaps);
 2154+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2155+ if(!lpDDSCaps) TRACE_RET(23,DDERR_INVALIDPARAMS);
18592156 HRESULT error;
18602157 DDSCAPS2 ddsCaps1;
18612158 error = glDDS7->GetCaps(&ddsCaps1);
18622159 ZeroMemory(&ddsCaps1,sizeof(DDSCAPS2));
18632160 memcpy(lpDDSCaps,&ddsCaps1,sizeof(DDSCAPS));
 2161+ TRACE_EXIT(23,error);
18642162 return error;
18652163 }
18662164 HRESULT WINAPI glDirectDrawSurface3::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
18672165 {
1868 - if(!this) return DDERR_INVALIDOBJECT;
1869 - return glDDS7->GetClipper(lplpDDClipper);
 2166+ TRACE_ENTER(2,14,this,14,lplpDDClipper);
 2167+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2168+ TRACE_RET(23,glDDS7->GetClipper(lplpDDClipper));
18702169 }
18712170 HRESULT WINAPI glDirectDrawSurface3::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
18722171 {
1873 - if(!this) return DDERR_INVALIDOBJECT;
1874 - return glDDS7->GetColorKey(dwFlags,lpDDColorKey);
 2172+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
 2173+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2174+ TRACE_RET(23,glDDS7->GetColorKey(dwFlags,lpDDColorKey));
18752175 }
18762176 HRESULT WINAPI glDirectDrawSurface3::GetDC(HDC FAR *lphDC)
18772177 {
1878 - if(!this) return DDERR_INVALIDOBJECT;
1879 - return glDDS7->GetDC(lphDC);
 2178+ TRACE_ENTER(2,14,this,14,lphDC);
 2179+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2180+ TRACE_RET(23,glDDS7->GetDC(lphDC));
18802181 }
18812182 HRESULT WINAPI glDirectDrawSurface3::GetFlipStatus(DWORD dwFlags)
18822183 {
1883 - if(!this) return DDERR_INVALIDOBJECT;
1884 - return glDDS7->GetFlipStatus(dwFlags);
 2184+ TRACE_ENTER(2,14,this,9,dwFlags);
 2185+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2186+ TRACE_RET(23,glDDS7->GetFlipStatus(dwFlags));
18852187 }
18862188 HRESULT WINAPI glDirectDrawSurface3::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
18872189 {
1888 - if(!this) return DDERR_INVALIDOBJECT;
1889 - return glDDS7->GetOverlayPosition(lplX,lplY);
 2190+ TRACE_ENTER(3,14,this,14,lplX,14,lplY);
 2191+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2192+ TRACE_RET(23,glDDS7->GetOverlayPosition(lplX,lplY));
18902193 }
18912194 HRESULT WINAPI glDirectDrawSurface3::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
18922195 {
1893 - if(!this) return DDERR_INVALIDOBJECT;
1894 - return glDDS7->GetPalette(lplpDDPalette);
 2196+ TRACE_ENTER(2,14,this,14,lplpDDPalette);
 2197+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2198+ TRACE_RET(23,glDDS7->GetPalette(lplpDDPalette));
18952199 }
18962200 HRESULT WINAPI glDirectDrawSurface3::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
18972201 {
1898 - if(!this) return DDERR_INVALIDOBJECT;
1899 - return glDDS7->GetPixelFormat(lpDDPixelFormat);
 2202+ TRACE_ENTER(2,14,this,14,lpDDPixelFormat);
 2203+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2204+ TRACE_RET(23,glDDS7->GetPixelFormat(lpDDPixelFormat));
19002205 }
19012206 HRESULT WINAPI glDirectDrawSurface3::GetSurfaceDesc(LPDDSURFACEDESC lpDDSurfaceDesc)
19022207 {
1903 - if(!this) return DDERR_INVALIDOBJECT;
1904 - return glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc);
 2208+ TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc);
 2209+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2210+ TRACE_RET(23,glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc));
19052211 }
19062212 HRESULT WINAPI glDirectDrawSurface3::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc)
19072213 {
1908 - if(!this) return DDERR_INVALIDOBJECT;
 2214+ TRACE_ENTER(3,14,this,14,lpDD,14,lpDDSurfaceDesc);
 2215+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2216+ TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
19092217 return DDERR_ALREADYINITIALIZED;
19102218 }
19112219 HRESULT WINAPI glDirectDrawSurface3::IsLost()
19122220 {
1913 - if(!this) return DDERR_INVALIDOBJECT;
1914 - return glDDS7->IsLost();
 2221+ TRACE_ENTER(1,14,this);
 2222+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2223+ TRACE_RET(23,glDDS7->IsLost());
19152224 }
19162225 HRESULT WINAPI glDirectDrawSurface3::Lock(LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
19172226 {
1918 - if(!this) return DDERR_INVALIDOBJECT;
1919 - return glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent);
 2227+ TRACE_ENTER(5,14,this,26,lpDestRect,14,lpDDSurfaceDesc,9,dwFlags,14,hEvent);
 2228+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2229+ TRACE_RET(23,glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent));
19202230 }
19212231 HRESULT WINAPI glDirectDrawSurface3::ReleaseDC(HDC hDC)
19222232 {
1923 - if(!this) return DDERR_INVALIDOBJECT;
1924 - return glDDS7->ReleaseDC(hDC);
 2233+ TRACE_ENTER(2,14,this,14,hDC);
 2234+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2235+ TRACE_RET(23,glDDS7->ReleaseDC(hDC));
19252236 }
19262237 HRESULT WINAPI glDirectDrawSurface3::Restore()
19272238 {
1928 - if(!this) return DDERR_INVALIDOBJECT;
1929 - return glDDS7->Restore();
 2239+ TRACE_ENTER(1,14,this);
 2240+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2241+ TRACE_RET(23,glDDS7->Restore());
19302242 }
19312243 HRESULT WINAPI glDirectDrawSurface3::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
19322244 {
1933 - if(!this) return DDERR_INVALIDOBJECT;
1934 - return glDDS7->SetClipper(lpDDClipper);
 2245+ TRACE_ENTER(2,14,this,14,lpDDClipper);
 2246+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2247+ TRACE_RET(23,glDDS7->SetClipper(lpDDClipper));
19352248 }
19362249 HRESULT WINAPI glDirectDrawSurface3::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
19372250 {
1938 - if(!this) return DDERR_INVALIDOBJECT;
1939 - return glDDS7->SetColorKey(dwFlags,lpDDColorKey);
 2251+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
 2252+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2253+ TRACE_RET(23,glDDS7->SetColorKey(dwFlags,lpDDColorKey));
19402254 }
19412255 HRESULT WINAPI glDirectDrawSurface3::SetOverlayPosition(LONG lX, LONG lY)
19422256 {
1943 - if(!this) return DDERR_INVALIDOBJECT;
1944 - return glDDS7->SetOverlayPosition(lX,lY);
 2257+ TRACE_ENTER(3,14,this,7,lX,7,lY);
 2258+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2259+ TRACE_RET(23,glDDS7->SetOverlayPosition(lX,lY));
19452260 }
19462261 HRESULT WINAPI glDirectDrawSurface3::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
19472262 {
1948 - if(!this) return DDERR_INVALIDOBJECT;
1949 - return glDDS7->SetPalette(lpDDPalette);
 2263+ TRACE_ENTER(2,14,this,14,lpDDPalette);
 2264+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2265+ TRACE_RET(23,glDDS7->SetPalette(lpDDPalette));
19502266 }
19512267 HRESULT WINAPI glDirectDrawSurface3::Unlock(LPVOID lpSurfaceData)
19522268 {
1953 - if(!this) return DDERR_INVALIDOBJECT;
1954 - return glDDS7->Unlock2(lpSurfaceData);
 2269+ TRACE_ENTER(2,14,this,14,lpSurfaceData);
 2270+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2271+ TRACE_RET(23,glDDS7->Unlock2(lpSurfaceData));
19552272 }
19562273 HRESULT WINAPI glDirectDrawSurface3::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE3 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
19572274 {
1958 - if(!this) return DDERR_INVALIDOBJECT;
1959 - return glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx);
 2275+ TRACE_ENTER(6,14,this,26,lpSrcRect,14,lpDDDestSurface,26,lpDestRect,9,dwFlags,14,lpDDOverlayFx);
 2276+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2277+ TRACE_RET(23,glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx));
19602278 }
19612279 HRESULT WINAPI glDirectDrawSurface3::UpdateOverlayDisplay(DWORD dwFlags)
19622280 {
1963 - if(!this) return DDERR_INVALIDOBJECT;
1964 - return glDDS7->UpdateOverlayDisplay(dwFlags);
 2281+ TRACE_ENTER(2,14,this,9,dwFlags);
 2282+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2283+ TRACE_RET(23,glDDS7->UpdateOverlayDisplay(dwFlags));
19652284 }
19662285 HRESULT WINAPI glDirectDrawSurface3::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSReference)
19672286 {
1968 - if(!this) return DDERR_INVALIDOBJECT;
1969 - return glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference);
 2287+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSReference);
 2288+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2289+ TRACE_RET(23,glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference));
19702290 }
19712291 HRESULT WINAPI glDirectDrawSurface3::GetDDInterface(LPVOID FAR *lplpDD)
19722292 {
1973 - if(!this) return DDERR_INVALIDOBJECT;
 2293+ TRACE_ENTER(2,14,this,14,lplpDD);
 2294+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
19742295 glDirectDraw7 *glDD7;
19752296 HRESULT ret = glDDS7->GetDDInterface((void**)&glDD7);
1976 - if(ret != DD_OK) return ret;
 2297+ if(ret != DD_OK) TRACE_RET(23,ret);
19772298 glDD7->QueryInterface(IID_IDirectDraw,lplpDD);
19782299 glDD7->Release();
 2300+ TRACE_VAR("*lplpDD",14,*lplpDD);
 2301+ TRACE_EXIT(23,ret);
19792302 return ret;
19802303 }
19812304 HRESULT WINAPI glDirectDrawSurface3::PageLock(DWORD dwFlags)
19822305 {
1983 - if(!this) return DDERR_INVALIDOBJECT;
1984 - return glDDS7->PageLock(dwFlags);
 2306+ TRACE_ENTER(2,14,this,14,dwFlags);
 2307+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2308+ TRACE_RET(23,glDDS7->PageLock(dwFlags));
19852309 }
19862310 HRESULT WINAPI glDirectDrawSurface3::PageUnlock(DWORD dwFlags)
19872311 {
1988 - if(!this) return DDERR_INVALIDOBJECT;
1989 - return glDDS7->PageUnlock(dwFlags);
 2312+ TRACE_ENTER(2,14,this,9,dwFlags);
 2313+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2314+ TRACE_RET(23,glDDS7->PageUnlock(dwFlags));
19902315 }
19912316 HRESULT WINAPI glDirectDrawSurface3::SetSurfaceDesc(LPDDSURFACEDESC lpddsd, DWORD dwFlags)
19922317 {
1993 - if(!this) return DDERR_INVALIDOBJECT;
1994 - return glDDS7->SetSurfaceDesc((LPDDSURFACEDESC2)lpddsd,dwFlags);
 2318+ TRACE_ENTER(3,14,this,14,lpddsd,9,dwFlags);
 2319+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2320+ TRACE_RET(23,glDDS7->SetSurfaceDesc((LPDDSURFACEDESC2)lpddsd,dwFlags));
19952321 }
19962322
19972323 // DDRAW4 wrapper
19982324 glDirectDrawSurface4::glDirectDrawSurface4(glDirectDrawSurface7 *gl_DDS7)
19992325 {
 2326+ TRACE_ENTER(2,14,this,14,gl_DDS7);
20002327 glDDS7 = gl_DDS7;
20012328 refcount = 1;
 2329+ TRACE_EXIT(-1,0);
20022330 }
20032331 glDirectDrawSurface4::~glDirectDrawSurface4()
20042332 {
 2333+ TRACE_ENTER(1,14,this);
20052334 glDDS7->dds4 = NULL;
20062335 glDDS7->Release();
 2336+ TRACE_EXIT(-1,0);
20072337 }
20082338 HRESULT WINAPI glDirectDrawSurface4::QueryInterface(REFIID riid, void** ppvObj)
20092339 {
2010 - if(!this) return DDERR_INVALIDOBJECT;
 2340+ TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
 2341+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
20112342 if(riid == IID_IUnknown)
20122343 {
20132344 this->AddRef();
20142345 *ppvObj = this;
 2346+ TRACE_VAR("*ppvObj",14,*ppvObj);
 2347+ TRACE_EXIT(23,DD_OK);
20152348 return DD_OK;
20162349 }
2017 - return glDDS7->QueryInterface(riid,ppvObj);
 2350+ TRACE_RET(23,glDDS7->QueryInterface(riid,ppvObj));
20182351 }
20192352 ULONG WINAPI glDirectDrawSurface4::AddRef()
20202353 {
2021 - if(!this) return 0;
 2354+ TRACE_ENTER(1,14,this);
 2355+ if(!this) TRACE_RET(8,0);
20222356 refcount++;
 2357+ TRACE_EXIT(8,refcount);
20232358 return refcount;
20242359 }
20252360 ULONG WINAPI glDirectDrawSurface4::Release()
20262361 {
2027 - if(!this) return 0;
 2362+ TRACE_ENTER(1,14,this);
 2363+ if(!this) TRACE_RET(8,0);
20282364 ULONG ret;
20292365 refcount--;
20302366 ret = refcount;
20312367 if(refcount == 0) delete this;
 2368+ TRACE_EXIT(8,ret);
20322369 return ret;
20332370 }
20342371 HRESULT WINAPI glDirectDrawSurface4::AddAttachedSurface(LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface)
20352372 {
2036 - if(!this) return DDERR_INVALIDOBJECT;
2037 - return glDDS7->AddAttachedSurface(((glDirectDrawSurface4*)lpDDSAttachedSurface)->GetDDS7());
 2373+ TRACE_ENTER(2,14,this,14,lpDDSAttachedSurface);
 2374+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2375+ TRACE_RET(23,glDDS7->AddAttachedSurface(((glDirectDrawSurface4*)lpDDSAttachedSurface)->GetDDS7()));
20382376 }
20392377 HRESULT WINAPI glDirectDrawSurface4::AddOverlayDirtyRect(LPRECT lpRect)
20402378 {
2041 - if(!this) return DDERR_INVALIDOBJECT;
2042 - return glDDS7->AddOverlayDirtyRect(lpRect);
 2379+ TRACE_ENTER(2,14,this,26,lpRect);
 2380+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2381+ TRACE_RET(23,glDDS7->AddOverlayDirtyRect(lpRect));
20432382 }
20442383 HRESULT WINAPI glDirectDrawSurface4::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
20452384 {
2046 - if(!this) return DDERR_INVALIDOBJECT;
2047 - if(lpDDSrcSurface) return glDDS7->Blt(lpDestRect,((glDirectDrawSurface4*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx);
2048 - else return glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx);
 2385+ TRACE_ENTER(6,14,this,26,lpDestRect,14,lpDDSrcSurface,26,lpSrcRect,9,dwFlags,14,lpDDBltFx);
 2386+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2387+ if(lpDDSrcSurface) {TRACE_RET(23,glDDS7->Blt(lpDestRect,((glDirectDrawSurface4*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx));}
 2388+ else TRACE_RET(23,glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx));
20492389 }
20502390 HRESULT WINAPI glDirectDrawSurface4::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
20512391 {
2052 - if(!this) return DDERR_INVALIDOBJECT;
2053 - return glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags);
 2392+ TRACE_ENTER(4,14,this,14,lpDDBltBatch,8,dwCount,9,dwFlags);
 2393+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2394+ TRACE_RET(23,glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags));
20542395 }
20552396 HRESULT WINAPI glDirectDrawSurface4::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
20562397 {
2057 - if(!this) return DDERR_INVALIDOBJECT;
2058 - return glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface4*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans);
 2398+ TRACE_ENTER(6,14,this,8,dwX,8,dwY,14,lpDDSrcSurface,26,lpSrcRect,9,dwTrans);
 2399+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2400+ TRACE_RET(23,glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface4*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans));
20592401 }
20602402 HRESULT WINAPI glDirectDrawSurface4::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface)
20612403 {
2062 - if(!this) return DDERR_INVALIDOBJECT;
2063 - return glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
 2404+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSAttachedSurface);
 2405+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2406+ TRACE_RET(23,glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface));
20642407 }
20652408 HRESULT WINAPI glDirectDrawSurface4::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpEnumSurfacesCallback)
20662409 {
2067 - if(!this) return DDERR_INVALIDOBJECT;
2068 - return glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback);
 2410+ TRACE_ENTER(3,14,this,14,lpContext,14,lpEnumSurfacesCallback);
 2411+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2412+ TRACE_RET(23,glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback));
20692413 }
20702414 HRESULT WINAPI glDirectDrawSurface4::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpfnCallback)
20712415 {
2072 - if(!this) return DDERR_INVALIDOBJECT;
2073 - return glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback);
 2416+ TRACE_ENTER(4,14,this,9,dwFlags,14,lpContext,14,lpfnCallback);
 2417+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2418+ TRACE_RET(23,glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback));
20742419 }
20752420 HRESULT WINAPI glDirectDrawSurface4::Flip(LPDIRECTDRAWSURFACE4 lpDDSurfaceTargetOverride, DWORD dwFlags)
20762421 {
2077 - if(!this) return DDERR_INVALIDOBJECT;
 2422+ TRACE_ENTER(3,14,this,14,lpDDSurfaceTargetOverride,9,dwFlags);
 2423+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
20782424 if(lpDDSurfaceTargetOverride)
2079 - return glDDS7->Flip(((glDirectDrawSurface4*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags);
2080 - else return glDDS7->Flip(NULL,dwFlags);
 2425+ {TRACE_RET(23,glDDS7->Flip(((glDirectDrawSurface4*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags));}
 2426+ else TRACE_RET(23,glDDS7->Flip(NULL,dwFlags));
20812427 }
20822428 HRESULT WINAPI glDirectDrawSurface4::GetAttachedSurface(LPDDSCAPS2 lpDDSCaps2, LPDIRECTDRAWSURFACE4 FAR *lplpDDAttachedSurface)
20832429 {
2084 - if(!this) return DDERR_INVALIDOBJECT;
 2430+ TRACE_ENTER(3,14,this,14,lpDDSCaps2,14,lplpDDAttachedSurface);
 2431+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
20852432 HRESULT error;
20862433 glDirectDrawSurface7 *attachedsurface;
20872434 glDirectDrawSurface4 *attached1;
@@ -2090,166 +2437,201 @@
20912438 attachedsurface->QueryInterface(IID_IDirectDrawSurface4,(void **)&attached1);
20922439 attachedsurface->Release();
20932440 *lplpDDAttachedSurface = attached1;
 2441+ TRACE_VAR("*lplpDDAttachedSurface",14,*lplpDDAttachedSurface);
20942442 }
 2443+ TRACE_EXIT(23,error);
20952444 return error;
20962445 }
20972446 HRESULT WINAPI glDirectDrawSurface4::GetBltStatus(DWORD dwFlags)
20982447 {
2099 - if(!this) return DDERR_INVALIDOBJECT;
2100 - return glDDS7->GetBltStatus(dwFlags);
 2448+ TRACE_ENTER(2,14,this,9,dwFlags);
 2449+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2450+ TRACE_RET(23,glDDS7->GetBltStatus(dwFlags));
21012451 }
21022452 HRESULT WINAPI glDirectDrawSurface4::GetCaps(LPDDSCAPS2 lpDDSCaps)
21032453 {
2104 - if(!this) return DDERR_INVALIDOBJECT;
2105 - return glDDS7->GetCaps(lpDDSCaps);
 2454+ TRACE_ENTER(2,14,this,14,lpDDSCaps);
 2455+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2456+ TRACE_RET(23,glDDS7->GetCaps(lpDDSCaps));
21062457 }
21072458 HRESULT WINAPI glDirectDrawSurface4::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
21082459 {
2109 - if(!this) return DDERR_INVALIDOBJECT;
2110 - return glDDS7->GetClipper(lplpDDClipper);
 2460+ TRACE_ENTER(2,14,this,14,lplpDDClipper);
 2461+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2462+ TRACE_RET(23,glDDS7->GetClipper(lplpDDClipper));
21112463 }
21122464 HRESULT WINAPI glDirectDrawSurface4::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
21132465 {
2114 - if(!this) return DDERR_INVALIDOBJECT;
2115 - return glDDS7->GetColorKey(dwFlags,lpDDColorKey);
 2466+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
 2467+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2468+ TRACE_RET(23,glDDS7->GetColorKey(dwFlags,lpDDColorKey));
21162469 }
21172470 HRESULT WINAPI glDirectDrawSurface4::GetDC(HDC FAR *lphDC)
21182471 {
2119 - if(!this) return DDERR_INVALIDOBJECT;
2120 - return glDDS7->GetDC(lphDC);
 2472+ TRACE_ENTER(2,14,this,14,lphDC);
 2473+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2474+ TRACE_RET(23,glDDS7->GetDC(lphDC));
21212475 }
21222476 HRESULT WINAPI glDirectDrawSurface4::GetFlipStatus(DWORD dwFlags)
21232477 {
2124 - if(!this) return DDERR_INVALIDOBJECT;
2125 - return glDDS7->GetFlipStatus(dwFlags);
 2478+ TRACE_ENTER(2,14,this,9,dwFlags);
 2479+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2480+ TRACE_RET(23,glDDS7->GetFlipStatus(dwFlags));
21262481 }
21272482 HRESULT WINAPI glDirectDrawSurface4::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
21282483 {
2129 - if(!this) return DDERR_INVALIDOBJECT;
2130 - return glDDS7->GetOverlayPosition(lplX,lplY);
 2484+ TRACE_ENTER(3,14,this,14,lplX,14,lplY);
 2485+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2486+ TRACE_RET(23,glDDS7->GetOverlayPosition(lplX,lplY));
21312487 }
21322488 HRESULT WINAPI glDirectDrawSurface4::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
21332489 {
2134 - if(!this) return DDERR_INVALIDOBJECT;
2135 - return glDDS7->GetPalette(lplpDDPalette);
 2490+ TRACE_ENTER(2,14,this,14,lplpDDPalette);
 2491+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2492+ TRACE_RET(23,glDDS7->GetPalette(lplpDDPalette));
21362493 }
21372494 HRESULT WINAPI glDirectDrawSurface4::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
21382495 {
2139 - if(!this) return DDERR_INVALIDOBJECT;
2140 - return glDDS7->GetPixelFormat(lpDDPixelFormat);
 2496+ TRACE_ENTER(2,14,this,14,lpDDPixelFormat);
 2497+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2498+ TRACE_RET(23,glDDS7->GetPixelFormat(lpDDPixelFormat));
21412499 }
21422500 HRESULT WINAPI glDirectDrawSurface4::GetSurfaceDesc(LPDDSURFACEDESC2 lpDDSurfaceDesc)
21432501 {
2144 - if(!this) return DDERR_INVALIDOBJECT;
2145 - return glDDS7->GetSurfaceDesc(lpDDSurfaceDesc);
 2502+ TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc);
 2503+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2504+ TRACE_RET(23,glDDS7->GetSurfaceDesc(lpDDSurfaceDesc));
21462505 }
21472506 HRESULT WINAPI glDirectDrawSurface4::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC2 lpDDSurfaceDesc)
21482507 {
2149 - if(!this) return DDERR_INVALIDOBJECT;
 2508+ TRACE_ENTER(3,14,this,14,lpDD,14,lpDDSurfaceDesc);
 2509+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2510+ TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
21502511 return DDERR_ALREADYINITIALIZED;
21512512 }
21522513 HRESULT WINAPI glDirectDrawSurface4::IsLost()
21532514 {
2154 - if(!this) return DDERR_INVALIDOBJECT;
2155 - return glDDS7->IsLost();
 2515+ TRACE_ENTER(1,14,this);
 2516+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2517+ TRACE_RET(23,glDDS7->IsLost());
21562518 }
21572519 HRESULT WINAPI glDirectDrawSurface4::Lock(LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
21582520 {
2159 - if(!this) return DDERR_INVALIDOBJECT;
2160 - return glDDS7->Lock(lpDestRect,lpDDSurfaceDesc,dwFlags,hEvent);
 2521+ TRACE_ENTER(5,14,this,26,lpDestRect,14,lpDDSurfaceDesc,9,dwFlags,14,hEvent);
 2522+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2523+ TRACE_RET(23,glDDS7->Lock(lpDestRect,lpDDSurfaceDesc,dwFlags,hEvent));
21612524 }
21622525 HRESULT WINAPI glDirectDrawSurface4::ReleaseDC(HDC hDC)
21632526 {
2164 - if(!this) return DDERR_INVALIDOBJECT;
2165 - return glDDS7->ReleaseDC(hDC);
 2527+ TRACE_ENTER(2,14,this,14,hDC);
 2528+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2529+ TRACE_RET(23,glDDS7->ReleaseDC(hDC));
21662530 }
21672531 HRESULT WINAPI glDirectDrawSurface4::Restore()
21682532 {
2169 - if(!this) return DDERR_INVALIDOBJECT;
2170 - return glDDS7->Restore();
 2533+ TRACE_ENTER(1,14,this);
 2534+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2535+ TRACE_RET(23,glDDS7->Restore());
21712536 }
21722537 HRESULT WINAPI glDirectDrawSurface4::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
21732538 {
2174 - if(!this) return DDERR_INVALIDOBJECT;
2175 - return glDDS7->SetClipper(lpDDClipper);
 2539+ TRACE_ENTER(2,14,this,14,lpDDClipper);
 2540+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2541+ TRACE_RET(23,glDDS7->SetClipper(lpDDClipper));
21762542 }
21772543 HRESULT WINAPI glDirectDrawSurface4::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
21782544 {
2179 - if(!this) return DDERR_INVALIDOBJECT;
2180 - return glDDS7->SetColorKey(dwFlags,lpDDColorKey);
 2545+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
 2546+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2547+ TRACE_RET(23,glDDS7->SetColorKey(dwFlags,lpDDColorKey));
21812548 }
21822549 HRESULT WINAPI glDirectDrawSurface4::SetOverlayPosition(LONG lX, LONG lY)
21832550 {
2184 - if(!this) return DDERR_INVALIDOBJECT;
2185 - return glDDS7->SetOverlayPosition(lX,lY);
 2551+ TRACE_ENTER(3,14,this,7,lX,7,lY);
 2552+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2553+ TRACE_RET(23,glDDS7->SetOverlayPosition(lX,lY));
21862554 }
21872555 HRESULT WINAPI glDirectDrawSurface4::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
21882556 {
2189 - if(!this) return DDERR_INVALIDOBJECT;
2190 - return glDDS7->SetPalette(lpDDPalette);
 2557+ TRACE_ENTER(2,14,this,14,lpDDPalette);
 2558+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2559+ TRACE_RET(23,glDDS7->SetPalette(lpDDPalette));
21912560 }
21922561 HRESULT WINAPI glDirectDrawSurface4::Unlock(LPRECT lpRect)
21932562 {
2194 - if(!this) return DDERR_INVALIDOBJECT;
2195 - return glDDS7->Unlock2(lpRect);
 2563+ TRACE_ENTER(2,14,this,26,lpRect);
 2564+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2565+ TRACE_RET(23,glDDS7->Unlock2(lpRect));
21962566 }
21972567 HRESULT WINAPI glDirectDrawSurface4::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE4 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
21982568 {
2199 - if(!this) return DDERR_INVALIDOBJECT;
2200 - return glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx);
 2569+ TRACE_ENTER(6,14,this,26,lpSrcRect,14,lpDDDestSurface,26,lpDestRect,9,dwFlags,14,lpDDOverlayFx);
 2570+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2571+ TRACE_RET(23,glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx));
22012572 }
22022573 HRESULT WINAPI glDirectDrawSurface4::UpdateOverlayDisplay(DWORD dwFlags)
22032574 {
2204 - if(!this) return DDERR_INVALIDOBJECT;
2205 - return glDDS7->UpdateOverlayDisplay(dwFlags);
 2575+ TRACE_ENTER(2,14,this,9,dwFlags);
 2576+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2577+ TRACE_RET(23,glDDS7->UpdateOverlayDisplay(dwFlags));
22062578 }
22072579 HRESULT WINAPI glDirectDrawSurface4::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSReference)
22082580 {
2209 - if(!this) return DDERR_INVALIDOBJECT;
2210 - return glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference);
 2581+ TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSReference);
 2582+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2583+ TRACE_RET(23,glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference));
22112584 }
22122585 HRESULT WINAPI glDirectDrawSurface4::GetDDInterface(LPVOID FAR *lplpDD)
22132586 {
2214 - if(!this) return DDERR_INVALIDOBJECT;
2215 - return glDDS7->GetDDInterface(lplpDD);
 2587+ TRACE_ENTER(2,14,this,14,lplpDD);
 2588+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2589+ TRACE_RET(23,glDDS7->GetDDInterface(lplpDD));
22162590 }
22172591 HRESULT WINAPI glDirectDrawSurface4::PageLock(DWORD dwFlags)
22182592 {
2219 - if(!this) return DDERR_INVALIDOBJECT;
2220 - return glDDS7->PageLock(dwFlags);
 2593+ TRACE_ENTER(2,14,this,9,dwFlags);
 2594+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2595+ TRACE_RET(23,glDDS7->PageLock(dwFlags));
22212596 }
22222597 HRESULT WINAPI glDirectDrawSurface4::PageUnlock(DWORD dwFlags)
22232598 {
2224 - if(!this) return DDERR_INVALIDOBJECT;
2225 - return glDDS7->PageUnlock(dwFlags);
 2599+ TRACE_ENTER(2,14,this,9,dwFlags);
 2600+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2601+ TRACE_RET(23,glDDS7->PageUnlock(dwFlags));
22262602 }
22272603 HRESULT WINAPI glDirectDrawSurface4::SetSurfaceDesc(LPDDSURFACEDESC2 lpddsd, DWORD dwFlags)
22282604 {
2229 - if(!this) return DDERR_INVALIDOBJECT;
2230 - return glDDS7->SetSurfaceDesc(lpddsd,dwFlags);
 2605+ TRACE_ENTER(3,14,this,14,lpddsd,9,dwFlags);
 2606+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2607+ TRACE_RET(23,glDDS7->SetSurfaceDesc(lpddsd,dwFlags));
22312608 }
2232 -HRESULT WINAPI glDirectDrawSurface4::SetPrivateData(REFGUID guidTag, LPVOID lpData, DWORD cbSize, DWORD dwFlags)
 2609+HRESULT WINAPI glDirectDrawSurface4::SetPrivateData(REFGUID guidTag, LPVOID lpData, DWORD cbSize, DWORD dwFlags)
22332610 {
2234 - if(!this) return DDERR_INVALIDOBJECT;
2235 - return glDDS7->SetPrivateData(guidTag,lpData,cbSize,dwFlags);
 2611+ TRACE_ENTER(5,14,this,24,&guidTag,14,lpData,8,cbSize,9,dwFlags);
 2612+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2613+ TRACE_RET(23,glDDS7->SetPrivateData(guidTag,lpData,cbSize,dwFlags));
22362614 }
2237 -HRESULT WINAPI glDirectDrawSurface4::GetPrivateData(REFGUID guidTag, LPVOID lpBuffer, LPDWORD lpcbBufferSize)
 2615+HRESULT WINAPI glDirectDrawSurface4::GetPrivateData(REFGUID guidTag, LPVOID lpBuffer, LPDWORD lpcbBufferSize)
22382616 {
2239 - if(!this) return DDERR_INVALIDOBJECT;
2240 - return glDDS7->GetPrivateData(guidTag,lpBuffer,lpcbBufferSize);
 2617+ TRACE_ENTER(4,14,this,24,&guidTag,14,lpBuffer,14,lpcbBufferSize);
 2618+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2619+ TRACE_RET(23,glDDS7->GetPrivateData(guidTag,lpBuffer,lpcbBufferSize));
22412620 }
22422621 HRESULT WINAPI glDirectDrawSurface4::FreePrivateData(REFGUID guidTag)
22432622 {
2244 - if(!this) return DDERR_INVALIDOBJECT;
2245 - return glDDS7->FreePrivateData(guidTag);
 2623+ TRACE_ENTER(2,14,this,24,&guidTag);
 2624+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2625+ TRACE_RET(23,glDDS7->FreePrivateData(guidTag));
22462626 }
22472627 HRESULT WINAPI glDirectDrawSurface4::GetUniquenessValue(LPDWORD lpValue)
22482628 {
2249 - if(!this) return DDERR_INVALIDOBJECT;
2250 - return glDDS7->GetUniquenessValue(lpValue);
 2629+ TRACE_ENTER(2,14,this,14,lpValue);
 2630+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2631+ TRACE_RET(23,glDDS7->GetUniquenessValue(lpValue));
22512632 }
22522633 HRESULT WINAPI glDirectDrawSurface4::ChangeUniquenessValue()
22532634 {
2254 - if(!this) return DDERR_INVALIDOBJECT;
2255 - return glDDS7->ChangeUniquenessValue();
 2635+ TRACE_ENTER(1,14,this);
 2636+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2637+ TRACE_RET(23,glDDS7->ChangeUniquenessValue());
22562638 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r346Trace glDirectDrawPalette.cpp and fix invalid object return values....admin21:51, 10 March 2013