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
ef12437b
Commit
ef12437b
authored
Sep 25, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Sep 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dswave: Simplify the stub WAVE IPersistStream_Load().
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fabef7ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
156 deletions
+19
-156
dswave.c
dlls/dswave/dswave.c
+19
-147
dswave_private.h
dlls/dswave/dswave_private.h
+0
-9
No files found.
dlls/dswave/dswave.c
View file @
ef12437b
...
...
@@ -21,8 +21,7 @@
#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dswave
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
/* an interface that is, according to my tests, obtained by loader after loading object; is it acting
as some sort of bridge between object and loader? */
static
const
GUID
IID_IDirectMusicWavePRIVATE
=
{
0x69e934e4
,
0x97f1
,
0x4f1d
,{
0x88
,
0xe8
,
0xf2
,
0xac
,
0x88
,
0x67
,
0x13
,
0x27
}};
...
...
@@ -144,151 +143,24 @@ static inline IDirectMusicWaveImpl *impl_from_IPersistStream(IPersistStream *ifa
return
CONTAINING_RECORD
(
iface
,
IDirectMusicWaveImpl
,
dmobj
.
IPersistStream_iface
);
}
static
HRESULT
WINAPI
IPersistStreamImpl_Load
(
IPersistStream
*
iface
,
IStream
*
pSt
m
)
static
HRESULT
WINAPI
wave_IPersistStream_Load
(
IPersistStream
*
iface
,
IStream
*
strea
m
)
{
IDirectMusicWaveImpl
*
This
=
impl_from_IPersistStream
(
iface
);
DMUS_PRIVATE_CHUNK
Chunk
;
DWORD
StreamSize
,
StreamCount
,
ListSize
[
1
],
ListCount
[
1
];
LARGE_INTEGER
liMove
;
/* used when skipping chunks */
FIXME
(
"(%p, %p): loading not implemented yet (only descriptor is loaded)
\n
"
,
This
,
pStm
);
/* FIXME: should this be determined from stream? */
This
->
dmobj
.
desc
.
dwValidData
|=
DMUS_OBJ_CLASS
;
This
->
dmobj
.
desc
.
guidClass
=
CLSID_DirectMusicSegment
;
IStream_Read
(
pStm
,
&
Chunk
,
sizeof
(
FOURCC
)
+
sizeof
(
DWORD
),
NULL
);
TRACE_
(
dmfile
)(
": %s chunk (size = 0x%04x)"
,
debugstr_fourcc
(
Chunk
.
fccID
),
Chunk
.
dwSize
);
switch
(
Chunk
.
fccID
)
{
case
FOURCC_RIFF
:
{
IStream_Read
(
pStm
,
&
Chunk
.
fccID
,
sizeof
(
FOURCC
),
NULL
);
TRACE_
(
dmfile
)(
": RIFF chunk of type %s"
,
debugstr_fourcc
(
Chunk
.
fccID
));
StreamSize
=
Chunk
.
dwSize
-
sizeof
(
FOURCC
);
StreamCount
=
0
;
if
(
Chunk
.
fccID
==
mmioFOURCC
(
'W'
,
'A'
,
'V'
,
'E'
))
{
TRACE_
(
dmfile
)(
": wave form
\n
"
);
do
{
IStream_Read
(
pStm
,
&
Chunk
,
sizeof
(
FOURCC
)
+
sizeof
(
DWORD
),
NULL
);
StreamCount
+=
sizeof
(
FOURCC
)
+
sizeof
(
DWORD
)
+
Chunk
.
dwSize
;
TRACE_
(
dmfile
)(
": %s chunk (size = 0x%04x)"
,
debugstr_fourcc
(
Chunk
.
fccID
),
Chunk
.
dwSize
);
switch
(
Chunk
.
fccID
)
{
case
DMUS_FOURCC_GUID_CHUNK
:
{
TRACE_
(
dmfile
)(
": GUID chunk
\n
"
);
This
->
dmobj
.
desc
.
dwValidData
|=
DMUS_OBJ_OBJECT
;
IStream_Read
(
pStm
,
&
This
->
dmobj
.
desc
.
guidObject
,
Chunk
.
dwSize
,
NULL
);
break
;
}
case
DMUS_FOURCC_VERSION_CHUNK
:
{
TRACE_
(
dmfile
)(
": version chunk
\n
"
);
This
->
dmobj
.
desc
.
dwValidData
|=
DMUS_OBJ_VERSION
;
IStream_Read
(
pStm
,
&
This
->
dmobj
.
desc
.
vVersion
,
Chunk
.
dwSize
,
NULL
);
break
;
}
case
DMUS_FOURCC_CATEGORY_CHUNK
:
{
TRACE_
(
dmfile
)(
": category chunk
\n
"
);
This
->
dmobj
.
desc
.
dwValidData
|=
DMUS_OBJ_CATEGORY
;
IStream_Read
(
pStm
,
This
->
dmobj
.
desc
.
wszCategory
,
Chunk
.
dwSize
,
NULL
);
break
;
}
case
FOURCC_LIST
:
{
IStream_Read
(
pStm
,
&
Chunk
.
fccID
,
sizeof
(
FOURCC
),
NULL
);
TRACE_
(
dmfile
)(
": LIST chunk of type %s"
,
debugstr_fourcc
(
Chunk
.
fccID
));
ListSize
[
0
]
=
Chunk
.
dwSize
-
sizeof
(
FOURCC
);
ListCount
[
0
]
=
0
;
switch
(
Chunk
.
fccID
)
{
/* evil M$ UNFO list, which can (!?) contain INFO elements */
case
DMUS_FOURCC_UNFO_LIST
:
{
TRACE_
(
dmfile
)(
": UNFO list
\n
"
);
do
{
IStream_Read
(
pStm
,
&
Chunk
,
sizeof
(
FOURCC
)
+
sizeof
(
DWORD
),
NULL
);
ListCount
[
0
]
+=
sizeof
(
FOURCC
)
+
sizeof
(
DWORD
)
+
Chunk
.
dwSize
;
TRACE_
(
dmfile
)(
": %s chunk (size = 0x%04x)"
,
debugstr_fourcc
(
Chunk
.
fccID
),
Chunk
.
dwSize
);
switch
(
Chunk
.
fccID
)
{
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case
mmioFOURCC
(
'I'
,
'N'
,
'A'
,
'M'
):
case
DMUS_FOURCC_UNAM_CHUNK
:
{
TRACE_
(
dmfile
)(
": name chunk
\n
"
);
This
->
dmobj
.
desc
.
dwValidData
|=
DMUS_OBJ_NAME
;
IStream_Read
(
pStm
,
This
->
dmobj
.
desc
.
wszName
,
Chunk
.
dwSize
,
NULL
);
break
;
}
case
mmioFOURCC
(
'I'
,
'A'
,
'R'
,
'T'
):
case
DMUS_FOURCC_UART_CHUNK
:
{
TRACE_
(
dmfile
)(
": artist chunk (ignored)
\n
"
);
liMove
.
QuadPart
=
Chunk
.
dwSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
case
mmioFOURCC
(
'I'
,
'C'
,
'O'
,
'P'
):
case
DMUS_FOURCC_UCOP_CHUNK
:
{
TRACE_
(
dmfile
)(
": copyright chunk (ignored)
\n
"
);
liMove
.
QuadPart
=
Chunk
.
dwSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
case
mmioFOURCC
(
'I'
,
'S'
,
'B'
,
'J'
):
case
DMUS_FOURCC_USBJ_CHUNK
:
{
TRACE_
(
dmfile
)(
": subject chunk (ignored)
\n
"
);
liMove
.
QuadPart
=
Chunk
.
dwSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
case
mmioFOURCC
(
'I'
,
'C'
,
'M'
,
'T'
):
case
DMUS_FOURCC_UCMT_CHUNK
:
{
TRACE_
(
dmfile
)(
": comment chunk (ignored)
\n
"
);
liMove
.
QuadPart
=
Chunk
.
dwSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unknown chunk (irrelevant & skipping)
\n
"
);
liMove
.
QuadPart
=
Chunk
.
dwSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
}
TRACE_
(
dmfile
)(
": ListCount[0] = %d < ListSize[0] = %d
\n
"
,
ListCount
[
0
],
ListSize
[
0
]);
}
while
(
ListCount
[
0
]
<
ListSize
[
0
]);
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unknown (skipping)
\n
"
);
liMove
.
QuadPart
=
Chunk
.
dwSize
-
sizeof
(
FOURCC
);
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
}
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unknown chunk (irrelevant & skipping)
\n
"
);
liMove
.
QuadPart
=
Chunk
.
dwSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
break
;
}
}
TRACE_
(
dmfile
)(
": StreamCount[0] = %d < StreamSize[0] = %d
\n
"
,
StreamCount
,
StreamSize
);
}
while
(
StreamCount
<
StreamSize
);
}
else
{
TRACE_
(
dmfile
)(
": unexpected chunk; loading failed)
\n
"
);
liMove
.
QuadPart
=
StreamSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
/* skip the rest of the chunk */
return
E_FAIL
;
}
TRACE_
(
dmfile
)(
": reading finished
\n
"
);
break
;
}
default:
{
TRACE_
(
dmfile
)(
": unexpected chunk; loading failed)
\n
"
);
liMove
.
QuadPart
=
Chunk
.
dwSize
;
IStream_Seek
(
pStm
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
/* skip the rest of the chunk */
return
DMUS_E_INVALIDFILE
;
}
}
return
S_OK
;
IDirectMusicWaveImpl
*
This
=
impl_from_IPersistStream
(
iface
);
struct
chunk_entry
riff
=
{
0
};
/* Without the private interface the implementation should go to dmime/segment.c */
FIXME
(
"(%p, %p): loading not implemented (only descriptor is loaded)
\n
"
,
This
,
stream
);
if
(
!
stream
)
return
E_POINTER
;
if
(
stream_get_chunk
(
stream
,
&
riff
)
!=
S_OK
||
riff
.
id
!=
FOURCC_RIFF
||
riff
.
type
!=
mmioFOURCC
(
'W'
,
'A'
,
'V'
,
'E'
))
return
DMUS_E_UNSUPPORTED_STREAM
;
stream_reset_chunk_start
(
stream
,
&
riff
);
return
IDirectMusicObject_ParseDescriptor
(
&
This
->
dmobj
.
IDirectMusicObject_iface
,
stream
,
&
This
->
dmobj
.
desc
);
}
static
const
IPersistStreamVtbl
persiststream_vtbl
=
{
...
...
@@ -297,7 +169,7 @@ static const IPersistStreamVtbl persiststream_vtbl = {
dmobj_IPersistStream_Release
,
dmobj_IPersistStream_GetClassID
,
unimpl_IPersistStream_IsDirty
,
IPersistStreamImpl
_Load
,
wave_IPersistStream
_Load
,
unimpl_IPersistStream_Save
,
unimpl_IPersistStream_GetSizeMax
};
...
...
dlls/dswave/dswave_private.h
View file @
ef12437b
...
...
@@ -51,13 +51,4 @@ extern LONG DSWAVE_refCount DECLSPEC_HIDDEN;
static
inline
void
DSWAVE_LockModule
(
void
)
{
InterlockedIncrement
(
&
DSWAVE_refCount
);
}
static
inline
void
DSWAVE_UnlockModule
(
void
)
{
InterlockedDecrement
(
&
DSWAVE_refCount
);
}
/*****************************************************************************
* Misc.
*/
/* for simpler reading */
typedef
struct
_DMUS_PRIVATE_CHUNK
{
FOURCC
fccID
;
/* FOURCC ID of the chunk */
DWORD
dwSize
;
/* size of the chunk */
}
DMUS_PRIVATE_CHUNK
,
*
LPDMUS_PRIVATE_CHUNK
;
#endif
/* __WINE_DSWAVE_PRIVATE_H */
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