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
675327c0
Commit
675327c0
authored
Sep 01, 2008
by
Christian Costa
Committed by
Alexandre Julliard
Sep 03, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dxof: Start implementing IDirectXFile_CreateEnumObject.
parent
3e76eacb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
4 deletions
+83
-4
d3dxof.c
dlls/d3dxof/d3dxof.c
+81
-4
d3dxof_private.h
dlls/d3dxof/d3dxof_private.h
+2
-0
No files found.
dlls/d3dxof/d3dxof.c
View file @
675327c0
...
...
@@ -161,33 +161,110 @@ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPV
IDirectXFileImpl
*
This
=
(
IDirectXFileImpl
*
)
iface
;
IDirectXFileEnumObjectImpl
*
object
;
HRESULT
hr
;
DWORD
header
[
4
];
DWORD
size
;
HANDLE
hFile
=
INVALID_HANDLE_VALUE
;
FIXME
(
"(%p/%p)->(%p,%x,%p) stub!
\n
"
,
This
,
iface
,
pvSource
,
dwLoadOptions
,
ppEnumObj
);
FIXME
(
"(%p/%p)->(%p,%x,%p) partial stub!
\n
"
,
This
,
iface
,
pvSource
,
dwLoadOptions
,
ppEnumObj
);
if
(
!
ppEnumObj
)
return
DXFILEERR_BADVALUE
;
if
(
dwLoadOptions
==
DXFILELOAD_FROMFILE
)
{
HANDLE
hFile
;
TRACE
(
"Open source file '%s'
\n
"
,
(
char
*
)
pvSource
);
hFile
=
CreateFileA
((
char
*
)
pvSource
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
if
(
hFile
==
INVALID_HANDLE_VALUE
)
{
TRACE
(
"File '%s' not found
\n
"
,
(
char
*
)
pvSource
);
return
DXFILEERR_FILENOTFOUND
;
}
CloseHandle
(
hFile
);
if
(
!
ReadFile
(
hFile
,
header
,
16
,
&
size
,
NULL
))
{
hr
=
DXFILEERR_BADVALUE
;
goto
error
;
}
if
(
size
<
16
)
{
hr
=
DXFILEERR_BADFILETYPE
;
goto
error
;
}
if
(
TRACE_ON
(
d3dxof
))
{
char
string
[
17
];
memcpy
(
string
,
header
,
16
);
string
[
16
]
=
0
;
TRACE
(
"header = '%s'
\n
"
,
string
);
}
}
else
{
FIXME
(
"Source type %d is not handled yet
\n
"
,
dwLoadOptions
);
hr
=
DXFILEERR_NOTDONEYET
;
goto
error
;
}
if
(
header
[
0
]
!=
XOFFILE_FORMAT_MAGIC
)
{
hr
=
DXFILEERR_BADFILETYPE
;
goto
error
;
}
if
(
header
[
1
]
!=
XOFFILE_FORMAT_VERSION
)
{
hr
=
DXFILEERR_BADFILEVERSION
;
goto
error
;
}
if
((
header
[
2
]
!=
XOFFILE_FORMAT_BINARY
)
&&
(
header
[
2
]
!=
XOFFILE_FORMAT_TEXT
)
&&
(
header
[
2
]
!=
XOFFILE_FORMAT_COMPRESSED
))
{
hr
=
DXFILEERR_BADFILETYPE
;
goto
error
;
}
if
(
header
[
2
]
==
XOFFILE_FORMAT_TEXT
)
{
FIXME
(
"Binary format not supported yet
\n
"
);
hr
=
DXFILEERR_NOTDONEYET
;
goto
error
;
}
if
(
header
[
2
]
==
XOFFILE_FORMAT_COMPRESSED
)
{
FIXME
(
"Compressed formats not supported yet"
);
hr
=
DXFILEERR_BADVALUE
;
goto
error
;
}
if
((
header
[
3
]
!=
XOFFILE_FORMAT_FLOAT_BITS_32
)
&&
(
header
[
3
]
!=
XOFFILE_FORMAT_FLOAT_BITS_64
))
{
hr
=
DXFILEERR_BADFILEFLOATSIZE
;
goto
error
;
}
TRACE
(
"Header is correct
\n
"
);
hr
=
IDirectXFileEnumObjectImpl_Create
(
&
object
);
if
(
!
SUCCEEDED
(
hr
))
return
hr
;
goto
error
;
object
->
source
=
dwLoadOptions
;
object
->
hFile
=
hFile
;
*
ppEnumObj
=
(
LPDIRECTXFILEENUMOBJECT
)
object
;
return
DXFILE_OK
;
error:
if
(
hFile
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
hFile
);
*
ppEnumObj
=
NULL
;
return
hr
;
}
static
HRESULT
WINAPI
IDirectXFileImpl_CreateSaveObject
(
IDirectXFile
*
iface
,
LPCSTR
szFileName
,
DXFILEFORMAT
dwFileFormat
,
LPDIRECTXFILESAVEOBJECT
*
ppSaveObj
)
...
...
dlls/d3dxof/d3dxof_private.h
View file @
675327c0
...
...
@@ -88,6 +88,8 @@ typedef struct {
typedef
struct
{
IDirectXFileEnumObject
lpVtbl
;
LONG
ref
;
DXFILELOADOPTIONS
source
;
HANDLE
hFile
;
}
IDirectXFileEnumObjectImpl
;
typedef
struct
{
...
...
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