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
ba693245
Commit
ba693245
authored
Jan 09, 2013
by
Christian Costa
Committed by
Alexandre Julliard
Jan 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9_36: Finish implementation of ID3DXFileImpl_CreateEnumObject and add…
d3dx9_36: Finish implementation of ID3DXFileImpl_CreateEnumObject and add stubbed interface for ID3DXFileData.
parent
f8582e10
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
255 additions
and
5 deletions
+255
-5
xfile.c
dlls/d3dx9_36/xfile.c
+255
-5
No files found.
dlls/d3dx9_36/xfile.c
View file @
ba693245
...
...
@@ -53,8 +53,17 @@ typedef struct {
typedef
struct
{
ID3DXFileEnumObject
ID3DXFileEnumObject_iface
;
LONG
ref
;
ULONG
nb_children
;
ID3DXFileData
**
children
;
}
ID3DXFileEnumObjectImpl
;
typedef
struct
{
ID3DXFileData
ID3DXFileData_iface
;
LONG
ref
;
IDirectXFileData
*
dxfile_data
;
}
ID3DXFileDataImpl
;
static
inline
ID3DXFileImpl
*
impl_from_ID3DXFile
(
ID3DXFile
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ID3DXFileImpl
,
ID3DXFile_iface
);
...
...
@@ -65,6 +74,169 @@ static inline ID3DXFileEnumObjectImpl* impl_from_ID3DXFileEnumObject(ID3DXFileEn
return
CONTAINING_RECORD
(
iface
,
ID3DXFileEnumObjectImpl
,
ID3DXFileEnumObject_iface
);
}
static
inline
ID3DXFileDataImpl
*
impl_from_ID3DXFileData
(
ID3DXFileData
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ID3DXFileDataImpl
,
ID3DXFileData_iface
);
}
/*** IUnknown methods ***/
static
HRESULT
WINAPI
ID3DXFileDataImpl_QueryInterface
(
ID3DXFileData
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
{
TRACE
(
"(%p)->(%s, %p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
ret_iface
);
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_ID3DXFileData
))
{
iface
->
lpVtbl
->
AddRef
(
iface
);
*
ret_iface
=
iface
;
return
S_OK
;
}
WARN
(
"(%p)->(%s, %p), not found
\n
"
,
iface
,
debugstr_guid
(
riid
),
ret_iface
);
*
ret_iface
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
ID3DXFileDataImpl_AddRef
(
ID3DXFileData
*
iface
)
{
ID3DXFileDataImpl
*
This
=
impl_from_ID3DXFileData
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): new ref = %u
\n
"
,
iface
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
ID3DXFileDataImpl_Release
(
ID3DXFileData
*
iface
)
{
ID3DXFileDataImpl
*
This
=
impl_from_ID3DXFileData
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): new ref = %u
\n
"
,
iface
,
ref
);
if
(
!
ref
)
{
IDirectXFileData_Release
(
This
->
dxfile_data
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
}
/*** ID3DXFileData methods ***/
static
HRESULT
WINAPI
ID3DXFileDataImpl_GetEnum
(
ID3DXFileData
*
iface
,
ID3DXFileEnumObject
**
enum_object
)
{
FIXME
(
"(%p)->(%p): stub
\n
"
,
iface
,
enum_object
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ID3DXFileDataImpl_GetName
(
ID3DXFileData
*
iface
,
char
*
name
,
SIZE_T
*
size
)
{
FIXME
(
"(%p)->(%p, %p): stub
\n
"
,
iface
,
name
,
size
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ID3DXFileDataImpl_GetId
(
ID3DXFileData
*
iface
,
GUID
*
guid
)
{
FIXME
(
"(%p)->(%p): stub
\n
"
,
iface
,
guid
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ID3DXFileDataImpl_Lock
(
ID3DXFileData
*
iface
,
SIZE_T
*
size
,
const
void
**
data
)
{
FIXME
(
"(%p)->(%p, %p): stub
\n
"
,
iface
,
size
,
data
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ID3DXFileDataImpl_Unlock
(
ID3DXFileData
*
iface
)
{
FIXME
(
"(%p)->(): stub
\n
"
,
iface
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ID3DXFileDataImpl_GetType
(
ID3DXFileData
*
iface
,
GUID
*
guid
)
{
FIXME
(
"(%p)->(%p): stub
\n
"
,
iface
,
guid
);
return
E_NOTIMPL
;
}
static
BOOL
WINAPI
ID3DXFileDataImpl_IsReference
(
ID3DXFileData
*
iface
)
{
TRACE
(
"(%p)->(): stub
\n
"
,
iface
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ID3DXFileDataImpl_GetChildren
(
ID3DXFileData
*
iface
,
SIZE_T
*
children
)
{
TRACE
(
"(%p)->(%p): stub
\n
"
,
iface
,
children
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ID3DXFileDataImpl_GetChild
(
ID3DXFileData
*
iface
,
SIZE_T
id
,
ID3DXFileData
**
object
)
{
TRACE
(
"(%p)->(%lu, %p): stub
\n
"
,
iface
,
id
,
object
);
return
E_NOTIMPL
;
}
static
const
ID3DXFileDataVtbl
ID3DXFileData_Vtbl
=
{
ID3DXFileDataImpl_QueryInterface
,
ID3DXFileDataImpl_AddRef
,
ID3DXFileDataImpl_Release
,
ID3DXFileDataImpl_GetEnum
,
ID3DXFileDataImpl_GetName
,
ID3DXFileDataImpl_GetId
,
ID3DXFileDataImpl_Lock
,
ID3DXFileDataImpl_Unlock
,
ID3DXFileDataImpl_GetType
,
ID3DXFileDataImpl_IsReference
,
ID3DXFileDataImpl_GetChildren
,
ID3DXFileDataImpl_GetChild
};
static
HRESULT
ID3DXFileDataImpl_Create
(
IDirectXFileData
*
dxfile_data
,
ID3DXFileData
**
ret_iface
)
{
ID3DXFileDataImpl
*
object
;
TRACE
(
"(%p, %p)
\n
"
,
dxfile_data
,
ret_iface
);
*
ret_iface
=
NULL
;
object
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
object
->
ID3DXFileData_iface
.
lpVtbl
=
&
ID3DXFileData_Vtbl
;
object
->
ref
=
1
;
object
->
dxfile_data
=
dxfile_data
;
*
ret_iface
=
&
object
->
ID3DXFileData_iface
;
return
S_OK
;
}
/*** IUnknown methods ***/
...
...
@@ -90,7 +262,7 @@ static ULONG WINAPI ID3DXFileEnumObjectImpl_AddRef(ID3DXFileEnumObject *iface)
ID3DXFileEnumObjectImpl
*
This
=
impl_from_ID3DXFileEnumObject
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): new ref %u
\n
"
,
iface
,
ref
);
TRACE
(
"(%p)->(): new ref
=
%u
\n
"
,
iface
,
ref
);
return
ref
;
}
...
...
@@ -100,10 +272,17 @@ static ULONG WINAPI ID3DXFileEnumObjectImpl_Release(ID3DXFileEnumObject *iface)
ID3DXFileEnumObjectImpl
*
This
=
impl_from_ID3DXFileEnumObject
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): new ref %u
\n
"
,
iface
,
ref
);
TRACE
(
"(%p)->(): new ref
=
%u
\n
"
,
iface
,
ref
);
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
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
}
...
...
@@ -189,7 +368,7 @@ static ULONG WINAPI ID3DXFileImpl_AddRef(ID3DXFile *iface)
ID3DXFileImpl
*
This
=
impl_from_ID3DXFile
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): new ref
%d
\n
"
,
iface
,
ref
);
TRACE
(
"(%p)->(): new ref
= %u
\n
"
,
iface
,
ref
);
return
ref
;
}
...
...
@@ -200,7 +379,7 @@ static ULONG WINAPI ID3DXFileImpl_Release(ID3DXFile *iface)
ID3DXFileImpl
*
This
=
impl_from_ID3DXFile
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): new ref
%d
\n
"
,
iface
,
ref
);
TRACE
(
"(%p)->(): new ref
= %u
\n
"
,
iface
,
ref
);
if
(
!
ref
)
{
...
...
@@ -216,15 +395,53 @@ static ULONG WINAPI ID3DXFileImpl_Release(ID3DXFile *iface)
static
HRESULT
WINAPI
ID3DXFileImpl_CreateEnumObject
(
ID3DXFile
*
iface
,
const
void
*
source
,
D3DXF_FILELOADOPTIONS
options
,
ID3DXFileEnumObject
**
enum_object
)
{
ID3DXFileImpl
*
This
=
impl_from_ID3DXFile
(
iface
);
ID3DXFileEnumObjectImpl
*
object
;
IDirectXFileEnumObject
*
dxfile_enum_object
;
void
*
dxfile_source
;
DXFILELOADOPTIONS
dxfile_options
;
DXFILELOADRESOURCE
dxfile_resource
;
DXFILELOADMEMORY
dxfile_memory
;
IDirectXFileData
*
data_object
;
HRESULT
ret
;
FIXME
(
"(%p)->(%p, %x, %p): partial stub
\n
"
,
iface
,
source
,
options
,
enum_object
);
TRACE
(
"(%p)->(%p, %x, %p)
\n
"
,
iface
,
source
,
options
,
enum_object
);
if
(
!
enum_object
)
return
E_POINTER
;
*
enum_object
=
NULL
;
if
(
options
==
D3DXF_FILELOAD_FROMFILE
)
{
dxfile_source
=
(
void
*
)
source
;
dxfile_options
=
DXFILELOAD_FROMFILE
;
}
else
if
(
options
==
D3DXF_FILELOAD_FROMRESOURCE
)
{
D3DXF_FILELOADRESOURCE
*
resource
=
(
D3DXF_FILELOADRESOURCE
*
)
source
;
dxfile_resource
.
hModule
=
resource
->
hModule
;
dxfile_resource
.
lpName
=
resource
->
lpName
;
dxfile_resource
.
lpType
=
resource
->
lpType
;
dxfile_source
=
&
dxfile_resource
;
dxfile_options
=
DXFILELOAD_FROMRESOURCE
;
}
else
if
(
options
==
D3DXF_FILELOAD_FROMMEMORY
)
{
D3DXF_FILELOADMEMORY
*
memory
=
(
D3DXF_FILELOADMEMORY
*
)
source
;
dxfile_memory
.
lpMemory
=
memory
->
lpMemory
;
dxfile_memory
.
dSize
=
memory
->
dSize
;
dxfile_source
=
&
dxfile_memory
;
dxfile_options
=
DXFILELOAD_FROMMEMORY
;
}
else
{
FIXME
(
"Source type %u is not handled yet
\n
"
,
options
);
return
E_NOTIMPL
;
}
object
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
...
...
@@ -232,6 +449,39 @@ static HRESULT WINAPI ID3DXFileImpl_CreateEnumObject(ID3DXFile *iface, const voi
object
->
ID3DXFileEnumObject_iface
.
lpVtbl
=
&
ID3DXFileEnumObject_Vtbl
;
object
->
ref
=
1
;
ret
=
IDirectXFile_CreateEnumObject
(
This
->
dxfile
,
dxfile_source
,
dxfile_options
,
&
dxfile_enum_object
);
if
(
ret
!=
S_OK
)
{
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
ret
;
}
/* Fill enum object with top level data objects */
while
(
SUCCEEDED
(
ret
=
IDirectXFileEnumObject_GetNextDataObject
(
dxfile_enum_object
,
&
data_object
)))
{
if
(
object
->
children
)
object
->
children
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
object
->
children
,
sizeof
(
*
object
->
children
)
*
(
object
->
nb_children
+
1
));
else
object
->
children
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
object
->
children
));
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
++
;
}
IDirectXFileEnumObject_Release
(
dxfile_enum_object
);
if
(
ret
!=
DXFILEERR_NOMOREOBJECTS
)
WARN
(
"Cannot get all top level data objects
\n
"
);
TRACE
(
"Found %u children
\n
"
,
object
->
nb_children
);
*
enum_object
=
&
object
->
ID3DXFileEnumObject_iface
;
return
S_OK
;
...
...
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