Potential patch for an oddity in dlls/d3d9/device.c

Gerald Pfeifer gerald at pfeifer.com
Thu Jun 25 14:56:00 CDT 2009


In reset_enum_callback we have 

  WINED3DRESOURCETYPE type;
  :
  type = IDirect3DResource9_GetType(parent);
  :
  switch(type)

Alas, the values in the case statements of this switch then are 
D3DRTYPE_SURFACE, D3DRTYPE_VOLUME, D3DRTYPE_INDEXBUFFER, and 
D3DRTYPE_VERTEXBUFFER which would indicate we'd need D3DRESOURCETYPE,
not WINED3DRESOURCETYPE.

In fact D3DRTYPE_INDEXBUFFER has an integer value of 7, which is none of 
the values that the WINED3DRESOURCETYPE has, whereas D3DRESOURCETYPE does 
feature this.

So, I wonder whether something like the patch below is the right fix, or 
whether there is a deeper problem?

Gerald


ChangeLog:
Fix variable type in reset_enum_callback().

diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 9d1c72e..14885de 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -424,7 +424,7 @@ static BOOL     WINAPI  IDirect3DDevice9Impl_ShowCursor(LPDIRECT3DDEVICE9EX ifac
 
 static HRESULT WINAPI reset_enum_callback(IWineD3DResource *resource, void *data) {
     BOOL *resources_ok = data;
-    WINED3DRESOURCETYPE type;
+    D3DRESOURCETYPE type;
     HRESULT ret = S_OK;
     WINED3DSURFACE_DESC surface_desc;
     WINED3DVOLUME_DESC volume_desc;



More information about the wine-patches mailing list