Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
5880ff01
Commit
5880ff01
authored
Jan 21, 2013
by
Christian Costa
Committed by
Alexandre Julliard
Jan 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9_36: Fill children info into ID3DXFileData object.
parent
ed367c50
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
5 deletions
+62
-5
xfile.c
dlls/d3dx9_36/xfile.c
+62
-5
No files found.
dlls/d3dx9_36/xfile.c
View file @
5880ff01
...
...
@@ -60,7 +60,10 @@ typedef struct {
typedef
struct
{
ID3DXFileData
ID3DXFileData_iface
;
LONG
ref
;
BOOL
reference
;
IDirectXFileData
*
dxfile_data
;
ULONG
nb_children
;
ID3DXFileData
**
children
;
}
ID3DXFileDataImpl
;
...
...
@@ -117,6 +120,11 @@ static ULONG WINAPI ID3DXFileDataImpl_Release(ID3DXFileData *iface)
if
(
!
ref
)
{
ULONG
i
;
for
(
i
=
0
;
i
<
This
->
nb_children
;
i
++
)
(
This
->
children
[
i
])
->
lpVtbl
->
Release
(
This
->
children
[
i
]);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
children
);
IDirectXFileData_Release
(
This
->
dxfile_data
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -266,21 +274,70 @@ static const ID3DXFileDataVtbl ID3DXFileData_Vtbl =
};
static
HRESULT
ID3DXFileDataImpl_Create
(
IDirectXFile
Data
*
dxfile_data
,
ID3DXFileData
**
ret_iface
)
static
HRESULT
ID3DXFileDataImpl_Create
(
IDirectXFile
Object
*
dxfile_object
,
ID3DXFileData
**
ret_iface
)
{
ID3DXFileDataImpl
*
object
;
IDirectXFileObject
*
data_object
;
HRESULT
ret
;
TRACE
(
"(%p, %p)
\n
"
,
dxfile_
data
,
ret_iface
);
TRACE
(
"(%p, %p)
\n
"
,
dxfile_
object
,
ret_iface
);
*
ret_iface
=
NULL
;
object
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
object
));
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
object
->
ID3DXFileData_iface
.
lpVtbl
=
&
ID3DXFileData_Vtbl
;
object
->
ref
=
1
;
object
->
dxfile_data
=
dxfile_data
;
ret
=
IDirectXFileObject_QueryInterface
(
dxfile_object
,
&
IID_IDirectXFileData
,
(
void
**
)
&
object
->
dxfile_data
);
if
(
FAILED
(
ret
))
{
IDirectXFileDataReference
*
reference
;
ret
=
IDirectXFileObject_QueryInterface
(
dxfile_object
,
&
IID_IDirectXFileDataReference
,
(
void
**
)
&
reference
);
if
(
SUCCEEDED
(
ret
))
{
ret
=
IDirectXFileDataReference_Resolve
(
reference
,
&
object
->
dxfile_data
);
if
(
FAILED
(
ret
))
{
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
E_FAIL
;
}
}
else
{
FIXME
(
"Don't known what to do with binary object
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
E_FAIL
;
}
}
while
(
SUCCEEDED
(
ret
=
IDirectXFileData_GetNextObject
(
object
->
dxfile_data
,
&
data_object
)))
{
if
(
object
->
children
)
object
->
children
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
object
->
children
,
sizeof
(
ID3DXFileData
*
)
*
(
object
->
nb_children
+
1
));
else
object
->
children
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
ID3DXFileData
*
));
if
(
!
object
->
children
)
{
ret
=
E_OUTOFMEMORY
;
break
;
}
ret
=
ID3DXFileDataImpl_Create
(
data_object
,
&
object
->
children
[
object
->
nb_children
]);
if
(
ret
!=
S_OK
)
break
;
object
->
nb_children
++
;
}
if
(
ret
!=
DXFILEERR_NOMOREOBJECTS
)
{
(
&
object
->
ID3DXFileData_iface
)
->
lpVtbl
->
Release
(
&
object
->
ID3DXFileData_iface
);
return
ret
;
}
TRACE
(
"Found %u children
\n
"
,
object
->
nb_children
);
*
ret_iface
=
&
object
->
ID3DXFileData_iface
;
...
...
@@ -534,7 +591,7 @@ static HRESULT WINAPI ID3DXFileImpl_CreateEnumObject(ID3DXFile *iface, const voi
ret
=
E_OUTOFMEMORY
;
break
;
}
ret
=
ID3DXFileDataImpl_Create
(
data_object
,
&
object
->
children
[
object
->
nb_children
]);
ret
=
ID3DXFileDataImpl_Create
(
(
IDirectXFileObject
*
)
data_object
,
&
object
->
children
[
object
->
nb_children
]);
if
(
ret
!=
S_OK
)
break
;
object
->
nb_children
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment