DXGL r362 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r361‎ | r362 | r363 >
Date:23:01, 24 March 2013
Author:admin
Status:new
Tags:
Comment:
Fix TRACE_RET calling function used as parameter twice.
Fix a few inappropriately used TRACE_EXIT lines.
Modified paths:
  • /ddraw/glClassFactory.cpp (modified) (history)
  • /ddraw/glDirect3D.cpp (modified) (history)
  • /ddraw/glDirect3DDevice.cpp (modified) (history)
  • /ddraw/glDirect3DExecuteBuffer.cpp (modified) (history)
  • /ddraw/glDirect3DLight.cpp (modified) (history)
  • /ddraw/glDirect3DMaterial.cpp (modified) (history)
  • /ddraw/glDirect3DTexture.cpp (modified) (history)
  • /ddraw/glDirect3DVertexBuffer.cpp (modified) (history)
  • /ddraw/glDirect3DViewport.cpp (modified) (history)
  • /ddraw/glDirectDraw.cpp (modified) (history)
  • /ddraw/glDirectDrawClipper.cpp (modified) (history)
  • /ddraw/glDirectDrawPalette.cpp (modified) (history)
  • /ddraw/glDirectDrawSurface.cpp (modified) (history)
  • /ddraw/trace.cpp (modified) (history)
  • /ddraw/trace.h (modified) (history)

Diff [purge]

Index: ddraw/glClassFactory.cpp
@@ -25,7 +25,7 @@
2626 ULONG WINAPI glClassFactory::AddRef()
2727 {
2828 TRACE_ENTER(1,14,this);
29 - if(!this) TRACE_RET(8,0);
 29+ if(!this) TRACE_RET(ULONG,8,0);
3030 refcount++;
3131 TRACE_EXIT(8,refcount);
3232 return refcount;
@@ -33,7 +33,7 @@
3434 ULONG WINAPI glClassFactory::Release()
3535 {
3636 TRACE_ENTER(1,14,this);
37 - if(!this) TRACE_RET(8,0);
 37+ if(!this) TRACE_RET(ULONG,8,0);
3838 ULONG ret;
3939 refcount--;
4040 ret = refcount;
@@ -45,8 +45,8 @@
4646 HRESULT WINAPI glClassFactory::QueryInterface(REFIID riid, void** ppvObj)
4747 {
4848 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
49 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
50 - if(!ppvObj) TRACE_RET(23,DDERR_INVALIDPARAMS);
 49+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 50+ if(!ppvObj) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
5151 if((riid == IID_IUnknown) || (riid == IID_IClassFactory))
5252 {
5353 *ppvObj = this;
@@ -55,7 +55,7 @@
5656 else
5757 {
5858 *ppvObj = NULL;
59 - TRACE_RET(23,E_NOINTERFACE);
 59+ TRACE_RET(HRESULT,23,E_NOINTERFACE);
6060 }
6161 TRACE_VAR("*ppvObj",14,*ppvObj);
6262 TRACE_EXIT(23,S_OK);
@@ -64,9 +64,9 @@
6565 HRESULT WINAPI glClassFactory::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObject)
6666 {
6767 TRACE_ENTER(4,14,this,14,pUnkOuter,24,&riid,14,ppvObject);
68 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 68+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
6969 glDirectDraw7 *glDD7;
70 - if(pUnkOuter != NULL) TRACE_RET(23,CLASS_E_NOAGGREGATION);
 70+ if(pUnkOuter != NULL) TRACE_RET(HRESULT,23,CLASS_E_NOAGGREGATION);
7171 if(riid == IID_IDirectDraw)
7272 {
7373 glDD7 = new glDirectDraw7;
@@ -115,7 +115,7 @@
116116 HRESULT WINAPI glClassFactory::LockServer(BOOL fLock)
117117 {
118118 TRACE_ENTER(2,14,this,22,fLock);
119 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 119+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
120120 if(fLock) InterlockedIncrement(&locks);
121121 else InterlockedDecrement(&locks);
122122 TRACE_EXIT(23,S_OK);
Index: ddraw/glDirect3D.cpp
@@ -217,7 +217,7 @@
218218 ULONG WINAPI glDirect3D7::AddRef()
219219 {
220220 TRACE_ENTER(1,14,this);
221 - if(!this) TRACE_RET(8,0);
 221+ if(!this) TRACE_RET(ULONG,8,0);
222222 refcount++;
223223 TRACE_EXIT(8,refcount);
224224 return refcount;
@@ -225,7 +225,7 @@
226226 ULONG WINAPI glDirect3D7::Release()
227227 {
228228 TRACE_ENTER(1,14,this);
229 - if(!this) TRACE_RET(8,0);
 229+ if(!this) TRACE_RET(ULONG,8,0);
230230 ULONG ret;
231231 refcount--;
232232 ret = refcount;
@@ -237,8 +237,8 @@
238238 HRESULT WINAPI glDirect3D7::QueryInterface(REFIID riid, void** ppvObj)
239239 {
240240 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
241 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
242 - if(!ppvObj) TRACE_RET(23,DDERR_INVALIDPARAMS);
 241+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 242+ if(!ppvObj) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
243243 if(riid == IID_IUnknown)
244244 {
245245 this->AddRef();
@@ -315,10 +315,10 @@
316316 HRESULT WINAPI glDirect3D7::CreateDevice(REFCLSID rclsid, LPDIRECTDRAWSURFACE7 lpDDS, LPDIRECT3DDEVICE7 *lplpD3DDevice)
317317 {
318318 TRACE_ENTER(4,14,this,24,&rclsid,14,lpDDS,14,lplpD3DDevice);
319 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 319+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
320320 HRESULT ret;
321321 glDirect3DDevice7 *glD3DDev7 = new glDirect3DDevice7(rclsid,this,(glDirectDrawSurface7*)lpDDS);
322 - if(!glD3DDev7) TRACE_RET(23,DDERR_OUTOFMEMORY);
 322+ if(!glD3DDev7) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
323323 if(FAILED(glD3DDev7->err()))
324324 {
325325 ret = glD3DDev7->err();
@@ -334,9 +334,9 @@
335335 HRESULT WINAPI glDirect3D7::CreateLight(LPDIRECT3DLIGHT* lplpDirect3DLight, IUnknown* pUnkOuter)
336336 {
337337 TRACE_ENTER(3,14,this,14,lplpDirect3DLight,14,pUnkOuter);
338 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
339 - if(!lplpDirect3DLight) TRACE_RET(23,DDERR_INVALIDPARAMS);
340 - if(pUnkOuter) TRACE_RET(23,DDERR_INVALIDPARAMS);
 338+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 339+ if(!lplpDirect3DLight) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 340+ if(pUnkOuter) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
341341 *lplpDirect3DLight = new glDirect3DLight();
342342 TRACE_VAR("*lplpDirect3DLight",14,*lplpDirect3DLight);
343343 TRACE_EXIT(23,D3D_OK);
@@ -345,9 +345,9 @@
346346 HRESULT WINAPI glDirect3D7::CreateMaterial(LPDIRECT3DMATERIAL3* lplpDirect3DMaterial, IUnknown* pUnkOuter)
347347 {
348348 TRACE_ENTER(3,14,this,14,lplpDirect3DMaterial,14,pUnkOuter);
349 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
350 - if(!lplpDirect3DMaterial) TRACE_RET(23,DDERR_INVALIDPARAMS);
351 - if(pUnkOuter) TRACE_RET(23,DDERR_INVALIDPARAMS);
 349+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 350+ if(!lplpDirect3DMaterial) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 351+ if(pUnkOuter) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
352352 *lplpDirect3DMaterial = new glDirect3DMaterial3();
353353 TRACE_VAR("*lplpDirect3DMaterial",14,*lplpDirect3DMaterial);
354354 TRACE_EXIT(23,D3D_OK);
@@ -356,9 +356,9 @@
357357 HRESULT WINAPI glDirect3D7::CreateVertexBuffer(LPD3DVERTEXBUFFERDESC lpVBDesc, LPDIRECT3DVERTEXBUFFER7* lplpD3DVertexBuffer, DWORD dwFlags)
358358 {
359359 TRACE_ENTER(4,14,this,14,lpVBDesc,14,lplpD3DVertexBuffer,9,dwFlags);
360 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
361 - if(!lplpD3DVertexBuffer) TRACE_RET(23,DDERR_INVALIDPARAMS);
362 - if(!lpVBDesc) TRACE_RET(23,DDERR_INVALIDPARAMS);
 360+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 361+ if(!lplpD3DVertexBuffer) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 362+ if(!lpVBDesc) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
363363 *lplpD3DVertexBuffer = (LPDIRECT3DVERTEXBUFFER7)new glDirect3DVertexBuffer7(this,*lpVBDesc,dwFlags);
364364 TRACE_VAR("*lplpD3DVertexBuffer",14,*lplpD3DVertexBuffer);
365365 TRACE_EXIT(23,D3D_OK);
@@ -367,9 +367,9 @@
368368 HRESULT WINAPI glDirect3D7::CreateViewport(LPDIRECT3DVIEWPORT3* lplpD3DViewport, IUnknown* pUnkOuter)
369369 {
370370 TRACE_ENTER(3,14,this,14,lplpD3DViewport,14,pUnkOuter);
371 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
372 - if(!lplpD3DViewport) TRACE_RET(23,DDERR_INVALIDPARAMS);
373 - if(pUnkOuter) TRACE_RET(23,DDERR_INVALIDPARAMS);
 371+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 372+ if(!lplpD3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 373+ if(pUnkOuter) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
374374 *lplpD3DViewport = new glDirect3DViewport3();
375375 TRACE_VAR("*lplpD3DViewport",14,*lplpD3DViewport);
376376 TRACE_EXIT(23,D3D_OK);
@@ -378,8 +378,8 @@
379379 HRESULT WINAPI glDirect3D7::EnumDevices(LPD3DENUMDEVICESCALLBACK7 lpEnumDevicesCallback, LPVOID lpUserArg)
380380 {
381381 TRACE_ENTER(3,14,this,14,lpEnumDevicesCallback,14,lpUserArg);
382 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
383 - if(!lpEnumDevicesCallback) TRACE_RET(23,DDERR_INVALIDPARAMS);
 382+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 383+ if(!lpEnumDevicesCallback) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
384384 HRESULT result;
385385 D3DDEVICEDESC7 desc = d3ddesc;
386386 for(int i = 0; i < 3; i++)
@@ -408,13 +408,13 @@
409409 HRESULT WINAPI glDirect3D7::EnumDevices3(LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback, LPVOID lpUserArg)
410410 {
411411 TRACE_ENTER(3,14,this,14,lpEnumDevicesCallback,14,lpUserArg);
412 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
413 - if(!lpEnumDevicesCallback) TRACE_RET(23,DDERR_INVALIDPARAMS);
 412+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 413+ if(!lpEnumDevicesCallback) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
414414 HRESULT result;
415415 D3DDEVICEDESC desc = d3ddesc3;
416416 GUID guid = IID_IDirect3DRGBDevice;
417417 result = lpEnumDevicesCallback(&guid,devices[0].name,devices[0].devname,&desc,&desc,lpUserArg);
418 - if(result != D3DENUMRET_OK) TRACE_RET(23,D3D_OK);
 418+ if(result != D3DENUMRET_OK) TRACE_RET(HRESULT,23,D3D_OK);
419419 guid = IID_IDirect3DHALDevice;
420420 result = lpEnumDevicesCallback(&guid,devices[1].name,devices[1].devname,&desc,&desc,lpUserArg);
421421 TRACE_EXIT(23,D3D_OK);
@@ -423,7 +423,7 @@
424424 HRESULT WINAPI glDirect3D7::EnumZBufferFormats(REFCLSID riidDevice, LPD3DENUMPIXELFORMATSCALLBACK lpEnumCallback, LPVOID lpContext)
425425 {
426426 TRACE_ENTER(4,14,this,24,&riidDevice,14,lpEnumCallback,14,lpContext);
427 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 427+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
428428 DDPIXELFORMAT ddpf;
429429 ZeroMemory(&ddpf,sizeof(DDPIXELFORMAT));
430430 ddpf.dwSize = sizeof(DDPIXELFORMAT);
@@ -430,14 +430,14 @@
431431 ddpf.dwFlags = DDPF_ZBUFFER;
432432 ddpf.dwZBufferBitDepth = 16;
433433 ddpf.dwZBitMask = 0xffff;
434 - if(lpEnumCallback(&ddpf,lpContext) == D3DENUMRET_CANCEL) TRACE_RET(23,D3D_OK);
 434+ if(lpEnumCallback(&ddpf,lpContext) == D3DENUMRET_CANCEL) TRACE_RET(HRESULT,23,D3D_OK);
435435 ddpf.dwZBufferBitDepth = 24;
436436 ddpf.dwZBitMask = 0xffffff00;
437 - if(lpEnumCallback(&ddpf,lpContext) == D3DENUMRET_CANCEL) TRACE_RET(23,D3D_OK);
 437+ if(lpEnumCallback(&ddpf,lpContext) == D3DENUMRET_CANCEL) TRACE_RET(HRESULT,23,D3D_OK);
438438 ddpf.dwZBufferBitDepth = 32;
439 - if(lpEnumCallback(&ddpf,lpContext) == D3DENUMRET_CANCEL) TRACE_RET(23,D3D_OK);
 439+ if(lpEnumCallback(&ddpf,lpContext) == D3DENUMRET_CANCEL) TRACE_RET(HRESULT,23,D3D_OK);
440440 ddpf.dwZBitMask = 0xffffffff;
441 - if(lpEnumCallback(&ddpf,lpContext) == D3DENUMRET_CANCEL) TRACE_RET(23,D3D_OK);
 441+ if(lpEnumCallback(&ddpf,lpContext) == D3DENUMRET_CANCEL) TRACE_RET(HRESULT,23,D3D_OK);
442442 if(GLEXT_EXT_packed_depth_stencil || GLEXT_NV_packed_depth_stencil)
443443 {
444444 ddpf.dwZBufferBitDepth = 32;
@@ -444,10 +444,10 @@
445445 ddpf.dwStencilBitDepth = 8;
446446 ddpf.dwZBitMask = 0xffffff00;
447447 ddpf.dwStencilBitMask = 0xff;
448 - if(lpEnumCallback(&ddpf,lpContext) == D3DENUMRET_CANCEL) TRACE_RET(23,D3D_OK);
 448+ if(lpEnumCallback(&ddpf,lpContext) == D3DENUMRET_CANCEL) TRACE_RET(HRESULT,23,D3D_OK);
449449 ddpf.dwZBitMask = 0x00ffffff;
450450 ddpf.dwStencilBitMask = 0xff000000;
451 - if(lpEnumCallback(&ddpf,lpContext) == D3DENUMRET_CANCEL) TRACE_RET(23,D3D_OK);
 451+ if(lpEnumCallback(&ddpf,lpContext) == D3DENUMRET_CANCEL) TRACE_RET(HRESULT,23,D3D_OK);
452452 }
453453 TRACE_EXIT(23,D3D_OK);
454454 return D3D_OK;
@@ -462,11 +462,11 @@
463463 HRESULT WINAPI glDirect3D7::FindDevice(LPD3DFINDDEVICESEARCH lpD3DFDS, LPD3DFINDDEVICERESULT lpD3DFDR)
464464 {
465465 TRACE_ENTER(3,14,this,14,lpD3DFDS,14,lpD3DFDR);
466 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
467 - if(!lpD3DFDS) TRACE_RET(23,DDERR_INVALIDPARAMS);
468 - if(!lpD3DFDR) TRACE_RET(23,DDERR_INVALIDPARAMS);
469 - if(lpD3DFDR->dwSize < sizeof(D3DFINDDEVICERESULT)) TRACE_RET(23,DDERR_INVALIDPARAMS);
470 - if(lpD3DFDS->dwSize < sizeof(D3DFINDDEVICESEARCH)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 466+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 467+ if(!lpD3DFDS) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 468+ if(!lpD3DFDR) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 469+ if(lpD3DFDR->dwSize < sizeof(D3DFINDDEVICERESULT)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 470+ if(lpD3DFDS->dwSize < sizeof(D3DFINDDEVICESEARCH)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
471471 bool found = true;
472472 GUID guid = IID_IDirect3DHALDevice;
473473 if((lpD3DFDS->dwFlags & D3DFDS_LINES) || (lpD3DFDS->dwFlags & D3DFDS_TRIANGLES))
@@ -541,7 +541,7 @@
542542 }
543543 else if(!lpD3DFDS->bHardware) guid = IID_IDirect3DRGBDevice;
544544 }
545 - if(!found) TRACE_RET(23,DDERR_NOTFOUND);
 545+ if(!found) TRACE_RET(HRESULT,23,DDERR_NOTFOUND);
546546 if(guid == IID_IDirect3DRGBDevice) lpD3DFDR->ddSwDesc = d3ddesc3;
547547 else lpD3DFDR->ddHwDesc = d3ddesc3;
548548 lpD3DFDR->guid = guid;
@@ -570,7 +570,7 @@
571571 HRESULT WINAPI glDirect3D3::QueryInterface(REFIID riid, void** ppvObj)
572572 {
573573 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
574 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 574+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
575575 if(riid == IID_IUnknown)
576576 {
577577 this->AddRef();
@@ -579,13 +579,13 @@
580580 TRACE_EXIT(23,DD_OK);
581581 return DD_OK;
582582 }
583 - TRACE_RET(23,glD3D7->QueryInterface(riid,ppvObj));
 583+ TRACE_RET(HRESULT,23,glD3D7->QueryInterface(riid,ppvObj));
584584 }
585585
586586 ULONG WINAPI glDirect3D3::AddRef()
587587 {
588588 TRACE_ENTER(1,14,this);
589 - if(!this) TRACE_RET(8,0);
 589+ if(!this) TRACE_RET(ULONG,8,0);
590590 refcount++;
591591 TRACE_EXIT(8,refcount);
592592 return refcount;
@@ -594,7 +594,7 @@
595595 ULONG WINAPI glDirect3D3::Release()
596596 {
597597 TRACE_ENTER(1,14,this);
598 - if(!this) TRACE_RET(8,0);
 598+ if(!this) TRACE_RET(ULONG,8,0);
599599 ULONG ret;
600600 refcount--;
601601 ret = refcount;
@@ -606,8 +606,8 @@
607607 HRESULT WINAPI glDirect3D3::CreateDevice(REFCLSID rclsid, LPDIRECTDRAWSURFACE4 lpDDS, LPDIRECT3DDEVICE3 *lplpD3DDevice, LPUNKNOWN pUnkOuter)
608608 {
609609 TRACE_ENTER(5,14,this,24,&rclsid,14,lpDDS,14,lplpD3DDevice,14,pUnkOuter);
610 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
611 - if(pUnkOuter) TRACE_RET(23,DDERR_INVALIDPARAMS);
 610+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 611+ if(pUnkOuter) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
612612 LPDIRECT3DDEVICE7 lpD3DDev7;
613613 HRESULT err = glD3D7->CreateDevice(rclsid,((glDirectDrawSurface4*)lpDDS)->GetDDS7(),&lpD3DDev7);
614614 if(err == D3D_OK)
@@ -625,20 +625,20 @@
626626 HRESULT WINAPI glDirect3D3::CreateLight(LPDIRECT3DLIGHT* lplpDirect3DLight, IUnknown* pUnkOuter)
627627 {
628628 TRACE_ENTER(3,14,this,14,lplpDirect3DLight,14,pUnkOuter);
629 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
630 - TRACE_RET(23,glD3D7->CreateLight(lplpDirect3DLight,pUnkOuter));
 629+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 630+ TRACE_RET(HRESULT,23,glD3D7->CreateLight(lplpDirect3DLight,pUnkOuter));
631631 }
632632 HRESULT WINAPI glDirect3D3::CreateMaterial(LPDIRECT3DMATERIAL3* lplpDirect3DMaterial, IUnknown* pUnkOuter)
633633 {
634634 TRACE_ENTER(3,14,this,14,lplpDirect3DMaterial,14,pUnkOuter);
635 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
636 - TRACE_RET(23,glD3D7->CreateMaterial(lplpDirect3DMaterial,pUnkOuter));
 635+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 636+ TRACE_RET(HRESULT,23,glD3D7->CreateMaterial(lplpDirect3DMaterial,pUnkOuter));
637637 }
638638 HRESULT WINAPI glDirect3D3::CreateVertexBuffer(LPD3DVERTEXBUFFERDESC lpVBDesc, LPDIRECT3DVERTEXBUFFER* lplpD3DVertexBuffer, DWORD dwFlags, LPUNKNOWN pUnkOuter)
639639 {
640640 TRACE_ENTER(5,14,this,14,lpVBDesc,14,lplpD3DVertexBuffer,9,dwFlags,14,pUnkOuter);
641 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
642 - if(pUnkOuter) TRACE_RET(23,DDERR_INVALIDPARAMS);
 641+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 642+ if(pUnkOuter) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
643643 LPDIRECT3DVERTEXBUFFER7 lpD3DVB7;
644644 HRESULT err = glD3D7->CreateVertexBuffer(lpVBDesc,&lpD3DVB7,dwFlags);
645645 if(err == D3D_OK)
@@ -655,34 +655,34 @@
656656 HRESULT WINAPI glDirect3D3::CreateViewport(LPDIRECT3DVIEWPORT3* lplpD3DViewport, IUnknown* pUnkOuter)
657657 {
658658 TRACE_ENTER(3,14,this,14,lplpD3DViewport,14,pUnkOuter);
659 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
660 - TRACE_RET(23,glD3D7->CreateViewport(lplpD3DViewport,pUnkOuter));
 659+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 660+ TRACE_RET(HRESULT,23,glD3D7->CreateViewport(lplpD3DViewport,pUnkOuter));
661661 }
662662
663663 HRESULT WINAPI glDirect3D3::EnumDevices(LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback, LPVOID lpUserArg)
664664 {
665665 TRACE_ENTER(3,14,this,14,lpEnumDevicesCallback,14,lpUserArg);
666 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
667 - TRACE_RET(23,glD3D7->EnumDevices3(lpEnumDevicesCallback,lpUserArg));
 666+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 667+ TRACE_RET(HRESULT,23,glD3D7->EnumDevices3(lpEnumDevicesCallback,lpUserArg));
668668 }
669669
670670 HRESULT WINAPI glDirect3D3::EnumZBufferFormats(REFCLSID riidDevice, LPD3DENUMPIXELFORMATSCALLBACK lpEnumCallback, LPVOID lpContext)
671671 {
672672 TRACE_ENTER(4,14,this,24,&riidDevice,14,lpEnumCallback,14,lpContext);
673 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
674 - TRACE_RET(23,glD3D7->EnumZBufferFormats(riidDevice,lpEnumCallback,lpContext));
 673+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 674+ TRACE_RET(HRESULT,23,glD3D7->EnumZBufferFormats(riidDevice,lpEnumCallback,lpContext));
675675 }
676676 HRESULT WINAPI glDirect3D3::EvictManagedTextures()
677677 {
678678 TRACE_ENTER(1,14,this);
679 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
680 - TRACE_RET(23,glD3D7->EvictManagedTextures());
 679+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 680+ TRACE_RET(HRESULT,23,glD3D7->EvictManagedTextures());
681681 }
682682 HRESULT WINAPI glDirect3D3::FindDevice(LPD3DFINDDEVICESEARCH lpD3DFDS, LPD3DFINDDEVICERESULT lpD3DFDR)
683683 {
684684 TRACE_ENTER(3,14,this,14,lpD3DFDS,14,lpD3DFDR);
685 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
686 - TRACE_RET(23,glD3D7->FindDevice(lpD3DFDS,lpD3DFDR));
 685+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 686+ TRACE_RET(HRESULT,23,glD3D7->FindDevice(lpD3DFDS,lpD3DFDR));
687687 }
688688
689689
@@ -705,7 +705,7 @@
706706 HRESULT WINAPI glDirect3D2::QueryInterface(REFIID riid, void** ppvObj)
707707 {
708708 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
709 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 709+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
710710 if(riid == IID_IUnknown)
711711 {
712712 this->AddRef();
@@ -714,13 +714,13 @@
715715 TRACE_ENTER(23,DD_OK);
716716 return DD_OK;
717717 }
718 - TRACE_RET(23,glD3D7->QueryInterface(riid,ppvObj));
 718+ TRACE_RET(HRESULT,23,glD3D7->QueryInterface(riid,ppvObj));
719719 }
720720
721721 ULONG WINAPI glDirect3D2::AddRef()
722722 {
723723 TRACE_ENTER(1,14,this);
724 - if(!this) TRACE_RET(8,0);
 724+ if(!this) TRACE_RET(ULONG,8,0);
725725 refcount++;
726726 TRACE_EXIT(8,refcount);
727727 return refcount;
@@ -729,7 +729,7 @@
730730 ULONG WINAPI glDirect3D2::Release()
731731 {
732732 TRACE_ENTER(1,14,this);
733 - if(!this) TRACE_RET(8,0);
 733+ if(!this) TRACE_RET(ULONG,8,0);
734734 ULONG ret;
735735 refcount--;
736736 ret = refcount;
@@ -741,8 +741,8 @@
742742 HRESULT WINAPI glDirect3D2::CreateDevice(REFCLSID rclsid, LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DDEVICE2 *lplpD3DDevice)
743743 {
744744 TRACE_ENTER(4,14,this,24,&rclsid,14,lpDDS,14,lplpD3DDevice);
745 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
746 - if(!lplpD3DDevice) TRACE_RET(23,DDERR_INVALIDPARAMS);
 745+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 746+ if(!lplpD3DDevice) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
747747 LPDIRECT3DDEVICE7 lpD3DDev7;
748748 HRESULT err = glD3D7->CreateDevice(rclsid,((glDirectDrawSurface1*)lpDDS)->GetDDS7(),&lpD3DDev7);
749749 if(err == D3D_OK)
@@ -760,18 +760,18 @@
761761 HRESULT WINAPI glDirect3D2::CreateLight(LPDIRECT3DLIGHT* lplpDirect3DLight, IUnknown* pUnkOuter)
762762 {
763763 TRACE_ENTER(3,14,this,14,lplpDirect3DLight,14,pUnkOuter);
764 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
765 - TRACE_RET(23,glD3D7->CreateLight(lplpDirect3DLight,pUnkOuter));
 764+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 765+ TRACE_RET(HRESULT,23,glD3D7->CreateLight(lplpDirect3DLight,pUnkOuter));
766766 }
767767
768768 HRESULT WINAPI glDirect3D2::CreateMaterial(LPDIRECT3DMATERIAL2* lplpDirect3DMaterial2, IUnknown* pUnkOuter)
769769 {
770770 TRACE_ENTER(3,14,this,14,lplpDirect3DMaterial2,14,pUnkOuter);
771 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
772 - if(!lplpDirect3DMaterial2) TRACE_RET(23,DDERR_INVALIDPARAMS);
 771+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 772+ if(!lplpDirect3DMaterial2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
773773 glDirect3DMaterial3 *glD3DM3;
774774 HRESULT error = glD3D7->CreateMaterial((LPDIRECT3DMATERIAL3*)&glD3DM3,pUnkOuter);
775 - if(FAILED(error)) TRACE_RET(23,error);
 775+ if(FAILED(error)) TRACE_RET(HRESULT,23,error);
776776 glD3DM3->QueryInterface(IID_IDirect3DMaterial2,(void**)lplpDirect3DMaterial2);
777777 glD3DM3->Release();
778778 TRACE_VAR("*lplpDirect3DMaterial2",14,*lplpDirect3DMaterial2);
@@ -782,11 +782,11 @@
783783 HRESULT WINAPI glDirect3D2::CreateViewport(LPDIRECT3DVIEWPORT2* lplpD3DViewport2, IUnknown* pUnkOuter)
784784 {
785785 TRACE_ENTER(3,14,this,14,lplpD3DViewport2,14,pUnkOuter);
786 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
787 - if(!lplpD3DViewport2) TRACE_RET(23,DDERR_INVALIDPARAMS);
 786+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 787+ if(!lplpD3DViewport2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
788788 glDirect3DMaterial3 *glD3DV3;
789789 HRESULT error = glD3D7->CreateViewport((LPDIRECT3DVIEWPORT3*)&glD3DV3,pUnkOuter);
790 - if(FAILED(error)) TRACE_RET(23,error);
 790+ if(FAILED(error)) TRACE_RET(HRESULT,23,error);
791791 glD3DV3->QueryInterface(IID_IDirect3DViewport2,(void**)lplpD3DViewport2);
792792 glD3DV3->Release();
793793 TRACE_VAR("*lplpD3DViewport2",14,*lplpD3DViewport2);
@@ -797,15 +797,15 @@
798798 HRESULT WINAPI glDirect3D2::EnumDevices(LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback, LPVOID lpUserArg)
799799 {
800800 TRACE_ENTER(3,14,this,14,lpEnumDevicesCallback,14,lpUserArg);
801 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
802 - TRACE_RET(23,glD3D7->EnumDevices3(lpEnumDevicesCallback,lpUserArg));
 801+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 802+ TRACE_RET(HRESULT,23,glD3D7->EnumDevices3(lpEnumDevicesCallback,lpUserArg));
803803 }
804804
805805 HRESULT WINAPI glDirect3D2::FindDevice(LPD3DFINDDEVICESEARCH lpD3DFDS, LPD3DFINDDEVICERESULT lpD3DFDR)
806806 {
807807 TRACE_ENTER(3,14,this,14,lpD3DFDS,14,lpD3DFDR);
808 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
809 - TRACE_RET(23,glD3D7->FindDevice(lpD3DFDS,lpD3DFDR));
 808+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 809+ TRACE_RET(HRESULT,23,glD3D7->FindDevice(lpD3DFDS,lpD3DFDR));
810810 }
811811
812812 glDirect3D1::glDirect3D1(glDirect3D7 *glD3D7)
@@ -827,7 +827,7 @@
828828 HRESULT WINAPI glDirect3D1::QueryInterface(REFIID riid, void** ppvObj)
829829 {
830830 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
831 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 831+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
832832 if(riid == IID_IUnknown)
833833 {
834834 this->AddRef();
@@ -836,13 +836,13 @@
837837 TRACE_EXIT(23,DD_OK);
838838 return DD_OK;
839839 }
840 - TRACE_RET(23,glD3D7->QueryInterface(riid,ppvObj));
 840+ TRACE_RET(HRESULT,23,glD3D7->QueryInterface(riid,ppvObj));
841841 }
842842
843843 ULONG WINAPI glDirect3D1::AddRef()
844844 {
845845 TRACE_ENTER(1,14,this);
846 - if(!this) TRACE_RET(8,0);
 846+ if(!this) TRACE_RET(ULONG,8,0);
847847 refcount++;
848848 TRACE_EXIT(8,refcount);
849849 return refcount;
@@ -851,7 +851,7 @@
852852 ULONG WINAPI glDirect3D1::Release()
853853 {
854854 TRACE_ENTER(1,14,this);
855 - if(!this) TRACE_RET(8,0);
 855+ if(!this) TRACE_RET(ULONG,8,0);
856856 ULONG ret;
857857 refcount--;
858858 ret = refcount;
@@ -863,18 +863,18 @@
864864 HRESULT WINAPI glDirect3D1::CreateLight(LPDIRECT3DLIGHT* lplpDirect3DLight, IUnknown* pUnkOuter)
865865 {
866866 TRACE_ENTER(3,14,this,14,pUnkOuter);
867 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
868 - TRACE_RET(23,glD3D7->CreateLight(lplpDirect3DLight,pUnkOuter));
 867+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 868+ TRACE_RET(HRESULT,23,glD3D7->CreateLight(lplpDirect3DLight,pUnkOuter));
869869 }
870870
871871 HRESULT WINAPI glDirect3D1::CreateMaterial(LPDIRECT3DMATERIAL* lplpDirect3DMaterial, IUnknown* pUnkOuter)
872872 {
873873 TRACE_ENTER(3,14,this,14,lplpDirect3DMaterial,14,pUnkOuter);
874 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
875 - if(!lplpDirect3DMaterial) TRACE_RET(23,DDERR_INVALIDPARAMS);
 874+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 875+ if(!lplpDirect3DMaterial) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
876876 glDirect3DMaterial3 *glD3DM3;
877877 HRESULT error = glD3D7->CreateMaterial((LPDIRECT3DMATERIAL3*)&glD3DM3,pUnkOuter);
878 - if(FAILED(error)) TRACE_RET(23,error);
 878+ if(FAILED(error)) TRACE_RET(HRESULT,23,error);
879879 glD3DM3->QueryInterface(IID_IDirect3DMaterial,(void**)lplpDirect3DMaterial);
880880 glD3DM3->Release();
881881 TRACE_VAR("*lplpDirect3DMaterial",14,*lplpDirect3DMaterial);
@@ -885,11 +885,11 @@
886886 HRESULT WINAPI glDirect3D1::CreateViewport(LPDIRECT3DVIEWPORT* lplpD3DViewport, IUnknown* pUnkOuter)
887887 {
888888 TRACE_ENTER(3,14,this,14,lplpD3DViewport,14,pUnkOuter);
889 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
890 - if(!lplpD3DViewport) TRACE_RET(23,DDERR_INVALIDPARAMS);
 889+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 890+ if(!lplpD3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
891891 glDirect3DMaterial3 *glD3DV3;
892892 HRESULT error = glD3D7->CreateViewport((LPDIRECT3DVIEWPORT3*)&glD3DV3,pUnkOuter);
893 - if(FAILED(error)) TRACE_RET(23,error);
 893+ if(FAILED(error)) TRACE_RET(HRESULT,23,error);
894894 glD3DV3->QueryInterface(IID_IDirect3DViewport,(void**)lplpD3DViewport);
895895 glD3DV3->Release();
896896 TRACE_VAR("*lplpD3DViewport",14,*lplpD3DViewport);
@@ -900,20 +900,20 @@
901901 HRESULT WINAPI glDirect3D1::EnumDevices(LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback, LPVOID lpUserArg)
902902 {
903903 TRACE_ENTER(3,14,this,14,lpEnumDevicesCallback,14,lpUserArg);
904 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
905 - TRACE_RET(23,glD3D7->EnumDevices3(lpEnumDevicesCallback,lpUserArg));
 904+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 905+ TRACE_RET(HRESULT,23,glD3D7->EnumDevices3(lpEnumDevicesCallback,lpUserArg));
906906 }
907907
908908 HRESULT WINAPI glDirect3D1::FindDevice(LPD3DFINDDEVICESEARCH lpD3DFDS, LPD3DFINDDEVICERESULT lpD3DFDR)
909909 {
910910 TRACE_ENTER(3,14,this,14,lpD3DFDS,14,lpD3DFDR);
911 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
912 - TRACE_RET(23,glD3D7->FindDevice(lpD3DFDS,lpD3DFDR));
 911+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 912+ TRACE_RET(HRESULT,23,glD3D7->FindDevice(lpD3DFDS,lpD3DFDR));
913913 }
914914
915915 HRESULT WINAPI glDirect3D1::Initialize(REFIID lpREFIID)
916916 {
917917 TRACE_ENTER(2,14,this,24,&lpREFIID);
918 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
919 - TRACE_RET(23,DDERR_ALREADYINITIALIZED);
 918+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 919+ TRACE_RET(HRESULT,23,DDERR_ALREADYINITIALIZED);
920920 }
Index: ddraw/glDirect3DDevice.cpp
@@ -416,8 +416,8 @@
417417 HRESULT WINAPI glDirect3DDevice7::QueryInterface(REFIID riid, void** ppvObj)
418418 {
419419 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
420 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
421 - if(!ppvObj) TRACE_RET(23,DDERR_INVALIDPARAMS);
 420+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 421+ if(!ppvObj) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
422422 if(riid == IID_IUnknown)
423423 {
424424 this->AddRef();
@@ -501,7 +501,7 @@
502502 ULONG WINAPI glDirect3DDevice7::AddRef()
503503 {
504504 TRACE_ENTER(1,14,this);
505 - if(!this) TRACE_RET(8,0);
 505+ if(!this) TRACE_RET(ULONG,8,0);
506506 refcount++;
507507 TRACE_EXIT(8,refcount);
508508 return refcount;
@@ -509,7 +509,7 @@
510510 ULONG WINAPI glDirect3DDevice7::Release()
511511 {
512512 TRACE_ENTER(1,14,this);
513 - if(!this) TRACE_RET(8,0);
 513+ if(!this) TRACE_RET(ULONG,8,0);
514514 ULONG ret;
515515 refcount--;
516516 ret = refcount;
@@ -521,7 +521,7 @@
522522 HRESULT WINAPI glDirect3DDevice7::ApplyStateBlock(DWORD dwBlockHandle)
523523 {
524524 TRACE_ENTER(2,14,this,9,dwBlockHandle);
525 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 525+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
526526 FIXME("glDirect3DDevice7::ApplyStateBlock: stub");
527527 TRACE_EXIT(23,DDERR_GENERIC);
528528 ERR(DDERR_GENERIC);
@@ -529,8 +529,8 @@
530530 HRESULT WINAPI glDirect3DDevice7::BeginScene()
531531 {
532532 TRACE_ENTER(1,14,this);
533 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
534 - if(inscene) TRACE_RET(23,D3DERR_SCENE_IN_SCENE);
 533+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 534+ if(inscene) TRACE_RET(HRESULT,23,D3DERR_SCENE_IN_SCENE);
535535 inscene = true;
536536 TRACE_EXIT(23,D3D_OK);
537537 return D3D_OK;
@@ -538,7 +538,7 @@
539539 HRESULT WINAPI glDirect3DDevice7::BeginStateBlock()
540540 {
541541 TRACE_ENTER(1,14,this);
542 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 542+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
543543 FIXME("glDirect3DDevice7::BeginStateBlock: stub");
544544 TRACE_EXIT(23,D3D_OK);
545545 ERR(DDERR_GENERIC);
@@ -546,7 +546,7 @@
547547 HRESULT WINAPI glDirect3DDevice7::CaptureStateBlock(DWORD dwBlockHandle)
548548 {
549549 TRACE_ENTER(2,14,this,9,dwBlockHandle);
550 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 550+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
551551 FIXME("glDirect3DDevice7::CaptureStateBlock: stub");
552552 TRACE_EXIT(23,D3D_OK);
553553 ERR(DDERR_GENERIC);
@@ -554,7 +554,7 @@
555555 HRESULT WINAPI glDirect3DDevice7::CreateStateBlock(D3DSTATEBLOCKTYPE d3dsbtype, LPDWORD lpdwBlockHandle)
556556 {
557557 TRACE_ENTER(3,14,this,9,d3dsbtype,14,lpdwBlockHandle);
558 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 558+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
559559 FIXME("glDirect3DDevice7::CreateStateBlock: stub");
560560 TRACE_EXIT(23,D3D_OK);
561561 ERR(DDERR_GENERIC);
@@ -562,15 +562,15 @@
563563 HRESULT WINAPI glDirect3DDevice7::Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags, DWORD dwColor, D3DVALUE dvZ, DWORD dwStencil)
564564 {
565565 TRACE_ENTER(7,14,this,8,dwCount,14,lpRects,9,dwFlags,9,dwColor,19,&dvZ,9,dwStencil);
566 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
567 - if(dwCount && !lpRects) TRACE_RET(23,DDERR_INVALIDPARAMS);
568 - TRACE_RET(23,renderer->Clear(glDDS7,dwCount,lpRects,dwFlags,dwColor,dvZ,dwStencil));
 566+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 567+ if(dwCount && !lpRects) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 568+ TRACE_RET(HRESULT,23,renderer->Clear(glDDS7,dwCount,lpRects,dwFlags,dwColor,dvZ,dwStencil));
569569 }
570570 HRESULT WINAPI glDirect3DDevice7::ComputeSphereVisibility(LPD3DVECTOR lpCenters, LPD3DVALUE lpRadii, DWORD dwNumSpheres,
571571 DWORD dwFlags, LPDWORD lpdwReturnValues)
572572 {
573573 TRACE_ENTER(6,14,this,14,lpCenters,14,lpRadii,8,dwNumSpheres,9,dwFlags,14,lpdwReturnValues);
574 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 574+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
575575 FIXME("glDirect3DDevice7::ComputeSphereVisibility: stub");
576576 TRACE_EXIT(23,DDERR_GENERIC);
577577 ERR(DDERR_GENERIC);
@@ -578,7 +578,7 @@
579579 HRESULT WINAPI glDirect3DDevice7::DeleteStateBlock(DWORD dwBlockHandle)
580580 {
581581 TRACE_ENTER(2,14,this,9,dwBlockHandle);
582 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 582+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
583583 FIXME("glDirect3DDevice7::DeleteStateBlock: stub");
584584 TRACE_EXIT(23,DDERR_GENERIC);
585585 ERR(DDERR_GENERIC);
@@ -708,7 +708,7 @@
709709 int i;
710710 int ptr = 0;
711711 if((dwVertexTypeDesc & D3DFVF_XYZ) && (dwVertexTypeDesc & D3DFVF_XYZRHW))
712 - TRACE_RET(23,DDERR_INVALIDPARAMS);
 712+ TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
713713 if(dwVertexTypeDesc & D3DFVF_XYZ)
714714 {
715715 vertdata[0].data = vertptr;
@@ -722,7 +722,7 @@
723723 vertdata[1].data = &vertptr[3];
724724 ptr += 4;
725725 }
726 - else TRACE_RET(23,DDERR_INVALIDPARAMS);
 726+ else TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
727727 for(i = 0; i < 5; i++)
728728 vertdata[i+2].data = NULL;
729729 if(((dwVertexTypeDesc >> 1) & 7) >= 3)
@@ -786,13 +786,13 @@
787787 LPVOID lpvVertices, DWORD dwVertexCount, LPWORD lpwIndices, DWORD dwIndexCount, DWORD dwFlags)
788788 {
789789 TRACE_ENTER(8,9,d3dptPrimitiveType,9,dwVertexTypeDesc,14,lpvVertices,8,dwVertexCount,14,lpwIndices,8,dwIndexCount,9,dwFlags);
790 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
791 - if(!inscene) TRACE_RET(23,D3DERR_SCENE_NOT_IN_SCENE);
 790+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 791+ if(!inscene) TRACE_RET(HRESULT,23,D3DERR_SCENE_NOT_IN_SCENE);
792792 HRESULT err = fvftoglvertex(dwVertexTypeDesc,(LPDWORD)lpvVertices);
793793 if(lpwIndices) AddStats(d3dptPrimitiveType,dwIndexCount,&stats);
794794 else AddStats(d3dptPrimitiveType,dwVertexCount,&stats);
795 - if(err != D3D_OK) TRACE_RET(23,err);
796 - TRACE_RET(23,renderer->DrawPrimitives(this,setdrawmode(d3dptPrimitiveType),vertdata,texformats,
 795+ if(err != D3D_OK) TRACE_RET(HRESULT,23,err);
 796+ TRACE_RET(HRESULT,23,renderer->DrawPrimitives(this,setdrawmode(d3dptPrimitiveType),vertdata,texformats,
797797 dwVertexCount,lpwIndices,dwIndexCount,dwFlags));
798798 }
799799 HRESULT WINAPI glDirect3DDevice7::DrawIndexedPrimitiveStrided(D3DPRIMITIVETYPE d3dptPrimitiveType, DWORD dwVertexTypeDesc,
@@ -799,7 +799,7 @@
800800 LPD3DDRAWPRIMITIVESTRIDEDDATA lpvVertexArray, DWORD dwVertexCount, LPWORD lpwIndices, DWORD dwIndexCount, DWORD dwFlags)
801801 {
802802 TRACE_ENTER(8,14,this,9,d3dptPrimitiveType,9,dwVertexTypeDesc,14,lpvVertexArray,8,dwVertexCount,14,lpwIndices,8,dwIndexCount,9,dwFlags);
803 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 803+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
804804 FIXME("glDirect3DDevice7::DrawIndexedPrimitiveStrided: stub");
805805 TRACE_EXIT(23,DDERR_GENERIC);
806806 ERR(DDERR_GENERIC);
@@ -808,7 +808,7 @@
809809 DWORD dwStartVertex, DWORD dwNumVertices, LPWORD lpwIndices, DWORD dwIndexCount, DWORD dwFlags)
810810 {
811811 TRACE_ENTER(8,14,this,9,d3dptPrimitiveType,14,lpd3dVertexBuffer,8,dwStartVertex,8,dwNumVertices,9,lpwIndices,8,dwIndexCount,9,dwFlags);
812 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 812+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
813813 FIXME("glDirect3DDevice7::DrawIndexedPrimitiveVB: stub");
814814 TRACE_EXIT(23,DDERR_GENERIC);
815815 ERR(DDERR_GENERIC);
@@ -817,14 +817,14 @@
818818 DWORD dwVertexCount, DWORD dwFlags)
819819 {
820820 TRACE_ENTER(6,14,this,9,dptPrimitiveType,9,dwVertexTypeDesc,14,lpVertices,8,dwVertexCount,9,dwFlags);
821 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
822 - TRACE_RET(23,DrawIndexedPrimitive(dptPrimitiveType,dwVertexTypeDesc,lpVertices,dwVertexCount,NULL,0,dwFlags));
 821+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 822+ TRACE_RET(HRESULT,23,DrawIndexedPrimitive(dptPrimitiveType,dwVertexTypeDesc,lpVertices,dwVertexCount,NULL,0,dwFlags));
823823 }
824824 HRESULT WINAPI glDirect3DDevice7::DrawPrimitiveStrided(D3DPRIMITIVETYPE dptPrimitiveType, DWORD dwVertexTypeDesc,
825825 LPD3DDRAWPRIMITIVESTRIDEDDATA lpVertexArray, DWORD dwVertexCount, DWORD dwFlags)
826826 {
827827 TRACE_ENTER(6,14,this,9,dptPrimitiveType,9,dwVertexTypeDesc,14,lpVertexArray,8,dwVertexCount,9,dwFlags);
828 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 828+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
829829 FIXME("glDirect3DDevice7::DrawPrimitiveStrided: stub");
830830 TRACE_EXIT(23,DDERR_GENERIC);
831831 ERR(DDERR_GENERIC);
@@ -833,7 +833,7 @@
834834 DWORD dwStartVertex, DWORD dwNumVertices, DWORD dwFlags)
835835 {
836836 TRACE_ENTER(5,14,this,9,d3dptPrimitiveType,14,lpd3dVertexBuffer,8,dwStartVertex,8,dwNumVertices,9,dwFlags);
837 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 837+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
838838 FIXME("glDirect3DDevice7::DrawPrimitiveVB: stub");
839839 TRACE_EXIT(23,DDERR_GENERIC);
840840 ERR(DDERR_GENERIC);
@@ -841,8 +841,8 @@
842842 HRESULT WINAPI glDirect3DDevice7::EndScene()
843843 {
844844 TRACE_ENTER(1,14,this);
845 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
846 - if(!inscene) TRACE_RET(23,D3DERR_SCENE_NOT_IN_SCENE);
 845+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 846+ if(!inscene) TRACE_RET(HRESULT,23,D3DERR_SCENE_NOT_IN_SCENE);
847847 inscene = false;
848848 renderer->Flush();
849849 TRACE_EXIT(23,D3D_OK);
@@ -851,7 +851,7 @@
852852 HRESULT WINAPI glDirect3DDevice7::EndStateBlock(LPDWORD lpdwBlockHandle)
853853 {
854854 TRACE_ENTER(2,14,this,14,lpdwBlockHandle);
855 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 855+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
856856 FIXME("glDirect3DDevice7::EndStateBlock: stub");
857857 TRACE_EXIT(23,DDERR_GENERIC);
858858 ERR(DDERR_GENERIC);
@@ -860,7 +860,7 @@
861861 HRESULT WINAPI glDirect3DDevice7::EnumTextureFormats(LPD3DENUMPIXELFORMATSCALLBACK lpd3dEnumPixelProc, LPVOID lpArg)
862862 {
863863 TRACE_ENTER(3,14,this,14,lpd3dEnumPixelProc,14,lpArg);
864 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 864+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
865865 HRESULT result;
866866 DDPIXELFORMAT fmt;
867867 for(int i = 0; i < numtexformats; i++)
@@ -869,7 +869,7 @@
870870 if(::texformats[i].dwFlags & DDPF_PALETTEINDEXED8) continue;
871871 memcpy(&fmt,&::texformats[i],sizeof(DDPIXELFORMAT));
872872 result = lpd3dEnumPixelProc(&fmt,lpArg);
873 - if(result != D3DENUMRET_OK) TRACE_RET(23,D3D_OK);
 873+ if(result != D3DENUMRET_OK) TRACE_RET(HRESULT,23,D3D_OK);
874874 }
875875 TRACE_EXIT(23,D3D_OK);
876876 return D3D_OK;
@@ -877,7 +877,7 @@
878878 HRESULT WINAPI glDirect3DDevice7::GetCaps(LPD3DDEVICEDESC7 lpD3DDevDesc)
879879 {
880880 TRACE_ENTER(2,14,this,14,lpD3DDevDesc);
881 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 881+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
882882 D3DDEVICEDESC7 desc = d3ddesc;
883883 desc.dwDevCaps |= D3DDEVCAPS_HWRASTERIZATION | D3DDEVCAPS_HWTRANSFORMANDLIGHT;
884884 desc.deviceGUID = IID_IDirect3DTnLHalDevice;
@@ -888,7 +888,7 @@
889889 HRESULT WINAPI glDirect3DDevice7::GetClipPlane(DWORD dwIndex, D3DVALUE *pPlaneEquation)
890890 {
891891 TRACE_ENTER(3,14,this,8,dwIndex,9,pPlaneEquation);
892 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 892+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
893893 FIXME("glDirect3DDevice7::GetClipPlane: stub");
894894 TRACE_EXIT(23,DDERR_GENERIC);
895895 ERR(DDERR_GENERIC);
@@ -896,7 +896,7 @@
897897 HRESULT WINAPI glDirect3DDevice7::GetClipStatus(LPD3DCLIPSTATUS lpD3DClipStatus)
898898 {
899899 TRACE_ENTER(2,14,this,14,lpD3DClipStatus);
900 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 900+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
901901 FIXME("glDirect3DDevice7::GetClipStatus: stub");
902902 TRACE_EXIT(23,DDERR_GENERIC);
903903 ERR(DDERR_GENERIC);
@@ -904,8 +904,8 @@
905905 HRESULT WINAPI glDirect3DDevice7::GetDirect3D(LPDIRECT3D7 *lplpD3D)
906906 {
907907 TRACE_ENTER(2,14,this,14,lplpD3D);
908 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
909 - if(!lplpD3D) TRACE_RET(23,DDERR_INVALIDPARAMS);
 908+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 909+ if(!lplpD3D) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
910910 *lplpD3D = glD3D7;
911911 glD3D7->AddRef();
912912 TRACE_VAR("*lplpD3D",14,*lplpD3D);
@@ -915,7 +915,7 @@
916916 HRESULT WINAPI glDirect3DDevice7::GetInfo(DWORD dwDevInfoID, LPVOID pDevInfoStruct, DWORD dwSize)
917917 {
918918 TRACE_ENTER(4,14,this,9,dwDevInfoID,14,pDevInfoStruct,8,dwSize);
919 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 919+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
920920 FIXME("glDirect3DDevice7::GetInfo: stub");
921921 TRACE_EXIT(23,DDERR_GENERIC);
922922 ERR(DDERR_GENERIC);
@@ -923,10 +923,10 @@
924924 HRESULT WINAPI glDirect3DDevice7::GetLight(DWORD dwLightIndex, LPD3DLIGHT7 lpLight)
925925 {
926926 TRACE_ENTER(3,14,this,8,dwLightIndex,14,lpLight);
927 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
928 - if(!lpLight) TRACE_RET(23,DDERR_INVALIDPARAMS);
929 - if(dwLightIndex >= lightsmax) TRACE_RET(23,DDERR_INVALIDOBJECT);
930 - if(!lights[dwLightIndex]) TRACE_RET(23,DDERR_INVALIDOBJECT);
 927+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 928+ if(!lpLight) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 929+ if(dwLightIndex >= lightsmax) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 930+ if(!lights[dwLightIndex]) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
931931 lights[dwLightIndex]->GetLight7(lpLight);
932932 TRACE_EXIT(23,D3D_OK);
933933 return D3D_OK;
@@ -934,10 +934,10 @@
935935 HRESULT WINAPI glDirect3DDevice7::GetLightEnable(DWORD dwLightIndex, BOOL* pbEnable)
936936 {
937937 TRACE_ENTER(3,14,this,8,dwLightIndex,14,pbEnable);
938 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
939 - if(dwLightIndex >= lightsmax) TRACE_RET(23,DDERR_INVALIDOBJECT);
940 - if(!lights[dwLightIndex]) TRACE_RET(23,DDERR_INVALIDOBJECT);
941 - if(!pbEnable) TRACE_RET(23,DDERR_INVALIDPARAMS);
 938+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 939+ if(dwLightIndex >= lightsmax) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 940+ if(!lights[dwLightIndex]) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 941+ if(!pbEnable) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
942942 *pbEnable = FALSE;
943943 for(int i = 0; i < 8; i++)
944944 if(gllights[i] == dwLightIndex) *pbEnable = TRUE;
@@ -948,8 +948,8 @@
949949 HRESULT WINAPI glDirect3DDevice7::GetMaterial(LPD3DMATERIAL7 lpMaterial)
950950 {
951951 TRACE_ENTER(2,14,this,14,lpMaterial);
952 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
953 - if(!lpMaterial) TRACE_RET(23,DDERR_INVALIDPARAMS);
 952+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 953+ if(!lpMaterial) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
954954 memcpy(lpMaterial,&material,sizeof(D3DMATERIAL7));
955955 TRACE_EXIT(23,D3D_OK);
956956 return D3D_OK;
@@ -957,7 +957,7 @@
958958 HRESULT WINAPI glDirect3DDevice7::GetRenderState(D3DRENDERSTATETYPE dwRenderStateType, LPDWORD lpdwRenderState)
959959 {
960960 TRACE_ENTER(3,14,this,27,dwRenderStateType,14,lpdwRenderState);
961 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 961+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
962962 if(dwRenderStateType <= 152)
963963 {
964964 *lpdwRenderState = renderstate[dwRenderStateType];
@@ -971,8 +971,8 @@
972972 HRESULT WINAPI glDirect3DDevice7::GetRenderTarget(LPDIRECTDRAWSURFACE7 *lplpRenderTarget)
973973 {
974974 TRACE_ENTER(2,14,this,14,lplpRenderTarget);
975 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
976 - if(!lplpRenderTarget) TRACE_RET(23,DDERR_INVALIDPARAMS);
 975+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 976+ if(!lplpRenderTarget) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
977977 glDDS7->AddRef();
978978 *lplpRenderTarget = glDDS7;
979979 TRACE_VAR("*lplpRenderTarger",14,*lplpRenderTarget);
@@ -982,7 +982,7 @@
983983 HRESULT WINAPI glDirect3DDevice7::GetStateData(DWORD dwState, LPVOID* lplpStateData)
984984 {
985985 TRACE_ENTER(3,14,this,9,dwState,14,lplpStateData);
986 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 986+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
987987 FIXME("glDirect3DDevice7::GetStateData: stub");
988988 TRACE_EXIT(23,DDERR_GENERIC);
989989 ERR(DDERR_GENERIC);
@@ -990,10 +990,10 @@
991991 HRESULT WINAPI glDirect3DDevice7::GetTexture(DWORD dwStage, LPDIRECTDRAWSURFACE7 *lplpTexture)
992992 {
993993 TRACE_ENTER(3,14,this,8,dwStage,14,lplpTexture);
994 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
995 - if(!lplpTexture) TRACE_RET(23,DDERR_INVALIDPARAMS);
996 - if(dwStage > 7) TRACE_RET(23,DDERR_INVALIDPARAMS);
997 - if(!texstages[dwStage].texture) TRACE_RET(23,DDERR_INVALIDOBJECT);
 994+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 995+ if(!lplpTexture) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 996+ if(dwStage > 7) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 997+ if(!texstages[dwStage].texture) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
998998 *lplpTexture = texstages[dwStage].texture;
999999 texstages[dwStage].texture->AddRef();
10001000 TRACE_VAR("*lplpTexture",14,*lplpTexture);
@@ -1003,110 +1003,110 @@
10041004 HRESULT WINAPI glDirect3DDevice7::GetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE dwState, LPDWORD lpdwValue)
10051005 {
10061006 TRACE_ENTER(4,14,this,8,dwStage,28,dwState,14,lpdwValue);
1007 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1008 - if(dwStage > 7) TRACE_RET(23,DDERR_INVALIDPARAMS);
1009 - if(!lpdwValue) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1007+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1008+ if(dwStage > 7) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1009+ if(!lpdwValue) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
10101010 switch(dwState)
10111011 {
10121012 case D3DTSS_COLOROP:
10131013 *lpdwValue = texstages[dwStage].colorop;
1014 - TRACE_RET(23,D3D_OK);
 1014+ TRACE_RET(HRESULT,23,D3D_OK);
10151015 case D3DTSS_COLORARG1:
10161016 *lpdwValue = texstages[dwStage].colorarg1;
1017 - TRACE_RET(23,D3D_OK);
 1017+ TRACE_RET(HRESULT,23,D3D_OK);
10181018 case D3DTSS_COLORARG2:
10191019 *lpdwValue = texstages[dwStage].colorarg2;
1020 - TRACE_RET(23,D3D_OK);
 1020+ TRACE_RET(HRESULT,23,D3D_OK);
10211021 case D3DTSS_ALPHAOP:
10221022 *lpdwValue = texstages[dwStage].alphaop;
1023 - TRACE_RET(23,D3D_OK);
 1023+ TRACE_RET(HRESULT,23,D3D_OK);
10241024 case D3DTSS_ALPHAARG1:
10251025 *lpdwValue = texstages[dwStage].alphaarg1;
1026 - TRACE_RET(23,D3D_OK);
 1026+ TRACE_RET(HRESULT,23,D3D_OK);
10271027 case D3DTSS_ALPHAARG2:
10281028 *lpdwValue = texstages[dwStage].alphaarg2;
1029 - TRACE_RET(23,D3D_OK);
 1029+ TRACE_RET(HRESULT,23,D3D_OK);
10301030 case D3DTSS_BUMPENVMAT00:
10311031 memcpy(lpdwValue,&texstages[dwStage].bumpenv00,sizeof(D3DVALUE));
1032 - TRACE_RET(23,D3D_OK);
 1032+ TRACE_RET(HRESULT,23,D3D_OK);
10331033 case D3DTSS_BUMPENVMAT01:
10341034 memcpy(lpdwValue,&texstages[dwStage].bumpenv01,sizeof(D3DVALUE));
1035 - TRACE_RET(23,D3D_OK);
 1035+ TRACE_RET(HRESULT,23,D3D_OK);
10361036 case D3DTSS_BUMPENVMAT10:
10371037 memcpy(lpdwValue,&texstages[dwStage].bumpenv10,sizeof(D3DVALUE));
1038 - TRACE_RET(23,D3D_OK);
 1038+ TRACE_RET(HRESULT,23,D3D_OK);
10391039 case D3DTSS_BUMPENVMAT11:
10401040 memcpy(lpdwValue,&texstages[dwStage].bumpenv11,sizeof(D3DVALUE));
1041 - TRACE_RET(23,D3D_OK);
 1041+ TRACE_RET(HRESULT,23,D3D_OK);
10421042 case D3DTSS_TEXCOORDINDEX:
10431043 *lpdwValue = texstages[dwStage].texcoordindex;
1044 - TRACE_RET(23,D3D_OK);
 1044+ TRACE_RET(HRESULT,23,D3D_OK);
10451045 case D3DTSS_ADDRESS:
10461046 case D3DTSS_ADDRESSU:
10471047 *lpdwValue = texstages[dwStage].addressu;
1048 - TRACE_RET(23,D3D_OK);
 1048+ TRACE_RET(HRESULT,23,D3D_OK);
10491049 case D3DTSS_ADDRESSV:
10501050 *lpdwValue = texstages[dwStage].addressv;
1051 - TRACE_RET(23,D3D_OK);
 1051+ TRACE_RET(HRESULT,23,D3D_OK);
10521052 case D3DTSS_BORDERCOLOR:
10531053 *lpdwValue = texstages[dwStage].bordercolor;
1054 - TRACE_RET(23,D3D_OK);
 1054+ TRACE_RET(HRESULT,23,D3D_OK);
10551055 case D3DTSS_MAGFILTER:
10561056 *lpdwValue = texstages[dwStage].magfilter;
1057 - TRACE_RET(23,D3D_OK);
 1057+ TRACE_RET(HRESULT,23,D3D_OK);
10581058 case D3DTSS_MINFILTER:
10591059 *lpdwValue = texstages[dwStage].minfilter;
1060 - TRACE_RET(23,D3D_OK);
 1060+ TRACE_RET(HRESULT,23,D3D_OK);
10611061 case D3DTSS_MIPFILTER:
10621062 *lpdwValue = texstages[dwStage].mipfilter;
1063 - TRACE_RET(23,D3D_OK);
 1063+ TRACE_RET(HRESULT,23,D3D_OK);
10641064 case D3DTSS_MIPMAPLODBIAS:
10651065 memcpy(lpdwValue,&texstages[dwStage].lodbias,sizeof(D3DVALUE));
1066 - TRACE_RET(23,D3D_OK);
 1066+ TRACE_RET(HRESULT,23,D3D_OK);
10671067 case D3DTSS_MAXMIPLEVEL:
10681068 *lpdwValue = texstages[dwStage].miplevel;
1069 - TRACE_RET(23,D3D_OK);
 1069+ TRACE_RET(HRESULT,23,D3D_OK);
10701070 case D3DTSS_MAXANISOTROPY:
10711071 *lpdwValue = texstages[dwStage].anisotropy;
1072 - TRACE_RET(23,D3D_OK);
 1072+ TRACE_RET(HRESULT,23,D3D_OK);
10731073 case D3DTSS_BUMPENVLSCALE:
10741074 memcpy(lpdwValue,&texstages[dwStage].bumpenvlscale,sizeof(D3DVALUE));
1075 - TRACE_RET(23,D3D_OK);
 1075+ TRACE_RET(HRESULT,23,D3D_OK);
10761076 case D3DTSS_BUMPENVLOFFSET:
10771077 memcpy(lpdwValue,&texstages[dwStage].bumpenvloffset,sizeof(D3DVALUE));
1078 - TRACE_RET(23,D3D_OK);
 1078+ TRACE_RET(HRESULT,23,D3D_OK);
10791079 case D3DTSS_TEXTURETRANSFORMFLAGS:
10801080 *lpdwValue = texstages[dwStage].textransform;
1081 - TRACE_RET(23,D3D_OK);
 1081+ TRACE_RET(HRESULT,23,D3D_OK);
10821082 default:
1083 - TRACE_RET(23,DDERR_INVALIDPARAMS);
 1083+ TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
10841084 }
1085 - TRACE_RET(23,DDERR_GENERIC);
 1085+ TRACE_RET(HRESULT,23,DDERR_GENERIC);
10861086 }
10871087 HRESULT WINAPI glDirect3DDevice7::GetTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix)
10881088 {
10891089 TRACE_ENTER(3,14,this,29,dtstTransformStateType,14,lpD3DMatrix);
1090 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1090+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
10911091 switch(dtstTransformStateType)
10921092 {
10931093 case D3DTRANSFORMSTATE_WORLD:
10941094 memcpy(lpD3DMatrix,&matWorld,sizeof(D3DMATRIX));
1095 - TRACE_RET(23,D3D_OK);
 1095+ TRACE_RET(HRESULT,23,D3D_OK);
10961096 case D3DTRANSFORMSTATE_VIEW:
10971097 memcpy(lpD3DMatrix,&matView,sizeof(D3DMATRIX));
1098 - TRACE_RET(23,D3D_OK);
 1098+ TRACE_RET(HRESULT,23,D3D_OK);
10991099 case D3DTRANSFORMSTATE_PROJECTION:
11001100 memcpy(lpD3DMatrix,&matProjection,sizeof(D3DMATRIX));
1101 - TRACE_RET(23,D3D_OK);
 1101+ TRACE_RET(HRESULT,23,D3D_OK);
11021102 default:
1103 - TRACE_RET(23,DDERR_INVALIDPARAMS);
 1103+ TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
11041104 }
1105 - TRACE_RET(23,DDERR_GENERIC);
 1105+ TRACE_RET(HRESULT,23,DDERR_GENERIC);
11061106 }
11071107 HRESULT WINAPI glDirect3DDevice7::GetViewport(LPD3DVIEWPORT7 lpViewport)
11081108 {
11091109 TRACE_ENTER(2,14,this,14,lpViewport);
1110 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1110+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
11111111 memcpy(lpViewport,&viewport,sizeof(D3DVIEWPORT7));
11121112 TRACE_EXIT(23,D3D_OK);
11131113 return D3D_OK;
@@ -1114,19 +1114,19 @@
11151115 HRESULT WINAPI glDirect3DDevice7::LightEnable(DWORD dwLightIndex, BOOL bEnable)
11161116 {
11171117 TRACE_ENTER(3,14,this,8,dwLightIndex,22,bEnable);
1118 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1118+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
11191119 int i;
11201120 D3DLIGHT7 light;
11211121 bool foundlight = false;
11221122 if(dwLightIndex >= lightsmax)
11231123 {
1124 - if(!ExpandLightBuffer(&lights,&lightsmax,dwLightIndex-1)) TRACE_RET(23,DDERR_OUTOFMEMORY);
 1124+ if(!ExpandLightBuffer(&lights,&lightsmax,dwLightIndex-1)) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
11251125 }
11261126 if(!lights[dwLightIndex]) lights[dwLightIndex] = new glDirect3DLight;
11271127 if(bEnable)
11281128 {
11291129 for(i = 0; i < 8; i++)
1130 - if(gllights[i] == dwLightIndex) TRACE_RET(23,D3D_OK);
 1130+ if(gllights[i] == dwLightIndex) TRACE_RET(HRESULT,23,D3D_OK);
11311131 for(i = 0; i < 8; i++)
11321132 {
11331133 if(gllights[i] == -1)
@@ -1136,7 +1136,7 @@
11371137 break;
11381138 }
11391139 }
1140 - if(!foundlight) TRACE_RET(23,D3DERR_LIGHT_SET_FAILED);
 1140+ if(!foundlight) TRACE_RET(HRESULT,23,D3DERR_LIGHT_SET_FAILED);
11411141 }
11421142 else
11431143 {
@@ -1157,7 +1157,7 @@
11581158 LPRECT lprcSrcRect, DWORD dwFlags)
11591159 {
11601160 TRACE_ENTER(6,14,this,14,lpDestTex,25,lpDestPoint,14,lpSrcTex,26,lprcSrcRect,9,dwFlags);
1161 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1161+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
11621162 FIXME("glDirect3DDevice7::Load: stub");
11631163 TRACE_EXIT(23,DDERR_GENERIC);
11641164 ERR(DDERR_GENERIC);
@@ -1165,7 +1165,7 @@
11661166 HRESULT WINAPI glDirect3DDevice7::MultiplyTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix)
11671167 {
11681168 TRACE_ENTER(3,14,this,29,dtstTransformStateType,14,lpD3DMatrix);
1169 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1169+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
11701170 FIXME("glDirect3DDevice7::MultiplyTransform: stub");
11711171 TRACE_EXIT(23,DDERR_GENERIC);
11721172 ERR(DDERR_GENERIC);
@@ -1173,7 +1173,7 @@
11741174 HRESULT WINAPI glDirect3DDevice7::PreLoad(LPDIRECTDRAWSURFACE7 lpddsTexture)
11751175 {
11761176 TRACE_ENTER(2,14,this,14,lpddsTexture);
1177 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1177+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
11781178 FIXME("glDirect3DDevice7::PreLoad: stub");
11791179 TRACE_EXIT(23,DDERR_GENERIC);
11801180 ERR(DDERR_GENERIC);
@@ -1181,7 +1181,7 @@
11821182 HRESULT WINAPI glDirect3DDevice7::SetClipPlane(DWORD dwIndex, D3DVALUE* pPlaneEquation)
11831183 {
11841184 TRACE_ENTER(3,14,this,8,dwIndex,14,pPlaneEquation);
1185 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1185+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
11861186 FIXME("glDirect3DDevice7::SetClipPland: stub");
11871187 TRACE_EXIT(23,DDERR_GENERIC);
11881188 ERR(DDERR_GENERIC);
@@ -1189,7 +1189,7 @@
11901190 HRESULT WINAPI glDirect3DDevice7::SetClipStatus(LPD3DCLIPSTATUS lpD3DClipStatus)
11911191 {
11921192 TRACE_ENTER(2,14,this,14,lpD3DClipStatus);
1193 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1193+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
11941194 FIXME("glDirect3DDevice7::SetClipStatus: stub");
11951195 TRACE_EXIT(23,DDERR_GENERIC);
11961196 ERR(DDERR_GENERIC);
@@ -1197,11 +1197,11 @@
11981198 HRESULT WINAPI glDirect3DDevice7::SetLight(DWORD dwLightIndex, LPD3DLIGHT7 lpLight)
11991199 {
12001200 TRACE_ENTER(3,14,this,8,dwLightIndex,14,lpLight);
1201 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1201+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
12021202 bool foundlight = false;
12031203 if(dwLightIndex >= lightsmax)
12041204 {
1205 - if(!ExpandLightBuffer(&lights,&lightsmax,dwLightIndex-1)) TRACE_RET(23,DDERR_OUTOFMEMORY);
 1205+ if(!ExpandLightBuffer(&lights,&lightsmax,dwLightIndex-1)) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
12061206 }
12071207 if(!lights[dwLightIndex]) lights[dwLightIndex] = new glDirect3DLight;
12081208 lights[dwLightIndex]->SetLight7(lpLight);
@@ -1211,8 +1211,8 @@
12121212 HRESULT WINAPI glDirect3DDevice7::SetMaterial(LPD3DMATERIAL7 lpMaterial)
12131213 {
12141214 TRACE_ENTER(2,14,this,14,lpMaterial);
1215 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1216 - if(!lpMaterial) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1215+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1216+ if(!lpMaterial) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
12171217 memcpy(&material,lpMaterial,sizeof(D3DMATERIAL7));
12181218 TRACE_EXIT(23,D3D_OK);
12191219 return D3D_OK;
@@ -1221,14 +1221,14 @@
12221222 HRESULT WINAPI glDirect3DDevice7::SetRenderState(D3DRENDERSTATETYPE dwRendStateType, DWORD dwRenderState)
12231223 {
12241224 TRACE_ENTER(3,14,this,27,dwRendStateType,9,dwRenderState);
1225 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1225+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
12261226 switch(dwRendStateType)
12271227 {
12281228 case D3DRENDERSTATE_TEXTUREHANDLE:
1229 - if(dwRenderState > texturecount-1) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1229+ if(dwRenderState > texturecount-1) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
12301230 if(dwRenderState)
12311231 {
1232 - if(!textures[dwRenderState]) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1232+ if(!textures[dwRenderState]) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
12331233 SetTexture(0,textures[dwRenderState]);
12341234 }
12351235 else SetTexture(0,NULL);
@@ -1287,7 +1287,7 @@
12881288 }
12891289 break;
12901290 case D3DRENDERSTATE_TEXTUREMAPBLEND:
1291 - if(!dwRenderState || (dwRenderState > D3DTBLEND_ADD)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1291+ if(!dwRenderState || (dwRenderState > D3DTBLEND_ADD)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
12921292 switch(dwRenderState)
12931293 {
12941294 case D3DTBLEND_DECAL:
@@ -1323,7 +1323,7 @@
13241324 case D3DTBLEND_DECALMASK:
13251325 case D3DTBLEND_MODULATEMASK:
13261326 FIXME("DX5 masked blend modes not supported.");
1327 - TRACE_RET(23,DDERR_UNSUPPORTED);
 1327+ TRACE_RET(HRESULT,23,DDERR_UNSUPPORTED);
13281328 case D3DTBLEND_ADD:
13291329 SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TEXTURE);
13301330 SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_CURRENT);
@@ -1334,8 +1334,8 @@
13351335 }
13361336 break;
13371337 }
1338 - if(dwRendStateType > 152) TRACE_RET(23,DDERR_INVALIDPARAMS);
1339 - if(dwRendStateType < 0) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1338+ if(dwRendStateType > 152) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1339+ if(dwRendStateType < 0) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
13401340 renderstate[dwRendStateType] = dwRenderState;
13411341 TRACE_EXIT(23,D3D_OK);
13421342 return D3D_OK;
@@ -1343,13 +1343,13 @@
13441344 HRESULT WINAPI glDirect3DDevice7::SetRenderTarget(LPDIRECTDRAWSURFACE7 lpNewRenderTarget, DWORD dwFlags)
13451345 {
13461346 TRACE_ENTER(3,14,this,14,lpNewRenderTarget,9,dwFlags);
1347 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1348 - if(!lpNewRenderTarget) TRACE_RET(23,DDERR_INVALIDPARAMS);
1349 - if(dwFlags) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1347+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1348+ if(!lpNewRenderTarget) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1349+ if(dwFlags) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
13501350 DDSURFACEDESC2 ddsd;
13511351 ddsd.dwSize = sizeof(DDSURFACEDESC2);
13521352 lpNewRenderTarget->GetSurfaceDesc(&ddsd);
1353 - if(!(ddsd.ddsCaps.dwCaps & DDSCAPS_3DDEVICE)) TRACE_RET(23,DDERR_INVALIDSURFACETYPE);
 1353+ if(!(ddsd.ddsCaps.dwCaps & DDSCAPS_3DDEVICE)) TRACE_RET(HRESULT,23,DDERR_INVALIDSURFACETYPE);
13541354 glDDS7->Release();
13551355 glDDS7 = (glDirectDrawSurface7*)lpNewRenderTarget;
13561356 glDDS7->AddRef();
@@ -1359,7 +1359,7 @@
13601360 HRESULT WINAPI glDirect3DDevice7::SetStateData(DWORD dwState, LPVOID lpStateData)
13611361 {
13621362 TRACE_ENTER(3,14,this,8,dwState,14,lpStateData);
1363 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1363+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
13641364 FIXME("glDirect3DDevice7::SetStateData: stub");
13651365 TRACE_EXIT(23,DDERR_GENERIC);
13661366 ERR(DDERR_GENERIC);
@@ -1367,8 +1367,8 @@
13681368 HRESULT WINAPI glDirect3DDevice7::SetTexture(DWORD dwStage, LPDIRECTDRAWSURFACE7 lpTexture)
13691369 {
13701370 TRACE_ENTER(3,14,this,8,dwStage,14,lpTexture);
1371 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1372 - if(dwStage > 7) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1371+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1372+ if(dwStage > 7) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
13731373 if(texstages[dwStage].texture) texstages[dwStage].texture->Release();
13741374 texstages[dwStage].texture = (glDirectDrawSurface7*)lpTexture;
13751375 texstages[dwStage].dirty = true;
@@ -1379,12 +1379,12 @@
13801380 HRESULT WINAPI glDirect3DDevice7::SetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE dwState, DWORD dwValue)
13811381 {
13821382 TRACE_ENTER(4,14,this,8,dwStage,28,dwState,9,dwValue);
1383 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1384 - if(dwStage > 7) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1383+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1384+ if(dwStage > 7) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
13851385 switch(dwState)
13861386 {
13871387 case D3DTSS_COLOROP:
1388 - if(!dwValue || (dwValue > 24)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1388+ if(!dwValue || (dwValue > 24)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
13891389 if(dwStage == 0)renderstate[D3DRENDERSTATE_TEXTUREMAPBLEND] = 0;
13901390 texstages[dwStage].colorop = (D3DTEXTUREOP)dwValue;
13911391 texstages[dwStage].dirty = true;
@@ -1391,21 +1391,21 @@
13921392 TRACE_EXIT(23,D3D_OK);
13931393 return D3D_OK;
13941394 case D3DTSS_COLORARG1:
1395 - if((dwValue & D3DTA_SELECTMASK) > 4) TRACE_RET(23,DDERR_INVALIDPARAMS);
1396 - if(dwValue > 0x34) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1395+ if((dwValue & D3DTA_SELECTMASK) > 4) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1396+ if(dwValue > 0x34) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
13971397 texstages[dwStage].colorarg1 = dwValue;
13981398 texstages[dwStage].dirty = true;
13991399 TRACE_EXIT(23,D3D_OK);
14001400 return D3D_OK;
14011401 case D3DTSS_COLORARG2:
1402 - if((dwValue & D3DTA_SELECTMASK) > 4) TRACE_RET(23,DDERR_INVALIDPARAMS);
1403 - if(dwValue > 0x34) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1402+ if((dwValue & D3DTA_SELECTMASK) > 4) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1403+ if(dwValue > 0x34) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
14041404 texstages[dwStage].colorarg2 = dwValue;
14051405 texstages[dwStage].dirty = true;
14061406 TRACE_EXIT(23,D3D_OK);
14071407 return D3D_OK;
14081408 case D3DTSS_ALPHAOP:
1409 - if(!dwValue || (dwValue > 24)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1409+ if(!dwValue || (dwValue > 24)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
14101410 if(dwStage == 0)renderstate[D3DRENDERSTATE_TEXTUREMAPBLEND] = 0;
14111411 texstages[dwStage].alphaop = (D3DTEXTUREOP )dwValue;
14121412 texstages[dwStage].dirty = true;
@@ -1412,15 +1412,15 @@
14131413 TRACE_EXIT(23,D3D_OK);
14141414 return D3D_OK;
14151415 case D3DTSS_ALPHAARG1:
1416 - if((dwValue & D3DTA_SELECTMASK) > 4) TRACE_RET(23,DDERR_INVALIDPARAMS);
1417 - if(dwValue > 0x34) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1416+ if((dwValue & D3DTA_SELECTMASK) > 4) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1417+ if(dwValue > 0x34) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
14181418 texstages[dwStage].alphaarg1 = dwValue;
14191419 texstages[dwStage].dirty = true;
1420 - TRACE_RET(23,D3D_OK);
 1420+ TRACE_RET(HRESULT,23,D3D_OK);
14211421 return D3D_OK;
14221422 case D3DTSS_ALPHAARG2:
1423 - if((dwValue & D3DTA_SELECTMASK) > 4) TRACE_RET(23,DDERR_INVALIDPARAMS);
1424 - if(dwValue > 0x34) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1423+ if((dwValue & D3DTA_SELECTMASK) > 4) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1424+ if(dwValue > 0x34) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
14251425 texstages[dwStage].alphaarg2 = dwValue;
14261426 texstages[dwStage].dirty = true;
14271427 TRACE_EXIT(23,D3D_OK);
@@ -1446,14 +1446,14 @@
14471447 TRACE_EXIT(23,D3D_OK);
14481448 return D3D_OK;
14491449 case D3DTSS_TEXCOORDINDEX:
1450 - if((dwValue & 0xFFFF) > 7) TRACE_RET(23,DDERR_INVALIDPARAMS);
1451 - if((dwValue >> 16) > 3) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1450+ if((dwValue & 0xFFFF) > 7) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1451+ if((dwValue >> 16) > 3) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
14521452 texstages[dwStage].texcoordindex = dwValue;
14531453 texstages[dwStage].dirty = true;
14541454 TRACE_EXIT(23,D3D_OK);
14551455 return D3D_OK;
14561456 case D3DTSS_ADDRESS:
1457 - if(!dwValue || (dwValue > 4)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1457+ if(!dwValue || (dwValue > 4)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
14581458 texstages[dwStage].addressu = (D3DTEXTUREADDRESS)dwValue;
14591459 texstages[dwStage].addressv = (D3DTEXTUREADDRESS)dwValue;
14601460 texstages[dwStage].dirty = true;
@@ -1460,13 +1460,13 @@
14611461 TRACE_EXIT(23,D3D_OK);
14621462 return D3D_OK;
14631463 case D3DTSS_ADDRESSU:
1464 - if(!dwValue || (dwValue > 4)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1464+ if(!dwValue || (dwValue > 4)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
14651465 texstages[dwStage].addressu = (D3DTEXTUREADDRESS)dwValue;
14661466 texstages[dwStage].dirty = true;
14671467 TRACE_EXIT(23,D3D_OK);
14681468 return D3D_OK;
14691469 case D3DTSS_ADDRESSV:
1470 - if(!dwValue || (dwValue > 4)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1470+ if(!dwValue || (dwValue > 4)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
14711471 texstages[dwStage].addressv = (D3DTEXTUREADDRESS)dwValue;
14721472 texstages[dwStage].dirty = true;
14731473 TRACE_EXIT(23,D3D_OK);
@@ -1477,7 +1477,7 @@
14781478 TRACE_EXIT(23,D3D_OK);
14791479 return D3D_OK;
14801480 case D3DTSS_MAGFILTER:
1481 - if(!dwValue || (dwValue > 5)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1481+ if(!dwValue || (dwValue > 5)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
14821482 texstages[dwStage].magfilter = (D3DTEXTUREMAGFILTER)dwValue;
14831483 texstages[dwStage].dirty = true;
14841484 switch(texstages[dwStage].magfilter)
@@ -1496,7 +1496,7 @@
14971497 TRACE_EXIT(23,D3D_OK);
14981498 return D3D_OK;
14991499 case D3DTSS_MINFILTER:
1500 - if(!dwValue || (dwValue > 3)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1500+ if(!dwValue || (dwValue > 3)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
15011501 texstages[dwStage].minfilter = (D3DTEXTUREMINFILTER)dwValue;
15021502 texstages[dwStage].dirty = true;
15031503 switch(texstages[dwStage].minfilter)
@@ -1537,7 +1537,7 @@
15381538 TRACE_EXIT(23,D3D_OK);
15391539 return D3D_OK;
15401540 case D3DTSS_MIPFILTER:
1541 - if(!dwValue || (dwValue > 3)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1541+ if(!dwValue || (dwValue > 3)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
15421542 texstages[dwStage].mipfilter = (D3DTEXTUREMIPFILTER)dwValue;
15431543 texstages[dwStage].dirty = true;
15441544 switch(texstages[dwStage].mipfilter)
@@ -1605,8 +1605,8 @@
16061606 TRACE_EXIT(23,D3D_OK);
16071607 return D3D_OK;
16081608 case D3DTSS_TEXTURETRANSFORMFLAGS:
1609 - if((dwValue & 0xFF) > 4) TRACE_RET(23,DDERR_INVALIDPARAMS);
1610 - if((dwValue >> 8) > 1) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1609+ if((dwValue & 0xFF) > 4) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1610+ if((dwValue >> 8) > 1) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
16111611 texstages[dwStage].textransform = (D3DTEXTURETRANSFORMFLAGS)dwValue;
16121612 texstages[dwStage].dirty = true;
16131613 TRACE_EXIT(23,D3D_OK);
@@ -1615,13 +1615,13 @@
16161616 TRACE_EXIT(23,DDERR_INVALIDPARAMS);
16171617 return DDERR_INVALIDPARAMS;
16181618 }
1619 - TRACE_RET(23,DDERR_GENERIC);
 1619+ TRACE_RET(HRESULT,23,DDERR_GENERIC);
16201620 ERR(DDERR_GENERIC);
16211621 }
16221622 HRESULT WINAPI glDirect3DDevice7::SetTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix)
16231623 {
16241624 TRACE_ENTER(3,14,this,29,dtstTransformStateType,14,lpD3DMatrix);
1625 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1625+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
16261626 switch(dtstTransformStateType)
16271627 {
16281628 case D3DTRANSFORMSTATE_WORLD:
@@ -1643,7 +1643,7 @@
16441644 TRACE_EXIT(23,D3D_OK);
16451645 return D3D_OK;
16461646 default:
1647 - TRACE_RET(23,DDERR_INVALIDPARAMS);
 1647+ TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
16481648 }
16491649 TRACE_EXIT(23,DDERR_GENERIC);
16501650 return DDERR_GENERIC;
@@ -1651,7 +1651,7 @@
16521652 HRESULT WINAPI glDirect3DDevice7::SetViewport(LPD3DVIEWPORT7 lpViewport)
16531653 {
16541654 TRACE_ENTER(2,14,this,14,lpViewport);
1655 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1655+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
16561656 memcpy(&viewport,lpViewport,sizeof(D3DVIEWPORT7));
16571657 transform_dirty = true;
16581658 TRACE_EXIT(23,D3D_OK);
@@ -1660,7 +1660,7 @@
16611661 HRESULT WINAPI glDirect3DDevice7::ValidateDevice(LPDWORD lpdwPasses)
16621662 {
16631663 TRACE_ENTER(2,14,this,14,lpdwPasses);
1664 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1664+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
16651665 for(int i = 0; i < 8; i++)
16661666 {
16671667 switch(texstages[i].colorop)
@@ -1682,7 +1682,7 @@
16831683 case D3DTOP_BLENDCURRENTALPHA:
16841684 break;
16851685 default:
1686 - TRACE_RET(23,D3DERR_UNSUPPORTEDCOLOROPERATION);
 1686+ TRACE_RET(HRESULT,23,D3DERR_UNSUPPORTEDCOLOROPERATION);
16871687 }
16881688 }
16891689 for(int i = 0; i < 8; i++)
@@ -1706,7 +1706,7 @@
17071707 case D3DTOP_BLENDCURRENTALPHA:
17081708 break;
17091709 default:
1710 - TRACE_RET(23,D3DERR_UNSUPPORTEDALPHAOPERATION);
 1710+ TRACE_RET(HRESULT,23,D3DERR_UNSUPPORTEDALPHAOPERATION);
17111711 }
17121712 }
17131713 if(lpdwPasses) *lpdwPasses = 1;
@@ -1804,11 +1804,11 @@
18051805 HRESULT glDirect3DDevice7::AddViewport(LPDIRECT3DVIEWPORT3 lpDirect3DViewport)
18061806 {
18071807 TRACE_ENTER(2,14,this,14,lpDirect3DViewport);
1808 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1809 - if(!lpDirect3DViewport) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1808+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1809+ if(!lpDirect3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
18101810 for(int i = 0; i < maxviewports; i++)
18111811 {
1812 - if(viewports[i] == lpDirect3DViewport) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1812+ if(viewports[i] == lpDirect3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
18131813 }
18141814 viewports[viewportcount] = (glDirect3DViewport3*)lpDirect3DViewport;
18151815 viewports[viewportcount]->AddRef();
@@ -1824,7 +1824,7 @@
18251825 viewports[viewportcount]->Release();
18261826 viewports[viewportcount] = NULL;
18271827 maxviewports -= 32;
1828 - TRACE_RET(23,DDERR_OUTOFMEMORY);
 1828+ TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
18291829 }
18301830 }
18311831 viewports[viewportcount-1]->SetDevice(this);
@@ -1835,8 +1835,8 @@
18361836 HRESULT glDirect3DDevice7::DeleteViewport(LPDIRECT3DVIEWPORT3 lpDirect3DViewport)
18371837 {
18381838 TRACE_ENTER(2,14,this,14,lpDirect3DViewport);
1839 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1840 - if(!lpDirect3DViewport) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1839+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1840+ if(!lpDirect3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
18411841 for(int i = 0; i < maxviewports; i++)
18421842 {
18431843 if(viewports[i] == lpDirect3DViewport)
@@ -1857,9 +1857,9 @@
18581858 HRESULT glDirect3DDevice7::NextViewport(LPDIRECT3DVIEWPORT3 lpDirect3DViewport, LPDIRECT3DVIEWPORT3 *lplpAnotherViewport, DWORD dwFlags)
18591859 {
18601860 TRACE_ENTER(4,14,this,14,lpDirect3DViewport,14,lplpAnotherViewport,9,dwFlags);
1861 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1862 - if(!lpDirect3DViewport) TRACE_RET(23,DDERR_INVALIDPARAMS);
1863 - if(!lplpAnotherViewport) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1861+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1862+ if(!lpDirect3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1863+ if(!lplpAnotherViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
18641864 FIXME("glDirect3DDevice7::NextViewport: stub");
18651865 TRACE_EXIT(23,DDERR_GENERIC);
18661866 return DDERR_GENERIC;
@@ -1868,9 +1868,9 @@
18691869 HRESULT glDirect3DDevice7::GetCurrentViewport(LPDIRECT3DVIEWPORT3 *lplpd3dViewport)
18701870 {
18711871 TRACE_ENTER(2,14,this,14,lplpd3dViewport);
1872 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1873 - if(!lplpd3dViewport) TRACE_RET(23,DDERR_INVALIDPARAMS);
1874 - if(!currentviewport) TRACE_RET(23,D3DERR_NOCURRENTVIEWPORT);
 1872+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1873+ if(!lplpd3dViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1874+ if(!currentviewport) TRACE_RET(HRESULT,23,D3DERR_NOCURRENTVIEWPORT);
18751875 *lplpd3dViewport = currentviewport;
18761876 currentviewport->AddRef();
18771877 TRACE_VAR("*lplpd3dViewport",14,*lplpd3dViewport);
@@ -1881,9 +1881,9 @@
18821882 HRESULT glDirect3DDevice7::SetCurrentViewport(LPDIRECT3DVIEWPORT3 lpd3dViewport)
18831883 {
18841884 TRACE_ENTER(2,14,this,14,lpd3dViewport);
1885 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1886 - if(!lpd3dViewport) TRACE_RET(23,DDERR_INVALIDPARAMS);
1887 - if(currentviewport == lpd3dViewport) TRACE_RET(23,D3D_OK);
 1885+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1886+ if(!lpd3dViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1887+ if(currentviewport == lpd3dViewport) TRACE_RET(HRESULT,23,D3D_OK);
18881888 for(int i = 0; i < maxviewports; i++)
18891889 {
18901890 if(lpd3dViewport == viewports[i])
@@ -1901,7 +1901,7 @@
19021902 HRESULT glDirect3DDevice7::Begin(D3DPRIMITIVETYPE d3dpt, DWORD dwVertexTypeDesc, DWORD dwFlags)
19031903 {
19041904 TRACE_ENTER(4,14,this,8,d3dpt,9,dwVertexTypeDesc,9,dwFlags);
1905 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1905+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
19061906 FIXME("glDirect3DDevice7::Begin: stub");
19071907 TRACE_EXIT(23,DDERR_GENERIC);
19081908 return DDERR_GENERIC;
@@ -1909,8 +1909,8 @@
19101910 HRESULT glDirect3DDevice7::BeginIndexed(D3DPRIMITIVETYPE dptPrimitiveType, DWORD dwVertexTypeDesc, LPVOID lpvVertices, DWORD dwNumVertices, DWORD dwFlags)
19111911 {
19121912 TRACE_ENTER(6,14,this,8,dptPrimitiveType,9,dwVertexTypeDesc,14,lpvVertices,8,dwNumVertices,9,dwFlags);
1913 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1914 - if(!lpvVertices) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1913+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1914+ if(!lpvVertices) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
19151915 FIXME("glDirect3DDevice7::BeginIndexed: stub");
19161916 TRACE_EXIT(23,DDERR_GENERIC);
19171917 return DDERR_GENERIC;
@@ -1918,7 +1918,7 @@
19191919 HRESULT glDirect3DDevice7::Index(WORD wVertexIndex)
19201920 {
19211921 TRACE_ENTER(2,14,this,5,wVertexIndex);
1922 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1922+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
19231923 FIXME("glDirect3DDevice7::Index: stub");
19241924 TRACE_EXIT(23,DDERR_GENERIC);
19251925 return DDERR_GENERIC;
@@ -1926,8 +1926,8 @@
19271927 HRESULT glDirect3DDevice7::Vertex(LPVOID lpVertex)
19281928 {
19291929 TRACE_ENTER(2,14,this,14,lpVertex);
1930 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1931 - if(!lpVertex) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1930+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1931+ if(!lpVertex) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
19321932 FIXME("glDirect3DDevice7::Vertex: stub");
19331933 TRACE_EXIT(23,DDERR_GENERIC);
19341934 return DDERR_GENERIC;
@@ -1935,7 +1935,7 @@
19361936 HRESULT glDirect3DDevice7::End(DWORD dwFlags)
19371937 {
19381938 TRACE_ENTER(2,14,this,9,dwFlags);
1939 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1939+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
19401940 FIXME("glDirect3DDevice7::End: stub");
19411941 TRACE_EXIT(23,DDERR_GENERIC);
19421942 return DDERR_GENERIC;
@@ -1944,7 +1944,7 @@
19451945 HRESULT glDirect3DDevice7::ComputeSphereVisibility3(LPD3DVECTOR lpCenters, LPD3DVALUE lpRadii, DWORD dwNumSpheres, DWORD dwFlags, LPDWORD lpdwReturnValues)
19461946 {
19471947 TRACE_ENTER(6,14,this,14,lpCenters,14,lpRadii,8,dwNumSpheres,9,dwFlags,14,lpdwReturnValues);
1948 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1948+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
19491949 FIXME("glDirect3DDevice3::ComputeSphereVisibility: stub");
19501950 TRACE_EXIT(23,DDERR_GENERIC);
19511951 return DDERR_GENERIC;
@@ -1953,13 +1953,13 @@
19541954 HRESULT glDirect3DDevice7::GetCaps3(LPD3DDEVICEDESC lpD3DHWDevDesc, LPD3DDEVICEDESC lpD3DHELDevDesc)
19551955 {
19561956 TRACE_ENTER(3,14,this,14,lpD3DHWDevDesc,14,lpD3DHELDevDesc);
1957 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1958 - if(!lpD3DHWDevDesc && !lpD3DHELDevDesc) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1957+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1958+ if(!lpD3DHWDevDesc && !lpD3DHELDevDesc) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
19591959 D3DDEVICEDESC desc = d3ddesc3;
19601960 if(lpD3DHELDevDesc)
19611961 {
19621962 desc.dwSize = lpD3DHELDevDesc->dwSize;
1963 - if(desc.dwSize < sizeof(D3DDEVICEDESC1)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1963+ if(desc.dwSize < sizeof(D3DDEVICEDESC1)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
19641964 if(desc.dwSize > sizeof(D3DDEVICEDESC1)) desc.dwSize = sizeof(D3DDEVICEDESC);
19651965 memcpy(lpD3DHELDevDesc, &desc, desc.dwSize);
19661966 }
@@ -1967,7 +1967,7 @@
19681968 if(lpD3DHWDevDesc)
19691969 {
19701970 desc.dwSize = lpD3DHWDevDesc->dwSize;
1971 - if(desc.dwSize < sizeof(D3DDEVICEDESC1)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1971+ if(desc.dwSize < sizeof(D3DDEVICEDESC1)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
19721972 if(desc.dwSize > sizeof(D3DDEVICEDESC1)) desc.dwSize = sizeof(D3DDEVICEDESC);
19731973 memcpy(lpD3DHWDevDesc, &desc, desc.dwSize);
19741974 }
@@ -1978,8 +1978,8 @@
19791979 HRESULT glDirect3DDevice7::GetLightState(D3DLIGHTSTATETYPE dwLightStateType, LPDWORD lpdwLightState)
19801980 {
19811981 TRACE_ENTER(3,14,this,30,dwLightStateType,14,lpdwLightState);
1982 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1983 - if(!lpdwLightState)TRACE_RET(23,DDERR_INVALIDPARAMS);
 1982+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1983+ if(!lpdwLightState)TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
19841984 switch(dwLightStateType)
19851985 {
19861986 default:
@@ -1991,27 +1991,27 @@
19921992 TRACE_EXIT(23,D3D_OK);
19931993 return D3D_OK;
19941994 case D3DLIGHTSTATE_AMBIENT:
1995 - TRACE_RET(23,GetRenderState(D3DRENDERSTATE_AMBIENT,lpdwLightState));
 1995+ TRACE_RET(HRESULT,23,GetRenderState(D3DRENDERSTATE_AMBIENT,lpdwLightState));
19961996 case D3DLIGHTSTATE_COLORMODEL:
19971997 *lpdwLightState = D3DCOLOR_RGB;
19981998 TRACE_EXIT(23,D3D_OK);
19991999 return D3D_OK;
20002000 case D3DLIGHTSTATE_FOGMODE:
2001 - TRACE_RET(23,GetRenderState(D3DRENDERSTATE_FOGVERTEXMODE,lpdwLightState));
 2001+ TRACE_RET(HRESULT,23,GetRenderState(D3DRENDERSTATE_FOGVERTEXMODE,lpdwLightState));
20022002 case D3DLIGHTSTATE_FOGSTART:
2003 - TRACE_RET(23,GetRenderState(D3DRENDERSTATE_FOGSTART,lpdwLightState));
 2003+ TRACE_RET(HRESULT,23,GetRenderState(D3DRENDERSTATE_FOGSTART,lpdwLightState));
20042004 case D3DLIGHTSTATE_FOGEND:
2005 - TRACE_RET(23,GetRenderState(D3DRENDERSTATE_FOGEND,lpdwLightState));
 2005+ TRACE_RET(HRESULT,23,GetRenderState(D3DRENDERSTATE_FOGEND,lpdwLightState));
20062006 case D3DLIGHTSTATE_FOGDENSITY:
2007 - TRACE_RET(23,GetRenderState(D3DRENDERSTATE_FOGDENSITY,lpdwLightState));
 2007+ TRACE_RET(HRESULT,23,GetRenderState(D3DRENDERSTATE_FOGDENSITY,lpdwLightState));
20082008 case D3DLIGHTSTATE_COLORVERTEX:
2009 - TRACE_RET(23,GetRenderState(D3DRENDERSTATE_COLORVERTEX,lpdwLightState));
 2009+ TRACE_RET(HRESULT,23,GetRenderState(D3DRENDERSTATE_COLORVERTEX,lpdwLightState));
20102010 }
20112011 }
20122012 HRESULT glDirect3DDevice7::SetLightState(D3DLIGHTSTATETYPE dwLightStateType, DWORD dwLightState)
20132013 {
20142014 TRACE_ENTER(3,14,this,30,dwLightStateType,9,dwLightState);
2015 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2015+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
20162016 switch(dwLightStateType)
20172017 {
20182018 default:
@@ -2018,10 +2018,10 @@
20192019 TRACE_EXIT(23,DDERR_INVALIDPARAMS);
20202020 return DDERR_INVALIDPARAMS;
20212021 case D3DLIGHTSTATE_MATERIAL:
2022 - if(!dwLightState) TRACE_RET(23,DDERR_INVALIDPARAMS);
 2022+ if(!dwLightState) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
20232023 if(dwLightState < materialcount)
20242024 {
2025 - if(materials[dwLightState] == currentmaterial) TRACE_RET(23,D3D_OK);
 2025+ if(materials[dwLightState] == currentmaterial) TRACE_RET(HRESULT,23,D3D_OK);
20262026 if(materials[dwLightState])
20272027 {
20282028 if(currentmaterial)currentmaterial->SetCurrent(false);
@@ -2032,20 +2032,20 @@
20332033 TRACE_EXIT(23,D3D_OK);
20342034 return D3D_OK;
20352035 case D3DLIGHTSTATE_AMBIENT:
2036 - TRACE_RET(23,SetRenderState(D3DRENDERSTATE_AMBIENT,dwLightState));
 2036+ TRACE_RET(HRESULT,23,SetRenderState(D3DRENDERSTATE_AMBIENT,dwLightState));
20372037 case D3DLIGHTSTATE_COLORMODEL:
20382038 TRACE_EXIT(23,D3D_OK);
20392039 return D3D_OK;
20402040 case D3DLIGHTSTATE_FOGMODE:
2041 - TRACE_RET(23,SetRenderState(D3DRENDERSTATE_FOGVERTEXMODE,dwLightState));
 2041+ TRACE_RET(HRESULT,23,SetRenderState(D3DRENDERSTATE_FOGVERTEXMODE,dwLightState));
20422042 case D3DLIGHTSTATE_FOGSTART:
2043 - TRACE_RET(23,SetRenderState(D3DRENDERSTATE_FOGSTART,dwLightState));
 2043+ TRACE_RET(HRESULT,23,SetRenderState(D3DRENDERSTATE_FOGSTART,dwLightState));
20442044 case D3DLIGHTSTATE_FOGEND:
2045 - TRACE_RET(23,SetRenderState(D3DRENDERSTATE_FOGEND,dwLightState));
 2045+ TRACE_RET(HRESULT,23,SetRenderState(D3DRENDERSTATE_FOGEND,dwLightState));
20462046 case D3DLIGHTSTATE_FOGDENSITY:
2047 - TRACE_RET(23,SetRenderState(D3DRENDERSTATE_FOGDENSITY,dwLightState));
 2047+ TRACE_RET(HRESULT,23,SetRenderState(D3DRENDERSTATE_FOGDENSITY,dwLightState));
20482048 case D3DLIGHTSTATE_COLORVERTEX:
2049 - TRACE_RET(23,SetRenderState(D3DRENDERSTATE_COLORVERTEX,dwLightState));
 2049+ TRACE_RET(HRESULT,23,SetRenderState(D3DRENDERSTATE_COLORVERTEX,dwLightState));
20502050 }
20512051 }
20522052
@@ -2052,9 +2052,9 @@
20532053 HRESULT glDirect3DDevice7::GetStats(LPD3DSTATS lpD3DStats)
20542054 {
20552055 TRACE_ENTER(2,14,this,14,lpD3DStats);
2056 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2057 - if(!lpD3DStats) TRACE_RET(23,DDERR_INVALIDPARAMS);
2058 - if(lpD3DStats->dwSize < sizeof(D3DSTATS)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 2056+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2057+ if(!lpD3DStats) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2058+ if(lpD3DStats->dwSize < sizeof(D3DSTATS)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
20592059 memcpy(lpD3DStats,&stats,sizeof(D3DSTATS));
20602060 TRACE_EXIT(23,D3D_OK);
20612061 return D3D_OK;
@@ -2063,9 +2063,9 @@
20642064 HRESULT glDirect3DDevice7::SwapTextureHandles(LPDIRECT3DTEXTURE2 lpD3DTex1, LPDIRECT3DTEXTURE2 lpD3DTex2)
20652065 {
20662066 TRACE_ENTER(3,14,this,14,lpD3DTex1,14,lpD3DTex2);
2067 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2068 - if(!lpD3DTex1) TRACE_RET(23,DDERR_INVALIDPARAMS);
2069 - if(!lpD3DTex2) TRACE_RET(23,DDERR_INVALIDPARAMS);
 2067+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2068+ if(!lpD3DTex1) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2069+ if(!lpD3DTex2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
20702070 FIXME("glDirect3DDevice7::SwapTextureHandles: stub");
20712071 TRACE_EXIT(23,DDERR_GENERIC);
20722072 return DDERR_GENERIC;
@@ -2088,13 +2088,13 @@
20892089 HRESULT glDirect3DDevice7::CreateMatrix(LPD3DMATRIXHANDLE lpD3DMatHandle)
20902090 {
20912091 TRACE_ENTER(2,14,this,14,lpD3DMatHandle);
2092 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2093 - if(!lpD3DMatHandle) TRACE_RET(23,DDERR_INVALIDPARAMS);
 2092+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2093+ if(!lpD3DMatHandle) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
20942094 int foundslot = 0;
20952095 if(!matrices)
20962096 {
20972097 matrices = (D3D1MATRIX*)malloc(16*sizeof(D3D1MATRIX));
2098 - if(!matrices) TRACE_RET(23,DDERR_OUTOFMEMORY);
 2098+ if(!matrices) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
20992099 ZeroMemory(matrices,16*sizeof(D3D1MATRIX));
21002100 matrixcount = 16;
21012101 }
@@ -2113,7 +2113,7 @@
21142114 D3D1MATRIX *newmatrices;
21152115 newcount = matrixcount + 16;
21162116 newmatrices = (D3D1MATRIX*)realloc(matrices,newcount*sizeof(D3D1MATRIX));
2117 - if(!newmatrices) TRACE_RET(23,DDERR_OUTOFMEMORY);
 2117+ if(!newmatrices) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
21182118 ZeroMemory(&newmatrices[matrixcount],16*sizeof(D3D1MATRIX));
21192119 matrices = newmatrices;
21202120 foundslot = matrixcount;
@@ -2130,10 +2130,10 @@
21312131 HRESULT glDirect3DDevice7::DeleteMatrix(D3DMATRIXHANDLE d3dMatHandle)
21322132 {
21332133 TRACE_ENTER(2,14,this,9,d3dMatHandle);
2134 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2135 - if(!d3dMatHandle) TRACE_RET(23,DDERR_INVALIDPARAMS);
2136 - if(d3dMatHandle >= matrixcount) TRACE_RET(23,DDERR_INVALIDPARAMS);
2137 - if(!matrices[d3dMatHandle].active) TRACE_RET(23,D3DERR_MATRIX_DESTROY_FAILED);
 2134+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2135+ if(!d3dMatHandle) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2136+ if(d3dMatHandle >= matrixcount) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2137+ if(!matrices[d3dMatHandle].active) TRACE_RET(HRESULT,23,D3DERR_MATRIX_DESTROY_FAILED);
21382138 matrices[d3dMatHandle].active = FALSE;
21392139 TRACE_EXIT(23,D3D_OK);
21402140 return D3D_OK;
@@ -2142,7 +2142,7 @@
21432143 HRESULT glDirect3DDevice7::GetMatrix(D3DMATRIXHANDLE lpD3DMatHandle, LPD3DMATRIX lpD3DMatrix)
21442144 {
21452145 TRACE_ENTER(3,14,this,9,lpD3DMatHandle,14,lpD3DMatrix);
2146 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2146+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
21472147 if(!lpD3DMatHandle)
21482148 {
21492149 __gluMakeIdentityf((GLfloat*)lpD3DMatrix);
@@ -2149,8 +2149,8 @@
21502150 TRACE_EXIT(23,D3D_OK);
21512151 return D3D_OK;
21522152 }
2153 - if(lpD3DMatHandle >= matrixcount) TRACE_RET(23,DDERR_INVALIDPARAMS);
2154 - if(!matrices[lpD3DMatHandle].active) TRACE_RET(23,D3DERR_MATRIX_GETDATA_FAILED);
 2153+ if(lpD3DMatHandle >= matrixcount) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2154+ if(!matrices[lpD3DMatHandle].active) TRACE_RET(HRESULT,23,D3DERR_MATRIX_GETDATA_FAILED);
21552155 memcpy(lpD3DMatrix,&matrices[lpD3DMatHandle].matrix,sizeof(D3DMATRIX));
21562156 TRACE_EXIT(23,D3D_OK);
21572157 return D3D_OK;
@@ -2159,10 +2159,10 @@
21602160 HRESULT glDirect3DDevice7::SetMatrix(D3DMATRIXHANDLE d3dMatHandle, LPD3DMATRIX lpD3DMatrix)
21612161 {
21622162 TRACE_ENTER(3,14,this,9,d3dMatHandle,14,lpD3DMatrix);
2163 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2164 - if(!d3dMatHandle) TRACE_RET(23,DDERR_INVALIDPARAMS);
2165 - if(d3dMatHandle >= matrixcount) TRACE_RET(23,DDERR_INVALIDPARAMS);
2166 - if(!matrices[d3dMatHandle].active) TRACE_RET(23,D3DERR_MATRIX_SETDATA_FAILED);
 2163+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2164+ if(!d3dMatHandle) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2165+ if(d3dMatHandle >= matrixcount) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2166+ if(!matrices[d3dMatHandle].active) TRACE_RET(HRESULT,23,D3DERR_MATRIX_SETDATA_FAILED);
21672167 memcpy(&matrices[d3dMatHandle].matrix,lpD3DMatrix,sizeof(D3DMATRIX));
21682168 if(d3dMatHandle == mhWorld) SetTransform(D3DTRANSFORMSTATE_WORLD,lpD3DMatrix);
21692169 if(d3dMatHandle == mhView) SetTransform(D3DTRANSFORMSTATE_VIEW,lpD3DMatrix);
@@ -2175,14 +2175,14 @@
21762176 IUnknown* pUnkOuter)
21772177 {
21782178 TRACE_ENTER(4,14,this,14,lpDesc,14,lplpDirect3DExecuteBuffer,14,pUnkOuter);
2179 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2180 - if(!lpDesc) TRACE_RET(23,DDERR_INVALIDPARAMS);
2181 - if(!lplpDirect3DExecuteBuffer) TRACE_RET(23,DDERR_INVALIDPARAMS);
2182 - if(pUnkOuter) TRACE_RET(23,DDERR_INVALIDPARAMS);
2183 - if(lpDesc->dwSize != sizeof(D3DEXECUTEBUFFERDESC)) TRACE_RET(23,DDERR_INVALIDPARAMS);
2184 - if(!(lpDesc->dwFlags & D3DDEB_BUFSIZE)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 2179+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2180+ if(!lpDesc) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2181+ if(!lplpDirect3DExecuteBuffer) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2182+ if(pUnkOuter) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2183+ if(lpDesc->dwSize != sizeof(D3DEXECUTEBUFFERDESC)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2184+ if(!(lpDesc->dwFlags & D3DDEB_BUFSIZE)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
21852185 *lplpDirect3DExecuteBuffer = new glDirect3DExecuteBuffer(lpDesc);
2186 - if(!*lplpDirect3DExecuteBuffer) TRACE_RET(23,DDERR_OUTOFMEMORY);
 2186+ if(!*lplpDirect3DExecuteBuffer) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
21872187 TRACE_VAR("*lplpDirect3DExecuteBuffer",14,*lplpDirect3DExecuteBuffer);
21882188 TRACE_EXIT(23,D3D_OK);
21892189 return D3D_OK;
@@ -2339,7 +2339,7 @@
23402340 if(*outsize < (dest+count)*sizeof(D3DTLVERTEX))
23412341 {
23422342 D3DTLVERTEX *tmpptr = (D3DTLVERTEX*)realloc(*output,(dest+count)*sizeof(D3DTLVERTEX));
2343 - if(!tmpptr) TRACE_RET(11,-1);
 2343+ if(!tmpptr) TRACE_RET(INT,11,-1);
23442344 *output = tmpptr;
23452345 *outsize = (dest+count)*sizeof(D3DTLVERTEX);
23462346 }
@@ -2450,7 +2450,7 @@
24512451 if(*outsize < (dest+count)*sizeof(D3DTLVERTEX))
24522452 {
24532453 D3DTLVERTEX *tmpptr = (D3DTLVERTEX*)realloc(*output,(dest+count)*sizeof(D3DTLVERTEX));
2454 - if(!tmpptr) TRACE_RET(11,-1);
 2454+ if(!tmpptr) TRACE_RET(INT,11,-1);
24552455 *output = tmpptr;
24562456 *outsize = (dest+count)*sizeof(D3DTLVERTEX);
24572457 }
@@ -2480,7 +2480,7 @@
24812481 if(*outsize < (dest+count)*sizeof(D3DTLVERTEX))
24822482 {
24832483 D3DTLVERTEX *tmpptr = (D3DTLVERTEX*)realloc(*output,(dest+count)*sizeof(D3DTLVERTEX));
2484 - if(!tmpptr) TRACE_RET(11,-1);
 2484+ if(!tmpptr) TRACE_RET(INT,11,-1);
24852485 *output = tmpptr;
24862486 *outsize = (dest+count)*sizeof(D3DTLVERTEX);
24872487 }
@@ -2508,7 +2508,7 @@
25092509 if(*outsize < (dest+count)*sizeof(D3DTLVERTEX))
25102510 {
25112511 D3DTLVERTEX *tmpptr = (D3DTLVERTEX*)realloc(*output,(dest+count)*sizeof(D3DTLVERTEX));
2512 - if(!tmpptr) TRACE_RET(11,-1);
 2512+ if(!tmpptr) TRACE_RET(INT,11,-1);
25132513 *output = tmpptr;
25142514 *outsize = (dest+count)*sizeof(D3DTLVERTEX);
25152515 }
@@ -2521,9 +2521,9 @@
25222522 HRESULT glDirect3DDevice7::Execute(LPDIRECT3DEXECUTEBUFFER lpDirect3DExecuteBuffer, LPDIRECT3DVIEWPORT lpDirect3DViewport, DWORD dwFlags)
25232523 {
25242524 TRACE_ENTER(4,14,this,14,lpDirect3DExecuteBuffer,14,lpDirect3DViewport,9,dwFlags);
2525 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2526 - if(!lpDirect3DExecuteBuffer) TRACE_RET(23,DDERR_INVALIDPARAMS);
2527 - if(!lpDirect3DViewport) TRACE_RET(23,DDERR_INVALIDPARAMS);
 2525+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2526+ if(!lpDirect3DExecuteBuffer) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2527+ if(!lpDirect3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
25282528 LPDIRECT3DVIEWPORT3 vp;
25292529 lpDirect3DViewport->QueryInterface(IID_IDirect3DViewport3,(void**)&vp);
25302530 if(FAILED(SetCurrentViewport(vp)))
@@ -2536,7 +2536,7 @@
25372537 D3DEXECUTEBUFFERDESC desc;
25382538 D3DEXECUTEDATA data;
25392539 HRESULT err = ((glDirect3DExecuteBuffer*)lpDirect3DExecuteBuffer)->ExecuteLock(&desc,&data);
2540 - if(FAILED(err)) TRACE_RET(23,err);
 2540+ if(FAILED(err)) TRACE_RET(HRESULT,23,err);
25412541 unsigned char *opptr = (unsigned char *)desc.lpData + data.dwInstructionOffset;
25422542 unsigned char *in_vertptr = (unsigned char *)desc.lpData + data.dwVertexOffset;
25432543 DWORD offset;
@@ -2547,7 +2547,7 @@
25482548 if(outbuffersize < desc.dwBufferSize)
25492549 {
25502550 unsigned char *tmpbuffer = (unsigned char *)realloc(outbuffer,desc.dwBufferSize);
2551 - if(!tmpbuffer) TRACE_RET(23,DDERR_OUTOFMEMORY);
 2551+ if(!tmpbuffer) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
25522552 outbuffer = tmpbuffer;
25532553 outbuffersize = desc.dwBufferSize;
25542554 }
@@ -2571,7 +2571,7 @@
25722572 {
25732573 if(!ExpandBuffer((void**)&ebBuffer,&ebBufferSize,(((D3DPOINT*)opptr)->wCount*sizeof(D3DVERTEX) > 1024) ?
25742574 ((D3DPOINT*)opptr)->wCount*sizeof(D3DVERTEX) : 1024))
2575 - TRACE_RET(23,DDERR_OUTOFMEMORY);
 2575+ TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
25762576 }
25772577 memcpy(&ebBuffer+offset,&vert_ptr[((D3DPOINT*)opptr)->wFirst],((D3DPOINT*)opptr)->wCount*sizeof(D3DVERTEX));
25782578 offset+=((D3DPOINT*)opptr)->wCount;
@@ -2590,7 +2590,7 @@
25912591 {
25922592 if(ebBufferSize < (offset + sizeof(D3DLINE)))
25932593 {
2594 - if(!ExpandBuffer((void**)&ebBuffer,&ebBufferSize,1024)) TRACE_RET(23,DDERR_OUTOFMEMORY);
 2594+ if(!ExpandBuffer((void**)&ebBuffer,&ebBufferSize,1024)) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
25952595 }
25962596 memcpy(&ebBuffer+offset,opptr,sizeof(D3DLINE));
25972597 offset += sizeof(D3DLINE);
@@ -2609,7 +2609,7 @@
26102610 for(i = 0; i < instruction->wCount; i++)
26112611 {
26122612 result = AddTriangle(&ebBuffer,&ebBufferSize,&offset,(D3DTRIANGLE*)opptr);
2613 - if(result == -1) TRACE_RET(23,DDERR_OUTOFMEMORY);
 2613+ if(result == -1) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
26142614 opptr += instruction->bSize;
26152615 }
26162616 if(instruction->wCount) DrawIndexedPrimitive(D3DPT_TRIANGLELIST,D3DFVF_TLVERTEX,vert_ptr,
@@ -2794,8 +2794,8 @@
27952795 HRESULT glDirect3DDevice7::GetPickRecords(LPDWORD lpCount, LPD3DPICKRECORD lpD3DPickRec)
27962796 {
27972797 TRACE_ENTER(3,14,this,14,lpCount,14,lpD3DPickRec);
2798 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2799 - if(!lpCount) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2798+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2799+ if(!lpCount) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
28002800 FIXME("glDirect3DDevice1::GetPickRecords: stub");
28012801 TRACE_EXIT(23,DDERR_GENERIC);
28022802 ERR(DDERR_GENERIC);
@@ -2805,10 +2805,10 @@
28062806 LPD3DRECT lpRect)
28072807 {
28082808 TRACE_ENTER(5,14,this,14,lpDirect3DExecuteBuffer,14,lpDirect3DViewport,9,dwFlags,26,lpRect);
2809 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2810 - if(lpDirect3DExecuteBuffer) TRACE_RET(23,DDERR_INVALIDPARAMS);
2811 - if(!lpDirect3DViewport) TRACE_RET(23,DDERR_INVALIDPARAMS);
2812 - if(!lpRect) TRACE_RET(23,DDERR_INVALIDPARAMS);
 2809+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2810+ if(lpDirect3DExecuteBuffer) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2811+ if(!lpDirect3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2812+ if(!lpRect) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
28132813 FIXME("glDirect3DDevice1::Pick: stub");
28142814 TRACE_EXIT(23,DDERR_GENERIC);
28152815 ERR(DDERR_GENERIC);
@@ -2834,7 +2834,7 @@
28352835 HRESULT WINAPI glDirect3DDevice3::QueryInterface(REFIID riid, void** ppvObj)
28362836 {
28372837 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
2838 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2838+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
28392839 if(riid == IID_IUnknown)
28402840 {
28412841 this->AddRef();
@@ -2843,13 +2843,13 @@
28442844 TRACE_EXIT(23,DD_OK);
28452845 return DD_OK;
28462846 }
2847 - TRACE_RET(23,glD3DDev7->QueryInterface(riid,ppvObj));
 2847+ TRACE_RET(HRESULT,23,glD3DDev7->QueryInterface(riid,ppvObj));
28482848 }
28492849
28502850 ULONG WINAPI glDirect3DDevice3::AddRef()
28512851 {
28522852 TRACE_ENTER(1,14,this);
2853 - if(!this) TRACE_RET(8,0);
 2853+ if(!this) TRACE_RET(ULONG,8,0);
28542854 refcount++;
28552855 TRACE_EXIT(8,refcount);
28562856 return refcount;
@@ -2858,7 +2858,7 @@
28592859 ULONG WINAPI glDirect3DDevice3::Release()
28602860 {
28612861 TRACE_ENTER(1,14,this);
2862 - if(!this) TRACE_RET(8,0);
 2862+ if(!this) TRACE_RET(ULONG,8,0);
28632863 ULONG ret;
28642864 refcount--;
28652865 ret = refcount;
@@ -2870,43 +2870,43 @@
28712871 HRESULT WINAPI glDirect3DDevice3::AddViewport(LPDIRECT3DVIEWPORT3 lpDirect3DViewport)
28722872 {
28732873 TRACE_ENTER(2,14,this,14,lpDirect3DViewport);
2874 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2875 - TRACE_RET(23,glD3DDev7->AddViewport(lpDirect3DViewport));
 2874+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2875+ TRACE_RET(HRESULT,23,glD3DDev7->AddViewport(lpDirect3DViewport));
28762876 }
28772877
28782878 HRESULT WINAPI glDirect3DDevice3::Begin(D3DPRIMITIVETYPE d3dpt, DWORD dwVertexTypeDesc, DWORD dwFlags)
28792879 {
28802880 TRACE_ENTER(4,14,this,8,d3dpt,9,dwVertexTypeDesc,9,dwFlags);
2881 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2882 - TRACE_RET(23,glD3DDev7->Begin(d3dpt,dwVertexTypeDesc,dwFlags));
 2881+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2882+ TRACE_RET(HRESULT,23,glD3DDev7->Begin(d3dpt,dwVertexTypeDesc,dwFlags));
28832883 }
28842884
28852885 HRESULT WINAPI glDirect3DDevice3::BeginIndexed(D3DPRIMITIVETYPE dptPrimitiveType, DWORD dwVertexTypeDesc, LPVOID lpvVertices, DWORD dwNumVertices, DWORD dwFlags)
28862886 {
28872887 TRACE_ENTER(6,14,this,8,dptPrimitiveType,9,dwVertexTypeDesc,14,lpvVertices,8,dwNumVertices,9,dwFlags);
2888 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2889 - TRACE_RET(23,glD3DDev7->BeginIndexed(dptPrimitiveType,dwVertexTypeDesc,lpvVertices,dwNumVertices,dwFlags));
 2888+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2889+ TRACE_RET(HRESULT,23,glD3DDev7->BeginIndexed(dptPrimitiveType,dwVertexTypeDesc,lpvVertices,dwNumVertices,dwFlags));
28902890 }
28912891
28922892 HRESULT WINAPI glDirect3DDevice3::BeginScene()
28932893 {
28942894 TRACE_ENTER(1,14,this);
2895 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2896 - TRACE_RET(23,glD3DDev7->BeginScene());
 2895+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2896+ TRACE_RET(HRESULT,23,glD3DDev7->BeginScene());
28972897 }
28982898
28992899 HRESULT WINAPI glDirect3DDevice3::ComputeSphereVisibility(LPD3DVECTOR lpCenters, LPD3DVALUE lpRadii, DWORD dwNumSpheres, DWORD dwFlags, LPDWORD lpdwReturnValues)
29002900 {
29012901 TRACE_ENTER(6,14,this,14,lpCenters,14,lpRadii,8,dwNumSpheres,9,dwFlags,14,lpdwReturnValues);
2902 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2903 - TRACE_RET(23,glD3DDev7->ComputeSphereVisibility3(lpCenters,lpRadii,dwNumSpheres,dwFlags,lpdwReturnValues));
 2902+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2903+ TRACE_RET(HRESULT,23,glD3DDev7->ComputeSphereVisibility3(lpCenters,lpRadii,dwNumSpheres,dwFlags,lpdwReturnValues));
29042904 }
29052905
29062906 HRESULT WINAPI glDirect3DDevice3::DeleteViewport(LPDIRECT3DVIEWPORT3 lpDirect3DViewport)
29072907 {
29082908 TRACE_ENTER(2,14,this,14,lpDirect3DViewport);
2909 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2910 - TRACE_RET(23,glD3DDev7->DeleteViewport(lpDirect3DViewport));
 2909+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2910+ TRACE_RET(HRESULT,23,glD3DDev7->DeleteViewport(lpDirect3DViewport));
29112911 }
29122912
29132913 HRESULT WINAPI glDirect3DDevice3::DrawIndexedPrimitive(D3DPRIMITIVETYPE d3dptPrimitiveType, DWORD dwVertexTypeDesc,
@@ -2913,8 +2913,8 @@
29142914 LPVOID lpvVertices, DWORD dwVertexCount, LPWORD lpwIndices, DWORD dwIndexCount, DWORD dwFlags)
29152915 {
29162916 TRACE_ENTER(8,14,this,8,d3dptPrimitiveType,9,dwVertexTypeDesc,14,lpvVertices,8,dwVertexCount,14,lpwIndices,8,dwIndexCount,9,dwFlags);
2917 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2918 - TRACE_RET(23,glD3DDev7->DrawIndexedPrimitive(d3dptPrimitiveType,dwVertexTypeDesc,lpvVertices,dwVertexCount,lpwIndices,dwIndexCount,dwFlags));
 2917+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2918+ TRACE_RET(HRESULT,23,glD3DDev7->DrawIndexedPrimitive(d3dptPrimitiveType,dwVertexTypeDesc,lpvVertices,dwVertexCount,lpwIndices,dwIndexCount,dwFlags));
29192919 }
29202920
29212921 HRESULT WINAPI glDirect3DDevice3::DrawIndexedPrimitiveStrided(D3DPRIMITIVETYPE d3dptPrimitiveType, DWORD dwVertexTypeDesc,
@@ -2921,8 +2921,8 @@
29222922 LPD3DDRAWPRIMITIVESTRIDEDDATA lpVertexArray, DWORD dwVertexCount, LPWORD lpwIndices, DWORD dwIndexCount, DWORD dwFlags)
29232923 {
29242924 TRACE_ENTER(8,14,this,8,d3dptPrimitiveType,9,dwVertexTypeDesc,14,lpVertexArray,8,dwVertexCount,14,lpwIndices,8,dwIndexCount,9,dwFlags);
2925 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2926 - TRACE_RET(23,glD3DDev7->DrawIndexedPrimitiveStrided(d3dptPrimitiveType,dwVertexTypeDesc,lpVertexArray,dwVertexCount,lpwIndices,dwIndexCount,dwFlags));
 2925+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2926+ TRACE_RET(HRESULT,23,glD3DDev7->DrawIndexedPrimitiveStrided(d3dptPrimitiveType,dwVertexTypeDesc,lpVertexArray,dwVertexCount,lpwIndices,dwIndexCount,dwFlags));
29272927 }
29282928
29292929 HRESULT WINAPI glDirect3DDevice3::DrawIndexedPrimitiveVB(D3DPRIMITIVETYPE d3dptPrimitiveType, LPDIRECT3DVERTEXBUFFER lpd3dVertexBuffer,
@@ -2929,9 +2929,9 @@
29302930 LPWORD lpwIndices, DWORD dwIndexCount, DWORD dwFlags)
29312931 {
29322932 TRACE_ENTER(6,14,this,8,d3dptPrimitiveType,14,lpd3dVertexBuffer,14,lpwIndices,8,dwIndexCount,9,dwFlags);
2933 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2934 - if(!lpd3dVertexBuffer) TRACE_RET(23,DDERR_INVALIDPARAMS);
2935 - TRACE_RET(23,glD3DDev7->DrawIndexedPrimitiveVB(d3dptPrimitiveType,
 2933+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2934+ if(!lpd3dVertexBuffer) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2935+ TRACE_RET(HRESULT,23,glD3DDev7->DrawIndexedPrimitiveVB(d3dptPrimitiveType,
29362936 ((glDirect3DVertexBuffer1*)lpd3dVertexBuffer)->GetGLD3DVB7(),0,-1,lpwIndices,dwIndexCount,dwFlags));
29372937 }
29382938
@@ -2939,8 +2939,8 @@
29402940 DWORD dwVertexCount, DWORD dwFlags)
29412941 {
29422942 TRACE_ENTER(6,14,this,8,dptPrimitiveType,9,dwVertexTypeDesc,14,lpVertices,8,dwVertexCount,9,dwFlags);
2943 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2944 - TRACE_RET(23,glD3DDev7->DrawPrimitive(dptPrimitiveType,dwVertexTypeDesc,lpVertices,dwVertexCount,dwFlags));
 2943+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2944+ TRACE_RET(HRESULT,23,glD3DDev7->DrawPrimitive(dptPrimitiveType,dwVertexTypeDesc,lpVertices,dwVertexCount,dwFlags));
29452945 }
29462946
29472947 HRESULT WINAPI glDirect3DDevice3::DrawPrimitiveStrided(D3DPRIMITIVETYPE dptPrimitiveType, DWORD dwVertexTypeDesc,
@@ -2947,8 +2947,8 @@
29482948 LPD3DDRAWPRIMITIVESTRIDEDDATA lpVertexArray, DWORD dwVertexCount, DWORD dwFlags)
29492949 {
29502950 TRACE_ENTER(6,14,this,8,dptPrimitiveType,9,dwVertexTypeDesc,14,lpVertexArray,8,dwVertexCount,9,dwFlags);
2951 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2952 - TRACE_RET(23,glD3DDev7->DrawPrimitiveStrided(dptPrimitiveType,dwVertexTypeDesc,lpVertexArray,dwVertexCount,dwFlags));
 2951+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2952+ TRACE_RET(HRESULT,23,glD3DDev7->DrawPrimitiveStrided(dptPrimitiveType,dwVertexTypeDesc,lpVertexArray,dwVertexCount,dwFlags));
29532953 }
29542954
29552955 HRESULT WINAPI glDirect3DDevice3::DrawPrimitiveVB(D3DPRIMITIVETYPE d3dptPrimitiveType, LPDIRECT3DVERTEXBUFFER lpd3dVertexBuffer,
@@ -2955,60 +2955,60 @@
29562956 DWORD dwStartVertex, DWORD dwNumVertices, DWORD dwFlags)
29572957 {
29582958 TRACE_ENTER(6,14,this,8,d3dptPrimitiveType,14,lpd3dVertexBuffer,8,dwStartVertex,8,dwNumVertices,9,dwFlags);
2959 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2960 - if(!lpd3dVertexBuffer) TRACE_RET(23,DDERR_INVALIDPARAMS);
2961 - TRACE_RET(23,glD3DDev7->DrawPrimitiveVB(d3dptPrimitiveType,((glDirect3DVertexBuffer1*)lpd3dVertexBuffer)->GetGLD3DVB7(),
 2959+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2960+ if(!lpd3dVertexBuffer) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2961+ TRACE_RET(HRESULT,23,glD3DDev7->DrawPrimitiveVB(d3dptPrimitiveType,((glDirect3DVertexBuffer1*)lpd3dVertexBuffer)->GetGLD3DVB7(),
29622962 dwStartVertex,dwNumVertices,dwFlags));
29632963 }
29642964 HRESULT WINAPI glDirect3DDevice3::End(DWORD dwFlags)
29652965 {
29662966 TRACE_ENTER(2,14,this,9,dwFlags);
2967 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2968 - TRACE_RET(23,glD3DDev7->End(dwFlags));
 2967+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2968+ TRACE_RET(HRESULT,23,glD3DDev7->End(dwFlags));
29692969 }
29702970
29712971 HRESULT WINAPI glDirect3DDevice3::EndScene()
29722972 {
29732973 TRACE_ENTER(1,14,this);
2974 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2975 - TRACE_RET(23,glD3DDev7->EndScene());
 2974+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2975+ TRACE_RET(HRESULT,23,glD3DDev7->EndScene());
29762976 }
29772977
29782978 HRESULT WINAPI glDirect3DDevice3::EnumTextureFormats(LPD3DENUMPIXELFORMATSCALLBACK lpd3dEnumPixelProc, LPVOID lpArg)
29792979 {
29802980 TRACE_ENTER(3,14,this,14,lpd3dEnumPixelProc,14,lpArg);
2981 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2982 - TRACE_RET(23,glD3DDev7->EnumTextureFormats(lpd3dEnumPixelProc,lpArg));
 2981+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2982+ TRACE_RET(HRESULT,23,glD3DDev7->EnumTextureFormats(lpd3dEnumPixelProc,lpArg));
29832983 }
29842984
29852985 HRESULT WINAPI glDirect3DDevice3::GetCaps(LPD3DDEVICEDESC lpD3DHWDevDesc, LPD3DDEVICEDESC lpD3DHELDevDesc)
29862986 {
29872987 TRACE_ENTER(3,14,this,14,lpD3DHWDevDesc,14,lpD3DHELDevDesc);
2988 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2989 - TRACE_RET(23,glD3DDev7->GetCaps3(lpD3DHWDevDesc,lpD3DHELDevDesc));
 2988+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2989+ TRACE_RET(HRESULT,23,glD3DDev7->GetCaps3(lpD3DHWDevDesc,lpD3DHELDevDesc));
29902990 }
29912991
29922992 HRESULT WINAPI glDirect3DDevice3::GetClipStatus(LPD3DCLIPSTATUS lpD3DClipStatus)
29932993 {
29942994 TRACE_ENTER(2,14,this,14,lpD3DClipStatus);
2995 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2996 - TRACE_RET(23,glD3DDev7->GetClipStatus(lpD3DClipStatus));
 2995+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2996+ TRACE_RET(HRESULT,23,glD3DDev7->GetClipStatus(lpD3DClipStatus));
29972997 }
29982998
29992999 HRESULT WINAPI glDirect3DDevice3::GetCurrentViewport(LPDIRECT3DVIEWPORT3 *lplpd3dViewport)
30003000 {
30013001 TRACE_ENTER(2,14,this,14,lplpd3dViewport);
3002 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3003 - TRACE_RET(23,glD3DDev7->GetCurrentViewport(lplpd3dViewport));
 3002+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3003+ TRACE_RET(HRESULT,23,glD3DDev7->GetCurrentViewport(lplpd3dViewport));
30043004 }
30053005
30063006 HRESULT WINAPI glDirect3DDevice3::GetDirect3D(LPDIRECT3D3 *lplpD3D)
30073007 {
30083008 TRACE_ENTER(2,14,this,14,lplpD3D);
3009 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3009+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
30103010 LPDIRECT3D7 d3d7;
30113011 HRESULT err = glD3DDev7->GetDirect3D(&d3d7);
3012 - if(!d3d7) TRACE_RET(23,err);
 3012+ if(!d3d7) TRACE_RET(HRESULT,23,err);
30133013 d3d7->QueryInterface(IID_IDirect3D3,(void**)lplpD3D);
30143014 d3d7->Release();
30153015 TRACE_VAR("*lplpD3D",14,*lplpD3D);
@@ -3019,24 +3019,24 @@
30203020 HRESULT WINAPI glDirect3DDevice3::GetLightState(D3DLIGHTSTATETYPE dwLightStateType, LPDWORD lpdwLightState)
30213021 {
30223022 TRACE_ENTER(3,14,this,30,dwLightStateType,14,lpdwLightState);
3023 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3024 - TRACE_RET(23,glD3DDev7->GetLightState(dwLightStateType,lpdwLightState));
 3023+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3024+ TRACE_RET(HRESULT,23,glD3DDev7->GetLightState(dwLightStateType,lpdwLightState));
30253025 }
30263026
30273027 HRESULT WINAPI glDirect3DDevice3::GetRenderState(D3DRENDERSTATETYPE dwRenderStateType, LPDWORD lpdwRenderState)
30283028 {
30293029 TRACE_ENTER(3,14,this,27,dwRenderStateType,14,lpdwRenderState);
3030 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3031 - TRACE_RET(23,glD3DDev7->GetRenderState(dwRenderStateType,lpdwRenderState));
 3030+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3031+ TRACE_RET(HRESULT,23,glD3DDev7->GetRenderState(dwRenderStateType,lpdwRenderState));
30323032 }
30333033
30343034 HRESULT WINAPI glDirect3DDevice3::GetRenderTarget(LPDIRECTDRAWSURFACE4 *lplpRenderTarget)
30353035 {
30363036 TRACE_ENTER(2,14,this,14,lplpRenderTarget);
3037 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3037+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
30383038 LPDIRECTDRAWSURFACE7 dds7;
30393039 HRESULT err = glD3DDev7->GetRenderTarget(&dds7);
3040 - if(!dds7) TRACE_RET(23,err);
 3040+ if(!dds7) TRACE_RET(HRESULT,23,err);
30413041 dds7->QueryInterface(IID_IDirectDrawSurface4,(void**)lplpRenderTarget);
30423042 dds7->Release();
30433043 TRACE_VAR("*lplpRenderTarget",14,*lplpRenderTarget);
@@ -3047,17 +3047,17 @@
30483048 HRESULT WINAPI glDirect3DDevice3::GetStats(LPD3DSTATS lpD3DStats)
30493049 {
30503050 TRACE_ENTER(2,14,this,14,lpD3DStats);
3051 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3052 - TRACE_RET(23,glD3DDev7->GetStats(lpD3DStats));
 3051+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3052+ TRACE_RET(HRESULT,23,glD3DDev7->GetStats(lpD3DStats));
30533053 }
30543054
30553055 HRESULT WINAPI glDirect3DDevice3::GetTexture(DWORD dwStage, LPDIRECT3DTEXTURE2 *lplpTexture)
30563056 {
30573057 TRACE_ENTER(3,14,this,8,dwStage,14,lplpTexture);
3058 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3058+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
30593059 LPDIRECTDRAWSURFACE7 dds7;
30603060 HRESULT err = glD3DDev7->GetTexture(dwStage,&dds7);
3061 - if(!dds7) TRACE_RET(23,err);
 3061+ if(!dds7) TRACE_RET(HRESULT,23,err);
30623062 dds7->QueryInterface(IID_IDirect3DTexture2,(void**)lplpTexture);
30633063 dds7->Release();
30643064 TRACE_VAR("*lplpTexture",14,*lplpTexture);
@@ -3068,108 +3068,108 @@
30693069 HRESULT WINAPI glDirect3DDevice3::GetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE dwState, LPDWORD lpdwValue)
30703070 {
30713071 TRACE_ENTER(4,14,this,8,dwStage,28,dwState,14,lpdwValue);
3072 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3073 - TRACE_RET(23,glD3DDev7->GetTextureStageState(dwStage,dwState,lpdwValue));
 3072+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3073+ TRACE_RET(HRESULT,23,glD3DDev7->GetTextureStageState(dwStage,dwState,lpdwValue));
30743074 }
30753075
30763076 HRESULT WINAPI glDirect3DDevice3::GetTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix)
30773077 {
30783078 TRACE_ENTER(3,14,this,29,dtstTransformStateType,14,lpD3DMatrix);
3079 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3080 - TRACE_RET(23,glD3DDev7->GetTransform(dtstTransformStateType,lpD3DMatrix));
 3079+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3080+ TRACE_RET(HRESULT,23,glD3DDev7->GetTransform(dtstTransformStateType,lpD3DMatrix));
30813081 }
30823082
30833083 HRESULT WINAPI glDirect3DDevice3::Index(WORD wVertexIndex)
30843084 {
30853085 TRACE_ENTER(2,14,this,5,wVertexIndex);
3086 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3087 - TRACE_RET(23,glD3DDev7->Index(wVertexIndex));
 3086+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3087+ TRACE_RET(HRESULT,23,glD3DDev7->Index(wVertexIndex));
30883088 }
30893089
30903090 HRESULT WINAPI glDirect3DDevice3::MultiplyTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix)
30913091 {
30923092 TRACE_ENTER(3,14,this,29,dtstTransformStateType,14,lpD3DMatrix);
3093 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3094 - TRACE_RET(23,glD3DDev7->MultiplyTransform(dtstTransformStateType,lpD3DMatrix));
 3093+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3094+ TRACE_RET(HRESULT,23,glD3DDev7->MultiplyTransform(dtstTransformStateType,lpD3DMatrix));
30953095 }
30963096 HRESULT WINAPI glDirect3DDevice3::NextViewport(LPDIRECT3DVIEWPORT3 lpDirect3DViewport, LPDIRECT3DVIEWPORT3 *lplpAnotherViewport, DWORD dwFlags)
30973097 {
30983098 TRACE_ENTER(4,14,this,14,lpDirect3DViewport,14,lplpAnotherViewport,9,dwFlags);
3099 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3100 - TRACE_RET(23,glD3DDev7->NextViewport(lpDirect3DViewport,lplpAnotherViewport,dwFlags));
 3099+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3100+ TRACE_RET(HRESULT,23,glD3DDev7->NextViewport(lpDirect3DViewport,lplpAnotherViewport,dwFlags));
31013101 }
31023102
31033103 HRESULT WINAPI glDirect3DDevice3::SetClipStatus(LPD3DCLIPSTATUS lpD3DClipStatus)
31043104 {
31053105 TRACE_ENTER(2,14,this,14,lpD3DClipStatus);
3106 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3107 - TRACE_RET(23,glD3DDev7->SetClipStatus(lpD3DClipStatus));
 3106+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3107+ TRACE_RET(HRESULT,23,glD3DDev7->SetClipStatus(lpD3DClipStatus));
31083108 }
31093109
31103110 HRESULT WINAPI glDirect3DDevice3::SetCurrentViewport(LPDIRECT3DVIEWPORT3 lpd3dViewport)
31113111 {
31123112 TRACE_ENTER(2,14,this,14,lpd3dViewport);
3113 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3114 - TRACE_RET(23,glD3DDev7->SetCurrentViewport(lpd3dViewport));
 3113+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3114+ TRACE_RET(HRESULT,23,glD3DDev7->SetCurrentViewport(lpd3dViewport));
31153115 }
31163116
31173117 HRESULT WINAPI glDirect3DDevice3::SetLightState(D3DLIGHTSTATETYPE dwLightStateType, DWORD dwLightState)
31183118 {
31193119 TRACE_ENTER(3,14,this,30,dwLightStateType,8,dwLightState);
3120 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3121 - TRACE_RET(23,glD3DDev7->SetLightState(dwLightStateType,dwLightState));
 3120+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3121+ TRACE_RET(HRESULT,23,glD3DDev7->SetLightState(dwLightStateType,dwLightState));
31223122 }
31233123
31243124 HRESULT WINAPI glDirect3DDevice3::SetRenderState(D3DRENDERSTATETYPE dwRendStateType, DWORD dwRenderState)
31253125 {
31263126 TRACE_ENTER(3,14,this,27,dwRendStateType,9,dwRenderState);
3127 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3128 - TRACE_RET(23,glD3DDev7->SetRenderState(dwRendStateType,dwRenderState));
 3127+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3128+ TRACE_RET(HRESULT,23,glD3DDev7->SetRenderState(dwRendStateType,dwRenderState));
31293129 }
31303130
31313131 HRESULT WINAPI glDirect3DDevice3::SetRenderTarget(LPDIRECTDRAWSURFACE4 lpNewRenderTarget, DWORD dwFlags)
31323132 {
31333133 TRACE_ENTER(3,14,this,14,lpNewRenderTarget,9,dwFlags);
3134 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3135 - TRACE_RET(23,glD3DDev7->SetRenderTarget(((glDirectDrawSurface4*)lpNewRenderTarget)->GetDDS7(),dwFlags));
 3134+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3135+ TRACE_RET(HRESULT,23,glD3DDev7->SetRenderTarget(((glDirectDrawSurface4*)lpNewRenderTarget)->GetDDS7(),dwFlags));
31363136 }
31373137
31383138 HRESULT WINAPI glDirect3DDevice3::SetTexture(DWORD dwStage, LPDIRECT3DTEXTURE2 lpTexture)
31393139 {
31403140 TRACE_ENTER(3,14,this,8,dwStage,14,lpTexture);
3141 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3141+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
31423142 glDirectDrawSurface7 *dds7;
31433143 if(lpTexture) dds7 = ((glDirect3DTexture2*)lpTexture)->GetDDS7();
31443144 else dds7 = NULL;
3145 - TRACE_RET(23,glD3DDev7->SetTexture(dwStage,dds7));
 3145+ TRACE_RET(HRESULT,23,glD3DDev7->SetTexture(dwStage,dds7));
31463146 }
31473147
31483148 HRESULT WINAPI glDirect3DDevice3::SetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE dwState, DWORD dwValue)
31493149 {
31503150 TRACE_ENTER(4,14,this,8,dwStage,28,dwState,9,dwValue);
3151 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3152 - TRACE_RET(23,glD3DDev7->SetTextureStageState(dwStage,dwState,dwValue));
 3151+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3152+ TRACE_RET(HRESULT,23,glD3DDev7->SetTextureStageState(dwStage,dwState,dwValue));
31533153 }
31543154
31553155 HRESULT WINAPI glDirect3DDevice3::SetTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix)
31563156 {
31573157 TRACE_ENTER(3,14,this,27,dtstTransformStateType,14,lpD3DMatrix);
3158 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3159 - TRACE_RET(23,glD3DDev7->SetTransform(dtstTransformStateType,lpD3DMatrix));
 3158+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3159+ TRACE_RET(HRESULT,23,glD3DDev7->SetTransform(dtstTransformStateType,lpD3DMatrix));
31603160 }
31613161
31623162 HRESULT WINAPI glDirect3DDevice3::ValidateDevice(LPDWORD lpdwPasses)
31633163 {
31643164 TRACE_ENTER(2,14,this,14,lpdwPasses);
3165 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3166 - TRACE_RET(23,glD3DDev7->ValidateDevice(lpdwPasses));
 3165+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3166+ TRACE_RET(HRESULT,23,glD3DDev7->ValidateDevice(lpdwPasses));
31673167 }
31683168
31693169 HRESULT WINAPI glDirect3DDevice3::Vertex(LPVOID lpVertex)
31703170 {
31713171 TRACE_ENTER(2,14,this,14,lpVertex);
3172 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3173 - TRACE_RET(23,glD3DDev7->Vertex(lpVertex));
 3172+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3173+ TRACE_RET(HRESULT,23,glD3DDev7->Vertex(lpVertex));
31743174 }
31753175
31763176 // IDirect3DDevice2 wrapper
@@ -3193,7 +3193,7 @@
31943194 HRESULT WINAPI glDirect3DDevice2::QueryInterface(REFIID riid, void** ppvObj)
31953195 {
31963196 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
3197 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3197+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
31983198 if(riid == IID_IUnknown)
31993199 {
32003200 this->AddRef();
@@ -3202,13 +3202,13 @@
32033203 TRACE_EXIT(23,DD_OK);
32043204 return DD_OK;
32053205 }
3206 - TRACE_RET(23,glD3DDev7->QueryInterface(riid,ppvObj));
 3206+ TRACE_RET(HRESULT,23,glD3DDev7->QueryInterface(riid,ppvObj));
32073207 }
32083208
32093209 ULONG WINAPI glDirect3DDevice2::AddRef()
32103210 {
32113211 TRACE_ENTER(1,14,this);
3212 - if(!this) TRACE_EXIT(8,0);;
 3212+ if(!this) TRACE_RET(ULONG,8,0);
32133213 refcount++;
32143214 TRACE_EXIT(8,refcount);
32153215 return refcount;
@@ -3217,7 +3217,7 @@
32183218 ULONG WINAPI glDirect3DDevice2::Release()
32193219 {
32203220 TRACE_ENTER(1,14,this);
3221 - if(!this) TRACE_EXIT(8,0);
 3221+ if(!this) TRACE_RET(ULONG,8,0);
32223222 ULONG ret;
32233223 refcount--;
32243224 ret = refcount;
@@ -3229,8 +3229,8 @@
32303230 HRESULT WINAPI glDirect3DDevice2::AddViewport(LPDIRECT3DVIEWPORT2 lpDirect3DViewport2)
32313231 {
32323232 TRACE_ENTER(2,14,this,14,lpDirect3DViewport2);
3233 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3234 - if(!lpDirect3DViewport2) TRACE_RET(23,DDERR_INVALIDPARAMS);
 3233+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3234+ if(!lpDirect3DViewport2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
32353235 glDirect3DViewport3 *glD3DV3;
32363236 lpDirect3DViewport2->QueryInterface(IID_IDirect3DViewport3,(void**)&glD3DV3);
32373237 HRESULT ret = glD3DDev7->AddViewport(glD3DV3);
@@ -3257,32 +3257,32 @@
32583258 HRESULT WINAPI glDirect3DDevice2::Begin(D3DPRIMITIVETYPE d3dpt, D3DVERTEXTYPE d3dvt, DWORD dwFlags)
32593259 {
32603260 TRACE_ENTER(4,14,this,8,d3dpt,8,d3dvt,9,dwFlags);
3261 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3261+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
32623262 DWORD vertextype = d3dvttofvf(d3dvt);
3263 - if(!vertextype) TRACE_RET(23,DDERR_INVALIDPARAMS);
3264 - TRACE_RET(23,glD3DDev7->Begin(d3dpt,vertextype,dwFlags));
 3263+ if(!vertextype) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 3264+ TRACE_RET(HRESULT,23,glD3DDev7->Begin(d3dpt,vertextype,dwFlags));
32653265 }
32663266
32673267 HRESULT WINAPI glDirect3DDevice2::BeginIndexed(D3DPRIMITIVETYPE dptPrimitiveType, D3DVERTEXTYPE dvtVertexType, LPVOID lpvVertices, DWORD dwNumVertices, DWORD dwFlags)
32683268 {
32693269 TRACE_ENTER(6,14,this,8,dptPrimitiveType,8,dvtVertexType,14,lpvVertices,8,dwNumVertices,9,dwFlags);
3270 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3270+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
32713271 DWORD vertextype = d3dvttofvf(dvtVertexType);
3272 - if(!vertextype) TRACE_RET(23,DDERR_INVALIDPARAMS);
3273 - TRACE_RET(23,glD3DDev7->BeginIndexed(dptPrimitiveType,vertextype,lpvVertices,dwNumVertices,dwFlags));
 3272+ if(!vertextype) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 3273+ TRACE_RET(HRESULT,23,glD3DDev7->BeginIndexed(dptPrimitiveType,vertextype,lpvVertices,dwNumVertices,dwFlags));
32743274 }
32753275
32763276 HRESULT WINAPI glDirect3DDevice2::BeginScene()
32773277 {
32783278 TRACE_ENTER(1,14,this);
3279 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3280 - TRACE_RET(23,glD3DDev7->BeginScene());
 3279+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3280+ TRACE_RET(HRESULT,23,glD3DDev7->BeginScene());
32813281 }
32823282
32833283 HRESULT WINAPI glDirect3DDevice2::DeleteViewport(LPDIRECT3DVIEWPORT2 lpDirect3DViewport2)
32843284 {
32853285 TRACE_ENTER(2,14,this,14,lpDirect3DViewport2);
3286 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3286+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
32873287 glDirect3DViewport3 *glD3DV3;
32883288 lpDirect3DViewport2->QueryInterface(IID_IDirect3DViewport3,(void**)&glD3DV3);
32893289 HRESULT ret = glD3DDev7->DeleteViewport(glD3DV3);
@@ -3295,10 +3295,10 @@
32963296 LPVOID lpvVertices, DWORD dwVertexCount, LPWORD dwIndices, DWORD dwIndexCount, DWORD dwFlags)
32973297 {
32983298 TRACE_ENTER(8,14,this,8,d3dptPrimitiveType,8,d3dvtVertexType,14,lpvVertices,8,dwVertexCount,14,dwIndices,8,dwIndexCount,9,dwFlags);
3299 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3299+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
33003300 DWORD vertextype = d3dvttofvf(d3dvtVertexType);
3301 - if(!vertextype) TRACE_RET(23,DDERR_INVALIDPARAMS);
3302 - TRACE_RET(23,glD3DDev7->DrawIndexedPrimitive(d3dptPrimitiveType,vertextype,lpvVertices,dwVertexCount,dwIndices,dwIndexCount,dwFlags));
 3301+ if(!vertextype) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 3302+ TRACE_RET(HRESULT,23,glD3DDev7->DrawIndexedPrimitive(d3dptPrimitiveType,vertextype,lpvVertices,dwVertexCount,dwIndices,dwIndexCount,dwFlags));
33033303 }
33043304
33053305 HRESULT WINAPI glDirect3DDevice2::DrawPrimitive(D3DPRIMITIVETYPE dptPrimitiveType, D3DVERTEXTYPE dvtVertexType, LPVOID lpvVertices,
@@ -3305,24 +3305,24 @@
33063306 DWORD dwVertexCount, DWORD dwFlags)
33073307 {
33083308 TRACE_ENTER(6,14,this,8,dptPrimitiveType,8,dvtVertexType,14,lpvVertices,8,dwVertexCount,9,dwFlags);
3309 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3309+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
33103310 DWORD vertextype = d3dvttofvf(dvtVertexType);
3311 - if(!vertextype) TRACE_RET(23,DDERR_INVALIDPARAMS);
3312 - TRACE_RET(23,glD3DDev7->DrawPrimitive(dptPrimitiveType,vertextype,lpvVertices,dwVertexCount,dwFlags));
 3311+ if(!vertextype) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 3312+ TRACE_RET(HRESULT,23,glD3DDev7->DrawPrimitive(dptPrimitiveType,vertextype,lpvVertices,dwVertexCount,dwFlags));
33133313 }
33143314
33153315 HRESULT WINAPI glDirect3DDevice2::End(DWORD dwFlags)
33163316 {
33173317 TRACE_ENTER(2,14,this,9,dwFlags);
3318 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3319 - TRACE_RET(23,glD3DDev7->End(dwFlags));
 3318+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3319+ TRACE_RET(HRESULT,23,glD3DDev7->End(dwFlags));
33203320 }
33213321
33223322 HRESULT WINAPI glDirect3DDevice2::EndScene()
33233323 {
33243324 TRACE_ENTER(1,14,this);
3325 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3326 - TRACE_RET(23,glD3DDev7->EndScene());
 3325+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3326+ TRACE_RET(HRESULT,23,glD3DDev7->EndScene());
33273327 }
33283328
33293329 HRESULT WINAPI EnumTex2(LPDDPIXELFORMAT ddpf, LPVOID lpUserArg)
@@ -3344,34 +3344,34 @@
33453345 HRESULT WINAPI glDirect3DDevice2::EnumTextureFormats(LPD3DENUMTEXTUREFORMATSCALLBACK lpd3dEnumTextureProc, LPVOID lpArg)
33463346 {
33473347 TRACE_ENTER(3,14,this,14,lpd3dEnumTextureProc,14,lpArg);
3348 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3348+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
33493349 LPVOID context[2];
33503350 context[0] = (LPVOID)lpd3dEnumTextureProc;
33513351 context[1] = lpArg;
3352 - TRACE_RET(23,glD3DDev7->EnumTextureFormats(EnumTex2,&context));
 3352+ TRACE_RET(HRESULT,23,glD3DDev7->EnumTextureFormats(EnumTex2,&context));
33533353 }
33543354
33553355 HRESULT WINAPI glDirect3DDevice2::GetCaps(LPD3DDEVICEDESC lpD3DHWDevDesc, LPD3DDEVICEDESC lpD3DHELDevDesc)
33563356 {
33573357 TRACE_ENTER(3,14,this,14,lpD3DHWDevDesc,14,lpD3DHELDevDesc);
3358 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3359 - TRACE_RET(23,glD3DDev7->GetCaps3(lpD3DHWDevDesc,lpD3DHELDevDesc));
 3358+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3359+ TRACE_RET(HRESULT,23,glD3DDev7->GetCaps3(lpD3DHWDevDesc,lpD3DHELDevDesc));
33603360 }
33613361
33623362 HRESULT WINAPI glDirect3DDevice2::GetClipStatus(LPD3DCLIPSTATUS lpD3DClipStatus)
33633363 {
33643364 TRACE_ENTER(2,14,this,14,lpD3DClipStatus);
3365 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3366 - TRACE_RET(23,glD3DDev7->GetClipStatus(lpD3DClipStatus));
 3365+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3366+ TRACE_RET(HRESULT,23,glD3DDev7->GetClipStatus(lpD3DClipStatus));
33673367 }
33683368
33693369 HRESULT WINAPI glDirect3DDevice2::GetCurrentViewport(LPDIRECT3DVIEWPORT2 *lplpd3dViewport2)
33703370 {
33713371 TRACE_ENTER(2,14,this,14,lplpd3dViewport2);
3372 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3372+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
33733373 glDirect3DViewport3 *glD3DV3;
33743374 HRESULT ret = glD3DDev7->GetCurrentViewport((LPDIRECT3DVIEWPORT3*)&glD3DV3);
3375 - if(!glD3DV3) TRACE_RET(23,ret);
 3375+ if(!glD3DV3) TRACE_RET(HRESULT,23,ret);
33763376 glD3DV3->QueryInterface(IID_IDirect3DViewport2,(void**)lplpd3dViewport2);
33773377 glD3DV3->Release();
33783378 TRACE_VAR("*lplpd3dViewport2",14,*lplpd3dViewport2);
@@ -3382,10 +3382,10 @@
33833383 HRESULT WINAPI glDirect3DDevice2::GetDirect3D(LPDIRECT3D2 *lplpD3D2)
33843384 {
33853385 TRACE_ENTER(2,14,this,14,lplpD3D2);
3386 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3386+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
33873387 LPDIRECT3D7 d3d7;
33883388 HRESULT err = glD3DDev7->GetDirect3D(&d3d7);
3389 - if(!d3d7) TRACE_RET(23,err);
 3389+ if(!d3d7) TRACE_RET(HRESULT,23,err);
33903390 d3d7->QueryInterface(IID_IDirect3D2,(void**)lplpD3D2);
33913391 d3d7->Release();
33923392 TRACE_VAR("*lplpD3D2",14,*lplpD3D2);
@@ -3396,24 +3396,24 @@
33973397 HRESULT WINAPI glDirect3DDevice2::GetLightState(D3DLIGHTSTATETYPE dwLightStateType, LPDWORD lpdwLightState)
33983398 {
33993399 TRACE_ENTER(3,14,this,30,dwLightStateType,14,lpdwLightState);
3400 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3401 - TRACE_RET(23,glD3DDev7->GetLightState(dwLightStateType,lpdwLightState));
 3400+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3401+ TRACE_RET(HRESULT,23,glD3DDev7->GetLightState(dwLightStateType,lpdwLightState));
34023402 }
34033403
34043404 HRESULT WINAPI glDirect3DDevice2::GetRenderState(D3DRENDERSTATETYPE dwRenderStateType, LPDWORD lpdwRenderState)
34053405 {
34063406 TRACE_ENTER(3,14,this,27,dwRenderStateType,14,lpdwRenderState);
3407 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3408 - TRACE_RET(23,glD3DDev7->GetRenderState(dwRenderStateType,lpdwRenderState));
 3407+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3408+ TRACE_RET(HRESULT,23,glD3DDev7->GetRenderState(dwRenderStateType,lpdwRenderState));
34093409 }
34103410
34113411 HRESULT WINAPI glDirect3DDevice2::GetRenderTarget(LPDIRECTDRAWSURFACE *lplpRenderTarget)
34123412 {
34133413 TRACE_ENTER(2,14,this,14,lplpRenderTarget);
3414 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3414+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
34153415 LPDIRECTDRAWSURFACE7 dds7;
34163416 HRESULT err = glD3DDev7->GetRenderTarget(&dds7);
3417 - if(!dds7) TRACE_RET(23,err);
 3417+ if(!dds7) TRACE_RET(HRESULT,23,err);
34183418 dds7->QueryInterface(IID_IDirectDrawSurface,(void**)lplpRenderTarget);
34193419 dds7->Release();
34203420 TRACE_VAR("*lplpRenderTarget",14,*lplpRenderTarget);
@@ -3424,37 +3424,37 @@
34253425 HRESULT WINAPI glDirect3DDevice2::GetStats(LPD3DSTATS lpD3DStats)
34263426 {
34273427 TRACE_ENTER(2,14,this,14,lpD3DStats);
3428 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3429 - TRACE_RET(23,glD3DDev7->GetStats(lpD3DStats));
 3428+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3429+ TRACE_RET(HRESULT,23,glD3DDev7->GetStats(lpD3DStats));
34303430 }
34313431
34323432 HRESULT WINAPI glDirect3DDevice2::GetTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix)
34333433 {
34343434 TRACE_ENTER(3,14,this,29,dtstTransformStateType,14,lpD3DMatrix);
3435 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3436 - TRACE_RET(23,glD3DDev7->GetTransform(dtstTransformStateType,lpD3DMatrix));
 3435+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3436+ TRACE_RET(HRESULT,23,glD3DDev7->GetTransform(dtstTransformStateType,lpD3DMatrix));
34373437 }
34383438
34393439 HRESULT WINAPI glDirect3DDevice2::Index(WORD wVertexIndex)
34403440 {
34413441 TRACE_ENTER(2,14,this,5,wVertexIndex);
3442 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3443 - TRACE_RET(23,glD3DDev7->Index(wVertexIndex));
 3442+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3443+ TRACE_RET(HRESULT,23,glD3DDev7->Index(wVertexIndex));
34443444 }
34453445
34463446 HRESULT WINAPI glDirect3DDevice2::MultiplyTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix)
34473447 {
34483448 TRACE_ENTER(3,14,this,29,dtstTransformStateType,14,lpD3DMatrix);
3449 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3450 - TRACE_RET(23,glD3DDev7->MultiplyTransform(dtstTransformStateType,lpD3DMatrix));
 3449+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3450+ TRACE_RET(HRESULT,23,glD3DDev7->MultiplyTransform(dtstTransformStateType,lpD3DMatrix));
34513451 }
34523452
34533453 HRESULT WINAPI glDirect3DDevice2::NextViewport(LPDIRECT3DVIEWPORT2 lpDirect3DViewport2, LPDIRECT3DVIEWPORT2 *lplpDirect3DViewport2, DWORD dwFlags)
34543454 {
34553455 TRACE_ENTER(4,14,this,14,lpDirect3DViewport2,14,lplpDirect3DViewport2,9,dwFlags);
3456 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3457 - if(!lpDirect3DViewport2) TRACE_RET(23,DDERR_INVALIDPARAMS);
3458 - if(!lplpDirect3DViewport2) TRACE_RET(23,DDERR_INVALIDPARAMS);
 3456+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3457+ if(!lpDirect3DViewport2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 3458+ if(!lplpDirect3DViewport2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
34593459 FIXME("glDirect3DDevice2::NextViewport: stub");
34603460 TRACE_EXIT(23,DDERR_GENERIC);
34613461 ERR(DDERR_GENERIC);
@@ -3463,15 +3463,15 @@
34643464 HRESULT WINAPI glDirect3DDevice2::SetClipStatus(LPD3DCLIPSTATUS lpD3DClipStatus)
34653465 {
34663466 TRACE_ENTER(2,14,this,14,lpD3DClipStatus);
3467 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3468 - TRACE_RET(23,glD3DDev7->SetClipStatus(lpD3DClipStatus));
 3467+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3468+ TRACE_RET(HRESULT,23,glD3DDev7->SetClipStatus(lpD3DClipStatus));
34693469 }
34703470
34713471 HRESULT WINAPI glDirect3DDevice2::SetCurrentViewport(LPDIRECT3DVIEWPORT2 lpd3dViewport2)
34723472 {
34733473 TRACE_ENTER(2,14,this,14,lpd3dViewport2);
3474 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3475 - if(!lpd3dViewport2) TRACE_RET(23,glD3DDev7->SetCurrentViewport(NULL));
 3474+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3475+ if(!lpd3dViewport2) TRACE_RET(HRESULT,23,glD3DDev7->SetCurrentViewport(NULL));
34763476 glDirect3DViewport3 *glD3DV3;
34773477 lpd3dViewport2->QueryInterface(IID_IDirect3DViewport3,(void**)&glD3DV3);
34783478 HRESULT ret = glD3DDev7->SetCurrentViewport(glD3DV3);
@@ -3483,43 +3483,43 @@
34843484 HRESULT WINAPI glDirect3DDevice2::SetLightState(D3DLIGHTSTATETYPE dwLightStateType, DWORD dwLightState)
34853485 {
34863486 TRACE_ENTER(3,14,this,30,dwLightStateType,9,dwLightState);
3487 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3488 - TRACE_RET(23,glD3DDev7->SetLightState(dwLightStateType,dwLightState));
 3487+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3488+ TRACE_RET(HRESULT,23,glD3DDev7->SetLightState(dwLightStateType,dwLightState));
34893489 }
34903490
34913491 HRESULT WINAPI glDirect3DDevice2::SetRenderState(D3DRENDERSTATETYPE dwRenderStateType, DWORD dwRenderState)
34923492 {
34933493 TRACE_ENTER(3,14,this,27,dwRenderStateType,9,dwRenderState);
3494 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3495 - TRACE_RET(23,glD3DDev7->SetRenderState(dwRenderStateType,dwRenderState));
 3494+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3495+ TRACE_RET(HRESULT,23,glD3DDev7->SetRenderState(dwRenderStateType,dwRenderState));
34963496 }
34973497
34983498 HRESULT WINAPI glDirect3DDevice2::SetRenderTarget(LPDIRECTDRAWSURFACE lpNewRenderTarget, DWORD dwFlags)
34993499 {
35003500 TRACE_ENTER(3,14,this,14,lpNewRenderTarget,9,dwFlags);
3501 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3502 - TRACE_RET(23,glD3DDev7->SetRenderTarget(((glDirectDrawSurface1*)lpNewRenderTarget)->GetDDS7(),dwFlags));
 3501+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3502+ TRACE_RET(HRESULT,23,glD3DDev7->SetRenderTarget(((glDirectDrawSurface1*)lpNewRenderTarget)->GetDDS7(),dwFlags));
35033503 }
35043504
35053505 HRESULT WINAPI glDirect3DDevice2::SetTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix)
35063506 {
35073507 TRACE_ENTER(3,14,this,29,dtstTransformStateType,14,lpD3DMatrix);
3508 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3509 - TRACE_RET(23,glD3DDev7->SetTransform(dtstTransformStateType,lpD3DMatrix));
 3508+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3509+ TRACE_RET(HRESULT,23,glD3DDev7->SetTransform(dtstTransformStateType,lpD3DMatrix));
35103510 }
35113511
35123512 HRESULT WINAPI glDirect3DDevice2::SwapTextureHandles(LPDIRECT3DTEXTURE2 lpD3DTex1, LPDIRECT3DTEXTURE2 lpD3DTex2)
35133513 {
35143514 TRACE_ENTER(3,14,this,14,lpD3DTex1,14,lpD3DTex2);
3515 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3516 - TRACE_RET(23,glD3DDev7->SwapTextureHandles(lpD3DTex1,lpD3DTex2));
 3515+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3516+ TRACE_RET(HRESULT,23,glD3DDev7->SwapTextureHandles(lpD3DTex1,lpD3DTex2));
35173517 }
35183518
35193519 HRESULT WINAPI glDirect3DDevice2::Vertex(LPVOID lpVertexType)
35203520 {
35213521 TRACE_ENTER(2,14,this,14,lpVertexType);
3522 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3523 - TRACE_RET(23,glD3DDev7->Vertex(lpVertexType));
 3522+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3523+ TRACE_RET(HRESULT,23,glD3DDev7->Vertex(lpVertexType));
35243524 }
35253525
35263526 // IDirect3DDevice wrapper
@@ -3543,7 +3543,7 @@
35443544 HRESULT WINAPI glDirect3DDevice1::QueryInterface(REFIID riid, void** ppvObj)
35453545 {
35463546 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
3547 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3547+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
35483548 if(riid == IID_IUnknown)
35493549 {
35503550 this->AddRef();
@@ -3552,13 +3552,13 @@
35533553 TRACE_EXIT(23,DD_OK);
35543554 return DD_OK;
35553555 }
3556 - TRACE_RET(23,glD3DDev7->QueryInterface(riid,ppvObj));
 3556+ TRACE_RET(HRESULT,23,glD3DDev7->QueryInterface(riid,ppvObj));
35573557 }
35583558
35593559 ULONG WINAPI glDirect3DDevice1::AddRef()
35603560 {
35613561 TRACE_ENTER(1,14,this);
3562 - if(!this) TRACE_RET(8,0);
 3562+ if(!this) TRACE_RET(ULONG,8,0);
35633563 refcount++;
35643564 TRACE_EXIT(8,refcount);
35653565 return refcount;
@@ -3567,7 +3567,7 @@
35683568 ULONG WINAPI glDirect3DDevice1::Release()
35693569 {
35703570 TRACE_ENTER(1,14,this);
3571 - if(!this) TRACE_RET(8,0);
 3571+ if(!this) TRACE_RET(ULONG,8,0);
35723572 ULONG ret;
35733573 refcount--;
35743574 ret = refcount;
@@ -3579,8 +3579,8 @@
35803580 HRESULT WINAPI glDirect3DDevice1::AddViewport(LPDIRECT3DVIEWPORT lpDirect3DViewport)
35813581 {
35823582 TRACE_ENTER(2,14,this,14,lpDirect3DViewport);
3583 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3584 - if(!lpDirect3DViewport) TRACE_RET(23,DDERR_INVALIDPARAMS);
 3583+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3584+ if(!lpDirect3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
35853585 glDirect3DViewport3 *glD3DV3;
35863586 lpDirect3DViewport->QueryInterface(IID_IDirect3DViewport3,(void**)&glD3DV3);
35873587 HRESULT ret = glD3DDev7->AddViewport(glD3DV3);
@@ -3591,32 +3591,32 @@
35923592 HRESULT WINAPI glDirect3DDevice1::BeginScene()
35933593 {
35943594 TRACE_ENTER(1,14,this);
3595 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3596 - TRACE_RET(23,glD3DDev7->BeginScene());
 3595+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3596+ TRACE_RET(HRESULT,23,glD3DDev7->BeginScene());
35973597 }
35983598 HRESULT WINAPI glDirect3DDevice1::CreateExecuteBuffer(LPD3DEXECUTEBUFFERDESC lpDesc,
35993599 LPDIRECT3DEXECUTEBUFFER* lplpDirect3DExecuteBuffer, IUnknown* pUnkOuter)
36003600 {
36013601 TRACE_ENTER(4,14,this,14,lpDesc,14,lplpDirect3DExecuteBuffer,14,pUnkOuter);
3602 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3603 - TRACE_RET(23,glD3DDev7->CreateExecuteBuffer(lpDesc,lplpDirect3DExecuteBuffer,pUnkOuter));
 3602+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3603+ TRACE_RET(HRESULT,23,glD3DDev7->CreateExecuteBuffer(lpDesc,lplpDirect3DExecuteBuffer,pUnkOuter));
36043604 }
36053605 HRESULT WINAPI glDirect3DDevice1::CreateMatrix(LPD3DMATRIXHANDLE lpD3DMatHandle)
36063606 {
36073607 TRACE_ENTER(2,14,this,14,lpD3DMatHandle);
3608 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3609 - TRACE_RET(23,glD3DDev7->CreateMatrix(lpD3DMatHandle));
 3608+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3609+ TRACE_RET(HRESULT,23,glD3DDev7->CreateMatrix(lpD3DMatHandle));
36103610 }
36113611 HRESULT WINAPI glDirect3DDevice1::DeleteMatrix(D3DMATRIXHANDLE d3dMatHandle)
36123612 {
36133613 TRACE_ENTER(2,14,this,9,d3dMatHandle);
3614 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3615 - TRACE_RET(23,glD3DDev7->DeleteMatrix(d3dMatHandle));
 3614+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3615+ TRACE_RET(HRESULT,23,glD3DDev7->DeleteMatrix(d3dMatHandle));
36163616 }
36173617 HRESULT WINAPI glDirect3DDevice1::DeleteViewport(LPDIRECT3DVIEWPORT lpDirect3DViewport)
36183618 {
36193619 TRACE_ENTER(2,14,this,14,lpDirect3DViewport);
3620 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3620+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
36213621 glDirect3DViewport3 *glD3DV3;
36223622 lpDirect3DViewport->QueryInterface(IID_IDirect3DViewport3,(void**)&glD3DV3);
36233623 HRESULT ret = glD3DDev7->DeleteViewport(glD3DV3);
@@ -3627,37 +3627,37 @@
36283628 HRESULT WINAPI glDirect3DDevice1::EndScene()
36293629 {
36303630 TRACE_ENTER(1,14,this);
3631 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3632 - TRACE_RET(23,glD3DDev7->EndScene());
 3631+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3632+ TRACE_RET(HRESULT,23,glD3DDev7->EndScene());
36333633 }
36343634 HRESULT WINAPI glDirect3DDevice1::EnumTextureFormats(LPD3DENUMTEXTUREFORMATSCALLBACK lpd3dEnumTextureProc, LPVOID lpArg)
36353635 {
36363636 TRACE_ENTER(3,14,this,14,lpd3dEnumTextureProc,14,lpArg);
3637 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3637+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
36383638 LPVOID context[2];
36393639 context[0] = (LPVOID)lpd3dEnumTextureProc;
36403640 context[1] = lpArg;
3641 - TRACE_RET(23,glD3DDev7->EnumTextureFormats(EnumTex2,&context));
 3641+ TRACE_RET(HRESULT,23,glD3DDev7->EnumTextureFormats(EnumTex2,&context));
36423642 }
36433643 HRESULT WINAPI glDirect3DDevice1::Execute(LPDIRECT3DEXECUTEBUFFER lpDirect3DExecuteBuffer, LPDIRECT3DVIEWPORT lpDirect3DViewport, DWORD dwFlags)
36443644 {
36453645 TRACE_ENTER(4,14,this,14,lpDirect3DExecuteBuffer,14,lpDirect3DViewport,9,dwFlags);
3646 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3647 - TRACE_RET(23,glD3DDev7->Execute(lpDirect3DExecuteBuffer,lpDirect3DViewport,dwFlags));
 3646+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3647+ TRACE_RET(HRESULT,23,glD3DDev7->Execute(lpDirect3DExecuteBuffer,lpDirect3DViewport,dwFlags));
36483648 }
36493649 HRESULT WINAPI glDirect3DDevice1::GetCaps(LPD3DDEVICEDESC lpD3DHWDevDesc, LPD3DDEVICEDESC lpD3DHELDevDesc)
36503650 {
36513651 TRACE_ENTER(3,14,this,14,lpD3DHWDevDesc,14,lpD3DHELDevDesc);
3652 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3653 - TRACE_RET(23,glD3DDev7->GetCaps3(lpD3DHWDevDesc,lpD3DHELDevDesc));
 3652+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3653+ TRACE_RET(HRESULT,23,glD3DDev7->GetCaps3(lpD3DHWDevDesc,lpD3DHELDevDesc));
36543654 }
36553655 HRESULT WINAPI glDirect3DDevice1::GetDirect3D(LPDIRECT3D* lpD3D)
36563656 {
36573657 TRACE_ENTER(2,14,this,14,lpD3D);
3658 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 3658+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
36593659 LPDIRECT3D7 d3d7;
36603660 HRESULT err = glD3DDev7->GetDirect3D(&d3d7);
3661 - if(!d3d7) TRACE_RET(23,err);
 3661+ if(!d3d7) TRACE_RET(HRESULT,23,err);
36623662 d3d7->QueryInterface(IID_IDirect3D,(void**)lpD3D);
36633663 d3d7->Release();
36643664 TRACE_VAR("*lpD3D",14,*lpD3D);
@@ -3668,36 +3668,36 @@
36693669 HRESULT WINAPI glDirect3DDevice1::GetMatrix(D3DMATRIXHANDLE lpD3DMatHandle, LPD3DMATRIX lpD3DMatrix)
36703670 {
36713671 TRACE_ENTER(3,14,this,9,lpD3DMatHandle,14,lpD3DMatrix);
3672 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3673 - TRACE_RET(23,glD3DDev7->GetMatrix(lpD3DMatHandle,lpD3DMatrix));
 3672+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3673+ TRACE_RET(HRESULT,23,glD3DDev7->GetMatrix(lpD3DMatHandle,lpD3DMatrix));
36743674 }
36753675
36763676 HRESULT WINAPI glDirect3DDevice1::GetPickRecords(LPDWORD lpCount, LPD3DPICKRECORD lpD3DPickRec)
36773677 {
36783678 TRACE_ENTER(3,14,this,14,lpCount,14,lpD3DPickRec);
3679 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3680 - TRACE_RET(23,glD3DDev7->GetPickRecords(lpCount,lpD3DPickRec));
 3679+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3680+ TRACE_RET(HRESULT,23,glD3DDev7->GetPickRecords(lpCount,lpD3DPickRec));
36813681 }
36823682
36833683 HRESULT WINAPI glDirect3DDevice1::GetStats(LPD3DSTATS lpD3DStats)
36843684 {
36853685 TRACE_ENTER(2,14,this,14,lpD3DStats);
3686 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3687 - TRACE_RET(23,glD3DDev7->GetStats(lpD3DStats));
 3686+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3687+ TRACE_RET(HRESULT,23,glD3DDev7->GetStats(lpD3DStats));
36883688 }
36893689
36903690 HRESULT WINAPI glDirect3DDevice1::Initialize(LPDIRECT3D lpd3d, LPGUID lpGUID, LPD3DDEVICEDESC lpd3ddvdesc)
36913691 {
36923692 TRACE_ENTER(4,14,this,14,lpd3d,24,lpGUID,14,lpd3ddvdesc);
3693 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3694 - TRACE_RET(23,DDERR_ALREADYINITIALIZED);
 3693+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3694+ TRACE_RET(HRESULT,23,DDERR_ALREADYINITIALIZED);
36953695 }
36963696 HRESULT WINAPI glDirect3DDevice1::NextViewport(LPDIRECT3DVIEWPORT lpDirect3DViewport, LPDIRECT3DVIEWPORT *lplpDirect3DViewport, DWORD dwFlags)
36973697 {
36983698 TRACE_ENTER(4,14,this,14,lpDirect3DViewport,14,lplpDirect3DViewport,9,dwFlags);
3699 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3700 - if(!lpDirect3DViewport) TRACE_RET(23,DDERR_INVALIDPARAMS);
3701 - if(!lplpDirect3DViewport) TRACE_RET(23,DDERR_INVALIDPARAMS);
 3699+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3700+ if(!lpDirect3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 3701+ if(!lplpDirect3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
37023702 FIXME("glDirect3DDevice1::NextViewport: stub");
37033703 TRACE_EXIT(23,DDERR_GENERIC);
37043704 ERR(DDERR_GENERIC);
@@ -3706,23 +3706,23 @@
37073707 DWORD dwFlags, LPD3DRECT lpRect)
37083708 {
37093709 TRACE_ENTER(5,14,this,14,lpDirect3DExecuteBuffer,14,lpDirect3DViewport,9,dwFlags,26,lpRect);
3710 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3711 - TRACE_RET(23,glD3DDev7->Pick(lpDirect3DExecuteBuffer, lpDirect3DViewport, dwFlags, lpRect));
 3710+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3711+ TRACE_RET(HRESULT,23,glD3DDev7->Pick(lpDirect3DExecuteBuffer, lpDirect3DViewport, dwFlags, lpRect));
37123712 }
37133713
37143714 HRESULT WINAPI glDirect3DDevice1::SetMatrix(D3DMATRIXHANDLE d3dMatHandle, LPD3DMATRIX lpD3DMatrix)
37153715 {
37163716 TRACE_ENTER(3,14,this,9,d3dMatHandle,14,lpD3DMatrix);
3717 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3718 - TRACE_RET(23,glD3DDev7->SetMatrix(d3dMatHandle,lpD3DMatrix));
 3717+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3718+ TRACE_RET(HRESULT,23,glD3DDev7->SetMatrix(d3dMatHandle,lpD3DMatrix));
37193719 }
37203720
37213721 HRESULT WINAPI glDirect3DDevice1::SwapTextureHandles(LPDIRECT3DTEXTURE lpD3DTex1, LPDIRECT3DTEXTURE lpD3DTex2)
37223722 {
37233723 TRACE_ENTER(3,14,this,14,lpD3DTex1,14,lpD3DTex2);
3724 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
3725 - if(!lpD3DTex1) TRACE_RET(23,DDERR_INVALIDPARAMS);
3726 - if(!lpD3DTex2) TRACE_RET(23,DDERR_INVALIDPARAMS);
 3724+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 3725+ if(!lpD3DTex1) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 3726+ if(!lpD3DTex2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
37273727 LPDIRECT3DTEXTURE2 tex1, tex2;
37283728 lpD3DTex1->QueryInterface(IID_IDirect3DTexture2,(void**)&tex1);
37293729 lpD3DTex2->QueryInterface(IID_IDirect3DTexture2,(void**)&tex2);
Index: ddraw/glDirect3DExecuteBuffer.cpp
@@ -44,7 +44,7 @@
4545 HRESULT WINAPI glDirect3DExecuteBuffer::QueryInterface(REFIID riid, void** ppvObj)
4646 {
4747 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
48 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 48+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
4949 if((riid == IID_IUnknown) || (riid == IID_IDirect3DExecuteBuffer))
5050 {
5151 this->AddRef();
@@ -59,7 +59,7 @@
6060 ULONG WINAPI glDirect3DExecuteBuffer::AddRef()
6161 {
6262 TRACE_ENTER(1,14,this);
63 - if(!this) TRACE_RET(8,0);
 63+ if(!this) TRACE_RET(ULONG,8,0);
6464 refcount++;
6565 TRACE_EXIT(8,refcount);
6666 return refcount;
@@ -68,7 +68,7 @@
6969 ULONG WINAPI glDirect3DExecuteBuffer::Release()
7070 {
7171 TRACE_ENTER(1,14,this);
72 - if(!this) TRACE_RET(8,0);
 72+ if(!this) TRACE_RET(ULONG,8,0);
7373 ULONG ret;
7474 refcount--;
7575 ret = refcount;
@@ -80,10 +80,10 @@
8181 HRESULT WINAPI glDirect3DExecuteBuffer::GetExecuteData(LPD3DEXECUTEDATA lpData)
8282 {
8383 TRACE_ENTER(2,14,this,14,lpData);
84 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
85 - if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
86 - if(locked) TRACE_RET(23,D3DERR_EXECUTE_LOCKED);
87 - if(lpData->dwSize < sizeof(D3DEXECUTEDATA)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 84+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 85+ if(!lpData) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 86+ if(locked) TRACE_RET(HRESULT,23,D3DERR_EXECUTE_LOCKED);
 87+ if(lpData->dwSize < sizeof(D3DEXECUTEDATA)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
8888 memcpy(lpData,&datadesc,sizeof(D3DEXECUTEDATA));
8989 TRACE_EXIT(23,D3D_OK);
9090 return D3D_OK;
@@ -93,7 +93,7 @@
9494 LPD3DEXECUTEBUFFERDESC lpDesc)
9595 {
9696 TRACE_ENTER(3,14,this,14,lpDirect3DDevice,14,lpDesc);
97 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 97+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
9898 TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
9999 return DDERR_ALREADYINITIALIZED;
100100 }
@@ -101,11 +101,11 @@
102102 HRESULT WINAPI glDirect3DExecuteBuffer::Lock(LPD3DEXECUTEBUFFERDESC lpDesc)
103103 {
104104 TRACE_ENTER(2,14,this,14,lpDesc);
105 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
106 - if(!lpDesc) TRACE_RET(23,DDERR_INVALIDPARAMS);
107 - if(lpDesc->dwSize < sizeof(D3DEXECUTEBUFFERDESC)) TRACE_RET(23,DDERR_INVALIDPARAMS);
108 - if(inuse) TRACE_RET(23,DDERR_WASSTILLDRAWING);
109 - if(locked) TRACE_RET(23,D3DERR_EXECUTE_LOCKED);
 105+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 106+ if(!lpDesc) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 107+ if(lpDesc->dwSize < sizeof(D3DEXECUTEBUFFERDESC)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 108+ if(inuse) TRACE_RET(HRESULT,23,DDERR_WASSTILLDRAWING);
 109+ if(locked) TRACE_RET(HRESULT,23,D3DERR_EXECUTE_LOCKED);
110110 desc.dwCaps = lpDesc->dwCaps;
111111 desc.dwFlags |= D3DDEB_LPDATA;
112112 if(!data)
@@ -123,7 +123,7 @@
124124 HRESULT WINAPI glDirect3DExecuteBuffer::Optimize(DWORD dwDummy)
125125 {
126126 TRACE_ENTER(2,14,this,9,dwDummy);
127 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 127+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
128128 TRACE_EXIT(23,DDERR_UNSUPPORTED);
129129 return DDERR_UNSUPPORTED;
130130 }
@@ -131,9 +131,9 @@
132132 HRESULT WINAPI glDirect3DExecuteBuffer::SetExecuteData(LPD3DEXECUTEDATA lpData)
133133 {
134134 TRACE_ENTER(2,14,this,14,lpData);
135 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
136 - if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
137 - if(lpData->dwSize != sizeof(D3DEXECUTEDATA)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 135+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 136+ if(!lpData) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 137+ if(lpData->dwSize != sizeof(D3DEXECUTEDATA)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
138138 memcpy(&datadesc,lpData,sizeof(D3DEXECUTEDATA));
139139 TRACE_EXIT(23,D3D_OK);
140140 return D3D_OK;
@@ -142,11 +142,11 @@
143143 HRESULT WINAPI glDirect3DExecuteBuffer::Unlock()
144144 {
145145 TRACE_ENTER(1,14,this);
146 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
147 - if(inuse) TRACE_RET(23,D3DERR_EXECUTE_NOT_LOCKED);
148 - if(!locked) TRACE_RET(23,D3DERR_EXECUTE_NOT_LOCKED);
 146+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 147+ if(inuse) TRACE_RET(HRESULT,23,D3DERR_EXECUTE_NOT_LOCKED);
 148+ if(!locked) TRACE_RET(HRESULT,23,D3DERR_EXECUTE_NOT_LOCKED);
149149 locked = false;
150 - TRACE_RET(23,D3D_OK);
 150+ TRACE_RET(HRESULT,23,D3D_OK);
151151 return D3D_OK;
152152 }
153153
@@ -153,7 +153,7 @@
154154 HRESULT WINAPI glDirect3DExecuteBuffer::Validate(LPDWORD lpdwOffset, LPD3DVALIDATECALLBACK lpFunc, LPVOID lpUserArg, DWORD dwReserved)
155155 {
156156 TRACE_ENTER(5,14,this,14,lpdwOffset,14,lpFunc,14,lpUserArg,9,dwReserved);
157 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 157+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
158158 TRACE_EXIT(23,DDERR_UNSUPPORTED);
159159 return DDERR_UNSUPPORTED;
160160 }
@@ -161,16 +161,16 @@
162162 HRESULT glDirect3DExecuteBuffer::ExecuteLock(LPD3DEXECUTEBUFFERDESC lpDesc,LPD3DEXECUTEDATA lpData)
163163 {
164164 TRACE_ENTER(3,14,this,14,lpDesc,14,lpData);
165 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
166 - if(inuse) TRACE_RET(23,DDERR_WASSTILLDRAWING);
167 - if(locked) TRACE_RET(23,D3DERR_EXECUTE_LOCKED);
168 - if(!lpDesc) TRACE_RET(23,DDERR_INVALIDPARAMS);
169 - if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
 165+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 166+ if(inuse) TRACE_RET(HRESULT,23,DDERR_WASSTILLDRAWING);
 167+ if(locked) TRACE_RET(HRESULT,23,D3DERR_EXECUTE_LOCKED);
 168+ if(!lpDesc) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 169+ if(!lpData) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
170170 desc.dwFlags |= D3DDEB_LPDATA;
171171 if(!data)
172172 {
173173 data = (unsigned char *)malloc(desc.dwBufferSize);
174 - if(!data) TRACE_RET(23,DDERR_OUTOFMEMORY);
 174+ if(!data) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
175175 }
176176 desc.lpData = data;
177177 memcpy(lpDesc,&desc,sizeof(D3DEXECUTEBUFFERDESC));
@@ -184,12 +184,12 @@
185185 HRESULT glDirect3DExecuteBuffer::ExecuteUnlock(LPD3DEXECUTEDATA lpData)
186186 {
187187 TRACE_ENTER(2,14,this,14,lpData);
188 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
189 - if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
190 - if(!inuse) TRACE_RET(23,D3DERR_EXECUTE_NOT_LOCKED);
 188+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 189+ if(!lpData) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 190+ if(!inuse) TRACE_RET(HRESULT,23,D3DERR_EXECUTE_NOT_LOCKED);
191191 inuse = false;
192192 locked = false;
193193 memcpy(&datadesc,lpData,sizeof(D3DEXECUTEDATA));
194 - TRACE_RET(23,D3D_OK);
 194+ TRACE_RET(HRESULT,23,D3D_OK);
195195 return D3D_OK;
196196 }
\ No newline at end of file
Index: ddraw/glDirect3DLight.cpp
@@ -55,7 +55,7 @@
5656 ULONG WINAPI glDirect3DLight::AddRef()
5757 {
5858 TRACE_ENTER(1,14,this);
59 - if(!this) TRACE_RET(8,0);
 59+ if(!this) TRACE_RET(ULONG,8,0);
6060 refcount++;
6161 TRACE_EXIT(8,refcount);
6262 return refcount;
@@ -63,7 +63,7 @@
6464 ULONG WINAPI glDirect3DLight::Release()
6565 {
6666 TRACE_ENTER(1,14,this);
67 - if(!this) TRACE_RET(8,0);
 67+ if(!this) TRACE_RET(ULONG,8,0);
6868 ULONG ret;
6969 refcount--;
7070 ret = refcount;
@@ -75,7 +75,7 @@
7676 HRESULT WINAPI glDirect3DLight::Initialize(LPDIRECT3D lpDirect3D)
7777 {
7878 TRACE_ENTER(2,14,this,14,lpDirect3D);
79 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 79+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
8080 TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
8181 return DDERR_ALREADYINITIALIZED;
8282 }
@@ -82,8 +82,8 @@
8383
8484 HRESULT WINAPI glDirect3DLight::QueryInterface(REFIID riid, void** ppvObj)
8585 {TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
86 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
87 - if(!ppvObj) TRACE_RET(23,DDERR_INVALIDPARAMS);
 86+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 87+ if(!ppvObj) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
8888 if(riid == IID_IUnknown)
8989 {
9090 this->AddRef();
@@ -112,9 +112,9 @@
113113 HRESULT WINAPI glDirect3DLight::GetLight(LPD3DLIGHT lpLight)
114114 {
115115 TRACE_ENTER(2,14,this,14,lpLight);
116 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
117 - if(!lpLight) TRACE_RET(23,DDERR_INVALIDPARAMS);
118 - if(lpLight->dwSize < sizeof(D3DLIGHT)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 116+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 117+ if(!lpLight) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 118+ if(lpLight->dwSize < sizeof(D3DLIGHT)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
119119 lpLight->dltType = light.dltType;
120120 lpLight->dcvColor = light.dcvDiffuse;
121121 lpLight->dvPosition = light.dvPosition;
@@ -132,9 +132,9 @@
133133 HRESULT WINAPI glDirect3DLight::SetLight(LPD3DLIGHT lpLight)
134134 {
135135 TRACE_ENTER(2,14,this,14,lpLight);
136 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
137 - if(!lpLight) TRACE_RET(23,DDERR_INVALIDPARAMS);
138 - if(lpLight->dwSize < sizeof(D3DLIGHT)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 136+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 137+ if(!lpLight) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 138+ if(lpLight->dwSize < sizeof(D3DLIGHT)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
139139 light.dltType = lpLight->dltType;
140140 light.dcvDiffuse = lpLight->dcvColor;
141141 light.dcvAmbient.r = light.dcvAmbient.g = light.dcvAmbient.b = light.dcvAmbient.a = 0;
Index: ddraw/glDirect3DMaterial.cpp
@@ -50,7 +50,7 @@
5151 HRESULT WINAPI glDirect3DMaterial3::QueryInterface(REFIID riid, void** ppvObj)
5252 {
5353 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
54 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 54+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
5555 if(riid == IID_IUnknown)
5656 {
5757 this->AddRef();
@@ -114,7 +114,7 @@
115115 ULONG WINAPI glDirect3DMaterial3::AddRef()
116116 {
117117 TRACE_ENTER(1,14,this);
118 - if(!this) TRACE_RET(8,0);
 118+ if(!this) TRACE_RET(ULONG,8,0);
119119 refcount++;
120120 TRACE_EXIT(8,refcount);
121121 return refcount;
@@ -122,7 +122,7 @@
123123
124124 ULONG WINAPI glDirect3DMaterial3::Release()
125125 {
126 - if(!this) TRACE_RET(8,0);
 126+ if(!this) TRACE_RET(ULONG,8,0);
127127 ULONG ret;
128128 refcount--;
129129 ret = refcount;
@@ -134,12 +134,12 @@
135135 HRESULT WINAPI glDirect3DMaterial3::GetHandle(LPDIRECT3DDEVICE3 lpDirect3DDevice, LPD3DMATERIALHANDLE lpHandle)
136136 {
137137 TRACE_ENTER(3,14,this,14,lpDirect3DDevice,14,lpHandle);
138 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
139 - if(!lpDirect3DDevice) TRACE_RET(23,DDERR_INVALIDPARAMS);
 138+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 139+ if(!lpDirect3DDevice) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
140140 glDirect3DDevice3 *dev3 = (glDirect3DDevice3*)lpDirect3DDevice;
141141 if(handle)
142142 {
143 - if(device != dev3->GetGLD3DDev7()) TRACE_RET(23,DDERR_INVALIDOBJECT);
 143+ if(device != dev3->GetGLD3DDev7()) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
144144 *lpHandle = handle;
145145 TRACE_VAR("*lpHandle",9,*lpHandle);
146146 TRACE_EXIT(23,D3D_OK);
@@ -147,7 +147,7 @@
148148 }
149149 device = dev3->GetGLD3DDev7();
150150 handle = device->AddMaterial(this);
151 - if(handle == -1) TRACE_RET(23,DDERR_OUTOFMEMORY);
 151+ if(handle == -1) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
152152 *lpHandle = handle;
153153 TRACE_VAR("*lpHandle",9,*lpHandle);
154154 TRACE_EXIT(23,D3D_OK);
@@ -157,8 +157,8 @@
158158 HRESULT WINAPI glDirect3DMaterial3::GetMaterial(LPD3DMATERIAL lpMat)
159159 {
160160 TRACE_ENTER(2,14,this,14,lpMat);
161 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
162 - if(lpMat->dwSize < sizeof(D3DMATERIAL)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 161+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 162+ if(lpMat->dwSize < sizeof(D3DMATERIAL)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
163163 memcpy(lpMat,&material,sizeof(D3DMATERIAL));
164164 TRACE_EXIT(23,D3D_OK);
165165 return D3D_OK;
@@ -167,8 +167,8 @@
168168 HRESULT WINAPI glDirect3DMaterial3::SetMaterial(LPD3DMATERIAL lpMat)
169169 {
170170 TRACE_ENTER(2,14,this,14,lpMat);
171 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
172 - if(lpMat->dwSize != sizeof(D3DMATERIAL)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 171+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 172+ if(lpMat->dwSize != sizeof(D3DMATERIAL)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
173173 memcpy(&material,lpMat,sizeof(D3DMATERIAL));
174174 if(device && current) Sync();
175175 TRACE_EXIT(23,D3D_OK);
@@ -229,7 +229,7 @@
230230 ULONG WINAPI glDirect3DMaterial2::AddRef()
231231 {
232232 TRACE_ENTER(1,14,this);
233 - if(!this) TRACE_RET(8,0);
 233+ if(!this) TRACE_RET(ULONG,8,0);
234234 refcount++;
235235 TRACE_EXIT(8,refcount);
236236 return refcount;
@@ -238,7 +238,7 @@
239239 ULONG WINAPI glDirect3DMaterial2::Release()
240240 {
241241 TRACE_ENTER(1,14,this);
242 - if(!this) TRACE_RET(8,0);
 242+ if(!this) TRACE_RET(ULONG,8,0);
243243 ULONG ret;
244244 refcount--;
245245 ret = refcount;
@@ -250,7 +250,7 @@
251251 HRESULT WINAPI glDirect3DMaterial2::QueryInterface(REFIID riid, void** ppvObj)
252252 {
253253 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
254 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 254+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
255255 if(riid == IID_IUnknown)
256256 {
257257 this->AddRef();
@@ -259,14 +259,14 @@
260260 TRACE_EXIT(23,D3D_OK);
261261 return D3D_OK;
262262 }
263 - TRACE_RET(23,glD3DM3->QueryInterface(riid,ppvObj));
 263+ TRACE_RET(HRESULT,23,glD3DM3->QueryInterface(riid,ppvObj));
264264 }
265265
266266 HRESULT WINAPI glDirect3DMaterial2::GetHandle(LPDIRECT3DDEVICE2 lpDirect3DDevice, LPD3DMATERIALHANDLE lpHandle)
267267 {
268268 TRACE_ENTER(3,14,this,14,lpDirect3DDevice,14,lpHandle);
269 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
270 - if(!lpDirect3DDevice) TRACE_RET(23,DDERR_INVALIDPARAMS);
 269+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 270+ if(!lpDirect3DDevice) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
271271 glDirect3DDevice2 *glD3DDev2 = (glDirect3DDevice2*)lpDirect3DDevice;
272272 glDirect3DDevice3 *glD3DDev3;
273273 glD3DDev2->QueryInterface(IID_IDirect3DDevice3,(void**)&glD3DDev3);
@@ -279,14 +279,14 @@
280280 HRESULT WINAPI glDirect3DMaterial2::GetMaterial(LPD3DMATERIAL lpMat)
281281 {
282282 TRACE_ENTER(2,14,this,14,lpMat);
283 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
284 - TRACE_RET(23,glD3DM3->GetMaterial(lpMat));
 283+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 284+ TRACE_RET(HRESULT,23,glD3DM3->GetMaterial(lpMat));
285285 }
286286 HRESULT WINAPI glDirect3DMaterial2::SetMaterial(LPD3DMATERIAL lpMat)
287287 {
288288 TRACE_ENTER(2,14,this,14,lpMat);
289 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
290 - TRACE_RET(23,glD3DM3->SetMaterial(lpMat));
 289+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 290+ TRACE_RET(HRESULT,23,glD3DM3->SetMaterial(lpMat));
291291 }
292292
293293 glDirect3DMaterial1::glDirect3DMaterial1(glDirect3DMaterial3 *glD3DM3)
@@ -308,7 +308,7 @@
309309 ULONG WINAPI glDirect3DMaterial1::AddRef()
310310 {
311311 TRACE_ENTER(1,14,this);
312 - if(!this) TRACE_RET(8,0);
 312+ if(!this) TRACE_RET(ULONG,8,0);
313313 refcount++;
314314 TRACE_EXIT(8,refcount);
315315 return refcount;
@@ -317,7 +317,7 @@
318318 ULONG WINAPI glDirect3DMaterial1::Release()
319319 {
320320 TRACE_ENTER(1,14,this);
321 - if(!this) TRACE_RET(8,0);
 321+ if(!this) TRACE_RET(ULONG,8,0);
322322 ULONG ret;
323323 refcount--;
324324 ret = refcount;
@@ -329,7 +329,7 @@
330330 HRESULT WINAPI glDirect3DMaterial1::QueryInterface(REFIID riid, void** ppvObj)
331331 {
332332 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
333 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 333+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
334334 if(riid == IID_IUnknown)
335335 {
336336 this->AddRef();
@@ -338,14 +338,14 @@
339339 TRACE_EXIT(23,D3D_OK);
340340 return D3D_OK;
341341 }
342 - TRACE_RET(23,glD3DM3->QueryInterface(riid,ppvObj));
 342+ TRACE_RET(HRESULT,23,glD3DM3->QueryInterface(riid,ppvObj));
343343 }
344344
345345 HRESULT WINAPI glDirect3DMaterial1::GetHandle(LPDIRECT3DDEVICE lpDirect3DDevice, LPD3DMATERIALHANDLE lpHandle)
346346 {
347347 TRACE_ENTER(3,14,this,14,lpDirect3DDevice,14,lpHandle);
348 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
349 - if(!lpDirect3DDevice) TRACE_RET(23,DDERR_INVALIDPARAMS);
 348+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 349+ if(!lpDirect3DDevice) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
350350 glDirect3DDevice1 *glD3DDev1 = (glDirect3DDevice1*)lpDirect3DDevice;
351351 glDirect3DDevice3 *glD3DDev3;
352352 glD3DDev1->QueryInterface(IID_IDirect3DDevice3,(void**)&glD3DDev3);
@@ -358,14 +358,14 @@
359359 HRESULT WINAPI glDirect3DMaterial1::GetMaterial(LPD3DMATERIAL lpMat)
360360 {
361361 TRACE_ENTER(2,14,this,14,lpMat);
362 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
363 - TRACE_RET(23,glD3DM3->GetMaterial(lpMat));
 362+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 363+ TRACE_RET(HRESULT,23,glD3DM3->GetMaterial(lpMat));
364364 }
365365
366366 HRESULT WINAPI glDirect3DMaterial1::Initialize(LPDIRECT3D lpDirect3D)
367367 {
368368 TRACE_ENTER(2,14,this,14,lpDirect3D);
369 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 369+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
370370 TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
371371 return DDERR_ALREADYINITIALIZED;
372372 }
@@ -373,7 +373,7 @@
374374 HRESULT WINAPI glDirect3DMaterial1::Reserve()
375375 {
376376 TRACE_ENTER(1,14,this);
377 - if(!this) TRACE_RET(23,DDERR_INVALIDPARAMS);
 377+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
378378 TRACE_EXIT(23,DDERR_UNSUPPORTED);
379379 return DDERR_UNSUPPORTED;
380380 }
@@ -381,14 +381,14 @@
382382 HRESULT WINAPI glDirect3DMaterial1::SetMaterial(LPD3DMATERIAL lpMat)
383383 {
384384 TRACE_ENTER(2,14,this,14,lpMat);
385 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
386 - TRACE_RET(23,glD3DM3->SetMaterial(lpMat));
 385+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 386+ TRACE_RET(HRESULT,23,glD3DM3->SetMaterial(lpMat));
387387 }
388388
389389 HRESULT WINAPI glDirect3DMaterial1::Unreserve()
390390 {
391391 TRACE_ENTER(1,14,this);
392 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 392+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
393393 TRACE_EXIT(23,DDERR_UNSUPPORTED);
394394 return DDERR_UNSUPPORTED;
395395 }
Index: ddraw/glDirect3DTexture.cpp
@@ -42,7 +42,7 @@
4343 HRESULT WINAPI glDirect3DTexture2::QueryInterface(REFIID riid, void** ppvObj)
4444 {
4545 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
46 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 46+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
4747 if(riid == IID_IUnknown)
4848 {
4949 this->AddRef();
@@ -51,13 +51,13 @@
5252 TRACE_EXIT(23,DD_OK);
5353 return DD_OK;
5454 }
55 - TRACE_RET(23,glDDS7->QueryInterface(riid,ppvObj));
 55+ TRACE_RET(HRESULT,23,glDDS7->QueryInterface(riid,ppvObj));
5656 }
5757
5858 ULONG WINAPI glDirect3DTexture2::AddRef()
5959 {
6060 TRACE_ENTER(1,14,this);
61 - if(!this) TRACE_RET(8,0);
 61+ if(!this) TRACE_RET(ULONG,8,0);
6262 refcount++;
6363 TRACE_EXIT(8,refcount);
6464 return refcount;
@@ -66,7 +66,7 @@
6767 ULONG WINAPI glDirect3DTexture2::Release()
6868 {
6969 TRACE_ENTER(1,14,this);
70 - if(!this) TRACE_RET(8,0);
 70+ if(!this) TRACE_RET(ULONG,8,0);
7171 ULONG ret;
7272 refcount--;
7373 ret = refcount;
@@ -78,8 +78,8 @@
7979 HRESULT WINAPI glDirect3DTexture2::GetHandle(LPDIRECT3DDEVICE2 lpDirect3DDevice2, LPD3DTEXTUREHANDLE lpHandle)
8080 {
8181 TRACE_ENTER(3,14,this,14,lpDirect3DDevice2,14,lpHandle);
82 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
83 - if(!lpDirect3DDevice2) TRACE_RET(23,DDERR_INVALIDPARAMS);
 82+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 83+ if(!lpDirect3DDevice2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
8484 glDirect3DDevice7 *glD3DDev7;
8585 lpDirect3DDevice2->QueryInterface(IID_IDirect3DDevice7,(void**)&glD3DDev7);
8686 HRESULT ret = glDDS7->GetHandle(glD3DDev7,lpHandle);
@@ -90,14 +90,14 @@
9191 HRESULT WINAPI glDirect3DTexture2::Load(LPDIRECT3DTEXTURE2 lpD3DTexture2)
9292 {
9393 TRACE_ENTER(2,14,this,14,lpD3DTexture2);
94 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
95 - if(!lpD3DTexture2) TRACE_RET(23,DDERR_INVALIDPARAMS);
96 - TRACE_RET(23,glDDS7->Load(((glDirect3DTexture2*)lpD3DTexture2)->GetDDS7()));
 94+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 95+ if(!lpD3DTexture2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 96+ TRACE_RET(HRESULT,23,glDDS7->Load(((glDirect3DTexture2*)lpD3DTexture2)->GetDDS7()));
9797 }
9898 HRESULT WINAPI glDirect3DTexture2::PaletteChanged(DWORD dwStart, DWORD dwCount)
9999 {
100100 TRACE_ENTER(3,14,this,8,dwStart,8,dwCount);
101 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 101+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
102102 FIXME("glDirect3DTexture2::PaletteChanged: stub");
103103 TRACE_EXIT(23,DDERR_GENERIC);
104104 return DDERR_GENERIC;
@@ -120,7 +120,7 @@
121121 HRESULT WINAPI glDirect3DTexture1::QueryInterface(REFIID riid, void** ppvObj)
122122 {
123123 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
124 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 124+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
125125 if(riid == IID_IUnknown)
126126 {
127127 this->AddRef();
@@ -129,12 +129,12 @@
130130 TRACE_EXIT(23,DD_OK);
131131 return DD_OK;
132132 }
133 - TRACE_RET(23,glDDS7->QueryInterface(riid,ppvObj));
 133+ TRACE_RET(HRESULT,23,glDDS7->QueryInterface(riid,ppvObj));
134134 }
135135 ULONG WINAPI glDirect3DTexture1::AddRef()
136136 {
137137 TRACE_ENTER(1,14,this);
138 - if(!this) TRACE_RET(8,0);
 138+ if(!this) TRACE_RET(ULONG,8,0);
139139 refcount++;
140140 TRACE_EXIT(8,refcount);
141141 return refcount;
@@ -142,7 +142,7 @@
143143 ULONG WINAPI glDirect3DTexture1::Release()
144144 {
145145 TRACE_ENTER(1,14,this);
146 - if(!this) TRACE_RET(8,0);
 146+ if(!this) TRACE_RET(ULONG,8,0);
147147 ULONG ret;
148148 refcount--;
149149 ret = refcount;
@@ -154,8 +154,8 @@
155155 HRESULT WINAPI glDirect3DTexture1::GetHandle(LPDIRECT3DDEVICE lpDirect3DDevice, LPD3DTEXTUREHANDLE lpHandle)
156156 {
157157 TRACE_ENTER(3,14,this,14,lpDirect3DDevice,14,lpHandle);
158 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
159 - if(!lpDirect3DDevice) TRACE_RET(23,DDERR_INVALIDPARAMS);
 158+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 159+ if(!lpDirect3DDevice) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
160160 glDirect3DDevice7 *glD3DDev7;
161161 lpDirect3DDevice->QueryInterface(IID_IDirect3DDevice7,(void**)&glD3DDev7);
162162 HRESULT ret = glDDS7->GetHandle(glD3DDev7,lpHandle);
@@ -166,7 +166,7 @@
167167 HRESULT WINAPI glDirect3DTexture1::Initialize(LPDIRECT3DDEVICE lpD3DDevice, LPDIRECTDRAWSURFACE lpDDSurface)
168168 {
169169 TRACE_ENTER(3,14,this,14,lpD3DDevice,14,lpDDSurface);
170 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 170+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
171171 TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
172172 return DDERR_ALREADYINITIALIZED;
173173 }
@@ -173,14 +173,14 @@
174174 HRESULT WINAPI glDirect3DTexture1::Load(LPDIRECT3DTEXTURE lpD3DTexture)
175175 {
176176 TRACE_ENTER(2,14,this,14,lpD3DTexture);
177 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
178 - if(!lpD3DTexture) TRACE_RET(23,DDERR_INVALIDPARAMS);
179 - TRACE_RET(23,glDDS7->Load(((glDirect3DTexture1*)lpD3DTexture)->GetDDS7()));
 177+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 178+ if(!lpD3DTexture) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 179+ TRACE_RET(HRESULT,23,glDDS7->Load(((glDirect3DTexture1*)lpD3DTexture)->GetDDS7()));
180180 }
181181 HRESULT WINAPI glDirect3DTexture1::PaletteChanged(DWORD dwStart, DWORD dwCount)
182182 {
183183 TRACE_ENTER(3,14,this,8,dwStart,8,dwCount);
184 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 184+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
185185 FIXME("glDirect3DTexture1::PaletteChanged: stub");
186186 TRACE_EXIT(23,DDERR_GENERIC);
187187 return DDERR_GENERIC;
@@ -188,7 +188,7 @@
189189 HRESULT WINAPI glDirect3DTexture1::Unload()
190190 {
191191 TRACE_ENTER(1,14,this);
192 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 192+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
193193 TRACE_EXIT(23,DDERR_UNSUPPORTED);
194194 return DDERR_UNSUPPORTED;
195195 }
Index: ddraw/glDirect3DVertexBuffer.cpp
@@ -45,7 +45,7 @@
4646 ULONG WINAPI glDirect3DVertexBuffer7::AddRef()
4747 {
4848 TRACE_ENTER(1,14,this);
49 - if(!this) TRACE_RET(8,0);
 49+ if(!this) TRACE_RET(ULONG,8,0);
5050 refcount++;
5151 TRACE_EXIT(8,refcount);
5252 return refcount;
@@ -53,7 +53,7 @@
5454 ULONG WINAPI glDirect3DVertexBuffer7::Release()
5555 {
5656 TRACE_ENTER(1,14,this);
57 - if(!this) TRACE_RET(8,0);
 57+ if(!this) TRACE_RET(ULONG,8,0);
5858 ULONG ret;
5959 refcount--;
6060 ret = refcount;
@@ -65,8 +65,8 @@
6666 HRESULT WINAPI glDirect3DVertexBuffer7::QueryInterface(REFIID riid, void** ppvObj)
6767 {
6868 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
69 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
70 - if(!ppvObj) TRACE_RET(23,DDERR_INVALIDPARAMS);
 69+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 70+ if(!ppvObj) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
7171 if(riid == IID_IUnknown)
7272 {
7373 this->AddRef();
@@ -82,8 +82,8 @@
8383 HRESULT WINAPI glDirect3DVertexBuffer7::GetVertexBufferDesc(LPD3DVERTEXBUFFERDESC lpVBDesc)
8484 {
8585 TRACE_ENTER(2,14,this,14,lpVBDesc);
86 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
87 - if(!lpVBDesc) TRACE_RET(23,DDERR_INVALIDPARAMS);
 86+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 87+ if(!lpVBDesc) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
8888 *lpVBDesc = vbdesc;
8989 TRACE_EXIT(23,D3D_OK);
9090 return D3D_OK;
@@ -92,7 +92,7 @@
9393 HRESULT WINAPI glDirect3DVertexBuffer7::Lock(DWORD dwFlags, LPVOID* lplpData, LPDWORD lpdwSize)
9494 {
9595 TRACE_ENTER(4,14,this,9,dwFlags,14,lplpData,14,lpdwSize);
96 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 96+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
9797 FIXME("glDirect3DVertexBuffer7::Lock: stub");
9898 TRACE_EXIT(23,DDERR_GENERIC);
9999 return DDERR_GENERIC;
@@ -101,7 +101,7 @@
102102 HRESULT WINAPI glDirect3DVertexBuffer7::Optimize(LPDIRECT3DDEVICE7 lpD3DDevice, DWORD dwFlags)
103103 {
104104 TRACE_ENTER(3,14,this,14,lpD3DDevice,9,dwFlags);
105 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 105+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
106106 FIXME("glDirect3DVertexBuffer7::Optimize: stub");
107107 TRACE_EXIT(23,DDERR_GENERIC);
108108 return DDERR_GENERIC;
@@ -110,7 +110,7 @@
111111 LPDIRECT3DVERTEXBUFFER7 lpSrcBuffer, DWORD dwSrcIndex, LPDIRECT3DDEVICE7 lpD3DDevice, DWORD dwFlags)
112112 {
113113 TRACE_ENTER(8,14,this,9,dwVertexOp,8,dwDestIndex,8,dwCount,14,lpSrcBuffer,8,dwSrcIndex,14,lpD3DDevice,9,dwFlags);
114 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 114+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
115115 FIXME("glDirect3DVertexBuffer7::ProcessVertices: stub");
116116 TRACE_EXIT(23,DDERR_GENERIC);
117117 return DDERR_GENERIC;
@@ -119,7 +119,7 @@
120120 LPD3DDRAWPRIMITIVESTRIDEDDATA lpVertexArray, DWORD dwSrcIndex, LPDIRECT3DDEVICE7 lpD3DDevice, DWORD dwFlags)
121121 {
122122 TRACE_ENTER(8,14,this,9,dwVertexOp,8,dwDestIndex,8,dwCount,14,lpVertexArray,8,dwSrcIndex,14,lpD3DDevice,9,dwFlags);
123 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 123+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
124124 FIXME("glDirect3DVertexBuffer7::ProcessVerticesStrided: stub");
125125 TRACE_EXIT(23,DDERR_GENERIC);
126126 return DDERR_GENERIC;
@@ -127,7 +127,7 @@
128128 HRESULT WINAPI glDirect3DVertexBuffer7::Unlock()
129129 {
130130 TRACE_ENTER(1,14,this);
131 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 131+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
132132 FIXME("glDirect3DVertexBuffer7::Unlock: stub");
133133 TRACE_EXIT(23,DDERR_GENERIC);
134134 return DDERR_GENERIC;
Index: ddraw/glDirect3DViewport.cpp
@@ -67,7 +67,7 @@
6868 HRESULT WINAPI glDirect3DViewport3::QueryInterface(REFIID riid, void** ppvObj)
6969 {
7070 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
71 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 71+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
7272 if(riid == IID_IUnknown)
7373 {
7474 this->AddRef();
@@ -131,7 +131,7 @@
132132 ULONG WINAPI glDirect3DViewport3::AddRef()
133133 {
134134 TRACE_ENTER(1,14,this);
135 - if(!this) TRACE_RET(8,0);
 135+ if(!this) TRACE_RET(ULONG,8,0);
136136 refcount++;
137137 TRACE_EXIT(8,refcount);
138138 return refcount;
@@ -140,7 +140,7 @@
141141 ULONG WINAPI glDirect3DViewport3::Release()
142142 {
143143 TRACE_ENTER(1,14,this);
144 - if(!this) TRACE_RET(8,0);
 144+ if(!this) TRACE_RET(ULONG,8,0);
145145 ULONG ret;
146146 refcount--;
147147 ret = refcount;
@@ -152,8 +152,8 @@
153153 HRESULT WINAPI glDirect3DViewport3::AddLight(LPDIRECT3DLIGHT lpDirect3DLight)
154154 {
155155 TRACE_ENTER(2,14,this,14,lpDirect3DLight);
156 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
157 - if(((glDirect3DLight*)lpDirect3DLight)->viewport) TRACE_EXIT(23,D3DERR_LIGHTHASVIEWPORT);
 156+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 157+ if(((glDirect3DLight*)lpDirect3DLight)->viewport) TRACE_RET(HRESULT,23,D3DERR_LIGHTHASVIEWPORT);
158158 for(int i = 0; i < 8; i++)
159159 {
160160 if(!lights[i])
@@ -175,26 +175,26 @@
176176 HRESULT WINAPI glDirect3DViewport3::Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags)
177177 {
178178 TRACE_ENTER(4,14,this,8,dwCount,14,lpRects,9,dwFlags);
179 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
180 - if(!device) TRACE_RET(23,D3DERR_VIEWPORTHASNODEVICE);
 179+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 180+ if(!device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
181181 D3DCOLORVALUE bgcolor = {0.0,0.0,0.0,0.0};
182182 if(device->materials[background]) bgcolor = device->materials[background]->material.diffuse;
183 - TRACE_RET(23,device->Clear(dwCount,lpRects,dwFlags,d3dcvtod3dcolor(bgcolor),0.0,0));
 183+ TRACE_RET(HRESULT,23,device->Clear(dwCount,lpRects,dwFlags,d3dcvtod3dcolor(bgcolor),0.0,0));
184184 }
185185
186186 HRESULT WINAPI glDirect3DViewport3::Clear2(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags, DWORD dwColor, D3DVALUE dvZ, DWORD dwStencil)
187187 {
188188 TRACE_ENTER(7,14,this,8,dwCount,14,lpRects,9,dwFlags,9,dwColor,19,&dvZ,9,dwStencil);
189 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
190 - if(!device) TRACE_EXIT(23,D3DERR_VIEWPORTHASNODEVICE);
191 - TRACE_RET(23,device->Clear(dwCount,lpRects,dwFlags,dwColor,dvZ,dwStencil));
 189+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 190+ if(!device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
 191+ TRACE_RET(HRESULT,23,device->Clear(dwCount,lpRects,dwFlags,dwColor,dvZ,dwStencil));
192192 }
193193
194194 HRESULT WINAPI glDirect3DViewport3::DeleteLight(LPDIRECT3DLIGHT lpDirect3DLight)
195195 {
196196 TRACE_ENTER(2,14,this,14,lpDirect3DLight);
197 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
198 - if(!lpDirect3DLight) TRACE_RET(23,DDERR_INVALIDPARAMS);
 197+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 198+ if(!lpDirect3DLight) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
199199 for(int i = 0; i < 8; i++)
200200 {
201201 if(lights[i] == lpDirect3DLight)
@@ -213,8 +213,8 @@
214214 HRESULT WINAPI glDirect3DViewport3::GetBackground(LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid)
215215 {
216216 TRACE_ENTER(3,14,this,14,lphMat,14,lpValid);
217 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
218 - if(!lphMat) TRACE_RET(23,DDERR_INVALIDPARAMS);
 217+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 218+ if(!lphMat) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
219219 if(lpValid)
220220 {
221221 if(background) *lpValid = TRUE;
@@ -230,8 +230,8 @@
231231 HRESULT WINAPI glDirect3DViewport3::GetBackgroundDepth(LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid)
232232 {
233233 TRACE_ENTER(3,14,this,14,lplpDDSurface,14,lpValid);
234 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
235 - if(!lplpDDSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
 234+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 235+ if(!lplpDDSurface) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
236236 if(lpValid)
237237 {
238238 if(backZ) *lpValid = TRUE;
@@ -247,8 +247,8 @@
248248 HRESULT WINAPI glDirect3DViewport3::GetBackgroundDepth2(LPDIRECTDRAWSURFACE4* lplpDDS, LPBOOL lpValid)
249249 {
250250 TRACE_ENTER(3,14,this,14,lplpDDS,14,lpValid);
251 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
252 - if(!lplpDDS) TRACE_RET(23,DDERR_INVALIDPARAMS);
 251+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 252+ if(!lplpDDS) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
253253 if(lpValid)
254254 {
255255 if(backZ) *lpValid = TRUE;
@@ -264,8 +264,8 @@
265265 HRESULT WINAPI glDirect3DViewport3::GetViewport(LPD3DVIEWPORT lpData)
266266 {
267267 TRACE_ENTER(2,14,this,14,lpData);
268 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
269 - if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
 268+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 269+ if(!lpData) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
270270 memcpy(lpData,&viewport,sizeof(D3DVIEWPORT2));
271271 lpData->dvScaleX = scaleX;
272272 lpData->dvScaleY = scaleY;
@@ -277,8 +277,8 @@
278278 HRESULT WINAPI glDirect3DViewport3::GetViewport2(LPD3DVIEWPORT2 lpData)
279279 {
280280 TRACE_ENTER(2,14,this,14,lpData);
281 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
282 - if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
 281+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 282+ if(!lpData) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
283283 memcpy(lpData,&viewport,sizeof(D3DVIEWPORT2));
284284 TRACE_EXIT(23,D3D_OK);
285285 return D3D_OK;
@@ -286,7 +286,7 @@
287287 HRESULT WINAPI glDirect3DViewport3::Initialize(LPDIRECT3D lpDirect3D)
288288 {
289289 TRACE_ENTER(2,14,this,14,lpDirect3D);
290 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 290+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
291291 TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
292292 return DDERR_ALREADYINITIALIZED;
293293 }
@@ -293,7 +293,7 @@
294294 HRESULT WINAPI glDirect3DViewport3::LightElements(DWORD dwElementCount, LPD3DLIGHTDATA lpData)
295295 {
296296 TRACE_ENTER(3,14,this,8,dwElementCount,14,lpData);
297 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 297+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
298298 TRACE_EXIT(23,DDERR_UNSUPPORTED);
299299 return DDERR_UNSUPPORTED;
300300 }
@@ -300,8 +300,8 @@
301301 HRESULT WINAPI glDirect3DViewport3::NextLight(LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags)
302302 {
303303 TRACE_ENTER(4,14,this,14,lpDirect3DLight,14,lplpDirect3DLight,9,dwFlags);
304 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
305 - if(!lplpDirect3DLight) TRACE_RET(23,DDERR_INVALIDPARAMS);
 304+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 305+ if(!lplpDirect3DLight) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
306306 FIXME("glDirect3DViewport3::NextLight: stub");
307307 TRACE_EXIT(23,DDERR_GENERIC);
308308 return DDERR_GENERIC;
@@ -309,9 +309,9 @@
310310 HRESULT WINAPI glDirect3DViewport3::SetBackground(D3DMATERIALHANDLE hMat)
311311 {
312312 TRACE_ENTER(2,14,this,9,hMat);
313 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
314 - if(!device) TRACE_RET(23,D3DERR_VIEWPORTHASNODEVICE);
315 - if(hMat > device->materialcount) TRACE_RET(23,DDERR_INVALIDPARAMS);
 313+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 314+ if(!device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
 315+ if(hMat > device->materialcount) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
316316 background = hMat;
317317 TRACE_EXIT(23,D3D_OK);
318318 return D3D_OK;
@@ -319,9 +319,9 @@
320320 HRESULT WINAPI glDirect3DViewport3::SetBackgroundDepth(LPDIRECTDRAWSURFACE lpDDSurface)
321321 {
322322 TRACE_ENTER(2,14,this,14,lpDDSurface);
323 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
324 - if(!backZ && !lpDDSurface) TRACE_RET(23,D3D_OK);
325 - if(((glDirectDrawSurface1*)lpDDSurface)->GetDDS7() == backZ) TRACE_RET(23,D3D_OK);
 323+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 324+ if(!backZ && !lpDDSurface) TRACE_RET(HRESULT,23,D3D_OK);
 325+ if(((glDirectDrawSurface1*)lpDDSurface)->GetDDS7() == backZ) TRACE_RET(HRESULT,23,D3D_OK);
326326 if(backZ)backZ->Release();
327327 if(lpDDSurface) lpDDSurface->QueryInterface(IID_IDirectDrawSurface7,(void**)&backZ);
328328 else backZ = NULL;
@@ -331,9 +331,9 @@
332332 HRESULT WINAPI glDirect3DViewport3::SetBackgroundDepth2(LPDIRECTDRAWSURFACE4 lpDDS)
333333 {
334334 TRACE_ENTER(2,14,this,14,lpDDS);
335 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
336 - if(!backZ && !lpDDS) TRACE_RET(23,D3D_OK);
337 - if(((glDirectDrawSurface4*)lpDDS)->GetDDS7() == backZ) TRACE_RET(23,D3D_OK);
 335+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 336+ if(!backZ && !lpDDS) TRACE_RET(HRESULT,23,D3D_OK);
 337+ if(((glDirectDrawSurface4*)lpDDS)->GetDDS7() == backZ) TRACE_RET(HRESULT,23,D3D_OK);
338338 if(backZ)backZ->Release();
339339 if(lpDDS) lpDDS->QueryInterface(IID_IDirectDrawSurface7,(void**)&backZ);
340340 else backZ = NULL;
@@ -344,9 +344,9 @@
345345 HRESULT WINAPI glDirect3DViewport3::SetViewport(LPD3DVIEWPORT lpData)
346346 {
347347 TRACE_ENTER(2,14,this,14,lpData);
348 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
349 - if(!device) TRACE_RET(23,D3DERR_VIEWPORTHASNODEVICE);
350 - if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
 348+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 349+ if(!device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
 350+ if(!lpData) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
351351 D3DVIEWPORT2 vp;
352352 memcpy(&vp,lpData,sizeof(D3DVIEWPORT));
353353 vp.dvClipHeight = viewport.dvClipHeight;
@@ -366,9 +366,9 @@
367367 HRESULT WINAPI glDirect3DViewport3::SetViewport2(LPD3DVIEWPORT2 lpData)
368368 {
369369 TRACE_ENTER(2,14,this,14,lpData);
370 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
371 - if(!device) TRACE_RET(23,D3DERR_VIEWPORTHASNODEVICE);
372 - if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
 370+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 371+ if(!device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
 372+ if(!lpData) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
373373 viewport = *lpData;
374374 if(current && device) Sync();
375375 TRACE_EXIT(23,D3D_OK);
@@ -377,7 +377,7 @@
378378 HRESULT WINAPI glDirect3DViewport3::TransformVertices(DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen)
379379 {
380380 TRACE_ENTER(5,14,this,8,dwVertexCount,14,lpData,9,dwFlags,14,lpOffscreen);
381 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 381+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
382382 FIXME("glDirect3DViewport3::TransformVertices: stub");
383383 TRACE_EXIT(23,DDERR_GENERIC);
384384 return DDERR_GENERIC;
@@ -453,7 +453,7 @@
454454 ULONG WINAPI glDirect3DViewport2::AddRef()
455455 {
456456 TRACE_ENTER(1,14,this);
457 - if(!this) TRACE_RET(8,0);
 457+ if(!this) TRACE_RET(ULONG,8,0);
458458 refcount++;
459459 TRACE_EXIT(8,refcount);
460460 return refcount;
@@ -462,7 +462,7 @@
463463 ULONG WINAPI glDirect3DViewport2::Release()
464464 {
465465 TRACE_ENTER(1,14,this);
466 - if(!this) TRACE_RET(8,0);
 466+ if(!this) TRACE_RET(ULONG,8,0);
467467 ULONG ret;
468468 refcount--;
469469 ret = refcount;
@@ -474,7 +474,7 @@
475475 HRESULT WINAPI glDirect3DViewport2::QueryInterface(REFIID riid, void** ppvObj)
476476 {
477477 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
478 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 478+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
479479 if(riid == IID_IUnknown)
480480 {
481481 this->AddRef();
@@ -483,98 +483,98 @@
484484 TRACE_EXIT(23,D3D_OK);
485485 return D3D_OK;
486486 }
487 - TRACE_RET(23,glD3DV3->QueryInterface(riid,ppvObj));
 487+ TRACE_RET(HRESULT,23,glD3DV3->QueryInterface(riid,ppvObj));
488488 }
489489
490490 HRESULT WINAPI glDirect3DViewport2::AddLight(LPDIRECT3DLIGHT lpLight)
491491 {
492492 TRACE_ENTER(2,14,this,14,lpLight);
493 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
494 - TRACE_RET(23,glD3DV3->AddLight(lpLight));
 493+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 494+ TRACE_RET(HRESULT,23,glD3DV3->AddLight(lpLight));
495495 }
496496 HRESULT WINAPI glDirect3DViewport2::Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags)
497497 {
498498 TRACE_ENTER(4,14,this,9,dwCount,14,lpRects,9,dwFlags);
499 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
500 - TRACE_RET(23,glD3DV3->Clear(dwCount,lpRects,dwFlags));
 499+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 500+ TRACE_RET(HRESULT,23,glD3DV3->Clear(dwCount,lpRects,dwFlags));
501501 }
502502 HRESULT WINAPI glDirect3DViewport2::DeleteLight(LPDIRECT3DLIGHT lpDirect3DLight)
503503 {
504504 TRACE_ENTER(2,14,this,14,lpDirect3DLight);
505 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
506 - TRACE_RET(23,glD3DV3->DeleteLight(lpDirect3DLight));
 505+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 506+ TRACE_RET(HRESULT,23,glD3DV3->DeleteLight(lpDirect3DLight));
507507 }
508508 HRESULT WINAPI glDirect3DViewport2::GetBackground(LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid)
509509 {
510510 TRACE_ENTER(3,14,this,14,lphMat,14,lpValid);
511 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
512 - TRACE_RET(23,glD3DV3->GetBackground(lphMat,lpValid));
 511+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 512+ TRACE_RET(HRESULT,23,glD3DV3->GetBackground(lphMat,lpValid));
513513 }
514514 HRESULT WINAPI glDirect3DViewport2::GetBackgroundDepth(LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid)
515515 {
516516 TRACE_ENTER(3,14,this,14,lplpDDSurface,14,lpValid);
517 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
518 - TRACE_RET(23,glD3DV3->GetBackgroundDepth(lplpDDSurface,lpValid));
 517+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 518+ TRACE_RET(HRESULT,23,glD3DV3->GetBackgroundDepth(lplpDDSurface,lpValid));
519519 }
520520 HRESULT WINAPI glDirect3DViewport2::GetViewport(LPD3DVIEWPORT lpData)
521521 {
522522 TRACE_ENTER(2,14,this,14,lpData);
523 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
524 - TRACE_RET(23,glD3DV3->GetViewport(lpData));
 523+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 524+ TRACE_RET(HRESULT,23,glD3DV3->GetViewport(lpData));
525525 }
526526 HRESULT WINAPI glDirect3DViewport2::GetViewport2(LPD3DVIEWPORT2 lpData)
527527 {
528528 TRACE_ENTER(2,14,this,14,lpData);
529 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
530 - TRACE_RET(23,glD3DV3->GetViewport2(lpData));
 529+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 530+ TRACE_RET(HRESULT,23,glD3DV3->GetViewport2(lpData));
531531 }
532532 HRESULT WINAPI glDirect3DViewport2::Initialize(LPDIRECT3D lpDirect3D)
533533 {
534534 TRACE_ENTER(2,14,this,14,lpDirect3D);
535 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
536 - TRACE_RET(23,glD3DV3->Initialize(lpDirect3D));
 535+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 536+ TRACE_RET(HRESULT,23,glD3DV3->Initialize(lpDirect3D));
537537 }
538538 HRESULT WINAPI glDirect3DViewport2::LightElements(DWORD dwElementCount, LPD3DLIGHTDATA lpData)
539539 {
540540 TRACE_ENTER(3,14,this,8,dwElementCount,14,lpData);
541 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
542 - TRACE_RET(23,glD3DV3->LightElements(dwElementCount,lpData));
 541+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 542+ TRACE_RET(HRESULT,23,glD3DV3->LightElements(dwElementCount,lpData));
543543 }
544544 HRESULT WINAPI glDirect3DViewport2::NextLight(LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags)
545545 {
546546 TRACE_ENTER(4,14,this,14,lpDirect3DLight,14,lplpDirect3DLight,9,dwFlags);
547 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
548 - TRACE_RET(23,glD3DV3->NextLight(lpDirect3DLight,lplpDirect3DLight,dwFlags));
 547+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 548+ TRACE_RET(HRESULT,23,glD3DV3->NextLight(lpDirect3DLight,lplpDirect3DLight,dwFlags));
549549 }
550550 HRESULT WINAPI glDirect3DViewport2::SetBackground(D3DMATERIALHANDLE hMat)
551551 {
552552 TRACE_ENTER(2,14,this,9,hMat);
553 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
554 - TRACE_RET(23,glD3DV3->SetBackground(hMat));
 553+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 554+ TRACE_RET(HRESULT,23,glD3DV3->SetBackground(hMat));
555555 }
556556 HRESULT WINAPI glDirect3DViewport2::SetBackgroundDepth(LPDIRECTDRAWSURFACE lpDDSurface)
557557 {
558558 TRACE_ENTER(2,14,this,14,lpDDSurface);
559 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
560 - TRACE_RET(23,glD3DV3->SetBackgroundDepth(lpDDSurface));
 559+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 560+ TRACE_RET(HRESULT,23,glD3DV3->SetBackgroundDepth(lpDDSurface));
561561 }
562562 HRESULT WINAPI glDirect3DViewport2::SetViewport(LPD3DVIEWPORT lpData)
563563 {
564564 TRACE_ENTER(2,14,this,14,lpData);
565 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
566 - TRACE_RET(23,glD3DV3->SetViewport(lpData));
 565+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 566+ TRACE_RET(HRESULT,23,glD3DV3->SetViewport(lpData));
567567 }
568568 HRESULT WINAPI glDirect3DViewport2::SetViewport2(LPD3DVIEWPORT2 lpData)
569569 {
570570 TRACE_ENTER(2,14,this,14,lpData);
571 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
572 - TRACE_RET(23,glD3DV3->SetViewport2(lpData));
 571+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 572+ TRACE_RET(HRESULT,23,glD3DV3->SetViewport2(lpData));
573573 }
574574 HRESULT WINAPI glDirect3DViewport2::TransformVertices(DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen)
575575 {
576576 TRACE_ENTER(5,14,this,8,dwVertexCount,14,lpData,9,dwFlags,14,lpOffscreen);
577 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
578 - TRACE_RET(23,glD3DV3->TransformVertices(dwVertexCount,lpData,dwFlags,lpOffscreen));
 577+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 578+ TRACE_RET(HRESULT,23,glD3DV3->TransformVertices(dwVertexCount,lpData,dwFlags,lpOffscreen));
579579 }
580580
581581
@@ -597,7 +597,7 @@
598598 ULONG WINAPI glDirect3DViewport1::AddRef()
599599 {
600600 TRACE_ENTER(1,14,this);
601 - if(!this) TRACE_RET(8,0);
 601+ if(!this) TRACE_RET(ULONG,8,0);
602602 refcount++;
603603 TRACE_EXIT(8,refcount);
604604 return refcount;
@@ -606,7 +606,7 @@
607607 ULONG WINAPI glDirect3DViewport1::Release()
608608 {
609609 TRACE_ENTER(1,14,this);
610 - if(!this) TRACE_RET(8,0);
 610+ if(!this) TRACE_RET(ULONG,8,0);
611611 ULONG ret;
612612 refcount--;
613613 ret = refcount;
@@ -627,84 +627,84 @@
628628 TRACE_EXIT(23,D3D_OK);
629629 return D3D_OK;
630630 }
631 - TRACE_RET(23,glD3DV3->QueryInterface(riid,ppvObj));
 631+ TRACE_RET(HRESULT,23,glD3DV3->QueryInterface(riid,ppvObj));
632632 }
633633
634634 HRESULT WINAPI glDirect3DViewport1::AddLight(LPDIRECT3DLIGHT lpLight)
635635 {
636636 TRACE_ENTER(2,14,this,14,lpLight);
637 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
638 - TRACE_RET(23,glD3DV3->AddLight(lpLight));
 637+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 638+ TRACE_RET(HRESULT,23,glD3DV3->AddLight(lpLight));
639639 }
640640 HRESULT WINAPI glDirect3DViewport1::Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags)
641641 {
642642 TRACE_ENTER(4,14,this,8,dwCount,14,lpRects,9,dwFlags);
643 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
644 - TRACE_RET(23,glD3DV3->Clear(dwCount,lpRects,dwFlags));
 643+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 644+ TRACE_RET(HRESULT,23,glD3DV3->Clear(dwCount,lpRects,dwFlags));
645645 }
646646 HRESULT WINAPI glDirect3DViewport1::DeleteLight(LPDIRECT3DLIGHT lpDirect3DLight)
647647 {
648648 TRACE_ENTER(2,14,this,14,lpDirect3DLight);
649 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
650 - TRACE_RET(23,glD3DV3->DeleteLight(lpDirect3DLight));
 649+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 650+ TRACE_RET(HRESULT,23,glD3DV3->DeleteLight(lpDirect3DLight));
651651 }
652652 HRESULT WINAPI glDirect3DViewport1::GetBackground(LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid)
653653 {
654654 TRACE_ENTER(3,14,this,14,lphMat,14,lpValid);
655 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
656 - TRACE_RET(23,glD3DV3->GetBackground(lphMat,lpValid));
 655+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 656+ TRACE_RET(HRESULT,23,glD3DV3->GetBackground(lphMat,lpValid));
657657 }
658658 HRESULT WINAPI glDirect3DViewport1::GetBackgroundDepth(LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid)
659659 {
660660 TRACE_ENTER(3,14,this,14,lplpDDSurface,14,lpValid);
661 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
662 - TRACE_RET(23,glD3DV3->GetBackgroundDepth(lplpDDSurface,lpValid));
 661+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 662+ TRACE_RET(HRESULT,23,glD3DV3->GetBackgroundDepth(lplpDDSurface,lpValid));
663663 }
664664 HRESULT WINAPI glDirect3DViewport1::GetViewport(LPD3DVIEWPORT lpData)
665665 {
666666 TRACE_ENTER(2,14,this,14,lpData);
667 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
668 - TRACE_RET(23,glD3DV3->GetViewport(lpData));
 667+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 668+ TRACE_RET(HRESULT,23,glD3DV3->GetViewport(lpData));
669669 }
670670 HRESULT WINAPI glDirect3DViewport1::Initialize(LPDIRECT3D lpDirect3D)
671671 {
672672 TRACE_ENTER(2,14,this,14,lpDirect3D);
673 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
674 - TRACE_RET(23,glD3DV3->Initialize(lpDirect3D));
 673+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 674+ TRACE_RET(HRESULT,23,glD3DV3->Initialize(lpDirect3D));
675675 }
676676 HRESULT WINAPI glDirect3DViewport1::LightElements(DWORD dwElementCount, LPD3DLIGHTDATA lpData)
677677 {
678678 TRACE_ENTER(3,14,this,8,dwElementCount,14,lpData);
679 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 679+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
680680 return glD3DV3->LightElements(dwElementCount,lpData);
681681 }
682682 HRESULT WINAPI glDirect3DViewport1::NextLight(LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags)
683683 {
684684 TRACE_ENTER(4,14,this,14,lpDirect3DLight,14,lplpDirect3DLight,9,dwFlags);
685 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
686 - TRACE_RET(23,glD3DV3->NextLight(lpDirect3DLight,lplpDirect3DLight,dwFlags));
 685+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 686+ TRACE_RET(HRESULT,23,glD3DV3->NextLight(lpDirect3DLight,lplpDirect3DLight,dwFlags));
687687 }
688688 HRESULT WINAPI glDirect3DViewport1::SetBackground(D3DMATERIALHANDLE hMat)
689689 {
690690 TRACE_ENTER(2,14,this,9,hMat);
691 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
692 - TRACE_RET(23,glD3DV3->SetBackground(hMat));
 691+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 692+ TRACE_RET(HRESULT,23,glD3DV3->SetBackground(hMat));
693693 }
694694 HRESULT WINAPI glDirect3DViewport1::SetBackgroundDepth(LPDIRECTDRAWSURFACE lpDDSurface)
695695 {
696696 TRACE_ENTER(2,14,this,14,lpDDSurface);
697 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
698 - TRACE_RET(23,glD3DV3->SetBackgroundDepth(lpDDSurface));
 697+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 698+ TRACE_RET(HRESULT,23,glD3DV3->SetBackgroundDepth(lpDDSurface));
699699 }
700700 HRESULT WINAPI glDirect3DViewport1::SetViewport(LPD3DVIEWPORT lpData)
701701 {
702702 TRACE_ENTER(2,14,this,14,lpData);
703 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
704 - TRACE_RET(23,glD3DV3->SetViewport(lpData));
 703+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 704+ TRACE_RET(HRESULT,23,glD3DV3->SetViewport(lpData));
705705 }
706706 HRESULT WINAPI glDirect3DViewport1::TransformVertices(DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen)
707707 {
708708 TRACE_ENTER(5,14,this,8,dwVertexCount,14,lpData,9,dwFlags,14,lpOffscreen);
709 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
710 - TRACE_RET(23,glD3DV3->TransformVertices(dwVertexCount,lpData,dwFlags,lpOffscreen));
 709+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 710+ TRACE_RET(HRESULT,23,glD3DV3->TransformVertices(dwVertexCount,lpData,dwFlags,lpOffscreen));
711711 }
Index: ddraw/glDirectDraw.cpp
@@ -613,8 +613,8 @@
614614 HRESULT WINAPI glDirectDraw7::QueryInterface(REFIID riid, void** ppvObj)
615615 {
616616 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
617 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
618 - if(!ppvObj) TRACE_RET(23,DDERR_INVALIDPARAMS);
 617+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 618+ if(!ppvObj) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
619619 if(riid == IID_IUnknown)
620620 {
621621 this->AddRef();
@@ -745,7 +745,7 @@
746746 ULONG WINAPI glDirectDraw7::AddRef()
747747 {
748748 TRACE_ENTER(1,14,this);
749 - if(!this) TRACE_RET(8,0);
 749+ if(!this) TRACE_RET(ULONG,8,0);
750750 refcount++;
751751 TRACE_EXIT(8,refcount);
752752 return refcount;
@@ -753,7 +753,7 @@
754754 ULONG WINAPI glDirectDraw7::Release()
755755 {
756756 TRACE_ENTER(1,14,this);
757 - if(!this) TRACE_RET(8,0);
 757+ if(!this) TRACE_RET(ULONG,8,0);
758758 ULONG ret;
759759 refcount--;
760760 ret = refcount;
@@ -765,7 +765,7 @@
766766 HRESULT WINAPI glDirectDraw7::Compact()
767767 {
768768 TRACE_ENTER(1,14,this);
769 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 769+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
770770 TRACE_EXIT(23,DD_OK);
771771 return DD_OK;
772772 }
@@ -772,15 +772,15 @@
773773 HRESULT WINAPI glDirectDraw7::CreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter)
774774 {
775775 TRACE_ENTER(4,14,this,9,dwFlags,14,lplpDDClipper,14,pUnkOuter);
776 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
777 - if(!lplpDDClipper) TRACE_RET(23,DDERR_INVALIDPARAMS);
778 - if(pUnkOuter) TRACE_RET(23,DDERR_INVALIDPARAMS);
 776+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 777+ if(!lplpDDClipper) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 778+ if(pUnkOuter) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
779779 clippercount++;
780780 if(clippercount > clippercountmax)
781781 {
782782 glDirectDrawClipper **clippers2;
783783 clippers2 = (glDirectDrawClipper **)realloc(clippers,(clippercountmax+1024)*sizeof(glDirectDrawClipper *));
784 - if(!clippers2) TRACE_RET(23,DDERR_OUTOFMEMORY);
 784+ if(!clippers2) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
785785 clippers = clippers2;
786786 ZeroMemory(&clippers[clippercountmax],1024*sizeof(glDirectDrawClipper *));
787787 clippercountmax += 1024;
@@ -794,9 +794,9 @@
795795 HRESULT WINAPI glDirectDraw7::CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR *lplpDDPalette, IUnknown FAR *pUnkOuter)
796796 {
797797 TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDColorArray,14,lplpDDPalette,14,pUnkOuter);
798 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
799 - if(!lplpDDPalette) TRACE_RET(23,DDERR_INVALIDPARAMS);
800 - if(pUnkOuter) TRACE_RET(23,DDERR_INVALIDPARAMS);
 798+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 799+ if(!lplpDDPalette) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 800+ if(pUnkOuter) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
801801 glDirectDrawPalette *pal = new glDirectDrawPalette(dwFlags,lpDDColorArray,lplpDDPalette);
802802 TRACE_VAR("*lplpDDPalette",14,*lplpDDPalette);
803803 TRACE_EXIT(23,DD_OK);
@@ -805,9 +805,9 @@
806806 HRESULT WINAPI glDirectDraw7::CreateSurface(LPDDSURFACEDESC2 lpDDSurfaceDesc2, LPDIRECTDRAWSURFACE7 FAR *lplpDDSurface, IUnknown FAR *pUnkOuter)
807807 {
808808 TRACE_ENTER(4,14,this,14,lpDDSurfaceDesc2,14,lplpDDSurface,14,pUnkOuter);
809 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
810 - if(!lpDDSurfaceDesc2) TRACE_RET(23,DDERR_INVALIDPARAMS);
811 - if(pUnkOuter) TRACE_RET(23,DDERR_INVALIDPARAMS);
 809+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 810+ if(!lpDDSurfaceDesc2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 811+ if(pUnkOuter) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
812812 if(primary && (lpDDSurfaceDesc2->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) && (renderer->hRC == primary->hRC) )
813813 {
814814 if(primarylost)
@@ -818,7 +818,7 @@
819819 TRACE_EXIT(23,DD_OK);
820820 return DD_OK;
821821 }
822 - else TRACE_RET(23,DDERR_PRIMARYSURFACEALREADYEXISTS);
 822+ else TRACE_RET(HRESULT,23,DDERR_PRIMARYSURFACEALREADYEXISTS);
823823 }
824824 surfacecount++;
825825 if(surfacecount > surfacecountmax)
@@ -825,7 +825,7 @@
826826 {
827827 glDirectDrawSurface7 **surfaces2;
828828 surfaces2 = (glDirectDrawSurface7 **)realloc(surfaces,(surfacecountmax+1024)*sizeof(glDirectDrawSurface7 *));
829 - if(!surfaces2) TRACE_RET(23,DDERR_OUTOFMEMORY);
 829+ if(!surfaces2) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
830830 surfaces = surfaces2;
831831 ZeroMemory(&surfaces[surfacecountmax],1024*sizeof(glDirectDrawSurface7 *));
832832 surfacecountmax += 1024;
@@ -845,9 +845,9 @@
846846 HRESULT WINAPI glDirectDraw7::DuplicateSurface(LPDIRECTDRAWSURFACE7 lpDDSurface, LPDIRECTDRAWSURFACE7 FAR *lplpDupDDSurface)
847847 {
848848 TRACE_ENTER(3,14,this,14,lpDDSurface,14,lplpDupDDSurface);
849 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
850 - if(!lpDDSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
851 - if(!lplpDupDDSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
 849+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 850+ if(!lpDDSurface) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 851+ if(!lplpDupDDSurface) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
852852 FIXME("IDirectDraw::DuplicateSurface: stub\n");
853853 TRACE_EXIT(23,DDERR_GENERIC);
854854 ERR(DDERR_GENERIC);
@@ -855,9 +855,9 @@
856856 HRESULT WINAPI glDirectDraw7::EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC2 lpDDSurfaceDesc2, LPVOID lpContext, LPDDENUMMODESCALLBACK2 lpEnumModesCallback)
857857 {
858858 TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSurfaceDesc2,14,lpContext,14,lpEnumModesCallback);
859 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
860 - if(!lpDDSurfaceDesc2) TRACE_RET(23,DDERR_INVALIDPARAMS);
861 - if(!lpEnumModesCallback) TRACE_RET(23,DDERR_INVALIDPARAMS);
 859+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 860+ if(!lpDDSurfaceDesc2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 861+ if(!lpEnumModesCallback) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
862862 HRESULT ret = ::EnumDisplayModes(dwFlags,lpDDSurfaceDesc2,lpContext,lpEnumModesCallback);
863863 TRACE_EXIT(23,ret);
864864 return ret;
@@ -865,9 +865,9 @@
866866 HRESULT WINAPI glDirectDraw7::EnumSurfaces(DWORD dwFlags, LPDDSURFACEDESC2 lpDDSD2, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback)
867867 {
868868 TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSD2,14,lpContext,14,lpEnumSurfacesCallback);
869 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
870 - if(!lpDDSD2) TRACE_RET(23,DDERR_INVALIDPARAMS);
871 - if(!lpEnumSurfacesCallback) TRACE_RET(23,DDERR_INVALIDPARAMS);
 869+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 870+ if(!lpDDSD2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 871+ if(!lpEnumSurfacesCallback) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
872872 FIXME("IDirectDraw::EnumSurfaces: stub\n");
873873 TRACE_EXIT(23,DDERR_GENERIC);
874874 ERR(DDERR_GENERIC);
@@ -875,7 +875,7 @@
876876 HRESULT WINAPI glDirectDraw7::FlipToGDISurface()
877877 {
878878 TRACE_ENTER(1,14,this);
879 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 879+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
880880 HRESULT error = DD_OK;
881881 if(primary)
882882 {
@@ -890,18 +890,18 @@
891891 TRACE_EXIT(23,error);
892892 return(error);
893893 }
894 - else TRACE_RET(23,DDERR_NOTFOUND);
 894+ else TRACE_RET(HRESULT,23,DDERR_NOTFOUND);
895895 }
896896 HRESULT WINAPI glDirectDraw7::GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps)
897897 {
898898 TRACE_ENTER(3,14,this,14,lpDDDriverCaps,14,lpDDHELCaps);
899 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 899+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
900900 //TODO: Fill in as implemented.
901901 DDCAPS_DX7 ddCaps;
902902 ZeroMemory(&ddCaps,sizeof(DDCAPS_DX7));
903903 if(lpDDDriverCaps) ddCaps.dwSize = lpDDDriverCaps->dwSize;
904904 else if(lpDDHELCaps) ddCaps.dwSize = lpDDHELCaps->dwSize;
905 - else TRACE_RET(23,DDERR_INVALIDPARAMS);
 905+ else TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
906906 if(ddCaps.dwSize > sizeof(DDCAPS_DX7)) ddCaps.dwSize = sizeof(DDCAPS_DX7);
907907 ddCaps.dwCaps = DDCAPS_BLT | DDCAPS_BLTCOLORFILL | DDCAPS_BLTSTRETCH |
908908 DDCAPS_COLORKEY | DDCAPS_GDI | DDCAPS_PALETTE | DDCAPS_CANBLTSYSMEM |
@@ -932,8 +932,8 @@
933933 HRESULT WINAPI glDirectDraw7::GetDisplayMode(LPDDSURFACEDESC2 lpDDSurfaceDesc2)
934934 {
935935 TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc2);
936 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
937 - if(!lpDDSurfaceDesc2) TRACE_RET(23,DDERR_INVALIDPARAMS);
 936+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 937+ if(!lpDDSurfaceDesc2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
938938 DDSURFACEDESC2 ddsdMode;
939939 ZeroMemory(&ddsdMode, sizeof(DDSURFACEDESC2));
940940 ddsdMode.dwSize = sizeof(DDSURFACEDESC2);
@@ -1017,7 +1017,7 @@
10181018 if(currmode.dmBitsPerPel == 15) ddsdMode.lPitch = currmode.dmPelsWidth * 2;
10191019 else if(currmode.dmBitsPerPel == 4) ddsdMode.lPitch = currmode.dmPelsWidth / 2;
10201020 else ddsdMode.lPitch = currmode.dmPelsWidth * (currmode.dmBitsPerPel / 8);
1021 - if(lpDDSurfaceDesc2->dwSize < sizeof(DDSURFACEDESC)) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1021+ if(lpDDSurfaceDesc2->dwSize < sizeof(DDSURFACEDESC)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
10221022 if(lpDDSurfaceDesc2->dwSize > sizeof(DDSURFACEDESC2))
10231023 lpDDSurfaceDesc2->dwSize = sizeof(DDSURFACEDESC2);
10241024 memcpy(lpDDSurfaceDesc2,&ddsdMode,lpDDSurfaceDesc2->dwSize);
@@ -1027,9 +1027,9 @@
10281028 HRESULT WINAPI glDirectDraw7::GetFourCCCodes(LPDWORD lpNumCodes, LPDWORD lpCodes)
10291029 {
10301030 TRACE_ENTER(3,14,this,14,lpNumCodes,14,lpCodes);
1031 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1032 - if(!lpNumCodes) TRACE_RET(23,DDERR_INVALIDPARAMS);
1033 - if(!lpCodes) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1031+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1032+ if(!lpNumCodes) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1033+ if(!lpCodes) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
10341034 FIXME("IDirectDraw::GetFourCCCodes: stub\n");
10351035 TRACE_EXIT(23,DDERR_GENERIC);
10361036 ERR(DDERR_GENERIC);
@@ -1037,8 +1037,8 @@
10381038 HRESULT WINAPI glDirectDraw7::GetGDISurface(LPDIRECTDRAWSURFACE7 FAR *lplpGDIDDSurface)
10391039 {
10401040 TRACE_ENTER(2,14,this,14,lplpGDIDDSurface);
1041 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1042 - if(!lplpGDIDDSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1041+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1042+ if(!lplpGDIDDSurface) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
10431043 FIXME("IDirectDraw::GetGDISurface: stub\n");
10441044 TRACE_EXIT(23,DDERR_GENERIC);
10451045 ERR(DDERR_GENERIC);
@@ -1046,8 +1046,8 @@
10471047 HRESULT WINAPI glDirectDraw7::GetMonitorFrequency(LPDWORD lpdwFrequency)
10481048 {
10491049 TRACE_ENTER(2,14,this,14,lpdwFrequency);
1050 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1051 - if(!lpdwFrequency) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1050+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1051+ if(!lpdwFrequency) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
10521052 DEBUG("IDirectDraw::GetMonitorFrequency: support multi-monitor\n");
10531053 DEVMODE devmode;
10541054 devmode.dmSize = sizeof(DEVMODE);
@@ -1060,8 +1060,8 @@
10611061 HRESULT WINAPI glDirectDraw7::GetScanLine(LPDWORD lpdwScanLine)
10621062 {
10631063 TRACE_ENTER(2,14,this,14,lpdwScanLine);
1064 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1065 - if(!lpdwScanLine) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1064+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1065+ if(!lpdwScanLine) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
10661066 FIXME("IDirectDraw::GetScanLine: stub\n");
10671067 TRACE_EXIT(23,DDERR_GENERIC);
10681068 ERR(DDERR_GENERIC);
@@ -1069,8 +1069,8 @@
10701070 HRESULT WINAPI glDirectDraw7::GetVerticalBlankStatus(LPBOOL lpbIsInVB)
10711071 {
10721072 TRACE_ENTER(2,14,this,14,lpbIsInVB);
1073 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1074 - if(!lpbIsInVB) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1073+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1074+ if(!lpbIsInVB) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
10751075 FIXME("IDirectDraw::GetVerticalBlankStatus: stub\n");
10761076 TRACE_EXIT(23,DDERR_GENERIC);
10771077 ERR(DDERR_GENERIC);
@@ -1078,8 +1078,8 @@
10791079 HRESULT WINAPI glDirectDraw7::Initialize(GUID FAR *lpGUID)
10801080 {
10811081 TRACE_ENTER(2,14,this,24,lpGUID);
1082 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1083 - if(initialized) TRACE_RET(23,DDERR_ALREADYINITIALIZED);
 1082+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1083+ if(initialized) TRACE_RET(HRESULT,23,DDERR_ALREADYINITIALIZED);
10841084 primarylost = true;
10851085 glD3D7 = NULL;
10861086 glDD1 = NULL;
@@ -1095,12 +1095,12 @@
10961096 timer = timeGetTime();
10971097 ZeroMemory(&oldmode,sizeof(DEVMODE));
10981098 surfaces = (glDirectDrawSurface7 **)malloc(1024*sizeof(glDirectDrawSurface7 *));
1099 - if(!surfaces) TRACE_RET(23,DDERR_OUTOFMEMORY);
 1099+ if(!surfaces) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
11001100 ZeroMemory(surfaces,1024*sizeof(glDirectDrawSurface7 *));
11011101 surfacecount = 0;
11021102 surfacecountmax = 1024;
11031103 clippers = (glDirectDrawClipper **)malloc(1024*sizeof(glDirectDrawClipper *));
1104 - if(!clippers) TRACE_RET(23,DDERR_OUTOFMEMORY);
 1104+ if(!clippers) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
11051105 ZeroMemory(clippers,1024*sizeof(glDirectDrawClipper *));
11061106 clippercount = 0;
11071107 clippercountmax = 1024;
@@ -1126,7 +1126,7 @@
11271127 HRESULT WINAPI glDirectDraw7::RestoreDisplayMode()
11281128 {
11291129 TRACE_ENTER(1,14,this);
1130 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1130+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
11311131 if(oldmode.dmSize != 0)
11321132 {
11331133 ChangeDisplaySettingsEx(NULL,&oldmode,NULL,0,NULL);
@@ -1137,7 +1137,7 @@
11381138 HRESULT WINAPI glDirectDraw7::SetCooperativeLevel(HWND hWnd, DWORD dwFlags)
11391139 {
11401140 TRACE_ENTER(3,14,this,13,hWnd,9,dwFlags);
1141 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1141+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
11421142 this->hWnd = hWnd;
11431143 winstyle = GetWindowLongPtrA(hWnd,GWL_STYLE);
11441144 winstyleex = GetWindowLongPtrA(hWnd,GWL_EXSTYLE);
@@ -1162,7 +1162,7 @@
11631163 fullscreen = true;
11641164 else fullscreen = false;
11651165 if(exclusive)
1166 - if(!fullscreen) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1166+ if(!fullscreen) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
11671167 if(dwFlags & DDSCL_FPUPRESERVE)
11681168 fpupreserve = true;
11691169 else fpupreserve = false;
@@ -1173,7 +1173,7 @@
11741174 threadsafe = true;
11751175 else threadsafe = false;
11761176 if(dwFlags & DDSCL_NORMAL)
1177 - if(exclusive) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1177+ if(exclusive) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
11781178 if(dwFlags & DDSCL_NOWINDOWCHANGES)
11791179 nowindowchanges = true;
11801180 else nowindowchanges = false;
@@ -1275,7 +1275,7 @@
12761276 HRESULT WINAPI glDirectDraw7::SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
12771277 {
12781278 TRACE_ENTER(6,14,this,8,dwWidth,8,dwHeight,8,dwBPP,8,dwRefreshRate,9,dwFlags);
1279 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1279+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
12801280 DEBUG("IDirectDraw::SetDisplayMode: implement multiple monitors\n");
12811281 DEVMODE newmode,newmode2;
12821282 DEVMODE currmode;
@@ -1320,23 +1320,23 @@
13211321 TRACE_EXIT(23,DD_OK);
13221322 return DD_OK;
13231323 case DISP_CHANGE_BADMODE:
1324 - TRACE_RET(23,DDERR_INVALIDMODE);
 1324+ TRACE_RET(HRESULT,23,DDERR_INVALIDMODE);
13251325 case DISP_CHANGE_BADFLAGS:
1326 - TRACE_RET(23,DDERR_INVALIDPARAMS);
 1326+ TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
13271327 case DISP_CHANGE_BADDUALVIEW:
1328 - TRACE_RET(23,DDERR_GENERIC);
 1328+ TRACE_RET(HRESULT,23,DDERR_GENERIC);
13291329 case DISP_CHANGE_BADPARAM:
1330 - TRACE_RET(23,DDERR_INVALIDPARAMS);
 1330+ TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
13311331 case DISP_CHANGE_FAILED:
1332 - TRACE_RET(23,DDERR_GENERIC);
 1332+ TRACE_RET(HRESULT,23,DDERR_GENERIC);
13331333 case DISP_CHANGE_NOTUPDATED:
1334 - TRACE_RET(23,DDERR_GENERIC);
 1334+ TRACE_RET(HRESULT,23,DDERR_GENERIC);
13351335 case DISP_CHANGE_RESTART:
1336 - TRACE_RET(23,DDERR_UNSUPPORTEDMODE);
 1336+ TRACE_RET(HRESULT,23,DDERR_UNSUPPORTEDMODE);
13371337 default:
1338 - TRACE_RET(23,DDERR_GENERIC);
 1338+ TRACE_RET(HRESULT,23,DDERR_GENERIC);
13391339 }
1340 - TRACE_RET(23,DDERR_GENERIC);
 1340+ TRACE_RET(HRESULT,23,DDERR_GENERIC);
13411341 break;
13421342 case 1: // Stretch to screen
13431343 primaryx = dwWidth;
@@ -1475,9 +1475,9 @@
14761476 HRESULT WINAPI glDirectDraw7::WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent)
14771477 {
14781478 TRACE_ENTER(3,14,this,9,dwFlags,14,hEvent);
1479 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1479+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
14801480 if(dwFlags & DDWAITVB_BLOCKBEGINEVENT)
1481 - TRACE_RET(23,DDERR_UNSUPPORTED);
 1481+ TRACE_RET(HRESULT,23,DDERR_UNSUPPORTED);
14821482 swapinterval=1;
14831483 primary->RenderScreen(primary->texture,primary);
14841484 swapinterval=0;
@@ -1487,7 +1487,7 @@
14881488 HRESULT WINAPI glDirectDraw7::GetAvailableVidMem(LPDDSCAPS2 lpDDSCaps2, LPDWORD lpdwTotal, LPDWORD lpdwFree)
14891489 {
14901490 TRACE_ENTER(4,14,this,14,lpDDSCaps2,14,lpdwTotal,14,lpdwFree);
1491 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1491+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
14921492 if(GLEXT_NVX_gpu_memory_info)
14931493 {
14941494 if(lpdwTotal) glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX,(GLint*)lpdwTotal);
@@ -1512,7 +1512,7 @@
15131513 HRESULT WINAPI glDirectDraw7::GetSurfaceFromDC(HDC hdc, LPDIRECTDRAWSURFACE7 *lpDDS)
15141514 {
15151515 TRACE_ENTER(3,14,this,13,hdc,14,lpDDS);
1516 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1516+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
15171517 FIXME("IDirectDraw::GetSurfaceFromDC: stub\n");
15181518 TRACE_EXIT(23,DDERR_GENERIC);
15191519 ERR(DDERR_GENERIC);
@@ -1520,7 +1520,7 @@
15211521 HRESULT WINAPI glDirectDraw7::RestoreAllSurfaces()
15221522 {
15231523 TRACE_ENTER(1,14,this);
1524 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1524+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
15251525 FIXME("IDirectDraw::RestoreAllSurfaces: stub\n");
15261526 TRACE_EXIT(23,DDERR_GENERIC);
15271527 ERR(DDERR_GENERIC);
@@ -1528,7 +1528,7 @@
15291529 HRESULT WINAPI glDirectDraw7::TestCooperativeLevel()
15301530 {
15311531 TRACE_ENTER(1,14,this);
1532 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1532+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
15331533 TRACE_EXIT(23,DD_OK);
15341534 return DD_OK;
15351535 }
@@ -1535,8 +1535,8 @@
15361536 HRESULT WINAPI glDirectDraw7::GetDeviceIdentifier(LPDDDEVICEIDENTIFIER2 lpdddi, DWORD dwFlags)
15371537 {
15381538 TRACE_ENTER(3,14,this,14,lpdddi,9,dwFlags);
1539 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1540 - if(!lpdddi) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1539+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1540+ if(!lpdddi) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
15411541 devid.guidDeviceIdentifier = device_template;
15421542 memcpy(lpdddi,&devid,sizeof(DDDEVICEIDENTIFIER2));
15431543 TRACE_EXIT(23,DD_OK);
@@ -1545,7 +1545,7 @@
15461546 HRESULT WINAPI glDirectDraw7::StartModeTest(LPSIZE lpModesToTest, DWORD dwNumEntries, DWORD dwFlags)
15471547 {
15481548 TRACE_ENTER(4,14,this,25,lpModesToTest,8,dwNumEntries,9,dwFlags);
1549 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1549+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
15501550 FIXME("IDirectDraw::StartModeTest: stub\n");
15511551 TRACE_EXIT(23,DDERR_GENERIC);
15521552 ERR(DDERR_GENERIC);
@@ -1553,7 +1553,7 @@
15541554 HRESULT WINAPI glDirectDraw7::EvaluateMode(DWORD dwFlags, DWORD *pSecondsUntilTimeout)
15551555 {
15561556 TRACE_ENTER(3,14,this,9,dwFlags,14,pSecondsUntilTimeout);
1557 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1557+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
15581558 FIXME("IDirectDraw::EvaluateMode: stub\n");
15591559 TRACE_EXIT(23,DDERR_GENERIC);
15601560 ERR(DDERR_GENERIC);
@@ -1604,7 +1604,7 @@
16051605 HRESULT WINAPI glDirectDraw1::QueryInterface(REFIID riid, void** ppvObj)
16061606 {
16071607 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
1608 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1608+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
16091609 if(riid == IID_IUnknown)
16101610 {
16111611 this->AddRef();
@@ -1620,7 +1620,7 @@
16211621 ULONG WINAPI glDirectDraw1::AddRef()
16221622 {
16231623 TRACE_ENTER(1,14,this);
1624 - if(!this) TRACE_RET(8,0);
 1624+ if(!this) TRACE_RET(ULONG,8,0);
16251625 refcount++;
16261626 TRACE_EXIT(8,refcount);
16271627 return refcount;
@@ -1628,7 +1628,7 @@
16291629 ULONG WINAPI glDirectDraw1::Release()
16301630 {
16311631 TRACE_ENTER(1,14,this);
1632 - if(!this) TRACE_RET(8,0);
 1632+ if(!this) TRACE_RET(ULONG,8,0);
16331633 ULONG ret;
16341634 refcount--;
16351635 ret = refcount;
@@ -1639,25 +1639,25 @@
16401640 HRESULT WINAPI glDirectDraw1::Compact()
16411641 {
16421642 TRACE_ENTER(1,14,this);
1643 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1644 - TRACE_RET(23,glDD7->Compact());
 1643+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1644+ TRACE_RET(HRESULT,23,glDD7->Compact());
16451645 }
16461646 HRESULT WINAPI glDirectDraw1::CreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter)
16471647 {
16481648 TRACE_ENTER(4,14,this,9,dwFlags,14,lplpDDClipper,14,pUnkOuter);
1649 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1650 - TRACE_RET(23,glDD7->CreateClipper(dwFlags,lplpDDClipper,pUnkOuter));
 1649+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1650+ TRACE_RET(HRESULT,23,glDD7->CreateClipper(dwFlags,lplpDDClipper,pUnkOuter));
16511651 }
16521652 HRESULT WINAPI glDirectDraw1::CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR *lplpDDPalette, IUnknown FAR *pUnkOuter)
16531653 {
16541654 TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDColorArray,14,lplpDDPalette,14,pUnkOuter);
1655 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1656 - TRACE_RET(23,glDD7->CreatePalette(dwFlags,lpDDColorArray,lplpDDPalette,pUnkOuter));
 1655+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1656+ TRACE_RET(HRESULT,23,glDD7->CreatePalette(dwFlags,lpDDColorArray,lplpDDPalette,pUnkOuter));
16571657 }
16581658 HRESULT WINAPI glDirectDraw1::CreateSurface(LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE FAR *lplpDDSurface, IUnknown FAR *pUnkOuter)
16591659 {
16601660 TRACE_ENTER(4,14,this,14,lpDDSurfaceDesc,14,lplpDDSurface,14,pUnkOuter);
1661 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1661+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
16621662 LPDIRECTDRAWSURFACE7 lpDDS7;
16631663 HRESULT err = glDD7->CreateSurface((LPDDSURFACEDESC2)lpDDSurfaceDesc,&lpDDS7,pUnkOuter);
16641664 if(err == DD_OK)
@@ -1674,7 +1674,7 @@
16751675 HRESULT WINAPI glDirectDraw1::DuplicateSurface(LPDIRECTDRAWSURFACE lpDDSurface, LPDIRECTDRAWSURFACE FAR *lplpDupDDSurface)
16761676 {
16771677 TRACE_ENTER(3,14,this,14,lpDDSurface,14,lplpDupDDSurface);
1678 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1678+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
16791679 FIXME("glDirectDraw1::DuplicateSurface: stub\n");
16801680 TRACE_EXIT(23,DDERR_GENERIC);
16811681 ERR(DDERR_GENERIC);
@@ -1682,13 +1682,13 @@
16831683 HRESULT WINAPI glDirectDraw1::EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback)
16841684 {
16851685 TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSurfaceDesc,14,lpContext,14,lpEnumModesCallback);
1686 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1687 - TRACE_RET(23,::EnumDisplayModes(dwFlags,lpDDSurfaceDesc,lpContext,lpEnumModesCallback));
 1686+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1687+ TRACE_RET(HRESULT,23,::EnumDisplayModes(dwFlags,lpDDSurfaceDesc,lpContext,lpEnumModesCallback));
16881688 }
16891689 HRESULT WINAPI glDirectDraw1::EnumSurfaces(DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
16901690 {
16911691 TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSD,14,lpContext,14,lpEnumSurfacesCallback);
1692 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1692+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
16931693 FIXME("glDirectDraw1::EnumSurfaces: stub\n");
16941694 TRACE_EXIT(23,DDERR_GENERIC);
16951695 ERR(DDERR_GENERIC);
@@ -1696,31 +1696,31 @@
16971697 HRESULT WINAPI glDirectDraw1::FlipToGDISurface()
16981698 {
16991699 TRACE_ENTER(1,14,this);
1700 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1701 - TRACE_RET(23,glDD7->FlipToGDISurface());
 1700+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1701+ TRACE_RET(HRESULT,23,glDD7->FlipToGDISurface());
17021702 }
17031703 HRESULT WINAPI glDirectDraw1::GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps)
17041704 {
17051705 TRACE_ENTER(3,14,this,14,lpDDDriverCaps,14,lpDDHELCaps);
1706 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1707 - TRACE_RET(23,glDD7->GetCaps(lpDDDriverCaps,lpDDHELCaps));
 1706+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1707+ TRACE_RET(HRESULT,23,glDD7->GetCaps(lpDDDriverCaps,lpDDHELCaps));
17081708 }
17091709 HRESULT WINAPI glDirectDraw1::GetDisplayMode(LPDDSURFACEDESC lpDDSurfaceDesc)
17101710 {
17111711 TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc);
1712 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1713 - TRACE_RET(23,glDD7->GetDisplayMode((LPDDSURFACEDESC2)lpDDSurfaceDesc));
 1712+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1713+ TRACE_RET(HRESULT,23,glDD7->GetDisplayMode((LPDDSURFACEDESC2)lpDDSurfaceDesc));
17141714 }
17151715 HRESULT WINAPI glDirectDraw1::GetFourCCCodes(LPDWORD lpNumCodes, LPDWORD lpCodes)
17161716 {
17171717 TRACE_ENTER(3,14,this,14,lpNumCodes,14,lpCodes);
1718 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1719 - TRACE_RET(23,glDD7->GetFourCCCodes(lpNumCodes,lpCodes));
 1718+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1719+ TRACE_RET(HRESULT,23,glDD7->GetFourCCCodes(lpNumCodes,lpCodes));
17201720 }
17211721 HRESULT WINAPI glDirectDraw1::GetGDISurface(LPDIRECTDRAWSURFACE FAR *lplpGDIDDSurface)
17221722 {
17231723 TRACE_ENTER(2,14,this,14,lplpGDIDDSurface);
1724 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1724+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
17251725 FIXME("glDirectDraw1::GetGDISurface: stub\n");
17261726 TRACE_EXIT(23,DDERR_GENERIC);
17271727 ERR(DDERR_GENERIC);
@@ -1728,50 +1728,50 @@
17291729 HRESULT WINAPI glDirectDraw1::GetMonitorFrequency(LPDWORD lpdwFrequency)
17301730 {
17311731 TRACE_ENTER(2,14,this,14,lpdwFrequency);
1732 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1733 - TRACE_RET(23,glDD7->GetMonitorFrequency(lpdwFrequency));
 1732+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1733+ TRACE_RET(HRESULT,23,glDD7->GetMonitorFrequency(lpdwFrequency));
17341734 }
17351735 HRESULT WINAPI glDirectDraw1::GetScanLine(LPDWORD lpdwScanLine)
17361736 {
17371737 TRACE_ENTER(2,14,this,14,lpdwScanLine);
1738 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1739 - TRACE_RET(23,glDD7->GetScanLine(lpdwScanLine));
 1738+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1739+ TRACE_RET(HRESULT,23,glDD7->GetScanLine(lpdwScanLine));
17401740 }
17411741 HRESULT WINAPI glDirectDraw1::GetVerticalBlankStatus(LPBOOL lpbIsInVB)
17421742 {
17431743 TRACE_ENTER(2,14,this,14,lpbIsInVB);
1744 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1745 - TRACE_RET(23,glDD7->GetVerticalBlankStatus(lpbIsInVB));
 1744+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1745+ TRACE_RET(HRESULT,23,glDD7->GetVerticalBlankStatus(lpbIsInVB));
17461746 }
17471747 HRESULT WINAPI glDirectDraw1::Initialize(GUID FAR *lpGUID)
17481748 {
17491749 TRACE_ENTER(2,14,this,24,lpGUID);
1750 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1751 - TRACE_RET(23,glDD7->Initialize(lpGUID));
 1750+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1751+ TRACE_RET(HRESULT,23,glDD7->Initialize(lpGUID));
17521752 }
17531753 HRESULT WINAPI glDirectDraw1::RestoreDisplayMode()
17541754 {
17551755 TRACE_ENTER(1,14,this);
1756 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1757 - TRACE_RET(23,glDD7->RestoreDisplayMode());
 1756+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1757+ TRACE_RET(HRESULT,23,glDD7->RestoreDisplayMode());
17581758 }
17591759 HRESULT WINAPI glDirectDraw1::SetCooperativeLevel(HWND hWnd, DWORD dwFlags)
17601760 {
17611761 TRACE_ENTER(3,14,this,13,hWnd,9,dwFlags);
1762 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1763 - TRACE_RET(23,glDD7->SetCooperativeLevel(hWnd,dwFlags));
 1762+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1763+ TRACE_RET(HRESULT,23,glDD7->SetCooperativeLevel(hWnd,dwFlags));
17641764 }
17651765 HRESULT WINAPI glDirectDraw1::SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP)
17661766 {
17671767 TRACE_ENTER(4,14,this,8,dwWidth,8,dwHeight,8,dwBPP);
1768 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1769 - TRACE_RET(23,glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,0,0));
 1768+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1769+ TRACE_RET(HRESULT,23,glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,0,0));
17701770 }
17711771 HRESULT WINAPI glDirectDraw1::WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent)
17721772 {
17731773 TRACE_ENTER(3,14,this,9,dwFlags,14,hEvent);
1774 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1775 - TRACE_RET(23,glDD7->WaitForVerticalBlank(dwFlags,hEvent));
 1774+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1775+ TRACE_RET(HRESULT,23,glDD7->WaitForVerticalBlank(dwFlags,hEvent));
17761776 }
17771777 // DDRAW2 wrapper
17781778 glDirectDraw2::glDirectDraw2(glDirectDraw7 *gl_DD7)
@@ -1791,7 +1791,7 @@
17921792 HRESULT WINAPI glDirectDraw2::QueryInterface(REFIID riid, void** ppvObj)
17931793 {
17941794 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
1795 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1795+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
17961796 if(riid == IID_IUnknown)
17971797 {
17981798 this->AddRef();
@@ -1800,12 +1800,12 @@
18011801 TRACE_EXIT(23,DD_OK);
18021802 return DD_OK;
18031803 }
1804 - TRACE_RET(23,glDD7->QueryInterface(riid,ppvObj));
 1804+ TRACE_RET(HRESULT,23,glDD7->QueryInterface(riid,ppvObj));
18051805 }
18061806 ULONG WINAPI glDirectDraw2::AddRef()
18071807 {
18081808 TRACE_ENTER(1,14,this);
1809 - if(!this) TRACE_RET(8,0);
 1809+ if(!this) TRACE_RET(ULONG,8,0);
18101810 refcount++;
18111811 TRACE_EXIT(8,refcount);
18121812 return refcount;
@@ -1813,7 +1813,7 @@
18141814 ULONG WINAPI glDirectDraw2::Release()
18151815 {
18161816 TRACE_ENTER(1,14,this);
1817 - if(!this) TRACE_RET(8,0);
 1817+ if(!this) TRACE_RET(ULONG,8,0);
18181818 ULONG ret;
18191819 refcount--;
18201820 ret = refcount;
@@ -1824,26 +1824,26 @@
18251825 HRESULT WINAPI glDirectDraw2::Compact()
18261826 {
18271827 TRACE_ENTER(1,14,this);
1828 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1829 - TRACE_RET(23,glDD7->Compact());
 1828+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1829+ TRACE_RET(HRESULT,23,glDD7->Compact());
18301830 }
18311831 HRESULT WINAPI glDirectDraw2::CreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter)
18321832 {
18331833 TRACE_ENTER(4,14,this,9,dwFlags,14,lplpDDClipper,14,pUnkOuter);
1834 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1835 - TRACE_RET(23,glDD7->CreateClipper(dwFlags,lplpDDClipper,pUnkOuter));
 1834+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1835+ TRACE_RET(HRESULT,23,glDD7->CreateClipper(dwFlags,lplpDDClipper,pUnkOuter));
18361836 }
18371837 HRESULT WINAPI glDirectDraw2::CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR *lplpDDPalette, IUnknown FAR *pUnkOuter)
18381838 {
18391839 TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDColorArray,14,lplpDDPalette,14,pUnkOuter);
1840 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1841 - TRACE_RET(23,glDD7->CreatePalette(dwFlags,lpDDColorArray,lplpDDPalette,pUnkOuter));
 1840+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1841+ TRACE_RET(HRESULT,23,glDD7->CreatePalette(dwFlags,lpDDColorArray,lplpDDPalette,pUnkOuter));
18421842 }
18431843 HRESULT WINAPI glDirectDraw2::CreateSurface(LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE FAR *lplpDDSurface, IUnknown FAR *pUnkOuter)
18441844 {
18451845 TRACE_ENTER(4,14,this,14,lpDDSurfaceDesc,14,lplpDDSurface,14,pUnkOuter);
1846 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1847 - if(!lplpDDSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1846+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1847+ if(!lplpDDSurface) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
18481848 LPDIRECTDRAWSURFACE7 lpDDS7;
18491849 HRESULT err = glDD7->CreateSurface((LPDDSURFACEDESC2)lpDDSurfaceDesc,&lpDDS7,pUnkOuter);
18501850 if(err == DD_OK)
@@ -1859,7 +1859,7 @@
18601860 HRESULT WINAPI glDirectDraw2::DuplicateSurface(LPDIRECTDRAWSURFACE lpDDSurface, LPDIRECTDRAWSURFACE FAR *lplpDupDDSurface)
18611861 {
18621862 TRACE_ENTER(3,14,this,14,lpDDSurface,14,lplpDupDDSurface);
1863 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1863+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
18641864 FIXME("glDirectDraw2::DuplicateSurface: stub\n");
18651865 TRACE_EXIT(23,DDERR_GENERIC);
18661866 ERR(DDERR_GENERIC);
@@ -1867,13 +1867,13 @@
18681868 HRESULT WINAPI glDirectDraw2::EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback)
18691869 {
18701870 TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSurfaceDesc,14,lpContext,14,lpEnumModesCallback);
1871 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1872 - TRACE_RET(23,::EnumDisplayModes(dwFlags,lpDDSurfaceDesc,lpContext,lpEnumModesCallback));
 1871+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1872+ TRACE_RET(HRESULT,23,::EnumDisplayModes(dwFlags,lpDDSurfaceDesc,lpContext,lpEnumModesCallback));
18731873 }
18741874 HRESULT WINAPI glDirectDraw2::EnumSurfaces(DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
18751875 {
18761876 TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSD,14,lpContext,14,lpEnumSurfacesCallback);
1877 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1877+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
18781878 FIXME("glDirectDraw2::EnumSurfaces: stub\n");
18791879 TRACE_EXIT(23,DDERR_GENERIC);
18801880 ERR(DDERR_GENERIC);
@@ -1881,31 +1881,31 @@
18821882 HRESULT WINAPI glDirectDraw2::FlipToGDISurface()
18831883 {
18841884 TRACE_ENTER(1,14,this);
1885 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1886 - TRACE_RET(23,glDD7->FlipToGDISurface());
 1885+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1886+ TRACE_RET(HRESULT,23,glDD7->FlipToGDISurface());
18871887 }
18881888 HRESULT WINAPI glDirectDraw2::GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps)
18891889 {
18901890 TRACE_ENTER(3,14,this,14,lpDDDriverCaps,14,lpDDHELCaps);
1891 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1892 - TRACE_RET(23,glDD7->GetCaps(lpDDDriverCaps,lpDDHELCaps));
 1891+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1892+ TRACE_RET(HRESULT,23,glDD7->GetCaps(lpDDDriverCaps,lpDDHELCaps));
18931893 }
18941894 HRESULT WINAPI glDirectDraw2::GetDisplayMode(LPDDSURFACEDESC lpDDSurfaceDesc)
18951895 {
18961896 TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc);
1897 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1898 - TRACE_RET(23,glDD7->GetDisplayMode((LPDDSURFACEDESC2)lpDDSurfaceDesc));
 1897+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1898+ TRACE_RET(HRESULT,23,glDD7->GetDisplayMode((LPDDSURFACEDESC2)lpDDSurfaceDesc));
18991899 }
19001900 HRESULT WINAPI glDirectDraw2::GetFourCCCodes(LPDWORD lpNumCodes, LPDWORD lpCodes)
19011901 {
19021902 TRACE_ENTER(3,14,this,14,lpNumCodes,14,lpCodes);
1903 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1904 - TRACE_RET(23,glDD7->GetFourCCCodes(lpNumCodes,lpCodes));
 1903+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1904+ TRACE_RET(HRESULT,23,glDD7->GetFourCCCodes(lpNumCodes,lpCodes));
19051905 }
19061906 HRESULT WINAPI glDirectDraw2::GetGDISurface(LPDIRECTDRAWSURFACE FAR *lplpGDIDDSurface)
19071907 {
19081908 TRACE_ENTER(2,14,this,14,lplpGDIDDSurface);
1909 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1909+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
19101910 FIXME("glDirectDraw2::GetGDISurface: stub\n");
19111911 TRACE_EXIT(23,DDERR_GENERIC);
19121912 ERR(DDERR_GENERIC);
@@ -1913,55 +1913,55 @@
19141914 HRESULT WINAPI glDirectDraw2::GetMonitorFrequency(LPDWORD lpdwFrequency)
19151915 {
19161916 TRACE_ENTER(2,14,this,14,lpdwFrequency);
1917 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1918 - TRACE_RET(23,glDD7->GetMonitorFrequency(lpdwFrequency));
 1917+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1918+ TRACE_RET(HRESULT,23,glDD7->GetMonitorFrequency(lpdwFrequency));
19191919 }
19201920 HRESULT WINAPI glDirectDraw2::GetScanLine(LPDWORD lpdwScanLine)
19211921 {
19221922 TRACE_ENTER(2,14,this,14,lpdwScanLine);
1923 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1924 - TRACE_RET(23,glDD7->GetScanLine(lpdwScanLine));
 1923+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1924+ TRACE_RET(HRESULT,23,glDD7->GetScanLine(lpdwScanLine));
19251925 }
19261926 HRESULT WINAPI glDirectDraw2::GetVerticalBlankStatus(LPBOOL lpbIsInVB)
19271927 {
19281928 TRACE_ENTER(2,14,this,14,lpbIsInVB);
1929 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1930 - TRACE_RET(23,glDD7->GetVerticalBlankStatus(lpbIsInVB));
 1929+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1930+ TRACE_RET(HRESULT,23,glDD7->GetVerticalBlankStatus(lpbIsInVB));
19311931 }
19321932 HRESULT WINAPI glDirectDraw2::Initialize(GUID FAR *lpGUID)
19331933 {
19341934 TRACE_ENTER(2,14,this,24,lpGUID);
1935 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1936 - TRACE_RET(23,glDD7->Initialize(lpGUID));
 1935+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1936+ TRACE_RET(HRESULT,23,glDD7->Initialize(lpGUID));
19371937 }
19381938 HRESULT WINAPI glDirectDraw2::RestoreDisplayMode()
19391939 {
19401940 TRACE_ENTER(1,14,this);
1941 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1942 - TRACE_RET(23,glDD7->RestoreDisplayMode());
 1941+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1942+ TRACE_RET(HRESULT,23,glDD7->RestoreDisplayMode());
19431943 }
19441944 HRESULT WINAPI glDirectDraw2::SetCooperativeLevel(HWND hWnd, DWORD dwFlags)
19451945 {
19461946 TRACE_ENTER(3,14,this,13,hWnd,9,dwFlags);
1947 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1948 - TRACE_RET(23,glDD7->SetCooperativeLevel(hWnd,dwFlags));
 1947+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1948+ TRACE_RET(HRESULT,23,glDD7->SetCooperativeLevel(hWnd,dwFlags));
19491949 }
19501950 HRESULT WINAPI glDirectDraw2::SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
19511951 {
19521952 TRACE_ENTER(6,14,this,8,dwWidth,8,dwHeight,8,dwBPP,8,dwRefreshRate,9,dwFlags);
1953 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1954 - TRACE_RET(23,glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,dwRefreshRate,dwFlags));
 1953+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1954+ TRACE_RET(HRESULT,23,glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,dwRefreshRate,dwFlags));
19551955 }
19561956 HRESULT WINAPI glDirectDraw2::WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent)
19571957 {
19581958 TRACE_ENTER(3,14,this,9,dwFlags,14,hEvent);
1959 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1960 - TRACE_RET(23,glDD7->WaitForVerticalBlank(dwFlags,hEvent));
 1959+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1960+ TRACE_RET(HRESULT,23,glDD7->WaitForVerticalBlank(dwFlags,hEvent));
19611961 }
19621962 HRESULT WINAPI glDirectDraw2::GetAvailableVidMem(LPDDSCAPS lpDDSCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree)
19631963 {
19641964 TRACE_ENTER(4,14,this,14,lpDDSCaps,14,lpdwTotal,14,lpdwFree);
1965 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1965+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
19661966 if(GLEXT_NVX_gpu_memory_info)
19671967 {
19681968 if(lpdwTotal) glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX,(GLint*)lpdwTotal);
@@ -2001,7 +2001,7 @@
20022002 HRESULT WINAPI glDirectDraw4::QueryInterface(REFIID riid, void** ppvObj)
20032003 {
20042004 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
2005 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2005+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
20062006 if(riid == IID_IUnknown)
20072007 {
20082008 this->AddRef();
@@ -2009,12 +2009,12 @@
20102010 TRACE_EXIT(23,DD_OK);
20112011 return DD_OK;
20122012 }
2013 - TRACE_RET(23,glDD7->QueryInterface(riid,ppvObj));
 2013+ TRACE_RET(HRESULT,23,glDD7->QueryInterface(riid,ppvObj));
20142014 }
20152015 ULONG WINAPI glDirectDraw4::AddRef()
20162016 {
20172017 TRACE_ENTER(1,14,this);
2018 - if(!this) TRACE_RET(8,0);
 2018+ if(!this) TRACE_RET(ULONG,8,0);
20192019 refcount++;
20202020 TRACE_EXIT(8,refcount);
20212021 return refcount;
@@ -2022,37 +2022,37 @@
20232023 ULONG WINAPI glDirectDraw4::Release()
20242024 {
20252025 TRACE_ENTER(1,14,this);
2026 - if(!this) TRACE_RET(8,0);
 2026+ if(!this) TRACE_RET(ULONG,8,0);
20272027 ULONG ret;
20282028 refcount--;
20292029 ret = refcount;
20302030 if(refcount == 0) delete this;
2031 - TRACE_RET(8,ret);
 2031+ TRACE_EXIT(8,ret);
20322032 return ret;
20332033 }
20342034 HRESULT WINAPI glDirectDraw4::Compact()
20352035 {
20362036 TRACE_ENTER(1,14,this);
2037 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2038 - TRACE_RET(23,glDD7->Compact());
 2037+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2038+ TRACE_RET(HRESULT,23,glDD7->Compact());
20392039 }
20402040 HRESULT WINAPI glDirectDraw4::CreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter)
20412041 {
20422042 TRACE_ENTER(4,14,this,9,dwFlags,14,lplpDDClipper,14,pUnkOuter);
2043 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2044 - TRACE_RET(23,glDD7->CreateClipper(dwFlags,lplpDDClipper,pUnkOuter));
 2043+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2044+ TRACE_RET(HRESULT,23,glDD7->CreateClipper(dwFlags,lplpDDClipper,pUnkOuter));
20452045 }
20462046 HRESULT WINAPI glDirectDraw4::CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR *lplpDDPalette, IUnknown FAR *pUnkOuter)
20472047 {
20482048 TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDColorArray,14,lplpDDPalette,14,pUnkOuter);
2049 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2050 - TRACE_RET(23,glDD7->CreatePalette(dwFlags,lpDDColorArray,lplpDDPalette,pUnkOuter));
 2049+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2050+ TRACE_RET(HRESULT,23,glDD7->CreatePalette(dwFlags,lpDDColorArray,lplpDDPalette,pUnkOuter));
20512051 }
20522052 HRESULT WINAPI glDirectDraw4::CreateSurface(LPDDSURFACEDESC2 lpDDSurfaceDesc, LPDIRECTDRAWSURFACE4 FAR *lplpDDSurface, IUnknown FAR *pUnkOuter)
20532053 {
20542054 TRACE_ENTER(4,14,this,14,lpDDSurfaceDesc,14,lplpDDSurface,14,pUnkOuter);
2055 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2056 - if(!lplpDDSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
 2055+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2056+ if(!lplpDDSurface) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
20572057 LPDIRECTDRAWSURFACE7 lpDDS7;
20582058 HRESULT err = glDD7->CreateSurface((LPDDSURFACEDESC2)lpDDSurfaceDesc,&lpDDS7,pUnkOuter);
20592059 if(err == DD_OK)
@@ -2068,7 +2068,7 @@
20692069 HRESULT WINAPI glDirectDraw4::DuplicateSurface(LPDIRECTDRAWSURFACE4 lpDDSurface, LPDIRECTDRAWSURFACE4 FAR *lplpDupDDSurface)
20702070 {
20712071 TRACE_ENTER(3,14,this,14,lpDDSurface,14,lplpDupDDSurface);
2072 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2072+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
20732073 FIXME("glDirectDraw4::DuplicateSurface: stub\n");
20742074 TRACE_EXIT(23,DDERR_GENERIC);
20752075 ERR(DDERR_GENERIC);
@@ -2076,13 +2076,13 @@
20772077 HRESULT WINAPI glDirectDraw4::EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC2 lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK2 lpEnumModesCallback)
20782078 {
20792079 TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSurfaceDesc,14,lpContext,14,lpEnumModesCallback);
2080 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2081 - TRACE_RET(23,::EnumDisplayModes(dwFlags,lpDDSurfaceDesc,lpContext,lpEnumModesCallback));
 2080+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2081+ TRACE_RET(HRESULT,23,::EnumDisplayModes(dwFlags,lpDDSurfaceDesc,lpContext,lpEnumModesCallback));
20822082 }
20832083 HRESULT WINAPI glDirectDraw4::EnumSurfaces(DWORD dwFlags, LPDDSURFACEDESC2 lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpEnumSurfacesCallback)
20842084 {
20852085 TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSD,14,lpContext,14,lpEnumSurfacesCallback);
2086 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2086+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
20872087 FIXME("glDirectDraw4::EnumSurfaces: stub\n");
20882088 TRACE_EXIT(23,DDERR_GENERIC);
20892089 ERR(DDERR_GENERIC);
@@ -2090,31 +2090,31 @@
20912091 HRESULT WINAPI glDirectDraw4::FlipToGDISurface()
20922092 {
20932093 TRACE_ENTER(1,14,this);
2094 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2095 - TRACE_RET(23,glDD7->FlipToGDISurface());
 2094+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2095+ TRACE_RET(HRESULT,23,glDD7->FlipToGDISurface());
20962096 }
20972097 HRESULT WINAPI glDirectDraw4::GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps)
20982098 {
20992099 TRACE_ENTER(3,14,this,14,lpDDDriverCaps,14,lpDDHELCaps);
2100 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2101 - TRACE_RET(23,glDD7->GetCaps(lpDDDriverCaps,lpDDHELCaps));
 2100+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2101+ TRACE_RET(HRESULT,23,glDD7->GetCaps(lpDDDriverCaps,lpDDHELCaps));
21022102 }
21032103 HRESULT WINAPI glDirectDraw4::GetDisplayMode(LPDDSURFACEDESC2 lpDDSurfaceDesc2)
21042104 {
21052105 TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc2);
2106 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2107 - TRACE_RET(23,glDD7->GetDisplayMode(lpDDSurfaceDesc2));
 2106+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2107+ TRACE_RET(HRESULT,23,glDD7->GetDisplayMode(lpDDSurfaceDesc2));
21082108 }
21092109 HRESULT WINAPI glDirectDraw4::GetFourCCCodes(LPDWORD lpNumCodes, LPDWORD lpCodes)
21102110 {
21112111 TRACE_ENTER(3,14,this,14,lpNumCodes,14,lpCodes);
2112 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2113 - TRACE_RET(23,glDD7->GetFourCCCodes(lpNumCodes,lpCodes));
 2112+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2113+ TRACE_RET(HRESULT,23,glDD7->GetFourCCCodes(lpNumCodes,lpCodes));
21142114 }
21152115 HRESULT WINAPI glDirectDraw4::GetGDISurface(LPDIRECTDRAWSURFACE4 FAR *lplpGDIDDSurface)
21162116 {
21172117 TRACE_ENTER(2,14,this,14,lplpGDIDDSurface);
2118 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2118+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
21192119 FIXME("glDirectDraw4::GetGDISurface: stub\n");
21202120 TRACE_EXIT(23,DDERR_GENERIC);
21212121 ERR(DDERR_GENERIC);
@@ -2122,61 +2122,61 @@
21232123 HRESULT WINAPI glDirectDraw4::GetMonitorFrequency(LPDWORD lpdwFrequency)
21242124 {
21252125 TRACE_ENTER(2,14,this,14,lpdwFrequency);
2126 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2127 - TRACE_RET(23,glDD7->GetMonitorFrequency(lpdwFrequency));
 2126+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2127+ TRACE_RET(HRESULT,23,glDD7->GetMonitorFrequency(lpdwFrequency));
21282128 }
21292129 HRESULT WINAPI glDirectDraw4::GetScanLine(LPDWORD lpdwScanLine)
21302130 {
21312131 TRACE_ENTER(2,14,this,14,lpdwScanLine);
2132 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2133 - TRACE_RET(23,glDD7->GetScanLine(lpdwScanLine));
 2132+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2133+ TRACE_RET(HRESULT,23,glDD7->GetScanLine(lpdwScanLine));
21342134 }
21352135 HRESULT WINAPI glDirectDraw4::GetVerticalBlankStatus(LPBOOL lpbIsInVB)
21362136 {
21372137 TRACE_ENTER(2,14,this,14,lpbIsInVB);
2138 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2139 - TRACE_RET(23,glDD7->GetVerticalBlankStatus(lpbIsInVB));
 2138+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2139+ TRACE_RET(HRESULT,23,glDD7->GetVerticalBlankStatus(lpbIsInVB));
21402140 }
21412141 HRESULT WINAPI glDirectDraw4::Initialize(GUID FAR *lpGUID)
21422142 {
21432143 TRACE_ENTER(2,14,this,24,lpGUID);
2144 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2145 - TRACE_RET(23,glDD7->Initialize(lpGUID));
 2144+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2145+ TRACE_RET(HRESULT,23,glDD7->Initialize(lpGUID));
21462146 }
21472147 HRESULT WINAPI glDirectDraw4::RestoreDisplayMode()
21482148 {
21492149 TRACE_ENTER(1,14,this);
2150 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2151 - TRACE_RET(23,glDD7->RestoreDisplayMode());
 2150+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2151+ TRACE_RET(HRESULT,23,glDD7->RestoreDisplayMode());
21522152 }
21532153 HRESULT WINAPI glDirectDraw4::SetCooperativeLevel(HWND hWnd, DWORD dwFlags)
21542154 {
21552155 TRACE_ENTER(3,14,this,13,hWnd,9,dwFlags);
2156 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2157 - TRACE_RET(23,glDD7->SetCooperativeLevel(hWnd,dwFlags));
 2156+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2157+ TRACE_RET(HRESULT,23,glDD7->SetCooperativeLevel(hWnd,dwFlags));
21582158 }
21592159 HRESULT WINAPI glDirectDraw4::SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
21602160 {
21612161 TRACE_ENTER(6,14,this,8,dwWidth,8,dwHeight,8,dwBPP,8,dwRefreshRate,9,dwFlags);
2162 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2163 - TRACE_RET(23,glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,dwRefreshRate,dwFlags));
 2162+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2163+ TRACE_RET(HRESULT,23,glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,dwRefreshRate,dwFlags));
21642164 }
21652165 HRESULT WINAPI glDirectDraw4::WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent)
21662166 {
21672167 TRACE_ENTER(3,14,this,9,dwFlags,14,hEvent);
2168 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2169 - TRACE_RET(23,glDD7->WaitForVerticalBlank(dwFlags,hEvent));
 2168+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2169+ TRACE_RET(HRESULT,23,glDD7->WaitForVerticalBlank(dwFlags,hEvent));
21702170 }
21712171 HRESULT WINAPI glDirectDraw4::GetAvailableVidMem(LPDDSCAPS2 lpDDSCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree)
21722172 {
21732173 TRACE_ENTER(4,14,this,14,lpDDSCaps,14,lpdwTotal,14,lpdwFree);
2174 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2175 - TRACE_RET(23,glDD7->GetAvailableVidMem(lpDDSCaps,lpdwTotal,lpdwFree));
 2174+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2175+ TRACE_RET(HRESULT,23,glDD7->GetAvailableVidMem(lpDDSCaps,lpdwTotal,lpdwFree));
21762176 }
21772177 HRESULT WINAPI glDirectDraw4::GetSurfaceFromDC(HDC hdc, LPDIRECTDRAWSURFACE4 *lpDDS)
21782178 {
21792179 TRACE_ENTER(3,14,this,13,hdc,14,lpDDS);
2180 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2180+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
21812181 FIXME("IDirectDraw4::GetSurfaceFromDC: stub\n");
21822182 TRACE_EXIT(23,DDERR_GENERIC);
21832183 ERR(DDERR_GENERIC);
@@ -2184,20 +2184,20 @@
21852185 HRESULT WINAPI glDirectDraw4::RestoreAllSurfaces()
21862186 {
21872187 TRACE_ENTER(1,14,this);
2188 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2189 - TRACE_RET(23,glDD7->RestoreAllSurfaces());
 2188+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2189+ TRACE_RET(HRESULT,23,glDD7->RestoreAllSurfaces());
21902190 }
21912191 HRESULT WINAPI glDirectDraw4::TestCooperativeLevel()
21922192 {
21932193 TRACE_ENTER(1,14,this);
2194 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2195 - TRACE_RET(23,glDD7->TestCooperativeLevel());
 2194+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2195+ TRACE_RET(HRESULT,23,glDD7->TestCooperativeLevel());
21962196 }
21972197 HRESULT WINAPI glDirectDraw4::GetDeviceIdentifier(LPDDDEVICEIDENTIFIER lpdddi, DWORD dwFlags)
21982198 {
21992199 TRACE_ENTER(3,14,this,14,lpdddi,9,dwFlags);
2200 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2201 - if(!lpdddi) TRACE_RET(23,DDERR_INVALIDPARAMS);
 2200+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2201+ if(!lpdddi) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
22022202 devid.guidDeviceIdentifier = device_template;
22032203 memcpy(lpdddi,&devid,sizeof(DDDEVICEIDENTIFIER));
22042204 TRACE_EXIT(23,DD_OK);
Index: ddraw/glDirectDrawClipper.cpp
@@ -44,8 +44,8 @@
4545 HRESULT WINAPI glDirectDrawClipper::QueryInterface(REFIID riid, LPVOID* obp)
4646 {
4747 TRACE_ENTER(3,14,this,24,&riid,14,obp);
48 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
49 - if(!obp) TRACE_RET(23,DDERR_INVALIDPARAMS);
 48+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 49+ if(!obp) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
5050 if(riid == IID_IUnknown)
5151 {
5252 this->AddRef();
@@ -68,7 +68,7 @@
6969 ULONG WINAPI glDirectDrawClipper::AddRef()
7070 {
7171 TRACE_ENTER(1,14,this);
72 - if(!this) TRACE_RET(8,0);
 72+ if(!this) TRACE_RET(ULONG,8,0);
7373 refcount++;
7474 TRACE_EXIT(8,refcount);
7575 return refcount;
@@ -76,7 +76,7 @@
7777 ULONG WINAPI glDirectDrawClipper::Release()
7878 {
7979 TRACE_ENTER(1,14,this);
80 - if(!this) TRACE_RET(8,0);
 80+ if(!this) TRACE_RET(ULONG,8,0);
8181 ULONG ret;
8282 refcount--;
8383 ret = refcount;
@@ -87,7 +87,7 @@
8888 HRESULT WINAPI glDirectDrawClipper::GetClipList(LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSize)
8989 {
9090 TRACE_ENTER(4,14,this,26,lpRect,14,lpClipList,14,lpdwSize);
91 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 91+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
9292 FIXME("IDirectDrawClipper::GetClipList: stub");
9393 TRACE_EXIT(23,DDERR_GENERIC);
9494 ERR(DDERR_GENERIC);
@@ -95,8 +95,8 @@
9696 HRESULT WINAPI glDirectDrawClipper::GetHWnd(HWND FAR *lphWnd)
9797 {
9898 TRACE_ENTER(2,14,this,14,lphWnd);
99 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
100 - if(!hWnd) TRACE_RET(23,DDERR_NOHWND);
 99+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 100+ if(!hWnd) TRACE_RET(HRESULT,23,DDERR_NOHWND);
101101 *lphWnd = hWnd;
102102 TRACE_VAR("*lphWnd",13,*lphWnd);
103103 TRACE_EXIT(23,DD_OK);
@@ -105,8 +105,8 @@
106106 HRESULT WINAPI glDirectDrawClipper::Initialize(LPDIRECTDRAW lpDD, DWORD dwFlags)
107107 {
108108 TRACE_ENTER(3,14,this,14,lpDD,9,dwFlags);
109 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
110 - if(initialized) TRACE_RET(23,DDERR_ALREADYINITIALIZED);
 109+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 110+ if(initialized) TRACE_RET(HRESULT,23,DDERR_ALREADYINITIALIZED);
111111 glDD7 = (glDirectDraw7*)lpDD;
112112 if(glDD7) hasparent = true;
113113 else hasparent = false;
@@ -119,7 +119,7 @@
120120 HRESULT WINAPI glDirectDrawClipper::IsClipListChanged(BOOL FAR *lpbChanged)
121121 {
122122 TRACE_ENTER(2,14,this,14,lpbChanged);
123 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 123+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
124124 FIXME("IDirectDrawClipper::IsClipListChanged: stub");
125125 TRACE_EXIT(23,DDERR_GENERIC);
126126 ERR(DDERR_GENERIC);
@@ -127,7 +127,7 @@
128128 HRESULT WINAPI glDirectDrawClipper::SetClipList(LPRGNDATA lpClipList, DWORD dwFlags)
129129 {
130130 TRACE_ENTER(3,14,this,14,lpClipList,9,dwFlags);
131 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 131+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
132132 FIXME("IDirectDrawClipper::SetClipList: stub");
133133 TRACE_EXIT(23,DDERR_GENERIC);
134134 ERR(DDERR_GENERIC);
@@ -135,7 +135,7 @@
136136 HRESULT WINAPI glDirectDrawClipper::SetHWnd(DWORD dwFlags, HWND hWnd)
137137 {
138138 TRACE_ENTER(3,14,this,9,dwFlags,13,hWnd);
139 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 139+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
140140 this->hWnd = hWnd;
141141 TRACE_EXIT(23,DD_OK);
142142 return DD_OK;
Index: ddraw/glDirectDrawPalette.cpp
@@ -120,8 +120,8 @@
121121 HRESULT WINAPI glDirectDrawPalette::QueryInterface(REFIID riid, void** ppvObj)
122122 {
123123 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
124 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
125 - if(!ppvObj) TRACE_RET(23,DDERR_INVALIDPARAMS);
 124+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 125+ if(!ppvObj) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
126126 if(riid == IID_IUnknown)
127127 {
128128 this->AddRef();
@@ -158,7 +158,7 @@
159159 HRESULT WINAPI glDirectDrawPalette::GetCaps(LPDWORD lpdwCaps)
160160 {
161161 TRACE_ENTER(2,14,this,14,lpdwCaps);
162 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 162+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
163163 *lpdwCaps = flags;
164164 TRACE_VAR("*lpdwCaps",9,*lpdwCaps);
165165 TRACE_EXIT(23,DD_OK);
@@ -168,7 +168,7 @@
169169 HRESULT WINAPI glDirectDrawPalette::GetEntries(DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries)
170170 {
171171 TRACE_ENTER(5,14,this,9,dwFlags,8,dwBase,8,dwNumEntries,14,lpEntries);
172 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 172+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
173173 DWORD allentries = 256;
174174 DWORD entrysize;
175175 if(flags & DDPCAPS_1BIT) allentries=2;
@@ -177,7 +177,7 @@
178178 if(flags & DDPCAPS_8BIT) allentries=256;
179179 if(flags & DDPCAPS_8BITENTRIES) entrysize = 1;
180180 else entrysize = sizeof(PALETTEENTRY);
181 - if((dwBase + dwNumEntries) > allentries) TRACE_RET(23,DDERR_INVALIDPARAMS);
 181+ if((dwBase + dwNumEntries) > allentries) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
182182 memcpy(lpEntries,((char *)palette)+(dwBase*entrysize),dwNumEntries*entrysize);
183183 TRACE_EXIT(23,DD_OK);
184184 return DD_OK;
@@ -185,7 +185,7 @@
186186 HRESULT WINAPI glDirectDrawPalette::Initialize(LPDIRECTDRAW lpDD, DWORD dwFlags, LPPALETTEENTRY lpDDColorTable)
187187 {
188188 TRACE_ENTER(4,14,this,14,lpDD,9,dwFlags,14,lpDDColorTable);
189 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 189+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
190190 TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
191191 return DDERR_ALREADYINITIALIZED;
192192 }
@@ -192,7 +192,7 @@
193193 HRESULT WINAPI glDirectDrawPalette::SetEntries(DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries)
194194 {
195195 TRACE_ENTER(5,14,this,9,dwFlags,8,dwStartingEntry,8,dwCount,14,lpEntries);
196 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 196+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
197197 DWORD allentries = 256;
198198 DWORD entrysize;
199199 if(flags & DDPCAPS_1BIT) allentries=2;
@@ -201,7 +201,7 @@
202202 if(flags & DDPCAPS_8BIT) allentries=256;
203203 if(flags & DDPCAPS_8BITENTRIES) entrysize = 1;
204204 else entrysize = sizeof(PALETTEENTRY);
205 - if((dwStartingEntry + dwCount) > allentries) TRACE_RET(23,DDERR_INVALIDPARAMS);
 205+ if((dwStartingEntry + dwCount) > allentries) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
206206 memcpy(((char *)palette)+(dwStartingEntry*entrysize),lpEntries,dwCount*entrysize);
207207 TRACE_EXIT(23,DD_OK);
208208 return DD_OK;
@@ -215,6 +215,6 @@
216216 *flags = this->flags;
217217 TRACE_VAR("*flags",9,*flags);
218218 }
219 - TRACE_RET(14,palette);
 219+ TRACE_RET(LPPALETTEENTRY,14,palette);
220220 return palette;
221221 }
Index: ddraw/glDirectDrawSurface.cpp
@@ -375,8 +375,8 @@
376376 HRESULT WINAPI glDirectDrawSurface7::QueryInterface(REFIID riid, void** ppvObj)
377377 {
378378 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);
 379+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 380+ if(!ppvObj) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
381381 if(riid == IID_IUnknown)
382382 {
383383 this->AddRef();
@@ -522,7 +522,7 @@
523523 glDirect3D7 *tmpd3d;
524524 glDirect3DDevice7 *tmpdev;
525525 ddInterface->QueryInterface(IID_IDirect3D7,(void**)&tmpd3d);
526 - if(!tmpd3d) TRACE_RET(23,E_NOINTERFACE);
 526+ if(!tmpd3d) TRACE_RET(HRESULT,23,E_NOINTERFACE);
527527 tmpd3d->CreateDevice(riid,this,(LPDIRECT3DDEVICE7*)&tmpdev);
528528 if(!tmpdev)
529529 {
@@ -552,7 +552,7 @@
553553 ULONG WINAPI glDirectDrawSurface7::AddRef()
554554 {
555555 TRACE_ENTER(1,14,this);
556 - if(!this) TRACE_RET(8,0);
 556+ if(!this) TRACE_RET(ULONG,8,0);
557557 refcount++;
558558 TRACE_EXIT(8,refcount);
559559 return refcount;
@@ -560,7 +560,7 @@
561561 ULONG WINAPI glDirectDrawSurface7::Release()
562562 {
563563 TRACE_ENTER(1,14,this);
564 - if(!this) TRACE_RET(8,0);
 564+ if(!this) TRACE_RET(ULONG,8,0);
565565 ULONG ret;
566566 refcount--;
567567 ret = refcount;
@@ -571,9 +571,9 @@
572572 HRESULT WINAPI glDirectDrawSurface7::AddAttachedSurface(LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface)
573573 {
574574 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);
 575+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 576+ if(!lpDDSAttachedSurface) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 577+ if(zbuffer) TRACE_RET(HRESULT,23,DDERR_SURFACEALREADYATTACHED);
578578 glDirectDrawSurface7 *attached = (glDirectDrawSurface7 *)lpDDSAttachedSurface;
579579 DDSURFACEDESC2 ddsd;
580580 ddsd.dwSize = sizeof(DDSURFACEDESC2);
@@ -585,12 +585,12 @@
586586 TRACE_EXIT(23,DD_OK);
587587 return DD_OK;
588588 }
589 - else TRACE_RET(23,DDERR_CANNOTATTACHSURFACE);
 589+ else TRACE_RET(HRESULT,23,DDERR_CANNOTATTACHSURFACE);
590590 }
591591 HRESULT WINAPI glDirectDrawSurface7::AddOverlayDirtyRect(LPRECT lpRect)
592592 {
593593 TRACE_ENTER(2,14,this,26,lpRect);
594 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 594+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
595595 FIXME("glDirectDrawSurface7::AddOverlayDirtyRect: stub\n");
596596 TRACE_EXIT(23,DDERR_GENERIC);
597597 ERR(DDERR_GENERIC);
@@ -598,8 +598,8 @@
599599 HRESULT WINAPI glDirectDrawSurface7::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
600600 {
601601 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);
 602+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 603+ if((dwFlags & DDBLT_COLORFILL) && !lpDDBltFx) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
604604 glDirectDrawSurface7 *src = (glDirectDrawSurface7 *)lpDDSrcSurface;
605605 if(dirty & 1)
606606 {
@@ -616,12 +616,12 @@
617617 src->ddsd.ddpfPixelFormat.dwRGBBitCount);
618618 src->dirty &= ~1;
619619 }
620 - TRACE_RET(23,renderer->Blt(lpDestRect,src,this,lpSrcRect,dwFlags,lpDDBltFx));
 620+ TRACE_RET(HRESULT,23,renderer->Blt(lpDestRect,src,this,lpSrcRect,dwFlags,lpDDBltFx));
621621 }
622622 HRESULT WINAPI glDirectDrawSurface7::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
623623 {
624624 TRACE_ENTER(4,14,this,14,lpDDBltBatch,8,dwCount,9,dwFlags);
625 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 625+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
626626 FIXME("glDirectDrawSurface7::BltBatch: stub\n");
627627 TRACE_EXIT(23,DDERR_GENERIC);
628628 ERR(DDERR_GENERIC);
@@ -629,7 +629,7 @@
630630 HRESULT WINAPI glDirectDrawSurface7::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
631631 {
632632 TRACE_ENTER(6,14,this,8,dwX,8,dwY,14,lpDDSrcSurface,26,lpSrcRect,9,dwTrans);
633 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 633+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
634634 DDSURFACEDESC2 ddsd;
635635 ddsd.dwSize = sizeof(DDSURFACEDESC2);
636636 lpDDSrcSurface->GetSurfaceDesc(&ddsd);
@@ -650,12 +650,12 @@
651651 if(dwTrans & DDBLTFAST_WAIT) flags |= DDBLT_WAIT;
652652 if(dwTrans & DDBLTFAST_DESTCOLORKEY) flags |= DDBLT_KEYDEST;
653653 if(dwTrans & DDBLTFAST_SRCCOLORKEY) flags |= DDBLT_KEYSRC;
654 - TRACE_RET(23,Blt(&dest,lpDDSrcSurface,lpSrcRect,flags,NULL));
 654+ TRACE_RET(HRESULT,23,Blt(&dest,lpDDSrcSurface,lpSrcRect,flags,NULL));
655655 }
656656 HRESULT WINAPI glDirectDrawSurface7::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface)
657657 {
658658 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSAttachedSurface);
659 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 659+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
660660 if(lpDDSAttachedSurface == (LPDIRECTDRAWSURFACE7)zbuffer)
661661 {
662662 zbuffer->Release();
@@ -663,12 +663,12 @@
664664 TRACE_EXIT(23,DD_OK);
665665 return DD_OK;
666666 }
667 - else TRACE_RET(23,DDERR_SURFACENOTATTACHED);
 667+ else TRACE_RET(HRESULT,23,DDERR_SURFACENOTATTACHED);
668668 }
669669 HRESULT WINAPI glDirectDrawSurface7::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback)
670670 {
671671 TRACE_ENTER(3,14,this,14,lpContext,14,lpEnumSurfacesCallback);
672 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 672+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
673673 FIXME("glDirectDrawSurface7::EnumAttachedSurfaces: stub\n");
674674 TRACE_EXIT(23,DDERR_GENERIC);
675675 ERR(DDERR_GENERIC);
@@ -676,7 +676,7 @@
677677 HRESULT WINAPI glDirectDrawSurface7::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpfnCallback)
678678 {
679679 TRACE_ENTER(4,14,this,9,dwFlags,14,lpContext,14,lpfnCallback);
680 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 680+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
681681 FIXME("glDirectDrawSurface7::EnumOverlayZOrders: stub\n");
682682 TRACE_EXIT(23,DDERR_GENERIC);
683683 ERR(DDERR_GENERIC);
@@ -684,7 +684,7 @@
685685 HRESULT WINAPI glDirectDrawSurface7::Flip(LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverride, DWORD dwFlags)
686686 {
687687 TRACE_ENTER(3,14,this,14,lpDDSurfaceTargetOverride,9,dwFlags);
688 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 688+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
689689 HRESULT ret = Flip2(lpDDSurfaceTargetOverride,dwFlags);
690690 if(ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) RenderScreen(texture,this);
691691 TRACE_EXIT(23,ret);
@@ -693,7 +693,7 @@
694694 HRESULT glDirectDrawSurface7::Flip2(LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverride, DWORD dwFlags)
695695 {
696696 TRACE_ENTER(3,14,this,14,lpDDSurfaceTargetOverride,9,dwFlags);
697 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 697+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
698698 DWORD i;
699699 glDirectDrawSurface7 *tmp;
700700 if(dwFlags & DDFLIP_NOVSYNC) swapinterval=0;
@@ -708,7 +708,7 @@
709709 if(lpDDSurfaceTargetOverride)
710710 {
711711 bool success = false;
712 - if(lpDDSurfaceTargetOverride == this) TRACE_RET(23,DD_OK);
 712+ if(lpDDSurfaceTargetOverride == this) TRACE_RET(HRESULT,23,DD_OK);
713713 tmp = this;
714714 for(i = 0; i < ddsd.dwBackBufferCount; i++)
715715 {
@@ -720,16 +720,16 @@
721721 break;
722722 }
723723 }
724 - if(!success) TRACE_RET(23,DDERR_INVALIDPARAMS);
 724+ if(!success) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
725725 for(DWORD x = 0; x < i; x++)
726726 {
727 - if(x == i-1) {TRACE_RET(23,Flip2(NULL,dwFlags));}
 727+ if(x == i-1) {TRACE_RET(HRESULT,23,Flip2(NULL,dwFlags));}
728728 else Flip2(NULL,0);
729729 }
730730 }
731731 if(ddsd.ddsCaps.dwCaps & DDSCAPS_FLIP)
732732 {
733 - if(ddsd.ddsCaps.dwCaps & DDSCAPS_BACKBUFFER) TRACE_RET(23,DDERR_INVALIDOBJECT);
 733+ if(ddsd.ddsCaps.dwCaps & DDSCAPS_BACKBUFFER) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
734734 TEXTURE **textures = new TEXTURE*[ddsd.dwBackBufferCount+1];
735735 textures[0] = texture;
736736 tmp = this;
@@ -766,7 +766,7 @@
767767 }
768768 delete[] textures;
769769 }
770 - else TRACE_RET(23,DDERR_NOTFLIPPABLE);
 770+ else TRACE_RET(HRESULT,23,DDERR_NOTFLIPPABLE);
771771 flipcount+=flips;
772772 if(flipcount > ddsd.dwBackBufferCount) flipcount -= (ddsd.dwBackBufferCount+1);
773773 TRACE_EXIT(23,DD_OK);
@@ -775,7 +775,7 @@
776776 HRESULT WINAPI glDirectDrawSurface7::GetAttachedSurface(LPDDSCAPS2 lpDDSCaps, LPDIRECTDRAWSURFACE7 FAR *lplpDDAttachedSurface)
777777 {
778778 TRACE_ENTER(3,14,this,14,lpDDSCaps,14,lplpDDAttachedSurface);
779 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 779+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
780780 DDSCAPS2 ddsComp;
781781 backbuffer->GetCaps(&ddsComp);
782782 unsigned __int64 comp1,comp2;
@@ -809,7 +809,7 @@
810810 HRESULT WINAPI glDirectDrawSurface7::GetBltStatus(DWORD dwFlags)
811811 {
812812 TRACE_ENTER(2,14,this,9,dwFlags);
813 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 813+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
814814 FIXME("glDirectDrawSurface7::GetBltStatus: stub\n");
815815 TRACE_EXIT(23,DDERR_GENERIC);
816816 ERR(DDERR_GENERIC);
@@ -817,8 +817,8 @@
818818 HRESULT WINAPI glDirectDrawSurface7::GetCaps(LPDDSCAPS2 lpDDSCaps)
819819 {
820820 TRACE_ENTER(2,14,this,14,lpDDSCaps);
821 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
822 - if(!lpDDSCaps) TRACE_RET(23,DDERR_INVALIDPARAMS);
 821+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 822+ if(!lpDDSCaps) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
823823 memcpy(lpDDSCaps,&ddsd.ddsCaps,sizeof(DDSCAPS2));
824824 TRACE_EXIT(23,DD_OK);
825825 return DD_OK;
@@ -826,7 +826,7 @@
827827 HRESULT WINAPI glDirectDrawSurface7::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
828828 {
829829 TRACE_ENTER(2,14,this,14,lplpDDClipper);
830 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 830+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
831831 FIXME("glDirectDrawSurface7::GetClipper: stub\n");
832832 TRACE_EXIT(23,DDERR_GENERIC);
833833 ERR(DDERR_GENERIC);
@@ -834,8 +834,8 @@
835835 HRESULT WINAPI glDirectDrawSurface7::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
836836 {
837837 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);
 838+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 839+ if(!lpDDColorKey) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
840840 if(dwFlags == DDCKEY_SRCBLT)
841841 {
842842 if(colorkey[0].enabled)
@@ -844,7 +844,7 @@
845845 TRACE_EXIT(23,DD_OK);
846846 return DD_OK;
847847 }
848 - else TRACE_RET(23,DDERR_NOCOLORKEY);
 848+ else TRACE_RET(HRESULT,23,DDERR_NOCOLORKEY);
849849 }
850850 if(dwFlags == DDCKEY_DESTBLT)
851851 {
@@ -854,7 +854,7 @@
855855 TRACE_EXIT(23,DD_OK);
856856 return DD_OK;
857857 }
858 - else TRACE_RET(23,DDERR_NOCOLORKEY);
 858+ else TRACE_RET(HRESULT,23,DDERR_NOCOLORKEY);
859859 }
860860 if(dwFlags == DDCKEY_SRCOVERLAY)
861861 {
@@ -864,7 +864,7 @@
865865 TRACE_EXIT(23,DD_OK);
866866 return DD_OK;
867867 }
868 - else TRACE_RET(23,DDERR_NOCOLORKEY);
 868+ else TRACE_RET(HRESULT,23,DDERR_NOCOLORKEY);
869869 }
870870 if(dwFlags == DDCKEY_DESTOVERLAY)
871871 {
@@ -874,7 +874,7 @@
875875 TRACE_EXIT(23,DD_OK);
876876 return DD_OK;
877877 }
878 - else TRACE_RET(23,DDERR_NOCOLORKEY);
 878+ else TRACE_RET(HRESULT,23,DDERR_NOCOLORKEY);
879879 }
880880 TRACE_EXIT(23,DDERR_INVALIDPARAMS);
881881 return DDERR_INVALIDPARAMS;
@@ -882,15 +882,15 @@
883883 HRESULT WINAPI glDirectDrawSurface7::GetDC(HDC FAR *lphDC)
884884 {
885885 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);
 886+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 887+ if(!lphDC) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 888+ if(hdc) TRACE_RET(HRESULT,23,DDERR_DCALREADYCREATED);
889889 glDirectDrawPalette *pal;
890890 DWORD colors[256];
891891 HRESULT error;
892892 LPVOID surface;
893893 error = this->Lock(NULL,&ddsd,0,NULL);
894 - if(error != DD_OK) TRACE_RET(23,error);
 894+ if(error != DD_OK) TRACE_RET(HRESULT,23,error);
895895 hdc = CreateCompatibleDC(NULL);
896896 bitmapinfo->bmiHeader.biWidth = ddsd.lPitch / (bitmapinfo->bmiHeader.biBitCount / 8);
897897 if(ddsd.ddpfPixelFormat.dwRGBBitCount == 8)
@@ -916,17 +916,17 @@
917917 HRESULT WINAPI glDirectDrawSurface7::GetFlipStatus(DWORD dwFlags)
918918 {
919919 TRACE_ENTER(2,14,this,9,dwFlags);
920 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 920+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
921921 TRACE_EXIT(23,DD_OK);
922922 return DD_OK;
923923 FIXME("glDirectDrawSurface7::GetFlipStatus: stub\n");
924 - TRACE_RET(23,DDERR_GENERIC);
 924+ TRACE_RET(HRESULT,23,DDERR_GENERIC);
925925 ERR(DDERR_GENERIC);
926926 }
927927 HRESULT WINAPI glDirectDrawSurface7::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
928928 {
929929 TRACE_ENTER(3,14,this,14,lplX,14,lplY);
930 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 930+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
931931 FIXME("glDirectDrawSurface7::GetOverlayPosition: stub\n");
932932 TRACE_EXIT(23,DDERR_GENERIC);
933933 ERR(DDERR_GENERIC);
@@ -934,7 +934,7 @@
935935 HRESULT WINAPI glDirectDrawSurface7::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
936936 {
937937 TRACE_ENTER(2,14,this,14,lplpDDPalette);
938 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 938+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
939939 HRESULT err;
940940 if(palette)
941941 {
@@ -954,8 +954,8 @@
955955 HRESULT WINAPI glDirectDrawSurface7::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
956956 {
957957 TRACE_ENTER(2,14,this,14,lpDDPixelFormat);
958 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
959 - if(!lpDDPixelFormat) TRACE_RET(23,DDERR_INVALIDPARAMS);
 958+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 959+ if(!lpDDPixelFormat) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
960960 *lpDDPixelFormat = ddsd.ddpfPixelFormat;
961961 TRACE_EXIT(23,DD_OK);
962962 return DD_OK;
@@ -963,8 +963,8 @@
964964 HRESULT WINAPI glDirectDrawSurface7::GetSurfaceDesc(LPDDSURFACEDESC2 lpDDSurfaceDesc)
965965 {
966966 TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc);
967 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
968 - if(!lpDDSurfaceDesc) TRACE_RET(23,DDERR_INVALIDPARAMS);
 967+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 968+ if(!lpDDSurfaceDesc) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
969969 memcpy(lpDDSurfaceDesc,&ddsd,lpDDSurfaceDesc->dwSize);
970970 TRACE_EXIT(23,DD_OK);
971971 return DD_OK;
@@ -972,7 +972,7 @@
973973 HRESULT WINAPI glDirectDrawSurface7::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC2 lpDDSurfaceDesc)
974974 {
975975 TRACE_ENTER(3,14,this,14,lpDD,14,lpDDSurfaceDesc);
976 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 976+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
977977 TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
978978 return DDERR_ALREADYINITIALIZED;
979979 }
@@ -979,16 +979,16 @@
980980 HRESULT WINAPI glDirectDrawSurface7::IsLost()
981981 {
982982 TRACE_ENTER(1,14,this);
983 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
984 - if(hRC == renderer->hRC) {TRACE_RET(23,DD_OK);}
985 - else TRACE_RET(23,DDERR_SURFACELOST);
 983+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 984+ if(hRC == renderer->hRC) {TRACE_RET(HRESULT,23,DD_OK);}
 985+ else TRACE_RET(HRESULT,23,DDERR_SURFACELOST);
986986 }
987987
988988 HRESULT WINAPI glDirectDrawSurface7::Lock(LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
989989 {
990990 TRACE_ENTER(5,14,this,26,lpDestRect,14,lpDDSurfaceDesc,9,dwFlags,14,hEvent);
991 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
992 - if(locked) TRACE_RET(23,DDERR_SURFACEBUSY);
 991+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 992+ if(locked) TRACE_RET(HRESULT,23,DDERR_SURFACEBUSY);
993993 dirty |= 1;
994994 retry:
995995 switch(surfacetype)
@@ -1035,9 +1035,9 @@
10361036 HRESULT WINAPI glDirectDrawSurface7::ReleaseDC(HDC hDC)
10371037 {
10381038 TRACE_ENTER(2,14,this,14,hDC);
1039 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1040 - if(!hdc) TRACE_RET(23,DDERR_INVALIDPARAMS);
1041 - if(hDC != hdc) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1039+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1040+ if(!hdc) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1041+ if(hDC != hdc) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
10421042 GetDIBits(hDC,hbitmap,0,ddsd.dwHeight,ddsd.lpSurface,bitmapinfo,DIB_RGB_COLORS);
10431043 Unlock(NULL);
10441044 DeleteObject(hbitmap);
@@ -1086,9 +1086,9 @@
10871087 HRESULT WINAPI glDirectDrawSurface7::Restore()
10881088 {
10891089 TRACE_ENTER(1,14,this);
1090 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1090+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
10911091 LONG sizes[6];
1092 - if(!renderer) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1092+ if(!renderer) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
10931093 if(hRC != renderer->hRC)
10941094 {
10951095 if(ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
@@ -1129,12 +1129,12 @@
11301130 TRACE_EXIT(23,DD_OK);
11311131 return DD_OK;
11321132 }
1133 - else TRACE_RET(23,DD_OK);
 1133+ else TRACE_RET(HRESULT,23,DD_OK);
11341134 }
11351135 HRESULT WINAPI glDirectDrawSurface7::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
11361136 {
11371137 TRACE_ENTER(2,14,this,14,lpDDClipper);
1138 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1138+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
11391139 if(clipper) clipper->Release();
11401140 clipper = (glDirectDrawClipper *)lpDDClipper;
11411141 if(clipper)clipper->AddRef();
@@ -1144,8 +1144,8 @@
11451145 HRESULT WINAPI glDirectDrawSurface7::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
11461146 {
11471147 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
1148 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1149 - if(!lpDDColorKey) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1148+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1149+ if(!lpDDColorKey) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
11501150 CKEY key;
11511151 key.enabled = true;
11521152 if(dwFlags & DDCKEY_COLORSPACE) key.colorspace = true;
@@ -1177,7 +1177,7 @@
11781178 HRESULT WINAPI glDirectDrawSurface7::SetOverlayPosition(LONG lX, LONG lY)
11791179 {
11801180 TRACE_ENTER(3,14,this,7,lX,7,lY);
1181 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1181+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
11821182 FIXME("glDirectDrawSurface7::SetOverlayPosition: stub\n");
11831183 TRACE_EXIT(23,DDERR_GENERIC);
11841184 ERR(DDERR_GENERIC);
@@ -1185,7 +1185,7 @@
11861186 HRESULT WINAPI glDirectDrawSurface7::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
11871187 {
11881188 TRACE_ENTER(2,14,this,14,lpDDPalette);
1189 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1189+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
11901190 if(palette)
11911191 {
11921192 palette->Release();
@@ -1203,8 +1203,8 @@
12041204 HRESULT WINAPI glDirectDrawSurface7::Unlock(LPRECT lpRect)
12051205 {
12061206 TRACE_ENTER(2,14,this,26,lpRect);
1207 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1208 - if(!locked) TRACE_RET(23,DDERR_NOTLOCKED);
 1207+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1208+ if(!locked) TRACE_RET(HRESULT,23,DDERR_NOTLOCKED);
12091209 locked--;
12101210 ddsd.lpSurface = NULL;
12111211 if(((ddsd.ddsCaps.dwCaps & (DDSCAPS_FRONTBUFFER)) &&
@@ -1217,7 +1217,7 @@
12181218 HRESULT WINAPI glDirectDrawSurface7::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE7 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
12191219 {
12201220 TRACE_ENTER(6,14,this,26,lpSrcRect,14,lpDDDestSurface,26,lpDestRect,9,dwFlags,14,lpDDOverlayFx);
1221 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1221+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
12221222 FIXME("glDirectDrawSurface7::UpdateOverlay: stub\n");
12231223 TRACE_EXIT(23,DDERR_GENERIC);
12241224 ERR(DDERR_GENERIC);
@@ -1225,7 +1225,7 @@
12261226 HRESULT WINAPI glDirectDrawSurface7::UpdateOverlayDisplay(DWORD dwFlags)
12271227 {
12281228 TRACE_ENTER(2,14,this,9,dwFlags);
1229 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1229+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
12301230 FIXME("glDirectDrawSurface7::UpdateOverlayDisplay: stub\n");
12311231 TRACE_EXIT(23,DDERR_GENERIC);
12321232 ERR(DDERR_GENERIC);
@@ -1233,7 +1233,7 @@
12341234 HRESULT WINAPI glDirectDrawSurface7::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSReference)
12351235 {
12361236 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSReference);
1237 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1237+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
12381238 FIXME("glDirectDrawSurface7::UpdateOverlayZOrder: stub\n");
12391239 TRACE_EXIT(23,DDERR_GENERIC);
12401240 ERR(DDERR_GENERIC);
@@ -1249,7 +1249,7 @@
12501250 HRESULT WINAPI glDirectDrawSurface7::GetDDInterface(LPVOID FAR *lplpDD)
12511251 {
12521252 TRACE_ENTER(2,14,this,14,lplpDD);
1253 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1253+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
12541254 ddInterface->AddRef();
12551255 *lplpDD = ddInterface;
12561256 TRACE_VAR("*lplpDD",14,*lplpDD);
@@ -1259,7 +1259,7 @@
12601260 HRESULT WINAPI glDirectDrawSurface7::PageLock(DWORD dwFlags)
12611261 {
12621262 TRACE_ENTER(2,14,this,9,dwFlags);
1263 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1263+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
12641264 pagelocked++;
12651265 TRACE_EXIT(23,DD_OK);
12661266 return DD_OK;
@@ -1267,8 +1267,8 @@
12681268 HRESULT WINAPI glDirectDrawSurface7::PageUnlock(DWORD dwFlags)
12691269 {
12701270 TRACE_ENTER(2,14,this,9,dwFlags);
1271 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1272 - if(!pagelocked) TRACE_RET(23,DDERR_NOTPAGELOCKED);
 1271+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1272+ if(!pagelocked) TRACE_RET(HRESULT,23,DDERR_NOTPAGELOCKED);
12731273 pagelocked--;
12741274 TRACE_EXIT(23,DD_OK);
12751275 return DD_OK;
@@ -1277,7 +1277,7 @@
12781278 HRESULT WINAPI glDirectDrawSurface7::SetSurfaceDesc(LPDDSURFACEDESC2 lpddsd2, DWORD dwFlags)
12791279 {
12801280 TRACE_ENTER(3,14,this,14,lpddsd2,9,dwFlags);
1281 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1281+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
12821282 FIXME("glDirectDrawSurface7::SetSurfaceDesc: stub\n");
12831283 TRACE_EXIT(23,DDERR_GENERIC);
12841284 ERR(DDERR_GENERIC);
@@ -1286,7 +1286,7 @@
12871287 HRESULT WINAPI glDirectDrawSurface7::SetPrivateData(REFGUID guidTag, LPVOID lpData, DWORD cbSize, DWORD dwFlags)
12881288 {
12891289 TRACE_ENTER(5,14,this,24,&guidTag,14,lpData,8,cbSize,9,dwFlags);
1290 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1290+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
12911291 FIXME("glDirectDrawSurface7::SetPrivateData: stub\n");
12921292 TRACE_EXIT(23,DDERR_GENERIC);
12931293 ERR(DDERR_GENERIC);
@@ -1294,7 +1294,7 @@
12951295 HRESULT WINAPI glDirectDrawSurface7::GetPrivateData(REFGUID guidTag, LPVOID lpBuffer, LPDWORD lpcbBufferSize)
12961296 {
12971297 TRACE_ENTER(4,14,this,24,&guidTag,14,lpBuffer,14,lpcbBufferSize);
1298 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1298+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
12991299 FIXME("glDirectDrawSurface7::GetPrivateData: stub\n");
13001300 TRACE_EXIT(23,DDERR_GENERIC);
13011301 ERR(DDERR_GENERIC);
@@ -1302,7 +1302,7 @@
13031303 HRESULT WINAPI glDirectDrawSurface7::FreePrivateData(REFGUID guidTag)
13041304 {
13051305 TRACE_ENTER(2,14,this,24,&guidTag);
1306 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1306+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
13071307 FIXME("glDirectDrawSurface7::FreePrivateData: stub\n");
13081308 TRACE_EXIT(23,DDERR_GENERIC);
13091309 ERR(DDERR_GENERIC);
@@ -1310,7 +1310,7 @@
13111311 HRESULT WINAPI glDirectDrawSurface7::GetUniquenessValue(LPDWORD lpValue)
13121312 {
13131313 TRACE_ENTER(2,14,this,14,lpValue);
1314 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1314+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
13151315 FIXME("glDirectDrawSurface7::GetUniquenessValue: stub\n");
13161316 TRACE_EXIT(23,DDERR_GENERIC);
13171317 ERR(DDERR_GENERIC);
@@ -1318,7 +1318,7 @@
13191319 HRESULT WINAPI glDirectDrawSurface7::ChangeUniquenessValue()
13201320 {
13211321 TRACE_ENTER(1,14,this);
1322 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1322+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
13231323 FIXME("glDirectDrawSurface7::ChangeUniquenessValue: stub\n");
13241324 TRACE_EXIT(23,DDERR_GENERIC);
13251325 ERR(DDERR_GENERIC);
@@ -1327,7 +1327,7 @@
13281328 HRESULT WINAPI glDirectDrawSurface7::SetPriority(DWORD dwPriority)
13291329 {
13301330 TRACE_ENTER(2,14,this,8,dwPriority);
1331 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1331+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
13321332 FIXME("glDirectDrawSurface7::SetPriority: stub\n");
13331333 TRACE_EXIT(23,DDERR_GENERIC);
13341334 ERR(DDERR_GENERIC);
@@ -1335,7 +1335,7 @@
13361336 HRESULT WINAPI glDirectDrawSurface7::GetPriority(LPDWORD lpdwPriority)
13371337 {
13381338 TRACE_ENTER(2,14,this,14,lpdwPriority);
1339 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1339+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
13401340 FIXME("glDirectDrawSurface7::GetPriority: stub\n");
13411341 TRACE_EXIT(23,DDERR_GENERIC);
13421342 ERR(DDERR_GENERIC);
@@ -1343,7 +1343,7 @@
13441344 HRESULT WINAPI glDirectDrawSurface7::SetLOD(DWORD dwMaxLOD)
13451345 {
13461346 TRACE_ENTER(2,14,this,8,dwMaxLOD);
1347 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1347+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
13481348 FIXME("glDirectDrawSurface7::SetLOD: stub\n");
13491349 TRACE_EXIT(23,DDERR_GENERIC);
13501350 ERR(DDERR_GENERIC);
@@ -1351,7 +1351,7 @@
13521352 HRESULT WINAPI glDirectDrawSurface7::GetLOD(LPDWORD lpdwMaxLOD)
13531353 {
13541354 TRACE_ENTER(2,14,this,14,lpdwMaxLOD);
1355 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1355+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
13561356 FIXME("glDirectDrawSurface7::GetLOD: stub\n");
13571357 TRACE_EXIT(23,DDERR_GENERIC);
13581358 ERR(DDERR_GENERIC);
@@ -1359,8 +1359,8 @@
13601360 HRESULT WINAPI glDirectDrawSurface7::Unlock2(LPVOID lpSurfaceData)
13611361 {
13621362 TRACE_ENTER(2,14,this,14,lpSurfaceData);
1363 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1364 - TRACE_RET(23,Unlock((LPRECT)lpSurfaceData));
 1363+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1364+ TRACE_RET(HRESULT,23,Unlock((LPRECT)lpSurfaceData));
13651365 }
13661366 void glDirectDrawSurface7::SetFilter(int level, GLint mag, GLint min)
13671367 {
@@ -1410,11 +1410,11 @@
14111411 HRESULT glDirectDrawSurface7::GetHandle(glDirect3DDevice7 *glD3DDev7, LPD3DTEXTUREHANDLE lpHandle)
14121412 {
14131413 TRACE_ENTER(3,14,this,14,glD3DDev7,14,lpHandle);
1414 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1415 - if(!glD3DDev7) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1414+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1415+ if(!glD3DDev7) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
14161416 if(handle)
14171417 {
1418 - if(device != glD3DDev7) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1418+ if(device != glD3DDev7) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
14191419 *lpHandle = handle;
14201420 TRACE_EXIT(23,D3D_OK);
14211421 return D3D_OK;
@@ -1421,7 +1421,7 @@
14221422 }
14231423 device = glD3DDev7;
14241424 handle = device->AddTexture(this);
1425 - if(handle == -1) TRACE_RET(23,DDERR_OUTOFMEMORY);
 1425+ if(handle == -1) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
14261426 device->AddRef();
14271427 *lpHandle = handle;
14281428 TRACE_VAR("*lpHandle",9,*lpHandle);
@@ -1432,8 +1432,8 @@
14331433 HRESULT glDirectDrawSurface7::Load(glDirectDrawSurface7 *src)
14341434 {
14351435 TRACE_ENTER(2,14,this,14,src);
1436 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1437 - if(!src) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1436+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1437+ if(!src) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
14381438 this->Blt(NULL,src,NULL,DDBLT_WAIT,NULL);
14391439 ddsd.ddsCaps.dwCaps &= ~DDSCAPS_ALLOCONLOAD;
14401440 TRACE_EXIT(23,D3D_OK);
@@ -1459,7 +1459,7 @@
14601460 HRESULT WINAPI glDirectDrawSurface1::QueryInterface(REFIID riid, void** ppvObj)
14611461 {
14621462 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
1463 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1463+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
14641464 if(riid == IID_IUnknown)
14651465 {
14661466 this->AddRef();
@@ -1468,12 +1468,12 @@
14691469 TRACE_EXIT(23,DD_OK);
14701470 return DD_OK;
14711471 }
1472 - TRACE_RET(23,glDDS7->QueryInterface(riid,ppvObj));
 1472+ TRACE_RET(HRESULT,23,glDDS7->QueryInterface(riid,ppvObj));
14731473 }
14741474 ULONG WINAPI glDirectDrawSurface1::AddRef()
14751475 {
14761476 TRACE_ENTER(1,14,this);
1477 - if(!this) TRACE_RET(8,0);
 1477+ if(!this) TRACE_RET(ULONG,8,0);
14781478 refcount++;
14791479 TRACE_EXIT(8,refcount);
14801480 return refcount;
@@ -1481,7 +1481,7 @@
14821482 ULONG WINAPI glDirectDrawSurface1::Release()
14831483 {
14841484 TRACE_ENTER(1,14,this);
1485 - if(!this) TRACE_RET(8,0);
 1485+ if(!this) TRACE_RET(ULONG,8,0);
14861486 ULONG ret;
14871487 refcount--;
14881488 ret = refcount;
@@ -1492,66 +1492,66 @@
14931493 HRESULT WINAPI glDirectDrawSurface1::AddAttachedSurface(LPDIRECTDRAWSURFACE lpDDSAttachedSurface)
14941494 {
14951495 TRACE_ENTER(2,14,this,14,lpDDSAttachedSurface);
1496 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1497 - if(!lpDDSAttachedSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
1498 - TRACE_RET(23,glDDS7->AddAttachedSurface(((glDirectDrawSurface1*)lpDDSAttachedSurface)->GetDDS7()));
 1496+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1497+ if(!lpDDSAttachedSurface) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1498+ TRACE_RET(HRESULT,23,glDDS7->AddAttachedSurface(((glDirectDrawSurface1*)lpDDSAttachedSurface)->GetDDS7()));
14991499 }
15001500 HRESULT WINAPI glDirectDrawSurface1::AddOverlayDirtyRect(LPRECT lpRect)
15011501 {
15021502 TRACE_ENTER(2,14,this,26,lpRect);
1503 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1504 - TRACE_RET(23,glDDS7->AddOverlayDirtyRect(lpRect));
 1503+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1504+ TRACE_RET(HRESULT,23,glDDS7->AddOverlayDirtyRect(lpRect));
15051505 }
15061506 HRESULT WINAPI glDirectDrawSurface1::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
15071507 {
15081508 TRACE_ENTER(6,14,this,26,lpDestRect,14,lpDDSrcSurface,14,lpSrcRect,9,dwFlags,14,lpDDBltFx);
1509 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1510 - if(lpDDSrcSurface) {TRACE_RET(23,glDDS7->Blt(lpDestRect,((glDirectDrawSurface1*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx))}
1511 - else TRACE_RET(23,glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx));
 1509+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1510+ if(lpDDSrcSurface) {TRACE_RET(HRESULT,23,glDDS7->Blt(lpDestRect,((glDirectDrawSurface1*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx))}
 1511+ else TRACE_RET(HRESULT,23,glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx));
15121512 }
15131513 HRESULT WINAPI glDirectDrawSurface1::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
15141514 {
15151515 TRACE_ENTER(4,14,this,14,lpDDBltBatch,8,dwCount,9,dwFlags);
1516 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1517 - TRACE_RET(23,glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags));
 1516+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1517+ TRACE_RET(HRESULT,23,glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags));
15181518 }
15191519 HRESULT WINAPI glDirectDrawSurface1::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
15201520 {
15211521 TRACE_ENTER(6,14,this,8,dwX,8,dwY,14,lpDDSrcSurface,26,lpSrcRect,9,dwTrans);
1522 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1523 - TRACE_RET(23,glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface1*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans));
 1522+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1523+ TRACE_RET(HRESULT,23,glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface1*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans));
15241524 }
15251525 HRESULT WINAPI glDirectDrawSurface1::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSAttachedSurface)
15261526 {
15271527 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSAttachedSurface);
1528 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1529 - TRACE_RET(23,glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface));
 1528+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1529+ TRACE_RET(HRESULT,23,glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface));
15301530 }
15311531 HRESULT WINAPI glDirectDrawSurface1::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
15321532 {
15331533 TRACE_ENTER(3,14,this,14,lpContext,14,lpEnumSurfacesCallback);
1534 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1535 - TRACE_RET(23,glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback));
 1534+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1535+ TRACE_RET(HRESULT,23,glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback));
15361536 }
15371537 HRESULT WINAPI glDirectDrawSurface1::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
15381538 {
15391539 TRACE_ENTER(4,14,this,9,dwFlags,14,lpContext,14,lpfnCallback);
1540 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1541 - TRACE_RET(23,glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback));
 1540+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1541+ TRACE_RET(HRESULT,23,glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback));
15421542 }
15431543 HRESULT WINAPI glDirectDrawSurface1::Flip(LPDIRECTDRAWSURFACE lpDDSurfaceTargetOverride, DWORD dwFlags)
15441544 {
15451545 TRACE_ENTER(3,14,this,14,lpDDSurfaceTargetOverride,9,dwFlags);
1546 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1546+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
15471547 if(lpDDSurfaceTargetOverride)
1548 - {TRACE_RET(23,glDDS7->Flip(((glDirectDrawSurface1*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags));}
1549 - else TRACE_RET(23,glDDS7->Flip(NULL,dwFlags));
 1548+ {TRACE_RET(HRESULT,23,glDDS7->Flip(((glDirectDrawSurface1*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags));}
 1549+ else TRACE_RET(HRESULT,23,glDDS7->Flip(NULL,dwFlags));
15501550 }
15511551 HRESULT WINAPI glDirectDrawSurface1::GetAttachedSurface(LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE FAR *lplpDDAttachedSurface)
15521552 {
15531553 TRACE_ENTER(3,14,this,14,lpDDSCaps,14,lplpDDAttachedSurface);
1554 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1555 - if(!lpDDSCaps) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1554+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1555+ if(!lpDDSCaps) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
15561556 HRESULT error;
15571557 glDirectDrawSurface7 *attachedsurface;
15581558 glDirectDrawSurface1 *attached1;
@@ -1572,14 +1572,14 @@
15731573 HRESULT WINAPI glDirectDrawSurface1::GetBltStatus(DWORD dwFlags)
15741574 {
15751575 TRACE_ENTER(2,14,this,9,dwFlags);
1576 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1577 - TRACE_RET(23,glDDS7->GetBltStatus(dwFlags));
 1576+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1577+ TRACE_RET(HRESULT,23,glDDS7->GetBltStatus(dwFlags));
15781578 }
15791579 HRESULT WINAPI glDirectDrawSurface1::GetCaps(LPDDSCAPS lpDDSCaps)
15801580 {
15811581 TRACE_ENTER(2,14,this,14,lpDDSCaps);
1582 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1583 - if(!lpDDSCaps) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1582+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1583+ if(!lpDDSCaps) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
15841584 HRESULT error;
15851585 DDSCAPS2 ddsCaps1;
15861586 error = glDDS7->GetCaps(&ddsCaps1);
@@ -1591,55 +1591,55 @@
15921592 HRESULT WINAPI glDirectDrawSurface1::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
15931593 {
15941594 TRACE_ENTER(2,14,this,14,lplpDDClipper);
1595 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1596 - TRACE_RET(23,glDDS7->GetClipper(lplpDDClipper));
 1595+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1596+ TRACE_RET(HRESULT,23,glDDS7->GetClipper(lplpDDClipper));
15971597 }
15981598 HRESULT WINAPI glDirectDrawSurface1::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
15991599 {
16001600 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
1601 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1602 - TRACE_RET(23,glDDS7->GetColorKey(dwFlags,lpDDColorKey));
 1601+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1602+ TRACE_RET(HRESULT,23,glDDS7->GetColorKey(dwFlags,lpDDColorKey));
16031603 }
16041604 HRESULT WINAPI glDirectDrawSurface1::GetDC(HDC FAR *lphDC)
16051605 {
16061606 TRACE_ENTER(2,14,this,14,lphDC);
1607 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1608 - TRACE_RET(23,glDDS7->GetDC(lphDC));
 1607+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1608+ TRACE_RET(HRESULT,23,glDDS7->GetDC(lphDC));
16091609 }
16101610 HRESULT WINAPI glDirectDrawSurface1::GetFlipStatus(DWORD dwFlags)
16111611 {
16121612 TRACE_ENTER(2,14,this,9,dwFlags);
1613 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1614 - TRACE_RET(23,glDDS7->GetFlipStatus(dwFlags));
 1613+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1614+ TRACE_RET(HRESULT,23,glDDS7->GetFlipStatus(dwFlags));
16151615 }
16161616 HRESULT WINAPI glDirectDrawSurface1::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
16171617 {
16181618 TRACE_ENTER(3,14,this,14,lplX,14,lplY);
1619 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1620 - TRACE_RET(23,glDDS7->GetOverlayPosition(lplX,lplY));
 1619+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1620+ TRACE_RET(HRESULT,23,glDDS7->GetOverlayPosition(lplX,lplY));
16211621 }
16221622 HRESULT WINAPI glDirectDrawSurface1::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
16231623 {
16241624 TRACE_ENTER(2,14,this,14,lplpDDPalette);
1625 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1626 - TRACE_RET(23,glDDS7->GetPalette(lplpDDPalette));
 1625+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1626+ TRACE_RET(HRESULT,23,glDDS7->GetPalette(lplpDDPalette));
16271627 }
16281628 HRESULT WINAPI glDirectDrawSurface1::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
16291629 {
16301630 TRACE_ENTER(2,14,this,14,lpDDPixelFormat);
1631 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1632 - TRACE_RET(23,glDDS7->GetPixelFormat(lpDDPixelFormat));
 1631+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1632+ TRACE_RET(HRESULT,23,glDDS7->GetPixelFormat(lpDDPixelFormat));
16331633 }
16341634 HRESULT WINAPI glDirectDrawSurface1::GetSurfaceDesc(LPDDSURFACEDESC lpDDSurfaceDesc)
16351635 {
16361636 TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc);
1637 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1638 - TRACE_RET(23,glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc));
 1637+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1638+ TRACE_RET(HRESULT,23,glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc));
16391639 }
16401640 HRESULT WINAPI glDirectDrawSurface1::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc)
16411641 {
16421642 TRACE_ENTER(3,14,this,14,lpDD,14,lpDDSurfaceDesc);
1643 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1643+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
16441644 TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
16451645 return DDERR_ALREADYINITIALIZED;
16461646 }
@@ -1646,74 +1646,74 @@
16471647 HRESULT WINAPI glDirectDrawSurface1::IsLost()
16481648 {
16491649 TRACE_ENTER(1,14,this);
1650 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1651 - TRACE_RET(23,glDDS7->IsLost());
 1650+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1651+ TRACE_RET(HRESULT,23,glDDS7->IsLost());
16521652 }
16531653 HRESULT WINAPI glDirectDrawSurface1::Lock(LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
16541654 {
16551655 TRACE_ENTER(5,14,this,26,lpDestRect,14,lpDDSurfaceDesc,9,dwFlags,14,hEvent);
1656 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1657 - TRACE_RET(23,glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent));
 1656+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1657+ TRACE_RET(HRESULT,23,glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent));
16581658 }
16591659 HRESULT WINAPI glDirectDrawSurface1::ReleaseDC(HDC hDC)
16601660 {
16611661 TRACE_ENTER(2,14,this,14,hDC);
1662 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1663 - TRACE_RET(23,glDDS7->ReleaseDC(hDC));
 1662+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1663+ TRACE_RET(HRESULT,23,glDDS7->ReleaseDC(hDC));
16641664 }
16651665 HRESULT WINAPI glDirectDrawSurface1::Restore()
16661666 {
16671667 TRACE_ENTER(1,14,this);
1668 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1669 - TRACE_RET(23,glDDS7->Restore());
 1668+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1669+ TRACE_RET(HRESULT,23,glDDS7->Restore());
16701670 }
16711671 HRESULT WINAPI glDirectDrawSurface1::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
16721672 {
16731673 TRACE_ENTER(2,14,this,14,lpDDClipper);
1674 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1675 - TRACE_RET(23,glDDS7->SetClipper(lpDDClipper));
 1674+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1675+ TRACE_RET(HRESULT,23,glDDS7->SetClipper(lpDDClipper));
16761676 }
16771677 HRESULT WINAPI glDirectDrawSurface1::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
16781678 {
16791679 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
1680 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1681 - TRACE_RET(23,glDDS7->SetColorKey(dwFlags,lpDDColorKey));
 1680+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1681+ TRACE_RET(HRESULT,23,glDDS7->SetColorKey(dwFlags,lpDDColorKey));
16821682 }
16831683 HRESULT WINAPI glDirectDrawSurface1::SetOverlayPosition(LONG lX, LONG lY)
16841684 {
16851685 TRACE_ENTER(3,14,this,7,lX,7,lY);
1686 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1687 - TRACE_RET(23,glDDS7->SetOverlayPosition(lX,lY));
 1686+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1687+ TRACE_RET(HRESULT,23,glDDS7->SetOverlayPosition(lX,lY));
16881688 }
16891689 HRESULT WINAPI glDirectDrawSurface1::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
16901690 {
16911691 TRACE_ENTER(2,14,this,14,lpDDPalette);
1692 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1693 - TRACE_RET(23,glDDS7->SetPalette(lpDDPalette));
 1692+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1693+ TRACE_RET(HRESULT,23,glDDS7->SetPalette(lpDDPalette));
16941694 }
16951695 HRESULT WINAPI glDirectDrawSurface1::Unlock(LPVOID lpSurfaceData)
16961696 {
16971697 TRACE_ENTER(2,14,this,14,lpSurfaceData);
1698 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1699 - TRACE_RET(23,glDDS7->Unlock2(lpSurfaceData));
 1698+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1699+ TRACE_RET(HRESULT,23,glDDS7->Unlock2(lpSurfaceData));
17001700 }
17011701 HRESULT WINAPI glDirectDrawSurface1::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
17021702 {
17031703 TRACE_ENTER(6,14,this,26,lpSrcRect,14,lpDDDestSurface,26,lpDestRect,9,dwFlags,14,lpDDOverlayFx);
1704 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1705 - TRACE_RET(23,glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx));
 1704+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1705+ TRACE_RET(HRESULT,23,glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx));
17061706 }
17071707 HRESULT WINAPI glDirectDrawSurface1::UpdateOverlayDisplay(DWORD dwFlags)
17081708 {
17091709 TRACE_ENTER(2,14,this,9,dwFlags);
1710 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1711 - TRACE_RET(23,glDDS7->UpdateOverlayDisplay(dwFlags));
 1710+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1711+ TRACE_RET(HRESULT,23,glDDS7->UpdateOverlayDisplay(dwFlags));
17121712 }
17131713 HRESULT WINAPI glDirectDrawSurface1::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSReference)
17141714 {
17151715 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSReference);
1716 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1717 - TRACE_RET(23,glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference));
 1716+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1717+ TRACE_RET(HRESULT,23,glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference));
17181718 }
17191719
17201720 // DDRAW2 wrapper
@@ -1734,7 +1734,7 @@
17351735 HRESULT WINAPI glDirectDrawSurface2::QueryInterface(REFIID riid, void** ppvObj)
17361736 {
17371737 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
1738 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1738+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
17391739 if(riid == IID_IUnknown)
17401740 {
17411741 this->AddRef();
@@ -1742,12 +1742,12 @@
17431743 TRACE_EXIT(23,DD_OK);
17441744 return DD_OK;
17451745 }
1746 - TRACE_RET(23,glDDS7->QueryInterface(riid,ppvObj));
 1746+ TRACE_RET(HRESULT,23,glDDS7->QueryInterface(riid,ppvObj));
17471747 }
17481748 ULONG WINAPI glDirectDrawSurface2::AddRef()
17491749 {
17501750 TRACE_ENTER(1,14,this);
1751 - if(!this) TRACE_RET(8,0);
 1751+ if(!this) TRACE_RET(ULONG,8,0);
17521752 refcount++;
17531753 TRACE_EXIT(8,refcount);
17541754 return refcount;
@@ -1755,7 +1755,7 @@
17561756 ULONG WINAPI glDirectDrawSurface2::Release()
17571757 {
17581758 TRACE_ENTER(1,14,this);
1759 - if(!this) TRACE_RET(8,0);
 1759+ if(!this) TRACE_RET(ULONG,8,0);
17601760 ULONG ret;
17611761 refcount--;
17621762 ret = refcount;
@@ -1766,65 +1766,65 @@
17671767 HRESULT WINAPI glDirectDrawSurface2::AddAttachedSurface(LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface)
17681768 {
17691769 TRACE_ENTER(2,14,this,14,lpDDSAttachedSurface);
1770 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1771 - if(!lpDDSAttachedSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
1772 - TRACE_RET(23,glDDS7->AddAttachedSurface(((glDirectDrawSurface2*)lpDDSAttachedSurface)->GetDDS7()));
 1770+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1771+ if(!lpDDSAttachedSurface) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1772+ TRACE_RET(HRESULT,23,glDDS7->AddAttachedSurface(((glDirectDrawSurface2*)lpDDSAttachedSurface)->GetDDS7()));
17731773 }
17741774 HRESULT WINAPI glDirectDrawSurface2::AddOverlayDirtyRect(LPRECT lpRect)
17751775 {
17761776 TRACE_ENTER(2,14,this,26,lpRect);
1777 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1778 - TRACE_RET(23,glDDS7->AddOverlayDirtyRect(lpRect));
 1777+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1778+ TRACE_RET(HRESULT,23,glDDS7->AddOverlayDirtyRect(lpRect));
17791779 }
17801780 HRESULT WINAPI glDirectDrawSurface2::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
17811781 {
17821782 TRACE_ENTER(6,14,this,26,lpDestRect,14,lpDDSrcSurface,26,lpSrcRect,9,dwFlags,14,lpDDBltFx);
1783 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1784 - if(lpDDSrcSurface) {TRACE_RET(23,glDDS7->Blt(lpDestRect,((glDirectDrawSurface2*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx));}
1785 - else TRACE_RET(23,glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx));
 1783+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1784+ if(lpDDSrcSurface) {TRACE_RET(HRESULT,23,glDDS7->Blt(lpDestRect,((glDirectDrawSurface2*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx));}
 1785+ else TRACE_RET(HRESULT,23,glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx));
17861786 }
17871787 HRESULT WINAPI glDirectDrawSurface2::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
17881788 {
17891789 TRACE_ENTER(4,14,this,14,lpDDBltBatch,8,dwCount,9,dwFlags);
1790 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1791 - TRACE_RET(23,glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags));
 1790+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1791+ TRACE_RET(HRESULT,23,glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags));
17921792 }
17931793 HRESULT WINAPI glDirectDrawSurface2::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
17941794 {
17951795 TRACE_ENTER(6,14,this,8,dwX,8,dwY,4,lpDDSrcSurface,26,lpSrcRect,9,dwTrans);
1796 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1797 - TRACE_RET(23,glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface2*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans));
 1796+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1797+ TRACE_RET(HRESULT,23,glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface2*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans));
17981798 }
17991799 HRESULT WINAPI glDirectDrawSurface2::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface)
18001800 {
18011801 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSAttachedSurface);
1802 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1803 - TRACE_RET(23,glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface));
 1802+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1803+ TRACE_RET(HRESULT,23,glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface));
18041804 }
18051805 HRESULT WINAPI glDirectDrawSurface2::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
18061806 {
18071807 TRACE_ENTER(3,14,this,14,lpContext,14,lpEnumSurfacesCallback);
1808 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1809 - TRACE_RET(23,glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback));
 1808+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1809+ TRACE_RET(HRESULT,23,glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback));
18101810 }
18111811 HRESULT WINAPI glDirectDrawSurface2::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
18121812 {
18131813 TRACE_ENTER(4,14,this,9,dwFlags,14,lpContext,14,lpfnCallback);
1814 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1815 - TRACE_RET(23,glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback));
 1814+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1815+ TRACE_RET(HRESULT,23,glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback));
18161816 }
18171817 HRESULT WINAPI glDirectDrawSurface2::Flip(LPDIRECTDRAWSURFACE2 lpDDSurfaceTargetOverride, DWORD dwFlags)
18181818 {
18191819 TRACE_ENTER(3,14,this,14,lpDDSurfaceTargetOverride,9,dwFlags);
1820 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1820+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
18211821 if(lpDDSurfaceTargetOverride)
1822 - {TRACE_RET(23,glDDS7->Flip(((glDirectDrawSurface2*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags));}
1823 - else TRACE_RET(23,glDDS7->Flip(NULL,dwFlags));
 1822+ {TRACE_RET(HRESULT,23,glDDS7->Flip(((glDirectDrawSurface2*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags));}
 1823+ else TRACE_RET(HRESULT,23,glDDS7->Flip(NULL,dwFlags));
18241824 }
18251825 HRESULT WINAPI glDirectDrawSurface2::GetAttachedSurface(LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE2 FAR *lplpDDAttachedSurface)
18261826 {
18271827 TRACE_ENTER(3,14,this,14,lpDDSCaps,14,lplpDDAttachedSurface);
1828 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1828+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
18291829 HRESULT error;
18301830 glDirectDrawSurface7 *attachedsurface;
18311831 glDirectDrawSurface2 *attached1;
@@ -1845,14 +1845,14 @@
18461846 HRESULT WINAPI glDirectDrawSurface2::GetBltStatus(DWORD dwFlags)
18471847 {
18481848 TRACE_ENTER(2,14,this,9,dwFlags);
1849 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1850 - TRACE_RET(23,glDDS7->GetBltStatus(dwFlags));
 1849+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1850+ TRACE_RET(HRESULT,23,glDDS7->GetBltStatus(dwFlags));
18511851 }
18521852 HRESULT WINAPI glDirectDrawSurface2::GetCaps(LPDDSCAPS lpDDSCaps)
18531853 {
18541854 TRACE_ENTER(2,14,this,14,lpDDSCaps);
1855 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1856 - if(!lpDDSCaps) TRACE_RET(23,DDERR_INVALIDPARAMS);
 1855+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1856+ if(!lpDDSCaps) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
18571857 HRESULT error;
18581858 DDSCAPS2 ddsCaps1;
18591859 error = glDDS7->GetCaps(&ddsCaps1);
@@ -1864,55 +1864,55 @@
18651865 HRESULT WINAPI glDirectDrawSurface2::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
18661866 {
18671867 TRACE_ENTER(2,14,this,14,lplpDDClipper);
1868 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1869 - TRACE_RET(23,glDDS7->GetClipper(lplpDDClipper));
 1868+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1869+ TRACE_RET(HRESULT,23,glDDS7->GetClipper(lplpDDClipper));
18701870 }
18711871 HRESULT WINAPI glDirectDrawSurface2::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
18721872 {
18731873 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
1874 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1875 - TRACE_RET(23,glDDS7->GetColorKey(dwFlags,lpDDColorKey));
 1874+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1875+ TRACE_RET(HRESULT,23,glDDS7->GetColorKey(dwFlags,lpDDColorKey));
18761876 }
18771877 HRESULT WINAPI glDirectDrawSurface2::GetDC(HDC FAR *lphDC)
18781878 {
18791879 TRACE_ENTER(2,14,this,14,lphDC);
1880 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1881 - TRACE_RET(23,glDDS7->GetDC(lphDC));
 1880+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1881+ TRACE_RET(HRESULT,23,glDDS7->GetDC(lphDC));
18821882 }
18831883 HRESULT WINAPI glDirectDrawSurface2::GetFlipStatus(DWORD dwFlags)
18841884 {
18851885 TRACE_ENTER(2,14,this,9,dwFlags);
1886 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1887 - TRACE_RET(23,glDDS7->GetFlipStatus(dwFlags));
 1886+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1887+ TRACE_RET(HRESULT,23,glDDS7->GetFlipStatus(dwFlags));
18881888 }
18891889 HRESULT WINAPI glDirectDrawSurface2::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
18901890 {
18911891 TRACE_ENTER(3,14,this,14,lplX,14,lplY);
1892 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1893 - TRACE_RET(23,glDDS7->GetOverlayPosition(lplX,lplY));
 1892+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1893+ TRACE_RET(HRESULT,23,glDDS7->GetOverlayPosition(lplX,lplY));
18941894 }
18951895 HRESULT WINAPI glDirectDrawSurface2::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
18961896 {
18971897 TRACE_ENTER(2,14,this,14,lplpDDPalette);
1898 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1899 - TRACE_RET(23,glDDS7->GetPalette(lplpDDPalette));
 1898+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1899+ TRACE_RET(HRESULT,23,glDDS7->GetPalette(lplpDDPalette));
19001900 }
19011901 HRESULT WINAPI glDirectDrawSurface2::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
19021902 {
19031903 TRACE_ENTER(2,14,this,14,lpDDPixelFormat);
1904 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1905 - TRACE_RET(23,glDDS7->GetPixelFormat(lpDDPixelFormat));
 1904+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1905+ TRACE_RET(HRESULT,23,glDDS7->GetPixelFormat(lpDDPixelFormat));
19061906 }
19071907 HRESULT WINAPI glDirectDrawSurface2::GetSurfaceDesc(LPDDSURFACEDESC lpDDSurfaceDesc)
19081908 {
19091909 TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc);
1910 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1911 - TRACE_RET(23,glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc));
 1910+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1911+ TRACE_RET(HRESULT,23,glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc));
19121912 }
19131913 HRESULT WINAPI glDirectDrawSurface2::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc)
19141914 {
19151915 TRACE_ENTER(3,14,this,14,lpDD,14,lpDDSurfaceDesc);
1916 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1916+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
19171917 TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
19181918 return DDERR_ALREADYINITIALIZED;
19191919 }
@@ -1919,98 +1919,98 @@
19201920 HRESULT WINAPI glDirectDrawSurface2::IsLost()
19211921 {
19221922 TRACE_ENTER(1,14,this);
1923 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1924 - TRACE_RET(23,glDDS7->IsLost());
 1923+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1924+ TRACE_RET(HRESULT,23,glDDS7->IsLost());
19251925 }
19261926 HRESULT WINAPI glDirectDrawSurface2::Lock(LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
19271927 {
19281928 TRACE_ENTER(5,14,this,26,lpDestRect,14,lpDDSurfaceDesc,9,dwFlags,14,hEvent);
1929 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1930 - TRACE_RET(23,glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent));
 1929+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1930+ TRACE_RET(HRESULT,23,glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent));
19311931 }
19321932 HRESULT WINAPI glDirectDrawSurface2::ReleaseDC(HDC hDC)
19331933 {
19341934 TRACE_ENTER(2,14,this,14,hDC);
1935 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1936 - TRACE_RET(23,glDDS7->ReleaseDC(hDC));
 1935+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1936+ TRACE_RET(HRESULT,23,glDDS7->ReleaseDC(hDC));
19371937 }
19381938 HRESULT WINAPI glDirectDrawSurface2::Restore()
19391939 {
19401940 TRACE_ENTER(1,14,this);
1941 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1942 - TRACE_RET(23,glDDS7->Restore());
 1941+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1942+ TRACE_RET(HRESULT,23,glDDS7->Restore());
19431943 }
19441944 HRESULT WINAPI glDirectDrawSurface2::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
19451945 {
19461946 TRACE_ENTER(2,14,this,14,lpDDClipper);
1947 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1948 - TRACE_RET(23,glDDS7->SetClipper(lpDDClipper));
 1947+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1948+ TRACE_RET(HRESULT,23,glDDS7->SetClipper(lpDDClipper));
19491949 }
19501950 HRESULT WINAPI glDirectDrawSurface2::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
19511951 {
19521952 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
1953 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1954 - TRACE_RET(23,glDDS7->SetColorKey(dwFlags,lpDDColorKey));
 1953+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1954+ TRACE_RET(HRESULT,23,glDDS7->SetColorKey(dwFlags,lpDDColorKey));
19551955 }
19561956 HRESULT WINAPI glDirectDrawSurface2::SetOverlayPosition(LONG lX, LONG lY)
19571957 {
19581958 TRACE_ENTER(3,14,this,7,lX,7,lY);
1959 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1960 - TRACE_RET(23,glDDS7->SetOverlayPosition(lX,lY));
 1959+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1960+ TRACE_RET(HRESULT,23,glDDS7->SetOverlayPosition(lX,lY));
19611961 }
19621962 HRESULT WINAPI glDirectDrawSurface2::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
19631963 {
19641964 TRACE_ENTER(2,14,this,14,lpDDPalette);
1965 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1966 - TRACE_RET(23,glDDS7->SetPalette(lpDDPalette));
 1965+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1966+ TRACE_RET(HRESULT,23,glDDS7->SetPalette(lpDDPalette));
19671967 }
19681968 HRESULT WINAPI glDirectDrawSurface2::Unlock(LPVOID lpSurfaceData)
19691969 {
19701970 TRACE_ENTER(2,14,this,14,lpSurfaceData);
1971 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1972 - TRACE_RET(23,glDDS7->Unlock2(lpSurfaceData));
 1971+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1972+ TRACE_RET(HRESULT,23,glDDS7->Unlock2(lpSurfaceData));
19731973 }
19741974 HRESULT WINAPI glDirectDrawSurface2::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE2 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
19751975 {
19761976 TRACE_ENTER(6,14,this,26,lpSrcRect,14,lpDDDestSurface,26,lpDestRect,9,dwFlags,14,lpDDOverlayFx);
1977 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1978 - TRACE_RET(23,glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx));
 1977+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1978+ TRACE_RET(HRESULT,23,glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx));
19791979 }
19801980 HRESULT WINAPI glDirectDrawSurface2::UpdateOverlayDisplay(DWORD dwFlags)
19811981 {
19821982 TRACE_ENTER(2,14,this,9,dwFlags);
1983 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1984 - TRACE_RET(23,glDDS7->UpdateOverlayDisplay(dwFlags));
 1983+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1984+ TRACE_RET(HRESULT,23,glDDS7->UpdateOverlayDisplay(dwFlags));
19851985 }
19861986 HRESULT WINAPI glDirectDrawSurface2::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSReference)
19871987 {
19881988 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSReference);
1989 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
1990 - TRACE_RET(23,glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference));
 1989+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 1990+ TRACE_RET(HRESULT,23,glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference));
19911991 }
19921992 HRESULT WINAPI glDirectDrawSurface2::GetDDInterface(LPVOID FAR *lplpDD)
19931993 {
19941994 TRACE_ENTER(2,14,this,14,lplpDD);
1995 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 1995+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
19961996 glDirectDraw7 *glDD7;
19971997 HRESULT ret = glDDS7->GetDDInterface((void**)&glDD7);
1998 - if(ret != DD_OK) TRACE_RET(23,ret);
 1998+ if(ret != DD_OK) TRACE_RET(HRESULT,23,ret);
19991999 glDD7->QueryInterface(IID_IDirectDraw,lplpDD);
20002000 glDD7->Release();
20012001 TRACE_VAR("*lplpDD",14,*lplpDD);
2002 - TRACE_RET(23,ret);
 2002+ TRACE_RET(HRESULT,23,ret);
20032003 }
20042004 HRESULT WINAPI glDirectDrawSurface2::PageLock(DWORD dwFlags)
20052005 {
20062006 TRACE_ENTER(2,14,this,9,dwFlags);
2007 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2008 - TRACE_RET(23,glDDS7->PageLock(dwFlags));
 2007+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2008+ TRACE_RET(HRESULT,23,glDDS7->PageLock(dwFlags));
20092009 }
20102010 HRESULT WINAPI glDirectDrawSurface2::PageUnlock(DWORD dwFlags)
20112011 {
20122012 TRACE_ENTER(2,14,this,9,dwFlags);
2013 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2014 - TRACE_RET(23,glDDS7->PageUnlock(dwFlags));
 2013+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2014+ TRACE_RET(HRESULT,23,glDDS7->PageUnlock(dwFlags));
20152015 }
20162016
20172017 // DDRAW3 wrapper
@@ -2031,7 +2031,7 @@
20322032 HRESULT WINAPI glDirectDrawSurface3::QueryInterface(REFIID riid, void** ppvObj)
20332033 {
20342034 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
2035 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2035+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
20362036 if(riid == IID_IUnknown)
20372037 {
20382038 this->AddRef();
@@ -2040,7 +2040,7 @@
20412041 TRACE_EXIT(23,DD_OK);
20422042 return DD_OK;
20432043 }
2044 - TRACE_RET(23,glDDS7->QueryInterface(riid,ppvObj));
 2044+ TRACE_RET(HRESULT,23,glDDS7->QueryInterface(riid,ppvObj));
20452045 }
20462046 ULONG WINAPI glDirectDrawSurface3::AddRef()
20472047 {
@@ -2064,65 +2064,65 @@
20652065 HRESULT WINAPI glDirectDrawSurface3::AddAttachedSurface(LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface)
20662066 {
20672067 TRACE_ENTER(2,14,this,14,lpDDSAttachedSurface);
2068 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2069 - if(!lpDDSAttachedSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
2070 - TRACE_RET(23,glDDS7->AddAttachedSurface(((glDirectDrawSurface3*)lpDDSAttachedSurface)->GetDDS7()));
 2068+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2069+ if(!lpDDSAttachedSurface) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 2070+ TRACE_RET(HRESULT,23,glDDS7->AddAttachedSurface(((glDirectDrawSurface3*)lpDDSAttachedSurface)->GetDDS7()));
20712071 }
20722072 HRESULT WINAPI glDirectDrawSurface3::AddOverlayDirtyRect(LPRECT lpRect)
20732073 {
20742074 TRACE_ENTER(2,14,this,26,lpRect);
2075 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2076 - TRACE_RET(23,glDDS7->AddOverlayDirtyRect(lpRect));
 2075+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2076+ TRACE_RET(HRESULT,23,glDDS7->AddOverlayDirtyRect(lpRect));
20772077 }
20782078 HRESULT WINAPI glDirectDrawSurface3::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
20792079 {
20802080 TRACE_ENTER(6,14,this,26,lpDestRect,14,lpDDSrcSurface,26,lpSrcRect,9,dwFlags,14,lpDDBltFx);
2081 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2082 - if(lpDDSrcSurface) {TRACE_RET(23,glDDS7->Blt(lpDestRect,((glDirectDrawSurface3*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx));}
2083 - else TRACE_RET(23,glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx));
 2081+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2082+ if(lpDDSrcSurface) {TRACE_RET(HRESULT,23,glDDS7->Blt(lpDestRect,((glDirectDrawSurface3*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx));}
 2083+ else TRACE_RET(HRESULT,23,glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx));
20842084 }
20852085 HRESULT WINAPI glDirectDrawSurface3::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
20862086 {
20872087 TRACE_ENTER(4,14,this,14,lpDDBltBatch,8,dwCount,9,dwFlags);
2088 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2089 - TRACE_RET(23,glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags));
 2088+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2089+ TRACE_RET(HRESULT,23,glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags));
20902090 }
20912091 HRESULT WINAPI glDirectDrawSurface3::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
20922092 {
20932093 TRACE_ENTER(6,14,this,8,dwX,8,dwY,14,lpDDSrcSurface,26,lpSrcRect,9,dwTrans);
2094 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2095 - TRACE_RET(23,glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface3*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans));
 2094+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2095+ TRACE_RET(HRESULT,23,glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface3*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans));
20962096 }
20972097 HRESULT WINAPI glDirectDrawSurface3::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface)
20982098 {
20992099 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSAttachedSurface);
2100 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2101 - TRACE_RET(23,glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface));
 2100+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2101+ TRACE_RET(HRESULT,23,glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface));
21022102 }
21032103 HRESULT WINAPI glDirectDrawSurface3::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
21042104 {
21052105 TRACE_ENTER(3,14,this,14,lpContext,14,lpEnumSurfacesCallback);
2106 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2107 - TRACE_RET(23,glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback));
 2106+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2107+ TRACE_RET(HRESULT,23,glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback));
21082108 }
21092109 HRESULT WINAPI glDirectDrawSurface3::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
21102110 {
21112111 TRACE_ENTER(4,14,this,9,dwFlags,14,lpContext,14,lpfnCallback);
2112 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2113 - TRACE_RET(23,glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback));
 2112+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2113+ TRACE_RET(HRESULT,23,glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback));
21142114 }
21152115 HRESULT WINAPI glDirectDrawSurface3::Flip(LPDIRECTDRAWSURFACE3 lpDDSurfaceTargetOverride, DWORD dwFlags)
21162116 {
21172117 TRACE_ENTER(3,14,this,14,lpDDSurfaceTargetOverride,9,dwFlags);
2118 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2118+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
21192119 if(lpDDSurfaceTargetOverride)
2120 - {TRACE_RET(23,glDDS7->Flip(((glDirectDrawSurface3*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags));}
2121 - else TRACE_RET(23,glDDS7->Flip(NULL,dwFlags));
 2120+ {TRACE_RET(HRESULT,23,glDDS7->Flip(((glDirectDrawSurface3*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags));}
 2121+ else TRACE_RET(HRESULT,23,glDDS7->Flip(NULL,dwFlags));
21222122 }
21232123 HRESULT WINAPI glDirectDrawSurface3::GetAttachedSurface(LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE3 FAR *lplpDDAttachedSurface)
21242124 {
21252125 TRACE_ENTER(3,14,this,14,lpDDSCaps,14,lplpDDAttachedSurface);
2126 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2126+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
21272127 HRESULT error;
21282128 glDirectDrawSurface7 *attachedsurface;
21292129 glDirectDrawSurface3 *attached1;
@@ -2143,14 +2143,14 @@
21442144 HRESULT WINAPI glDirectDrawSurface3::GetBltStatus(DWORD dwFlags)
21452145 {
21462146 TRACE_ENTER(2,14,this,9,dwFlags);
2147 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2148 - TRACE_RET(23,glDDS7->GetBltStatus(dwFlags));
 2147+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2148+ TRACE_RET(HRESULT,23,glDDS7->GetBltStatus(dwFlags));
21492149 }
21502150 HRESULT WINAPI glDirectDrawSurface3::GetCaps(LPDDSCAPS lpDDSCaps)
21512151 {
21522152 TRACE_ENTER(2,14,this,14,lpDDSCaps);
2153 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2154 - if(!lpDDSCaps) TRACE_RET(23,DDERR_INVALIDPARAMS);
 2153+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2154+ if(!lpDDSCaps) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
21552155 HRESULT error;
21562156 DDSCAPS2 ddsCaps1;
21572157 error = glDDS7->GetCaps(&ddsCaps1);
@@ -2162,55 +2162,55 @@
21632163 HRESULT WINAPI glDirectDrawSurface3::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
21642164 {
21652165 TRACE_ENTER(2,14,this,14,lplpDDClipper);
2166 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2167 - TRACE_RET(23,glDDS7->GetClipper(lplpDDClipper));
 2166+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2167+ TRACE_RET(HRESULT,23,glDDS7->GetClipper(lplpDDClipper));
21682168 }
21692169 HRESULT WINAPI glDirectDrawSurface3::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
21702170 {
21712171 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
2172 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2173 - TRACE_RET(23,glDDS7->GetColorKey(dwFlags,lpDDColorKey));
 2172+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2173+ TRACE_RET(HRESULT,23,glDDS7->GetColorKey(dwFlags,lpDDColorKey));
21742174 }
21752175 HRESULT WINAPI glDirectDrawSurface3::GetDC(HDC FAR *lphDC)
21762176 {
21772177 TRACE_ENTER(2,14,this,14,lphDC);
2178 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2179 - TRACE_RET(23,glDDS7->GetDC(lphDC));
 2178+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2179+ TRACE_RET(HRESULT,23,glDDS7->GetDC(lphDC));
21802180 }
21812181 HRESULT WINAPI glDirectDrawSurface3::GetFlipStatus(DWORD dwFlags)
21822182 {
21832183 TRACE_ENTER(2,14,this,9,dwFlags);
2184 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2185 - TRACE_RET(23,glDDS7->GetFlipStatus(dwFlags));
 2184+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2185+ TRACE_RET(HRESULT,23,glDDS7->GetFlipStatus(dwFlags));
21862186 }
21872187 HRESULT WINAPI glDirectDrawSurface3::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
21882188 {
21892189 TRACE_ENTER(3,14,this,14,lplX,14,lplY);
2190 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2191 - TRACE_RET(23,glDDS7->GetOverlayPosition(lplX,lplY));
 2190+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2191+ TRACE_RET(HRESULT,23,glDDS7->GetOverlayPosition(lplX,lplY));
21922192 }
21932193 HRESULT WINAPI glDirectDrawSurface3::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
21942194 {
21952195 TRACE_ENTER(2,14,this,14,lplpDDPalette);
2196 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2197 - TRACE_RET(23,glDDS7->GetPalette(lplpDDPalette));
 2196+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2197+ TRACE_RET(HRESULT,23,glDDS7->GetPalette(lplpDDPalette));
21982198 }
21992199 HRESULT WINAPI glDirectDrawSurface3::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
22002200 {
22012201 TRACE_ENTER(2,14,this,14,lpDDPixelFormat);
2202 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2203 - TRACE_RET(23,glDDS7->GetPixelFormat(lpDDPixelFormat));
 2202+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2203+ TRACE_RET(HRESULT,23,glDDS7->GetPixelFormat(lpDDPixelFormat));
22042204 }
22052205 HRESULT WINAPI glDirectDrawSurface3::GetSurfaceDesc(LPDDSURFACEDESC lpDDSurfaceDesc)
22062206 {
22072207 TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc);
2208 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2209 - TRACE_RET(23,glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc));
 2208+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2209+ TRACE_RET(HRESULT,23,glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc));
22102210 }
22112211 HRESULT WINAPI glDirectDrawSurface3::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc)
22122212 {
22132213 TRACE_ENTER(3,14,this,14,lpDD,14,lpDDSurfaceDesc);
2214 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2214+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
22152215 TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
22162216 return DDERR_ALREADYINITIALIZED;
22172217 }
@@ -2217,82 +2217,82 @@
22182218 HRESULT WINAPI glDirectDrawSurface3::IsLost()
22192219 {
22202220 TRACE_ENTER(1,14,this);
2221 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2222 - TRACE_RET(23,glDDS7->IsLost());
 2221+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2222+ TRACE_RET(HRESULT,23,glDDS7->IsLost());
22232223 }
22242224 HRESULT WINAPI glDirectDrawSurface3::Lock(LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
22252225 {
22262226 TRACE_ENTER(5,14,this,26,lpDestRect,14,lpDDSurfaceDesc,9,dwFlags,14,hEvent);
2227 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2228 - TRACE_RET(23,glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent));
 2227+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2228+ TRACE_RET(HRESULT,23,glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent));
22292229 }
22302230 HRESULT WINAPI glDirectDrawSurface3::ReleaseDC(HDC hDC)
22312231 {
22322232 TRACE_ENTER(2,14,this,14,hDC);
2233 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2234 - TRACE_RET(23,glDDS7->ReleaseDC(hDC));
 2233+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2234+ TRACE_RET(HRESULT,23,glDDS7->ReleaseDC(hDC));
22352235 }
22362236 HRESULT WINAPI glDirectDrawSurface3::Restore()
22372237 {
22382238 TRACE_ENTER(1,14,this);
2239 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2240 - TRACE_RET(23,glDDS7->Restore());
 2239+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2240+ TRACE_RET(HRESULT,23,glDDS7->Restore());
22412241 }
22422242 HRESULT WINAPI glDirectDrawSurface3::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
22432243 {
22442244 TRACE_ENTER(2,14,this,14,lpDDClipper);
2245 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2246 - TRACE_RET(23,glDDS7->SetClipper(lpDDClipper));
 2245+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2246+ TRACE_RET(HRESULT,23,glDDS7->SetClipper(lpDDClipper));
22472247 }
22482248 HRESULT WINAPI glDirectDrawSurface3::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
22492249 {
22502250 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
2251 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2252 - TRACE_RET(23,glDDS7->SetColorKey(dwFlags,lpDDColorKey));
 2251+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2252+ TRACE_RET(HRESULT,23,glDDS7->SetColorKey(dwFlags,lpDDColorKey));
22532253 }
22542254 HRESULT WINAPI glDirectDrawSurface3::SetOverlayPosition(LONG lX, LONG lY)
22552255 {
22562256 TRACE_ENTER(3,14,this,7,lX,7,lY);
2257 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2258 - TRACE_RET(23,glDDS7->SetOverlayPosition(lX,lY));
 2257+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2258+ TRACE_RET(HRESULT,23,glDDS7->SetOverlayPosition(lX,lY));
22592259 }
22602260 HRESULT WINAPI glDirectDrawSurface3::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
22612261 {
22622262 TRACE_ENTER(2,14,this,14,lpDDPalette);
2263 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2264 - TRACE_RET(23,glDDS7->SetPalette(lpDDPalette));
 2263+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2264+ TRACE_RET(HRESULT,23,glDDS7->SetPalette(lpDDPalette));
22652265 }
22662266 HRESULT WINAPI glDirectDrawSurface3::Unlock(LPVOID lpSurfaceData)
22672267 {
22682268 TRACE_ENTER(2,14,this,14,lpSurfaceData);
2269 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2270 - TRACE_RET(23,glDDS7->Unlock2(lpSurfaceData));
 2269+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2270+ TRACE_RET(HRESULT,23,glDDS7->Unlock2(lpSurfaceData));
22712271 }
22722272 HRESULT WINAPI glDirectDrawSurface3::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE3 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
22732273 {
22742274 TRACE_ENTER(6,14,this,26,lpSrcRect,14,lpDDDestSurface,26,lpDestRect,9,dwFlags,14,lpDDOverlayFx);
2275 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2276 - TRACE_RET(23,glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx));
 2275+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2276+ TRACE_RET(HRESULT,23,glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx));
22772277 }
22782278 HRESULT WINAPI glDirectDrawSurface3::UpdateOverlayDisplay(DWORD dwFlags)
22792279 {
22802280 TRACE_ENTER(2,14,this,9,dwFlags);
2281 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2282 - TRACE_RET(23,glDDS7->UpdateOverlayDisplay(dwFlags));
 2281+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2282+ TRACE_RET(HRESULT,23,glDDS7->UpdateOverlayDisplay(dwFlags));
22832283 }
22842284 HRESULT WINAPI glDirectDrawSurface3::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSReference)
22852285 {
22862286 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSReference);
2287 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2288 - TRACE_RET(23,glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference));
 2287+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2288+ TRACE_RET(HRESULT,23,glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference));
22892289 }
22902290 HRESULT WINAPI glDirectDrawSurface3::GetDDInterface(LPVOID FAR *lplpDD)
22912291 {
22922292 TRACE_ENTER(2,14,this,14,lplpDD);
2293 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2293+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
22942294 glDirectDraw7 *glDD7;
22952295 HRESULT ret = glDDS7->GetDDInterface((void**)&glDD7);
2296 - if(ret != DD_OK) TRACE_RET(23,ret);
 2296+ if(ret != DD_OK) TRACE_RET(HRESULT,23,ret);
22972297 glDD7->QueryInterface(IID_IDirectDraw,lplpDD);
22982298 glDD7->Release();
22992299 TRACE_VAR("*lplpDD",14,*lplpDD);
@@ -2302,20 +2302,20 @@
23032303 HRESULT WINAPI glDirectDrawSurface3::PageLock(DWORD dwFlags)
23042304 {
23052305 TRACE_ENTER(2,14,this,14,dwFlags);
2306 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2307 - TRACE_RET(23,glDDS7->PageLock(dwFlags));
 2306+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2307+ TRACE_RET(HRESULT,23,glDDS7->PageLock(dwFlags));
23082308 }
23092309 HRESULT WINAPI glDirectDrawSurface3::PageUnlock(DWORD dwFlags)
23102310 {
23112311 TRACE_ENTER(2,14,this,9,dwFlags);
2312 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2313 - TRACE_RET(23,glDDS7->PageUnlock(dwFlags));
 2312+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2313+ TRACE_RET(HRESULT,23,glDDS7->PageUnlock(dwFlags));
23142314 }
23152315 HRESULT WINAPI glDirectDrawSurface3::SetSurfaceDesc(LPDDSURFACEDESC lpddsd, DWORD dwFlags)
23162316 {
23172317 TRACE_ENTER(3,14,this,14,lpddsd,9,dwFlags);
2318 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2319 - TRACE_RET(23,glDDS7->SetSurfaceDesc((LPDDSURFACEDESC2)lpddsd,dwFlags));
 2318+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2319+ TRACE_RET(HRESULT,23,glDDS7->SetSurfaceDesc((LPDDSURFACEDESC2)lpddsd,dwFlags));
23202320 }
23212321
23222322 // DDRAW4 wrapper
@@ -2336,7 +2336,7 @@
23372337 HRESULT WINAPI glDirectDrawSurface4::QueryInterface(REFIID riid, void** ppvObj)
23382338 {
23392339 TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
2340 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2340+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
23412341 if(riid == IID_IUnknown)
23422342 {
23432343 this->AddRef();
@@ -2345,12 +2345,12 @@
23462346 TRACE_EXIT(23,DD_OK);
23472347 return DD_OK;
23482348 }
2349 - TRACE_RET(23,glDDS7->QueryInterface(riid,ppvObj));
 2349+ TRACE_RET(HRESULT,23,glDDS7->QueryInterface(riid,ppvObj));
23502350 }
23512351 ULONG WINAPI glDirectDrawSurface4::AddRef()
23522352 {
23532353 TRACE_ENTER(1,14,this);
2354 - if(!this) TRACE_RET(8,0);
 2354+ if(!this) TRACE_RET(ULONG,8,0);
23552355 refcount++;
23562356 TRACE_EXIT(8,refcount);
23572357 return refcount;
@@ -2358,7 +2358,7 @@
23592359 ULONG WINAPI glDirectDrawSurface4::Release()
23602360 {
23612361 TRACE_ENTER(1,14,this);
2362 - if(!this) TRACE_RET(8,0);
 2362+ if(!this) TRACE_RET(ULONG,8,0);
23632363 ULONG ret;
23642364 refcount--;
23652365 ret = refcount;
@@ -2369,64 +2369,64 @@
23702370 HRESULT WINAPI glDirectDrawSurface4::AddAttachedSurface(LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface)
23712371 {
23722372 TRACE_ENTER(2,14,this,14,lpDDSAttachedSurface);
2373 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2374 - TRACE_RET(23,glDDS7->AddAttachedSurface(((glDirectDrawSurface4*)lpDDSAttachedSurface)->GetDDS7()));
 2373+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2374+ TRACE_RET(HRESULT,23,glDDS7->AddAttachedSurface(((glDirectDrawSurface4*)lpDDSAttachedSurface)->GetDDS7()));
23752375 }
23762376 HRESULT WINAPI glDirectDrawSurface4::AddOverlayDirtyRect(LPRECT lpRect)
23772377 {
23782378 TRACE_ENTER(2,14,this,26,lpRect);
2379 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2380 - TRACE_RET(23,glDDS7->AddOverlayDirtyRect(lpRect));
 2379+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2380+ TRACE_RET(HRESULT,23,glDDS7->AddOverlayDirtyRect(lpRect));
23812381 }
23822382 HRESULT WINAPI glDirectDrawSurface4::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
23832383 {
23842384 TRACE_ENTER(6,14,this,26,lpDestRect,14,lpDDSrcSurface,26,lpSrcRect,9,dwFlags,14,lpDDBltFx);
2385 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2386 - if(lpDDSrcSurface) {TRACE_RET(23,glDDS7->Blt(lpDestRect,((glDirectDrawSurface4*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx));}
2387 - else TRACE_RET(23,glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx));
 2385+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2386+ if(lpDDSrcSurface) {TRACE_RET(HRESULT,23,glDDS7->Blt(lpDestRect,((glDirectDrawSurface4*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx));}
 2387+ else TRACE_RET(HRESULT,23,glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx));
23882388 }
23892389 HRESULT WINAPI glDirectDrawSurface4::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
23902390 {
23912391 TRACE_ENTER(4,14,this,14,lpDDBltBatch,8,dwCount,9,dwFlags);
2392 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2393 - TRACE_RET(23,glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags));
 2392+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2393+ TRACE_RET(HRESULT,23,glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags));
23942394 }
23952395 HRESULT WINAPI glDirectDrawSurface4::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
23962396 {
23972397 TRACE_ENTER(6,14,this,8,dwX,8,dwY,14,lpDDSrcSurface,26,lpSrcRect,9,dwTrans);
2398 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2399 - TRACE_RET(23,glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface4*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans));
 2398+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2399+ TRACE_RET(HRESULT,23,glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface4*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans));
24002400 }
24012401 HRESULT WINAPI glDirectDrawSurface4::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface)
24022402 {
24032403 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSAttachedSurface);
2404 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2405 - TRACE_RET(23,glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface));
 2404+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2405+ TRACE_RET(HRESULT,23,glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface));
24062406 }
24072407 HRESULT WINAPI glDirectDrawSurface4::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpEnumSurfacesCallback)
24082408 {
24092409 TRACE_ENTER(3,14,this,14,lpContext,14,lpEnumSurfacesCallback);
2410 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2411 - TRACE_RET(23,glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback));
 2410+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2411+ TRACE_RET(HRESULT,23,glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback));
24122412 }
24132413 HRESULT WINAPI glDirectDrawSurface4::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpfnCallback)
24142414 {
24152415 TRACE_ENTER(4,14,this,9,dwFlags,14,lpContext,14,lpfnCallback);
2416 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2417 - TRACE_RET(23,glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback));
 2416+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2417+ TRACE_RET(HRESULT,23,glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback));
24182418 }
24192419 HRESULT WINAPI glDirectDrawSurface4::Flip(LPDIRECTDRAWSURFACE4 lpDDSurfaceTargetOverride, DWORD dwFlags)
24202420 {
24212421 TRACE_ENTER(3,14,this,14,lpDDSurfaceTargetOverride,9,dwFlags);
2422 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2422+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
24232423 if(lpDDSurfaceTargetOverride)
2424 - {TRACE_RET(23,glDDS7->Flip(((glDirectDrawSurface4*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags));}
2425 - else TRACE_RET(23,glDDS7->Flip(NULL,dwFlags));
 2424+ {TRACE_RET(HRESULT,23,glDDS7->Flip(((glDirectDrawSurface4*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags));}
 2425+ else TRACE_RET(HRESULT,23,glDDS7->Flip(NULL,dwFlags));
24262426 }
24272427 HRESULT WINAPI glDirectDrawSurface4::GetAttachedSurface(LPDDSCAPS2 lpDDSCaps2, LPDIRECTDRAWSURFACE4 FAR *lplpDDAttachedSurface)
24282428 {
24292429 TRACE_ENTER(3,14,this,14,lpDDSCaps2,14,lplpDDAttachedSurface);
2430 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2430+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
24312431 HRESULT error;
24322432 glDirectDrawSurface7 *attachedsurface;
24332433 glDirectDrawSurface4 *attached1;
@@ -2444,67 +2444,67 @@
24452445 HRESULT WINAPI glDirectDrawSurface4::GetBltStatus(DWORD dwFlags)
24462446 {
24472447 TRACE_ENTER(2,14,this,9,dwFlags);
2448 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2449 - TRACE_RET(23,glDDS7->GetBltStatus(dwFlags));
 2448+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2449+ TRACE_RET(HRESULT,23,glDDS7->GetBltStatus(dwFlags));
24502450 }
24512451 HRESULT WINAPI glDirectDrawSurface4::GetCaps(LPDDSCAPS2 lpDDSCaps)
24522452 {
24532453 TRACE_ENTER(2,14,this,14,lpDDSCaps);
2454 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2455 - TRACE_RET(23,glDDS7->GetCaps(lpDDSCaps));
 2454+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2455+ TRACE_RET(HRESULT,23,glDDS7->GetCaps(lpDDSCaps));
24562456 }
24572457 HRESULT WINAPI glDirectDrawSurface4::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
24582458 {
24592459 TRACE_ENTER(2,14,this,14,lplpDDClipper);
2460 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2461 - TRACE_RET(23,glDDS7->GetClipper(lplpDDClipper));
 2460+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2461+ TRACE_RET(HRESULT,23,glDDS7->GetClipper(lplpDDClipper));
24622462 }
24632463 HRESULT WINAPI glDirectDrawSurface4::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
24642464 {
24652465 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
2466 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2467 - TRACE_RET(23,glDDS7->GetColorKey(dwFlags,lpDDColorKey));
 2466+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2467+ TRACE_RET(HRESULT,23,glDDS7->GetColorKey(dwFlags,lpDDColorKey));
24682468 }
24692469 HRESULT WINAPI glDirectDrawSurface4::GetDC(HDC FAR *lphDC)
24702470 {
24712471 TRACE_ENTER(2,14,this,14,lphDC);
2472 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2473 - TRACE_RET(23,glDDS7->GetDC(lphDC));
 2472+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2473+ TRACE_RET(HRESULT,23,glDDS7->GetDC(lphDC));
24742474 }
24752475 HRESULT WINAPI glDirectDrawSurface4::GetFlipStatus(DWORD dwFlags)
24762476 {
24772477 TRACE_ENTER(2,14,this,9,dwFlags);
2478 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2479 - TRACE_RET(23,glDDS7->GetFlipStatus(dwFlags));
 2478+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2479+ TRACE_RET(HRESULT,23,glDDS7->GetFlipStatus(dwFlags));
24802480 }
24812481 HRESULT WINAPI glDirectDrawSurface4::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
24822482 {
24832483 TRACE_ENTER(3,14,this,14,lplX,14,lplY);
2484 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2485 - TRACE_RET(23,glDDS7->GetOverlayPosition(lplX,lplY));
 2484+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2485+ TRACE_RET(HRESULT,23,glDDS7->GetOverlayPosition(lplX,lplY));
24862486 }
24872487 HRESULT WINAPI glDirectDrawSurface4::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
24882488 {
24892489 TRACE_ENTER(2,14,this,14,lplpDDPalette);
2490 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2491 - TRACE_RET(23,glDDS7->GetPalette(lplpDDPalette));
 2490+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2491+ TRACE_RET(HRESULT,23,glDDS7->GetPalette(lplpDDPalette));
24922492 }
24932493 HRESULT WINAPI glDirectDrawSurface4::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
24942494 {
24952495 TRACE_ENTER(2,14,this,14,lpDDPixelFormat);
2496 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2497 - TRACE_RET(23,glDDS7->GetPixelFormat(lpDDPixelFormat));
 2496+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2497+ TRACE_RET(HRESULT,23,glDDS7->GetPixelFormat(lpDDPixelFormat));
24982498 }
24992499 HRESULT WINAPI glDirectDrawSurface4::GetSurfaceDesc(LPDDSURFACEDESC2 lpDDSurfaceDesc)
25002500 {
25012501 TRACE_ENTER(2,14,this,14,lpDDSurfaceDesc);
2502 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2503 - TRACE_RET(23,glDDS7->GetSurfaceDesc(lpDDSurfaceDesc));
 2502+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2503+ TRACE_RET(HRESULT,23,glDDS7->GetSurfaceDesc(lpDDSurfaceDesc));
25042504 }
25052505 HRESULT WINAPI glDirectDrawSurface4::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC2 lpDDSurfaceDesc)
25062506 {
25072507 TRACE_ENTER(3,14,this,14,lpDD,14,lpDDSurfaceDesc);
2508 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 2508+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
25092509 TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
25102510 return DDERR_ALREADYINITIALIZED;
25112511 }
@@ -2511,126 +2511,126 @@
25122512 HRESULT WINAPI glDirectDrawSurface4::IsLost()
25132513 {
25142514 TRACE_ENTER(1,14,this);
2515 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2516 - TRACE_RET(23,glDDS7->IsLost());
 2515+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2516+ TRACE_RET(HRESULT,23,glDDS7->IsLost());
25172517 }
25182518 HRESULT WINAPI glDirectDrawSurface4::Lock(LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
25192519 {
25202520 TRACE_ENTER(5,14,this,26,lpDestRect,14,lpDDSurfaceDesc,9,dwFlags,14,hEvent);
2521 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2522 - TRACE_RET(23,glDDS7->Lock(lpDestRect,lpDDSurfaceDesc,dwFlags,hEvent));
 2521+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2522+ TRACE_RET(HRESULT,23,glDDS7->Lock(lpDestRect,lpDDSurfaceDesc,dwFlags,hEvent));
25232523 }
25242524 HRESULT WINAPI glDirectDrawSurface4::ReleaseDC(HDC hDC)
25252525 {
25262526 TRACE_ENTER(2,14,this,14,hDC);
2527 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2528 - TRACE_RET(23,glDDS7->ReleaseDC(hDC));
 2527+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2528+ TRACE_RET(HRESULT,23,glDDS7->ReleaseDC(hDC));
25292529 }
25302530 HRESULT WINAPI glDirectDrawSurface4::Restore()
25312531 {
25322532 TRACE_ENTER(1,14,this);
2533 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2534 - TRACE_RET(23,glDDS7->Restore());
 2533+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2534+ TRACE_RET(HRESULT,23,glDDS7->Restore());
25352535 }
25362536 HRESULT WINAPI glDirectDrawSurface4::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
25372537 {
25382538 TRACE_ENTER(2,14,this,14,lpDDClipper);
2539 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2540 - TRACE_RET(23,glDDS7->SetClipper(lpDDClipper));
 2539+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2540+ TRACE_RET(HRESULT,23,glDDS7->SetClipper(lpDDClipper));
25412541 }
25422542 HRESULT WINAPI glDirectDrawSurface4::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
25432543 {
25442544 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDColorKey);
2545 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2546 - TRACE_RET(23,glDDS7->SetColorKey(dwFlags,lpDDColorKey));
 2545+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2546+ TRACE_RET(HRESULT,23,glDDS7->SetColorKey(dwFlags,lpDDColorKey));
25472547 }
25482548 HRESULT WINAPI glDirectDrawSurface4::SetOverlayPosition(LONG lX, LONG lY)
25492549 {
25502550 TRACE_ENTER(3,14,this,7,lX,7,lY);
2551 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2552 - TRACE_RET(23,glDDS7->SetOverlayPosition(lX,lY));
 2551+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2552+ TRACE_RET(HRESULT,23,glDDS7->SetOverlayPosition(lX,lY));
25532553 }
25542554 HRESULT WINAPI glDirectDrawSurface4::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
25552555 {
25562556 TRACE_ENTER(2,14,this,14,lpDDPalette);
2557 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2558 - TRACE_RET(23,glDDS7->SetPalette(lpDDPalette));
 2557+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2558+ TRACE_RET(HRESULT,23,glDDS7->SetPalette(lpDDPalette));
25592559 }
25602560 HRESULT WINAPI glDirectDrawSurface4::Unlock(LPRECT lpRect)
25612561 {
25622562 TRACE_ENTER(2,14,this,26,lpRect);
2563 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2564 - TRACE_RET(23,glDDS7->Unlock2(lpRect));
 2563+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2564+ TRACE_RET(HRESULT,23,glDDS7->Unlock2(lpRect));
25652565 }
25662566 HRESULT WINAPI glDirectDrawSurface4::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE4 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
25672567 {
25682568 TRACE_ENTER(6,14,this,26,lpSrcRect,14,lpDDDestSurface,26,lpDestRect,9,dwFlags,14,lpDDOverlayFx);
2569 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2570 - TRACE_RET(23,glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx));
 2569+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2570+ TRACE_RET(HRESULT,23,glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx));
25712571 }
25722572 HRESULT WINAPI glDirectDrawSurface4::UpdateOverlayDisplay(DWORD dwFlags)
25732573 {
25742574 TRACE_ENTER(2,14,this,9,dwFlags);
2575 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2576 - TRACE_RET(23,glDDS7->UpdateOverlayDisplay(dwFlags));
 2575+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2576+ TRACE_RET(HRESULT,23,glDDS7->UpdateOverlayDisplay(dwFlags));
25772577 }
25782578 HRESULT WINAPI glDirectDrawSurface4::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSReference)
25792579 {
25802580 TRACE_ENTER(3,14,this,9,dwFlags,14,lpDDSReference);
2581 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2582 - TRACE_RET(23,glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference));
 2581+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2582+ TRACE_RET(HRESULT,23,glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference));
25832583 }
25842584 HRESULT WINAPI glDirectDrawSurface4::GetDDInterface(LPVOID FAR *lplpDD)
25852585 {
25862586 TRACE_ENTER(2,14,this,14,lplpDD);
2587 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2588 - TRACE_RET(23,glDDS7->GetDDInterface(lplpDD));
 2587+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2588+ TRACE_RET(HRESULT,23,glDDS7->GetDDInterface(lplpDD));
25892589 }
25902590 HRESULT WINAPI glDirectDrawSurface4::PageLock(DWORD dwFlags)
25912591 {
25922592 TRACE_ENTER(2,14,this,9,dwFlags);
2593 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2594 - TRACE_RET(23,glDDS7->PageLock(dwFlags));
 2593+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2594+ TRACE_RET(HRESULT,23,glDDS7->PageLock(dwFlags));
25952595 }
25962596 HRESULT WINAPI glDirectDrawSurface4::PageUnlock(DWORD dwFlags)
25972597 {
25982598 TRACE_ENTER(2,14,this,9,dwFlags);
2599 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2600 - TRACE_RET(23,glDDS7->PageUnlock(dwFlags));
 2599+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2600+ TRACE_RET(HRESULT,23,glDDS7->PageUnlock(dwFlags));
26012601 }
26022602 HRESULT WINAPI glDirectDrawSurface4::SetSurfaceDesc(LPDDSURFACEDESC2 lpddsd, DWORD dwFlags)
26032603 {
26042604 TRACE_ENTER(3,14,this,14,lpddsd,9,dwFlags);
2605 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2606 - TRACE_RET(23,glDDS7->SetSurfaceDesc(lpddsd,dwFlags));
 2605+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2606+ TRACE_RET(HRESULT,23,glDDS7->SetSurfaceDesc(lpddsd,dwFlags));
26072607 }
26082608 HRESULT WINAPI glDirectDrawSurface4::SetPrivateData(REFGUID guidTag, LPVOID lpData, DWORD cbSize, DWORD dwFlags)
26092609 {
26102610 TRACE_ENTER(5,14,this,24,&guidTag,14,lpData,8,cbSize,9,dwFlags);
2611 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2612 - TRACE_RET(23,glDDS7->SetPrivateData(guidTag,lpData,cbSize,dwFlags));
 2611+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2612+ TRACE_RET(HRESULT,23,glDDS7->SetPrivateData(guidTag,lpData,cbSize,dwFlags));
26132613 }
26142614 HRESULT WINAPI glDirectDrawSurface4::GetPrivateData(REFGUID guidTag, LPVOID lpBuffer, LPDWORD lpcbBufferSize)
26152615 {
26162616 TRACE_ENTER(4,14,this,24,&guidTag,14,lpBuffer,14,lpcbBufferSize);
2617 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2618 - TRACE_RET(23,glDDS7->GetPrivateData(guidTag,lpBuffer,lpcbBufferSize));
 2617+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2618+ TRACE_RET(HRESULT,23,glDDS7->GetPrivateData(guidTag,lpBuffer,lpcbBufferSize));
26192619 }
26202620 HRESULT WINAPI glDirectDrawSurface4::FreePrivateData(REFGUID guidTag)
26212621 {
26222622 TRACE_ENTER(2,14,this,24,&guidTag);
2623 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2624 - TRACE_RET(23,glDDS7->FreePrivateData(guidTag));
 2623+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2624+ TRACE_RET(HRESULT,23,glDDS7->FreePrivateData(guidTag));
26252625 }
26262626 HRESULT WINAPI glDirectDrawSurface4::GetUniquenessValue(LPDWORD lpValue)
26272627 {
26282628 TRACE_ENTER(2,14,this,14,lpValue);
2629 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2630 - TRACE_RET(23,glDDS7->GetUniquenessValue(lpValue));
 2629+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2630+ TRACE_RET(HRESULT,23,glDDS7->GetUniquenessValue(lpValue));
26312631 }
26322632 HRESULT WINAPI glDirectDrawSurface4::ChangeUniquenessValue()
26332633 {
26342634 TRACE_ENTER(1,14,this);
2635 - if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
2636 - TRACE_RET(23,glDDS7->ChangeUniquenessValue());
 2635+ if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
 2636+ TRACE_RET(HRESULT,23,glDDS7->ChangeUniquenessValue());
26372637 }
Index: ddraw/trace.cpp
@@ -1080,6 +1080,11 @@
10811081 WriteFile(outfile,"\r\n",2,&byteswritten,NULL);
10821082 LeaveCriticalSection(&trace_cs);
10831083 }
 1084+void *trace_ret(const char *function, int argtype, void *arg)
 1085+{
 1086+ trace_exit(function,argtype,arg);
 1087+ return arg;
 1088+}
10841089 void trace_var(const char *function, const char *var, int argtype, void *arg)
10851090 {
10861091 if(trace_fail) return;
Index: ddraw/trace.h
@@ -27,18 +27,15 @@
2828 #define TRACE_SYSINFO() trace_sysinfo() // Must be in thread used by OpenGL.
2929 void trace_enter(const char *function, int paramcount, ...);
3030 void trace_exit(const char *function, int argtype, void *arg);
 31+void *trace_ret(const char *function, int argtype, void *arg);
3132 void trace_var(const char *function, const char *var, int argtype, void *arg);
3233 void trace_sysinfo();
33 -#define TRACE_RET(argtype, arg) \
34 -{\
35 - trace_exit(__FUNCTION__,argtype,(void*)arg);\
36 - return arg;\
37 -}
 34+#define TRACE_RET(type, argtype, arg) return (type)trace_ret(__FUNCTION__,argtype,(void*)arg);
3835 #else
3936 #define TRACE_ENTER(a,...)
4037 #define TRACE_EXIT(a,b)
4138 #define TRACE_VAR(a,b,c)
42 -#define TRACE_RET(argtype, arg) return arg;
 39+#define TRACE_RET(type, argtype, arg) return arg;
4340 #define TRACE_SYSINFO()
4441 #endif
4542