Christian Costa : d3dxof: Enumerate only 2 levels of objects obtained from a reference.

Alexandre Julliard julliard at winehq.org
Wed Oct 8 08:32:42 CDT 2008


Module: wine
Branch: master
Commit: ded68e8a4f698369801570dca294e489727cc901
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ded68e8a4f698369801570dca294e489727cc901

Author: Christian Costa <titan.costa at wanadoo.fr>
Date:   Tue Oct  7 22:52:55 2008 +0200

d3dxof: Enumerate only 2 levels of objects obtained from a reference.

---

 dlls/d3dxof/d3dxof.c         |   12 ++++++++++++
 dlls/d3dxof/d3dxof_private.h |    2 ++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/dlls/d3dxof/d3dxof.c b/dlls/d3dxof/d3dxof.c
index 553dbf9..6d4d496 100644
--- a/dlls/d3dxof/d3dxof.c
+++ b/dlls/d3dxof/d3dxof.c
@@ -1409,6 +1409,12 @@ static HRESULT WINAPI IDirectXFileDataImpl_GetNextObject(IDirectXFileData* iface
   if (This->cur_enum_object >= This->pobj->nb_childs)
     return DXFILEERR_NOMOREOBJECTS;
 
+  if (This->from_ref && (This->level >= 1))
+  {
+    /* Only 2 levels can enumerated if the object is obtained from a reference */
+    return DXFILEERR_NOMOREOBJECTS;
+  }
+
   if (This->pobj->childs[This->cur_enum_object]->ptarget)
   {
     IDirectXFileDataReferenceImpl *object;
@@ -1431,6 +1437,8 @@ static HRESULT WINAPI IDirectXFileDataImpl_GetNextObject(IDirectXFileData* iface
 
     object->pobj = This->pobj->childs[This->cur_enum_object++];
     object->cur_enum_object = 0;
+    object->from_ref = This->from_ref;
+    object->level = This->level + 1;
 
     *ppChildObj = (LPDIRECTXFILEOBJECT)object;
   }
@@ -1590,6 +1598,8 @@ static HRESULT WINAPI IDirectXFileDataReferenceImpl_Resolve(IDirectXFileDataRefe
 
   object->pobj = This->ptarget;
   object->cur_enum_object = 0;
+  object->level = 0;
+  object->from_ref = TRUE;
 
   *ppDataObj = (LPDIRECTXFILEDATA)object;
 
@@ -1981,6 +1991,8 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
 
   object->pobj = This->buf.pxo;
   object->cur_enum_object = 0;
+  object->level = 0;
+  object->from_ref = FALSE;
 
   *ppDataObj = (LPDIRECTXFILEDATA)object;
 
diff --git a/dlls/d3dxof/d3dxof_private.h b/dlls/d3dxof/d3dxof_private.h
index 99bec1c..3a4735d 100644
--- a/dlls/d3dxof/d3dxof_private.h
+++ b/dlls/d3dxof/d3dxof_private.h
@@ -98,6 +98,8 @@ typedef struct {
     LONG ref;
     xobject* pobj;
     int cur_enum_object;
+    BOOL from_ref;
+    ULONG level;
 } IDirectXFileDataImpl;
 
 typedef struct {




More information about the wine-cvs mailing list