DXGL r353 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r352‎ | r353 | r354 >
Date:23:45, 17 March 2013
Author:admin
Status:new
Tags:
Comment:
Trace glDirect3DVertexBuffer.cpp and fix invalid object return values.
Add Debug Trace output directories to ignore list.
Modified paths:
  • / (modified) (history)
  • /ddraw (modified) (history)
  • /ddraw/glDirect3DVertexBuffer.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirect3DVertexBuffer.cpp
@@ -26,85 +26,109 @@
2727
2828 glDirect3DVertexBuffer7::glDirect3DVertexBuffer7(glDirect3D7 *glD3D7, D3DVERTEXBUFFERDESC desc, DWORD flags)
2929 {
 30+ TRACE_ENTER(4,14,this,14,glD3D7,14,&desc,9,flags);
3031 this->glD3D7 = glD3D7;
3132 glD3D7->AddRef();
3233 refcount = 1;
3334 vbdesc = desc;
3435 this->flags = flags;
 36+ TRACE_EXIT(-1,0);
3537 }
3638
3739 glDirect3DVertexBuffer7::~glDirect3DVertexBuffer7()
3840 {
 41+ TRACE_ENTER(1,14,this);
3942 glD3D7->Release();
 43+ TRACE_EXIT(-1,0);
4044 }
4145
4246 ULONG WINAPI glDirect3DVertexBuffer7::AddRef()
4347 {
44 - if(!this) return 0;
 48+ TRACE_ENTER(1,14,this);
 49+ if(!this) TRACE_RET(8,0);
4550 refcount++;
 51+ TRACE_EXIT(8,refcount);
4652 return refcount;
4753 }
4854 ULONG WINAPI glDirect3DVertexBuffer7::Release()
4955 {
50 - if(!this) return 0;
 56+ TRACE_ENTER(1,14,this);
 57+ if(!this) TRACE_RET(8,0);
5158 ULONG ret;
5259 refcount--;
5360 ret = refcount;
5461 if(refcount == 0) delete this;
 62+ TRACE_EXIT(8,ret);
5563 return ret;
5664 }
5765
5866 HRESULT WINAPI glDirect3DVertexBuffer7::QueryInterface(REFIID riid, void** ppvObj)
5967 {
60 - if(!this) return DDERR_INVALIDPARAMS;
61 - if(!ppvObj) return DDERR_INVALIDPARAMS;
 68+ 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);
6271 if(riid == IID_IUnknown)
6372 {
6473 this->AddRef();
6574 *ppvObj = this;
 75+ TRACE_VAR("*ppvObj",14,*ppvObj);
 76+ TRACE_EXIT(23,D3D_OK);
6677 return D3D_OK;
6778 }
 79+ TRACE_EXIT(23,E_NOINTERFACE);
6880 return E_NOINTERFACE;
6981 }
7082
7183 HRESULT WINAPI glDirect3DVertexBuffer7::GetVertexBufferDesc(LPD3DVERTEXBUFFERDESC lpVBDesc)
7284 {
73 - if(!this) return DDERR_INVALIDPARAMS;
74 - if(!lpVBDesc) return DDERR_INVALIDPARAMS;
 85+ TRACE_ENTER(2,14,this,14,lpVBDesc);
 86+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 87+ if(!lpVBDesc) TRACE_RET(23,DDERR_INVALIDPARAMS);
7588 *lpVBDesc = vbdesc;
 89+ TRACE_EXIT(23,D3D_OK);
7690 return D3D_OK;
7791 }
7892
7993 HRESULT WINAPI glDirect3DVertexBuffer7::Lock(DWORD dwFlags, LPVOID* lplpData, LPDWORD lpdwSize)
8094 {
81 - if(!this) return DDERR_INVALIDPARAMS;
 95+ TRACE_ENTER(4,14,this,9,dwFlags,14,lplpData,14,lpdwSize);
 96+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
8297 FIXME("glDirect3DVertexBuffer7::Lock: stub");
 98+ TRACE_EXIT(23,DDERR_GENERIC);
8399 return DDERR_GENERIC;
84100 }
85101
86102 HRESULT WINAPI glDirect3DVertexBuffer7::Optimize(LPDIRECT3DDEVICE7 lpD3DDevice, DWORD dwFlags)
87103 {
88 - if(!this) return DDERR_INVALIDPARAMS;
 104+ TRACE_ENTER(3,14,this,14,lpD3DDevice,9,dwFlags);
 105+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
89106 FIXME("glDirect3DVertexBuffer7::Optimize: stub");
 107+ TRACE_EXIT(23,DDERR_GENERIC);
90108 return DDERR_GENERIC;
91109 }
92110 HRESULT WINAPI glDirect3DVertexBuffer7::ProcessVertices(DWORD dwVertexOp, DWORD dwDestIndex, DWORD dwCount,
93111 LPDIRECT3DVERTEXBUFFER7 lpSrcBuffer, DWORD dwSrcIndex, LPDIRECT3DDEVICE7 lpD3DDevice, DWORD dwFlags)
94112 {
95 - if(!this) return DDERR_INVALIDPARAMS;
 113+ 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);
96115 FIXME("glDirect3DVertexBuffer7::ProcessVertices: stub");
 116+ TRACE_EXIT(23,DDERR_GENERIC);
97117 return DDERR_GENERIC;
98118 }
99119 HRESULT WINAPI glDirect3DVertexBuffer7::ProcessVerticesStrided(DWORD dwVertexOp, DWORD dwDestIndex, DWORD dwCount,
100120 LPD3DDRAWPRIMITIVESTRIDEDDATA lpVertexArray, DWORD dwSrcIndex, LPDIRECT3DDEVICE7 lpD3DDevice, DWORD dwFlags)
101121 {
102 - if(!this) return DDERR_INVALIDPARAMS;
 122+ 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);
103124 FIXME("glDirect3DVertexBuffer7::ProcessVerticesStrided: stub");
 125+ TRACE_EXIT(23,DDERR_GENERIC);
104126 return DDERR_GENERIC;
105127 }
106128 HRESULT WINAPI glDirect3DVertexBuffer7::Unlock()
107129 {
108 - if(!this) return DDERR_INVALIDPARAMS;
 130+ TRACE_ENTER(1,14,this);
 131+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
109132 FIXME("glDirect3DVertexBuffer7::Unlock: stub");
 133+ TRACE_EXIT(23,DDERR_GENERIC);
110134 return DDERR_GENERIC;
111135 }
\ No newline at end of file
Index: ddraw
Property changes on: ddraw
___________________________________________________________________
Modified: svn:ignore
## -6,3 +6,4 ##
112136 Release no DXGL
113137 ddraw.vcxproj.user
114138 Debug No MSVCRT
 139+Debug Trace
Index: .
Property changes on: .
___________________________________________________________________
Modified: svn:ignore
## -11,3 +11,4 ##
115140 *.vcxproj.user
116141 Debug No MSVCRT
117142 pingme.txt
 143+Debug Trace