Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9f9fce44
Commit
9f9fce44
authored
Nov 30, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Dec 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Sync up the dmobject.[ch] files.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2ad09b01
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
791 additions
and
42 deletions
+791
-42
dmobject.c
dlls/dmband/dmobject.c
+106
-5
dmobject.h
dlls/dmband/dmobject.h
+7
-1
dmobject.c
dlls/dmcompos/dmobject.c
+106
-5
dmobject.h
dlls/dmcompos/dmobject.h
+7
-1
dmobject.c
dlls/dmloader/dmobject.c
+106
-5
dmobject.h
dlls/dmloader/dmobject.h
+7
-1
dmobject.c
dlls/dmscript/dmobject.c
+106
-5
dmobject.h
dlls/dmscript/dmobject.h
+7
-1
dmobject.c
dlls/dmstyle/dmobject.c
+106
-5
dmobject.h
dlls/dmstyle/dmobject.h
+7
-1
dmobject.c
dlls/dmusic/dmobject.c
+106
-5
dmobject.h
dlls/dmusic/dmobject.h
+7
-1
dmobject.c
dlls/dswave/dmobject.c
+106
-5
dmobject.h
dlls/dswave/dmobject.h
+7
-1
No files found.
dlls/dmband/dmobject.c
View file @
9f9fce44
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "dmusics.h"
#include "dmusics.h"
#include "dmobject.h"
#include "dmobject.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmobj
);
WINE_DEFAULT_DEBUG_CHANNEL
(
dmobj
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
...
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
...
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
return
S_OK
;
return
S_OK
;
}
}
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
)
{
{
LARGE_INTEGER
end
;
LARGE_INTEGER
end
;
...
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
...
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
return
stream_get_chunk
(
stream
,
chunk
);
return
stream_get_chunk
(
stream
,
chunk
);
}
}
/* Reads chunk data of the form:
DWORD - size of array element
element[] - Array of elements
The caller needs to heap_free() the array.
*/
HRESULT
stream_chunk_get_array
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
**
array
,
unsigned
int
*
count
,
DWORD
elem_size
)
{
DWORD
size
;
HRESULT
hr
;
*
array
=
NULL
;
*
count
=
0
;
if
(
chunk
->
size
<
sizeof
(
DWORD
))
{
WARN_
(
dmfile
)(
"%s: Too short to read element size
\n
"
,
debugstr_chunk
(
chunk
));
return
E_FAIL
;
}
if
(
FAILED
(
hr
=
stream_read
(
stream
,
&
size
,
sizeof
(
DWORD
))))
return
hr
;
if
(
size
!=
elem_size
)
{
WARN_
(
dmfile
)(
"%s: Array element size mismatch: got %u, expected %u
\n
"
,
debugstr_chunk
(
chunk
),
size
,
elem_size
);
return
DMUS_E_UNSUPPORTED_STREAM
;
}
*
count
=
(
chunk
->
size
-
sizeof
(
DWORD
))
/
elem_size
;
size
=
*
count
*
elem_size
;
if
(
!
(
*
array
=
heap_alloc
(
size
)))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
stream_read
(
stream
,
*
array
,
size
)))
{
heap_free
(
*
array
);
*
array
=
NULL
;
return
hr
;
}
if
(
chunk
->
size
>
size
+
sizeof
(
DWORD
))
{
WARN_
(
dmfile
)(
"%s: Extraneous data at end of array
\n
"
,
debugstr_chunk
(
chunk
));
stream_skip_chunk
(
stream
,
chunk
);
return
S_FALSE
;
}
return
S_OK
;
}
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
ULONG
size
)
ULONG
size
)
{
{
...
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
switch
(
chunk
.
id
)
{
switch
(
chunk
.
id
)
{
case
DMUS_FOURCC_CATEGORY_CHUNK
:
if
((
supported
&
DMUS_OBJ_CATEGORY
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wszCategory
,
sizeof
(
desc
->
wszCategory
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_CATEGORY
;
break
;
case
DMUS_FOURCC_DATE_CHUNK
:
if
((
supported
&
DMUS_OBJ_DATE
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
&
desc
->
ftDate
,
sizeof
(
desc
->
ftDate
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_DATE
;
break
;
case
DMUS_FOURCC_FILE_CHUNK
:
if
((
supported
&
DMUS_OBJ_FILENAME
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wszFileName
,
sizeof
(
desc
->
wszFileName
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_FILENAME
;
break
;
case
DMUS_FOURCC_GUID_CHUNK
:
case
DMUS_FOURCC_GUID_CHUNK
:
if
((
supported
&
DMUS_OBJ_OBJECT
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_OBJECT
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
&
desc
->
guidObject
,
sizeof
(
desc
->
guidObject
))
==
S_OK
)
&
desc
->
guidObject
,
sizeof
(
desc
->
guidObject
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_OBJECT
;
desc
->
dwValidData
|=
DMUS_OBJ_OBJECT
;
break
;
break
;
case
DMUS_FOURCC_
CATEGORY
_CHUNK
:
case
DMUS_FOURCC_
NAME
_CHUNK
:
if
((
supported
&
DMUS_OBJ_
CATEGORY
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_
NAME
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wsz
Category
,
sizeof
(
desc
->
wszCategory
))
==
S_OK
)
desc
->
wsz
Name
,
sizeof
(
desc
->
wszName
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_
CATEGORY
;
desc
->
dwValidData
|=
DMUS_OBJ_
NAME
;
break
;
break
;
case
DMUS_FOURCC_VERSION_CHUNK
:
case
DMUS_FOURCC_VERSION_CHUNK
:
if
((
supported
&
DMUS_OBJ_VERSION
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_VERSION
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
...
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
return
hr
;
return
hr
;
}
}
HRESULT
dmobj_parsereference
(
IStream
*
stream
,
const
struct
chunk_entry
*
list
,
IDirectMusicObject
**
dmobj
)
{
struct
chunk_entry
chunk
=
{.
parent
=
list
};
IDirectMusicGetLoader
*
getloader
;
IDirectMusicLoader
*
loader
;
DMUS_OBJECTDESC
desc
;
DMUS_IO_REFERENCE
reference
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
stream_next_chunk
(
stream
,
&
chunk
)))
return
hr
;
if
(
chunk
.
id
!=
DMUS_FOURCC_REF_CHUNK
)
return
DMUS_E_UNSUPPORTED_STREAM
;
if
(
FAILED
(
hr
=
stream_chunk_get_data
(
stream
,
&
chunk
,
&
reference
,
sizeof
(
reference
))))
{
WARN
(
"Failed to read data of %s
\n
"
,
debugstr_chunk
(
&
chunk
));
return
hr
;
}
TRACE
(
"REFERENCE guidClassID %s, dwValidData %#x
\n
"
,
debugstr_dmguid
(
&
reference
.
guidClassID
),
reference
.
dwValidData
);
if
(
FAILED
(
hr
=
dmobj_parsedescriptor
(
stream
,
list
,
&
desc
,
reference
.
dwValidData
)))
return
hr
;
desc
.
guidClass
=
reference
.
guidClassID
;
desc
.
dwValidData
|=
DMUS_OBJ_CLASS
;
dump_DMUS_OBJECTDESC
(
&
desc
);
if
(
FAILED
(
hr
=
IStream_QueryInterface
(
stream
,
&
IID_IDirectMusicGetLoader
,
(
void
**
)
&
getloader
)))
return
hr
;
hr
=
IDirectMusicGetLoader_GetLoader
(
getloader
,
&
loader
);
IDirectMusicGetLoader_Release
(
getloader
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IDirectMusicLoader_GetObject
(
loader
,
&
desc
,
&
IID_IDirectMusicObject
,
(
void
**
)
dmobj
);
IDirectMusicLoader_Release
(
loader
);
return
hr
;
}
/* Generic IPersistStream methods */
/* Generic IPersistStream methods */
static
inline
struct
dmobject
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
static
inline
struct
dmobject
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
{
{
...
...
dlls/dmband/dmobject.h
View file @
9f9fce44
...
@@ -33,8 +33,10 @@ struct chunk_entry {
...
@@ -33,8 +33,10 @@ struct chunk_entry {
HRESULT
stream_get_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_get_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_next_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_next_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_array
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
**
array
,
unsigned
int
*
count
,
DWORD
elem_size
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
ULONG
size
)
DECLSPEC_HIDDEN
;
ULONG
size
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_wstr
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
WCHAR
*
str
,
HRESULT
stream_chunk_get_wstr
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
WCHAR
*
str
,
...
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
#define DMUS_OBJ_NAME_INAM 0x1000
/* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INAM 0x1000
/* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INFO 0x2000
/* 'INAM' chunk in INFO list */
#define DMUS_OBJ_NAME_INFO 0x2000
/* 'INAM' chunk in INFO list */
/* 'DMRF' (reference list) helper */
HRESULT
dmobj_parsereference
(
IStream
*
stream
,
const
struct
chunk_entry
*
list
,
IDirectMusicObject
**
dmobj
)
DECLSPEC_HIDDEN
;
/* Generic IPersistStream methods */
/* Generic IPersistStream methods */
HRESULT
WINAPI
dmobj_IPersistStream_QueryInterface
(
IPersistStream
*
iface
,
REFIID
riid
,
HRESULT
WINAPI
dmobj_IPersistStream_QueryInterface
(
IPersistStream
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
DECLSPEC_HIDDEN
;
void
**
ret_iface
)
DECLSPEC_HIDDEN
;
...
...
dlls/dmcompos/dmobject.c
View file @
9f9fce44
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "dmusics.h"
#include "dmusics.h"
#include "dmobject.h"
#include "dmobject.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmobj
);
WINE_DEFAULT_DEBUG_CHANNEL
(
dmobj
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
...
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
...
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
return
S_OK
;
return
S_OK
;
}
}
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
)
{
{
LARGE_INTEGER
end
;
LARGE_INTEGER
end
;
...
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
...
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
return
stream_get_chunk
(
stream
,
chunk
);
return
stream_get_chunk
(
stream
,
chunk
);
}
}
/* Reads chunk data of the form:
DWORD - size of array element
element[] - Array of elements
The caller needs to heap_free() the array.
*/
HRESULT
stream_chunk_get_array
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
**
array
,
unsigned
int
*
count
,
DWORD
elem_size
)
{
DWORD
size
;
HRESULT
hr
;
*
array
=
NULL
;
*
count
=
0
;
if
(
chunk
->
size
<
sizeof
(
DWORD
))
{
WARN_
(
dmfile
)(
"%s: Too short to read element size
\n
"
,
debugstr_chunk
(
chunk
));
return
E_FAIL
;
}
if
(
FAILED
(
hr
=
stream_read
(
stream
,
&
size
,
sizeof
(
DWORD
))))
return
hr
;
if
(
size
!=
elem_size
)
{
WARN_
(
dmfile
)(
"%s: Array element size mismatch: got %u, expected %u
\n
"
,
debugstr_chunk
(
chunk
),
size
,
elem_size
);
return
DMUS_E_UNSUPPORTED_STREAM
;
}
*
count
=
(
chunk
->
size
-
sizeof
(
DWORD
))
/
elem_size
;
size
=
*
count
*
elem_size
;
if
(
!
(
*
array
=
heap_alloc
(
size
)))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
stream_read
(
stream
,
*
array
,
size
)))
{
heap_free
(
*
array
);
*
array
=
NULL
;
return
hr
;
}
if
(
chunk
->
size
>
size
+
sizeof
(
DWORD
))
{
WARN_
(
dmfile
)(
"%s: Extraneous data at end of array
\n
"
,
debugstr_chunk
(
chunk
));
stream_skip_chunk
(
stream
,
chunk
);
return
S_FALSE
;
}
return
S_OK
;
}
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
ULONG
size
)
ULONG
size
)
{
{
...
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
switch
(
chunk
.
id
)
{
switch
(
chunk
.
id
)
{
case
DMUS_FOURCC_CATEGORY_CHUNK
:
if
((
supported
&
DMUS_OBJ_CATEGORY
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wszCategory
,
sizeof
(
desc
->
wszCategory
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_CATEGORY
;
break
;
case
DMUS_FOURCC_DATE_CHUNK
:
if
((
supported
&
DMUS_OBJ_DATE
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
&
desc
->
ftDate
,
sizeof
(
desc
->
ftDate
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_DATE
;
break
;
case
DMUS_FOURCC_FILE_CHUNK
:
if
((
supported
&
DMUS_OBJ_FILENAME
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wszFileName
,
sizeof
(
desc
->
wszFileName
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_FILENAME
;
break
;
case
DMUS_FOURCC_GUID_CHUNK
:
case
DMUS_FOURCC_GUID_CHUNK
:
if
((
supported
&
DMUS_OBJ_OBJECT
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_OBJECT
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
&
desc
->
guidObject
,
sizeof
(
desc
->
guidObject
))
==
S_OK
)
&
desc
->
guidObject
,
sizeof
(
desc
->
guidObject
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_OBJECT
;
desc
->
dwValidData
|=
DMUS_OBJ_OBJECT
;
break
;
break
;
case
DMUS_FOURCC_
CATEGORY
_CHUNK
:
case
DMUS_FOURCC_
NAME
_CHUNK
:
if
((
supported
&
DMUS_OBJ_
CATEGORY
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_
NAME
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wsz
Category
,
sizeof
(
desc
->
wszCategory
))
==
S_OK
)
desc
->
wsz
Name
,
sizeof
(
desc
->
wszName
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_
CATEGORY
;
desc
->
dwValidData
|=
DMUS_OBJ_
NAME
;
break
;
break
;
case
DMUS_FOURCC_VERSION_CHUNK
:
case
DMUS_FOURCC_VERSION_CHUNK
:
if
((
supported
&
DMUS_OBJ_VERSION
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_VERSION
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
...
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
return
hr
;
return
hr
;
}
}
HRESULT
dmobj_parsereference
(
IStream
*
stream
,
const
struct
chunk_entry
*
list
,
IDirectMusicObject
**
dmobj
)
{
struct
chunk_entry
chunk
=
{.
parent
=
list
};
IDirectMusicGetLoader
*
getloader
;
IDirectMusicLoader
*
loader
;
DMUS_OBJECTDESC
desc
;
DMUS_IO_REFERENCE
reference
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
stream_next_chunk
(
stream
,
&
chunk
)))
return
hr
;
if
(
chunk
.
id
!=
DMUS_FOURCC_REF_CHUNK
)
return
DMUS_E_UNSUPPORTED_STREAM
;
if
(
FAILED
(
hr
=
stream_chunk_get_data
(
stream
,
&
chunk
,
&
reference
,
sizeof
(
reference
))))
{
WARN
(
"Failed to read data of %s
\n
"
,
debugstr_chunk
(
&
chunk
));
return
hr
;
}
TRACE
(
"REFERENCE guidClassID %s, dwValidData %#x
\n
"
,
debugstr_dmguid
(
&
reference
.
guidClassID
),
reference
.
dwValidData
);
if
(
FAILED
(
hr
=
dmobj_parsedescriptor
(
stream
,
list
,
&
desc
,
reference
.
dwValidData
)))
return
hr
;
desc
.
guidClass
=
reference
.
guidClassID
;
desc
.
dwValidData
|=
DMUS_OBJ_CLASS
;
dump_DMUS_OBJECTDESC
(
&
desc
);
if
(
FAILED
(
hr
=
IStream_QueryInterface
(
stream
,
&
IID_IDirectMusicGetLoader
,
(
void
**
)
&
getloader
)))
return
hr
;
hr
=
IDirectMusicGetLoader_GetLoader
(
getloader
,
&
loader
);
IDirectMusicGetLoader_Release
(
getloader
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IDirectMusicLoader_GetObject
(
loader
,
&
desc
,
&
IID_IDirectMusicObject
,
(
void
**
)
dmobj
);
IDirectMusicLoader_Release
(
loader
);
return
hr
;
}
/* Generic IPersistStream methods */
/* Generic IPersistStream methods */
static
inline
struct
dmobject
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
static
inline
struct
dmobject
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
{
{
...
...
dlls/dmcompos/dmobject.h
View file @
9f9fce44
...
@@ -33,8 +33,10 @@ struct chunk_entry {
...
@@ -33,8 +33,10 @@ struct chunk_entry {
HRESULT
stream_get_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_get_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_next_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_next_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_array
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
**
array
,
unsigned
int
*
count
,
DWORD
elem_size
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
ULONG
size
)
DECLSPEC_HIDDEN
;
ULONG
size
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_wstr
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
WCHAR
*
str
,
HRESULT
stream_chunk_get_wstr
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
WCHAR
*
str
,
...
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
#define DMUS_OBJ_NAME_INAM 0x1000
/* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INAM 0x1000
/* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INFO 0x2000
/* 'INAM' chunk in INFO list */
#define DMUS_OBJ_NAME_INFO 0x2000
/* 'INAM' chunk in INFO list */
/* 'DMRF' (reference list) helper */
HRESULT
dmobj_parsereference
(
IStream
*
stream
,
const
struct
chunk_entry
*
list
,
IDirectMusicObject
**
dmobj
)
DECLSPEC_HIDDEN
;
/* Generic IPersistStream methods */
/* Generic IPersistStream methods */
HRESULT
WINAPI
dmobj_IPersistStream_QueryInterface
(
IPersistStream
*
iface
,
REFIID
riid
,
HRESULT
WINAPI
dmobj_IPersistStream_QueryInterface
(
IPersistStream
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
DECLSPEC_HIDDEN
;
void
**
ret_iface
)
DECLSPEC_HIDDEN
;
...
...
dlls/dmloader/dmobject.c
View file @
9f9fce44
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "dmusics.h"
#include "dmusics.h"
#include "dmobject.h"
#include "dmobject.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmobj
);
WINE_DEFAULT_DEBUG_CHANNEL
(
dmobj
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
...
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
...
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
return
S_OK
;
return
S_OK
;
}
}
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
)
{
{
LARGE_INTEGER
end
;
LARGE_INTEGER
end
;
...
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
...
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
return
stream_get_chunk
(
stream
,
chunk
);
return
stream_get_chunk
(
stream
,
chunk
);
}
}
/* Reads chunk data of the form:
DWORD - size of array element
element[] - Array of elements
The caller needs to heap_free() the array.
*/
HRESULT
stream_chunk_get_array
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
**
array
,
unsigned
int
*
count
,
DWORD
elem_size
)
{
DWORD
size
;
HRESULT
hr
;
*
array
=
NULL
;
*
count
=
0
;
if
(
chunk
->
size
<
sizeof
(
DWORD
))
{
WARN_
(
dmfile
)(
"%s: Too short to read element size
\n
"
,
debugstr_chunk
(
chunk
));
return
E_FAIL
;
}
if
(
FAILED
(
hr
=
stream_read
(
stream
,
&
size
,
sizeof
(
DWORD
))))
return
hr
;
if
(
size
!=
elem_size
)
{
WARN_
(
dmfile
)(
"%s: Array element size mismatch: got %u, expected %u
\n
"
,
debugstr_chunk
(
chunk
),
size
,
elem_size
);
return
DMUS_E_UNSUPPORTED_STREAM
;
}
*
count
=
(
chunk
->
size
-
sizeof
(
DWORD
))
/
elem_size
;
size
=
*
count
*
elem_size
;
if
(
!
(
*
array
=
heap_alloc
(
size
)))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
stream_read
(
stream
,
*
array
,
size
)))
{
heap_free
(
*
array
);
*
array
=
NULL
;
return
hr
;
}
if
(
chunk
->
size
>
size
+
sizeof
(
DWORD
))
{
WARN_
(
dmfile
)(
"%s: Extraneous data at end of array
\n
"
,
debugstr_chunk
(
chunk
));
stream_skip_chunk
(
stream
,
chunk
);
return
S_FALSE
;
}
return
S_OK
;
}
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
ULONG
size
)
ULONG
size
)
{
{
...
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
switch
(
chunk
.
id
)
{
switch
(
chunk
.
id
)
{
case
DMUS_FOURCC_CATEGORY_CHUNK
:
if
((
supported
&
DMUS_OBJ_CATEGORY
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wszCategory
,
sizeof
(
desc
->
wszCategory
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_CATEGORY
;
break
;
case
DMUS_FOURCC_DATE_CHUNK
:
if
((
supported
&
DMUS_OBJ_DATE
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
&
desc
->
ftDate
,
sizeof
(
desc
->
ftDate
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_DATE
;
break
;
case
DMUS_FOURCC_FILE_CHUNK
:
if
((
supported
&
DMUS_OBJ_FILENAME
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wszFileName
,
sizeof
(
desc
->
wszFileName
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_FILENAME
;
break
;
case
DMUS_FOURCC_GUID_CHUNK
:
case
DMUS_FOURCC_GUID_CHUNK
:
if
((
supported
&
DMUS_OBJ_OBJECT
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_OBJECT
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
&
desc
->
guidObject
,
sizeof
(
desc
->
guidObject
))
==
S_OK
)
&
desc
->
guidObject
,
sizeof
(
desc
->
guidObject
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_OBJECT
;
desc
->
dwValidData
|=
DMUS_OBJ_OBJECT
;
break
;
break
;
case
DMUS_FOURCC_
CATEGORY
_CHUNK
:
case
DMUS_FOURCC_
NAME
_CHUNK
:
if
((
supported
&
DMUS_OBJ_
CATEGORY
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_
NAME
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wsz
Category
,
sizeof
(
desc
->
wszCategory
))
==
S_OK
)
desc
->
wsz
Name
,
sizeof
(
desc
->
wszName
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_
CATEGORY
;
desc
->
dwValidData
|=
DMUS_OBJ_
NAME
;
break
;
break
;
case
DMUS_FOURCC_VERSION_CHUNK
:
case
DMUS_FOURCC_VERSION_CHUNK
:
if
((
supported
&
DMUS_OBJ_VERSION
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_VERSION
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
...
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
return
hr
;
return
hr
;
}
}
HRESULT
dmobj_parsereference
(
IStream
*
stream
,
const
struct
chunk_entry
*
list
,
IDirectMusicObject
**
dmobj
)
{
struct
chunk_entry
chunk
=
{.
parent
=
list
};
IDirectMusicGetLoader
*
getloader
;
IDirectMusicLoader
*
loader
;
DMUS_OBJECTDESC
desc
;
DMUS_IO_REFERENCE
reference
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
stream_next_chunk
(
stream
,
&
chunk
)))
return
hr
;
if
(
chunk
.
id
!=
DMUS_FOURCC_REF_CHUNK
)
return
DMUS_E_UNSUPPORTED_STREAM
;
if
(
FAILED
(
hr
=
stream_chunk_get_data
(
stream
,
&
chunk
,
&
reference
,
sizeof
(
reference
))))
{
WARN
(
"Failed to read data of %s
\n
"
,
debugstr_chunk
(
&
chunk
));
return
hr
;
}
TRACE
(
"REFERENCE guidClassID %s, dwValidData %#x
\n
"
,
debugstr_dmguid
(
&
reference
.
guidClassID
),
reference
.
dwValidData
);
if
(
FAILED
(
hr
=
dmobj_parsedescriptor
(
stream
,
list
,
&
desc
,
reference
.
dwValidData
)))
return
hr
;
desc
.
guidClass
=
reference
.
guidClassID
;
desc
.
dwValidData
|=
DMUS_OBJ_CLASS
;
dump_DMUS_OBJECTDESC
(
&
desc
);
if
(
FAILED
(
hr
=
IStream_QueryInterface
(
stream
,
&
IID_IDirectMusicGetLoader
,
(
void
**
)
&
getloader
)))
return
hr
;
hr
=
IDirectMusicGetLoader_GetLoader
(
getloader
,
&
loader
);
IDirectMusicGetLoader_Release
(
getloader
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IDirectMusicLoader_GetObject
(
loader
,
&
desc
,
&
IID_IDirectMusicObject
,
(
void
**
)
dmobj
);
IDirectMusicLoader_Release
(
loader
);
return
hr
;
}
/* Generic IPersistStream methods */
/* Generic IPersistStream methods */
static
inline
struct
dmobject
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
static
inline
struct
dmobject
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
{
{
...
...
dlls/dmloader/dmobject.h
View file @
9f9fce44
...
@@ -33,8 +33,10 @@ struct chunk_entry {
...
@@ -33,8 +33,10 @@ struct chunk_entry {
HRESULT
stream_get_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_get_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_next_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_next_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_array
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
**
array
,
unsigned
int
*
count
,
DWORD
elem_size
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
ULONG
size
)
DECLSPEC_HIDDEN
;
ULONG
size
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_wstr
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
WCHAR
*
str
,
HRESULT
stream_chunk_get_wstr
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
WCHAR
*
str
,
...
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
#define DMUS_OBJ_NAME_INAM 0x1000
/* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INAM 0x1000
/* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INFO 0x2000
/* 'INAM' chunk in INFO list */
#define DMUS_OBJ_NAME_INFO 0x2000
/* 'INAM' chunk in INFO list */
/* 'DMRF' (reference list) helper */
HRESULT
dmobj_parsereference
(
IStream
*
stream
,
const
struct
chunk_entry
*
list
,
IDirectMusicObject
**
dmobj
)
DECLSPEC_HIDDEN
;
/* Generic IPersistStream methods */
/* Generic IPersistStream methods */
HRESULT
WINAPI
dmobj_IPersistStream_QueryInterface
(
IPersistStream
*
iface
,
REFIID
riid
,
HRESULT
WINAPI
dmobj_IPersistStream_QueryInterface
(
IPersistStream
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
DECLSPEC_HIDDEN
;
void
**
ret_iface
)
DECLSPEC_HIDDEN
;
...
...
dlls/dmscript/dmobject.c
View file @
9f9fce44
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "dmusics.h"
#include "dmusics.h"
#include "dmobject.h"
#include "dmobject.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmobj
);
WINE_DEFAULT_DEBUG_CHANNEL
(
dmobj
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
...
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
...
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
return
S_OK
;
return
S_OK
;
}
}
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
)
{
{
LARGE_INTEGER
end
;
LARGE_INTEGER
end
;
...
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
...
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
return
stream_get_chunk
(
stream
,
chunk
);
return
stream_get_chunk
(
stream
,
chunk
);
}
}
/* Reads chunk data of the form:
DWORD - size of array element
element[] - Array of elements
The caller needs to heap_free() the array.
*/
HRESULT
stream_chunk_get_array
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
**
array
,
unsigned
int
*
count
,
DWORD
elem_size
)
{
DWORD
size
;
HRESULT
hr
;
*
array
=
NULL
;
*
count
=
0
;
if
(
chunk
->
size
<
sizeof
(
DWORD
))
{
WARN_
(
dmfile
)(
"%s: Too short to read element size
\n
"
,
debugstr_chunk
(
chunk
));
return
E_FAIL
;
}
if
(
FAILED
(
hr
=
stream_read
(
stream
,
&
size
,
sizeof
(
DWORD
))))
return
hr
;
if
(
size
!=
elem_size
)
{
WARN_
(
dmfile
)(
"%s: Array element size mismatch: got %u, expected %u
\n
"
,
debugstr_chunk
(
chunk
),
size
,
elem_size
);
return
DMUS_E_UNSUPPORTED_STREAM
;
}
*
count
=
(
chunk
->
size
-
sizeof
(
DWORD
))
/
elem_size
;
size
=
*
count
*
elem_size
;
if
(
!
(
*
array
=
heap_alloc
(
size
)))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
stream_read
(
stream
,
*
array
,
size
)))
{
heap_free
(
*
array
);
*
array
=
NULL
;
return
hr
;
}
if
(
chunk
->
size
>
size
+
sizeof
(
DWORD
))
{
WARN_
(
dmfile
)(
"%s: Extraneous data at end of array
\n
"
,
debugstr_chunk
(
chunk
));
stream_skip_chunk
(
stream
,
chunk
);
return
S_FALSE
;
}
return
S_OK
;
}
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
ULONG
size
)
ULONG
size
)
{
{
...
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
switch
(
chunk
.
id
)
{
switch
(
chunk
.
id
)
{
case
DMUS_FOURCC_CATEGORY_CHUNK
:
if
((
supported
&
DMUS_OBJ_CATEGORY
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wszCategory
,
sizeof
(
desc
->
wszCategory
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_CATEGORY
;
break
;
case
DMUS_FOURCC_DATE_CHUNK
:
if
((
supported
&
DMUS_OBJ_DATE
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
&
desc
->
ftDate
,
sizeof
(
desc
->
ftDate
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_DATE
;
break
;
case
DMUS_FOURCC_FILE_CHUNK
:
if
((
supported
&
DMUS_OBJ_FILENAME
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wszFileName
,
sizeof
(
desc
->
wszFileName
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_FILENAME
;
break
;
case
DMUS_FOURCC_GUID_CHUNK
:
case
DMUS_FOURCC_GUID_CHUNK
:
if
((
supported
&
DMUS_OBJ_OBJECT
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_OBJECT
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
&
desc
->
guidObject
,
sizeof
(
desc
->
guidObject
))
==
S_OK
)
&
desc
->
guidObject
,
sizeof
(
desc
->
guidObject
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_OBJECT
;
desc
->
dwValidData
|=
DMUS_OBJ_OBJECT
;
break
;
break
;
case
DMUS_FOURCC_
CATEGORY
_CHUNK
:
case
DMUS_FOURCC_
NAME
_CHUNK
:
if
((
supported
&
DMUS_OBJ_
CATEGORY
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_
NAME
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wsz
Category
,
sizeof
(
desc
->
wszCategory
))
==
S_OK
)
desc
->
wsz
Name
,
sizeof
(
desc
->
wszName
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_
CATEGORY
;
desc
->
dwValidData
|=
DMUS_OBJ_
NAME
;
break
;
break
;
case
DMUS_FOURCC_VERSION_CHUNK
:
case
DMUS_FOURCC_VERSION_CHUNK
:
if
((
supported
&
DMUS_OBJ_VERSION
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_VERSION
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
...
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
return
hr
;
return
hr
;
}
}
HRESULT
dmobj_parsereference
(
IStream
*
stream
,
const
struct
chunk_entry
*
list
,
IDirectMusicObject
**
dmobj
)
{
struct
chunk_entry
chunk
=
{.
parent
=
list
};
IDirectMusicGetLoader
*
getloader
;
IDirectMusicLoader
*
loader
;
DMUS_OBJECTDESC
desc
;
DMUS_IO_REFERENCE
reference
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
stream_next_chunk
(
stream
,
&
chunk
)))
return
hr
;
if
(
chunk
.
id
!=
DMUS_FOURCC_REF_CHUNK
)
return
DMUS_E_UNSUPPORTED_STREAM
;
if
(
FAILED
(
hr
=
stream_chunk_get_data
(
stream
,
&
chunk
,
&
reference
,
sizeof
(
reference
))))
{
WARN
(
"Failed to read data of %s
\n
"
,
debugstr_chunk
(
&
chunk
));
return
hr
;
}
TRACE
(
"REFERENCE guidClassID %s, dwValidData %#x
\n
"
,
debugstr_dmguid
(
&
reference
.
guidClassID
),
reference
.
dwValidData
);
if
(
FAILED
(
hr
=
dmobj_parsedescriptor
(
stream
,
list
,
&
desc
,
reference
.
dwValidData
)))
return
hr
;
desc
.
guidClass
=
reference
.
guidClassID
;
desc
.
dwValidData
|=
DMUS_OBJ_CLASS
;
dump_DMUS_OBJECTDESC
(
&
desc
);
if
(
FAILED
(
hr
=
IStream_QueryInterface
(
stream
,
&
IID_IDirectMusicGetLoader
,
(
void
**
)
&
getloader
)))
return
hr
;
hr
=
IDirectMusicGetLoader_GetLoader
(
getloader
,
&
loader
);
IDirectMusicGetLoader_Release
(
getloader
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IDirectMusicLoader_GetObject
(
loader
,
&
desc
,
&
IID_IDirectMusicObject
,
(
void
**
)
dmobj
);
IDirectMusicLoader_Release
(
loader
);
return
hr
;
}
/* Generic IPersistStream methods */
/* Generic IPersistStream methods */
static
inline
struct
dmobject
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
static
inline
struct
dmobject
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
{
{
...
...
dlls/dmscript/dmobject.h
View file @
9f9fce44
...
@@ -33,8 +33,10 @@ struct chunk_entry {
...
@@ -33,8 +33,10 @@ struct chunk_entry {
HRESULT
stream_get_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_get_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_next_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_next_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_array
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
**
array
,
unsigned
int
*
count
,
DWORD
elem_size
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
ULONG
size
)
DECLSPEC_HIDDEN
;
ULONG
size
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_wstr
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
WCHAR
*
str
,
HRESULT
stream_chunk_get_wstr
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
WCHAR
*
str
,
...
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
#define DMUS_OBJ_NAME_INAM 0x1000
/* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INAM 0x1000
/* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INFO 0x2000
/* 'INAM' chunk in INFO list */
#define DMUS_OBJ_NAME_INFO 0x2000
/* 'INAM' chunk in INFO list */
/* 'DMRF' (reference list) helper */
HRESULT
dmobj_parsereference
(
IStream
*
stream
,
const
struct
chunk_entry
*
list
,
IDirectMusicObject
**
dmobj
)
DECLSPEC_HIDDEN
;
/* Generic IPersistStream methods */
/* Generic IPersistStream methods */
HRESULT
WINAPI
dmobj_IPersistStream_QueryInterface
(
IPersistStream
*
iface
,
REFIID
riid
,
HRESULT
WINAPI
dmobj_IPersistStream_QueryInterface
(
IPersistStream
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
DECLSPEC_HIDDEN
;
void
**
ret_iface
)
DECLSPEC_HIDDEN
;
...
...
dlls/dmstyle/dmobject.c
View file @
9f9fce44
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "dmusics.h"
#include "dmusics.h"
#include "dmobject.h"
#include "dmobject.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmobj
);
WINE_DEFAULT_DEBUG_CHANNEL
(
dmobj
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
...
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
...
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
return
S_OK
;
return
S_OK
;
}
}
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
)
{
{
LARGE_INTEGER
end
;
LARGE_INTEGER
end
;
...
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
...
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
return
stream_get_chunk
(
stream
,
chunk
);
return
stream_get_chunk
(
stream
,
chunk
);
}
}
/* Reads chunk data of the form:
DWORD - size of array element
element[] - Array of elements
The caller needs to heap_free() the array.
*/
HRESULT
stream_chunk_get_array
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
**
array
,
unsigned
int
*
count
,
DWORD
elem_size
)
{
DWORD
size
;
HRESULT
hr
;
*
array
=
NULL
;
*
count
=
0
;
if
(
chunk
->
size
<
sizeof
(
DWORD
))
{
WARN_
(
dmfile
)(
"%s: Too short to read element size
\n
"
,
debugstr_chunk
(
chunk
));
return
E_FAIL
;
}
if
(
FAILED
(
hr
=
stream_read
(
stream
,
&
size
,
sizeof
(
DWORD
))))
return
hr
;
if
(
size
!=
elem_size
)
{
WARN_
(
dmfile
)(
"%s: Array element size mismatch: got %u, expected %u
\n
"
,
debugstr_chunk
(
chunk
),
size
,
elem_size
);
return
DMUS_E_UNSUPPORTED_STREAM
;
}
*
count
=
(
chunk
->
size
-
sizeof
(
DWORD
))
/
elem_size
;
size
=
*
count
*
elem_size
;
if
(
!
(
*
array
=
heap_alloc
(
size
)))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
stream_read
(
stream
,
*
array
,
size
)))
{
heap_free
(
*
array
);
*
array
=
NULL
;
return
hr
;
}
if
(
chunk
->
size
>
size
+
sizeof
(
DWORD
))
{
WARN_
(
dmfile
)(
"%s: Extraneous data at end of array
\n
"
,
debugstr_chunk
(
chunk
));
stream_skip_chunk
(
stream
,
chunk
);
return
S_FALSE
;
}
return
S_OK
;
}
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
ULONG
size
)
ULONG
size
)
{
{
...
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
switch
(
chunk
.
id
)
{
switch
(
chunk
.
id
)
{
case
DMUS_FOURCC_CATEGORY_CHUNK
:
if
((
supported
&
DMUS_OBJ_CATEGORY
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wszCategory
,
sizeof
(
desc
->
wszCategory
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_CATEGORY
;
break
;
case
DMUS_FOURCC_DATE_CHUNK
:
if
((
supported
&
DMUS_OBJ_DATE
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
&
desc
->
ftDate
,
sizeof
(
desc
->
ftDate
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_DATE
;
break
;
case
DMUS_FOURCC_FILE_CHUNK
:
if
((
supported
&
DMUS_OBJ_FILENAME
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wszFileName
,
sizeof
(
desc
->
wszFileName
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_FILENAME
;
break
;
case
DMUS_FOURCC_GUID_CHUNK
:
case
DMUS_FOURCC_GUID_CHUNK
:
if
((
supported
&
DMUS_OBJ_OBJECT
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_OBJECT
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
&
desc
->
guidObject
,
sizeof
(
desc
->
guidObject
))
==
S_OK
)
&
desc
->
guidObject
,
sizeof
(
desc
->
guidObject
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_OBJECT
;
desc
->
dwValidData
|=
DMUS_OBJ_OBJECT
;
break
;
break
;
case
DMUS_FOURCC_
CATEGORY
_CHUNK
:
case
DMUS_FOURCC_
NAME
_CHUNK
:
if
((
supported
&
DMUS_OBJ_
CATEGORY
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_
NAME
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wsz
Category
,
sizeof
(
desc
->
wszCategory
))
==
S_OK
)
desc
->
wsz
Name
,
sizeof
(
desc
->
wszName
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_
CATEGORY
;
desc
->
dwValidData
|=
DMUS_OBJ_
NAME
;
break
;
break
;
case
DMUS_FOURCC_VERSION_CHUNK
:
case
DMUS_FOURCC_VERSION_CHUNK
:
if
((
supported
&
DMUS_OBJ_VERSION
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_VERSION
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
...
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
return
hr
;
return
hr
;
}
}
HRESULT
dmobj_parsereference
(
IStream
*
stream
,
const
struct
chunk_entry
*
list
,
IDirectMusicObject
**
dmobj
)
{
struct
chunk_entry
chunk
=
{.
parent
=
list
};
IDirectMusicGetLoader
*
getloader
;
IDirectMusicLoader
*
loader
;
DMUS_OBJECTDESC
desc
;
DMUS_IO_REFERENCE
reference
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
stream_next_chunk
(
stream
,
&
chunk
)))
return
hr
;
if
(
chunk
.
id
!=
DMUS_FOURCC_REF_CHUNK
)
return
DMUS_E_UNSUPPORTED_STREAM
;
if
(
FAILED
(
hr
=
stream_chunk_get_data
(
stream
,
&
chunk
,
&
reference
,
sizeof
(
reference
))))
{
WARN
(
"Failed to read data of %s
\n
"
,
debugstr_chunk
(
&
chunk
));
return
hr
;
}
TRACE
(
"REFERENCE guidClassID %s, dwValidData %#x
\n
"
,
debugstr_dmguid
(
&
reference
.
guidClassID
),
reference
.
dwValidData
);
if
(
FAILED
(
hr
=
dmobj_parsedescriptor
(
stream
,
list
,
&
desc
,
reference
.
dwValidData
)))
return
hr
;
desc
.
guidClass
=
reference
.
guidClassID
;
desc
.
dwValidData
|=
DMUS_OBJ_CLASS
;
dump_DMUS_OBJECTDESC
(
&
desc
);
if
(
FAILED
(
hr
=
IStream_QueryInterface
(
stream
,
&
IID_IDirectMusicGetLoader
,
(
void
**
)
&
getloader
)))
return
hr
;
hr
=
IDirectMusicGetLoader_GetLoader
(
getloader
,
&
loader
);
IDirectMusicGetLoader_Release
(
getloader
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IDirectMusicLoader_GetObject
(
loader
,
&
desc
,
&
IID_IDirectMusicObject
,
(
void
**
)
dmobj
);
IDirectMusicLoader_Release
(
loader
);
return
hr
;
}
/* Generic IPersistStream methods */
/* Generic IPersistStream methods */
static
inline
struct
dmobject
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
static
inline
struct
dmobject
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
{
{
...
...
dlls/dmstyle/dmobject.h
View file @
9f9fce44
...
@@ -33,8 +33,10 @@ struct chunk_entry {
...
@@ -33,8 +33,10 @@ struct chunk_entry {
HRESULT
stream_get_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_get_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_next_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_next_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_array
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
**
array
,
unsigned
int
*
count
,
DWORD
elem_size
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
ULONG
size
)
DECLSPEC_HIDDEN
;
ULONG
size
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_wstr
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
WCHAR
*
str
,
HRESULT
stream_chunk_get_wstr
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
WCHAR
*
str
,
...
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
#define DMUS_OBJ_NAME_INAM 0x1000
/* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INAM 0x1000
/* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INFO 0x2000
/* 'INAM' chunk in INFO list */
#define DMUS_OBJ_NAME_INFO 0x2000
/* 'INAM' chunk in INFO list */
/* 'DMRF' (reference list) helper */
HRESULT
dmobj_parsereference
(
IStream
*
stream
,
const
struct
chunk_entry
*
list
,
IDirectMusicObject
**
dmobj
)
DECLSPEC_HIDDEN
;
/* Generic IPersistStream methods */
/* Generic IPersistStream methods */
HRESULT
WINAPI
dmobj_IPersistStream_QueryInterface
(
IPersistStream
*
iface
,
REFIID
riid
,
HRESULT
WINAPI
dmobj_IPersistStream_QueryInterface
(
IPersistStream
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
DECLSPEC_HIDDEN
;
void
**
ret_iface
)
DECLSPEC_HIDDEN
;
...
...
dlls/dmusic/dmobject.c
View file @
9f9fce44
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "dmusics.h"
#include "dmusics.h"
#include "dmobject.h"
#include "dmobject.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmobj
);
WINE_DEFAULT_DEBUG_CHANNEL
(
dmobj
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
...
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
...
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
return
S_OK
;
return
S_OK
;
}
}
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
)
{
{
LARGE_INTEGER
end
;
LARGE_INTEGER
end
;
...
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
...
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
return
stream_get_chunk
(
stream
,
chunk
);
return
stream_get_chunk
(
stream
,
chunk
);
}
}
/* Reads chunk data of the form:
DWORD - size of array element
element[] - Array of elements
The caller needs to heap_free() the array.
*/
HRESULT
stream_chunk_get_array
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
**
array
,
unsigned
int
*
count
,
DWORD
elem_size
)
{
DWORD
size
;
HRESULT
hr
;
*
array
=
NULL
;
*
count
=
0
;
if
(
chunk
->
size
<
sizeof
(
DWORD
))
{
WARN_
(
dmfile
)(
"%s: Too short to read element size
\n
"
,
debugstr_chunk
(
chunk
));
return
E_FAIL
;
}
if
(
FAILED
(
hr
=
stream_read
(
stream
,
&
size
,
sizeof
(
DWORD
))))
return
hr
;
if
(
size
!=
elem_size
)
{
WARN_
(
dmfile
)(
"%s: Array element size mismatch: got %u, expected %u
\n
"
,
debugstr_chunk
(
chunk
),
size
,
elem_size
);
return
DMUS_E_UNSUPPORTED_STREAM
;
}
*
count
=
(
chunk
->
size
-
sizeof
(
DWORD
))
/
elem_size
;
size
=
*
count
*
elem_size
;
if
(
!
(
*
array
=
heap_alloc
(
size
)))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
stream_read
(
stream
,
*
array
,
size
)))
{
heap_free
(
*
array
);
*
array
=
NULL
;
return
hr
;
}
if
(
chunk
->
size
>
size
+
sizeof
(
DWORD
))
{
WARN_
(
dmfile
)(
"%s: Extraneous data at end of array
\n
"
,
debugstr_chunk
(
chunk
));
stream_skip_chunk
(
stream
,
chunk
);
return
S_FALSE
;
}
return
S_OK
;
}
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
ULONG
size
)
ULONG
size
)
{
{
...
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
switch
(
chunk
.
id
)
{
switch
(
chunk
.
id
)
{
case
DMUS_FOURCC_CATEGORY_CHUNK
:
if
((
supported
&
DMUS_OBJ_CATEGORY
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wszCategory
,
sizeof
(
desc
->
wszCategory
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_CATEGORY
;
break
;
case
DMUS_FOURCC_DATE_CHUNK
:
if
((
supported
&
DMUS_OBJ_DATE
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
&
desc
->
ftDate
,
sizeof
(
desc
->
ftDate
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_DATE
;
break
;
case
DMUS_FOURCC_FILE_CHUNK
:
if
((
supported
&
DMUS_OBJ_FILENAME
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wszFileName
,
sizeof
(
desc
->
wszFileName
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_FILENAME
;
break
;
case
DMUS_FOURCC_GUID_CHUNK
:
case
DMUS_FOURCC_GUID_CHUNK
:
if
((
supported
&
DMUS_OBJ_OBJECT
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_OBJECT
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
&
desc
->
guidObject
,
sizeof
(
desc
->
guidObject
))
==
S_OK
)
&
desc
->
guidObject
,
sizeof
(
desc
->
guidObject
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_OBJECT
;
desc
->
dwValidData
|=
DMUS_OBJ_OBJECT
;
break
;
break
;
case
DMUS_FOURCC_
CATEGORY
_CHUNK
:
case
DMUS_FOURCC_
NAME
_CHUNK
:
if
((
supported
&
DMUS_OBJ_
CATEGORY
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_
NAME
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wsz
Category
,
sizeof
(
desc
->
wszCategory
))
==
S_OK
)
desc
->
wsz
Name
,
sizeof
(
desc
->
wszName
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_
CATEGORY
;
desc
->
dwValidData
|=
DMUS_OBJ_
NAME
;
break
;
break
;
case
DMUS_FOURCC_VERSION_CHUNK
:
case
DMUS_FOURCC_VERSION_CHUNK
:
if
((
supported
&
DMUS_OBJ_VERSION
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_VERSION
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
...
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
return
hr
;
return
hr
;
}
}
HRESULT
dmobj_parsereference
(
IStream
*
stream
,
const
struct
chunk_entry
*
list
,
IDirectMusicObject
**
dmobj
)
{
struct
chunk_entry
chunk
=
{.
parent
=
list
};
IDirectMusicGetLoader
*
getloader
;
IDirectMusicLoader
*
loader
;
DMUS_OBJECTDESC
desc
;
DMUS_IO_REFERENCE
reference
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
stream_next_chunk
(
stream
,
&
chunk
)))
return
hr
;
if
(
chunk
.
id
!=
DMUS_FOURCC_REF_CHUNK
)
return
DMUS_E_UNSUPPORTED_STREAM
;
if
(
FAILED
(
hr
=
stream_chunk_get_data
(
stream
,
&
chunk
,
&
reference
,
sizeof
(
reference
))))
{
WARN
(
"Failed to read data of %s
\n
"
,
debugstr_chunk
(
&
chunk
));
return
hr
;
}
TRACE
(
"REFERENCE guidClassID %s, dwValidData %#x
\n
"
,
debugstr_dmguid
(
&
reference
.
guidClassID
),
reference
.
dwValidData
);
if
(
FAILED
(
hr
=
dmobj_parsedescriptor
(
stream
,
list
,
&
desc
,
reference
.
dwValidData
)))
return
hr
;
desc
.
guidClass
=
reference
.
guidClassID
;
desc
.
dwValidData
|=
DMUS_OBJ_CLASS
;
dump_DMUS_OBJECTDESC
(
&
desc
);
if
(
FAILED
(
hr
=
IStream_QueryInterface
(
stream
,
&
IID_IDirectMusicGetLoader
,
(
void
**
)
&
getloader
)))
return
hr
;
hr
=
IDirectMusicGetLoader_GetLoader
(
getloader
,
&
loader
);
IDirectMusicGetLoader_Release
(
getloader
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IDirectMusicLoader_GetObject
(
loader
,
&
desc
,
&
IID_IDirectMusicObject
,
(
void
**
)
dmobj
);
IDirectMusicLoader_Release
(
loader
);
return
hr
;
}
/* Generic IPersistStream methods */
/* Generic IPersistStream methods */
static
inline
struct
dmobject
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
static
inline
struct
dmobject
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
{
{
...
...
dlls/dmusic/dmobject.h
View file @
9f9fce44
...
@@ -33,8 +33,10 @@ struct chunk_entry {
...
@@ -33,8 +33,10 @@ struct chunk_entry {
HRESULT
stream_get_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_get_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_next_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_next_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_array
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
**
array
,
unsigned
int
*
count
,
DWORD
elem_size
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
ULONG
size
)
DECLSPEC_HIDDEN
;
ULONG
size
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_wstr
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
WCHAR
*
str
,
HRESULT
stream_chunk_get_wstr
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
WCHAR
*
str
,
...
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
#define DMUS_OBJ_NAME_INAM 0x1000
/* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INAM 0x1000
/* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INFO 0x2000
/* 'INAM' chunk in INFO list */
#define DMUS_OBJ_NAME_INFO 0x2000
/* 'INAM' chunk in INFO list */
/* 'DMRF' (reference list) helper */
HRESULT
dmobj_parsereference
(
IStream
*
stream
,
const
struct
chunk_entry
*
list
,
IDirectMusicObject
**
dmobj
)
DECLSPEC_HIDDEN
;
/* Generic IPersistStream methods */
/* Generic IPersistStream methods */
HRESULT
WINAPI
dmobj_IPersistStream_QueryInterface
(
IPersistStream
*
iface
,
REFIID
riid
,
HRESULT
WINAPI
dmobj_IPersistStream_QueryInterface
(
IPersistStream
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
DECLSPEC_HIDDEN
;
void
**
ret_iface
)
DECLSPEC_HIDDEN
;
...
...
dlls/dswave/dmobject.c
View file @
9f9fce44
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "dmusics.h"
#include "dmusics.h"
#include "dmobject.h"
#include "dmobject.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmobj
);
WINE_DEFAULT_DEBUG_CHANNEL
(
dmobj
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
WINE_DECLARE_DEBUG_CHANNEL
(
dmfile
);
...
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
...
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
return
S_OK
;
return
S_OK
;
}
}
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
)
{
{
LARGE_INTEGER
end
;
LARGE_INTEGER
end
;
...
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
...
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
return
stream_get_chunk
(
stream
,
chunk
);
return
stream_get_chunk
(
stream
,
chunk
);
}
}
/* Reads chunk data of the form:
DWORD - size of array element
element[] - Array of elements
The caller needs to heap_free() the array.
*/
HRESULT
stream_chunk_get_array
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
**
array
,
unsigned
int
*
count
,
DWORD
elem_size
)
{
DWORD
size
;
HRESULT
hr
;
*
array
=
NULL
;
*
count
=
0
;
if
(
chunk
->
size
<
sizeof
(
DWORD
))
{
WARN_
(
dmfile
)(
"%s: Too short to read element size
\n
"
,
debugstr_chunk
(
chunk
));
return
E_FAIL
;
}
if
(
FAILED
(
hr
=
stream_read
(
stream
,
&
size
,
sizeof
(
DWORD
))))
return
hr
;
if
(
size
!=
elem_size
)
{
WARN_
(
dmfile
)(
"%s: Array element size mismatch: got %u, expected %u
\n
"
,
debugstr_chunk
(
chunk
),
size
,
elem_size
);
return
DMUS_E_UNSUPPORTED_STREAM
;
}
*
count
=
(
chunk
->
size
-
sizeof
(
DWORD
))
/
elem_size
;
size
=
*
count
*
elem_size
;
if
(
!
(
*
array
=
heap_alloc
(
size
)))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
stream_read
(
stream
,
*
array
,
size
)))
{
heap_free
(
*
array
);
*
array
=
NULL
;
return
hr
;
}
if
(
chunk
->
size
>
size
+
sizeof
(
DWORD
))
{
WARN_
(
dmfile
)(
"%s: Extraneous data at end of array
\n
"
,
debugstr_chunk
(
chunk
));
stream_skip_chunk
(
stream
,
chunk
);
return
S_FALSE
;
}
return
S_OK
;
}
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
ULONG
size
)
ULONG
size
)
{
{
...
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
while
((
hr
=
stream_next_chunk
(
stream
,
&
chunk
))
==
S_OK
)
{
switch
(
chunk
.
id
)
{
switch
(
chunk
.
id
)
{
case
DMUS_FOURCC_CATEGORY_CHUNK
:
if
((
supported
&
DMUS_OBJ_CATEGORY
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wszCategory
,
sizeof
(
desc
->
wszCategory
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_CATEGORY
;
break
;
case
DMUS_FOURCC_DATE_CHUNK
:
if
((
supported
&
DMUS_OBJ_DATE
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
&
desc
->
ftDate
,
sizeof
(
desc
->
ftDate
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_DATE
;
break
;
case
DMUS_FOURCC_FILE_CHUNK
:
if
((
supported
&
DMUS_OBJ_FILENAME
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wszFileName
,
sizeof
(
desc
->
wszFileName
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_FILENAME
;
break
;
case
DMUS_FOURCC_GUID_CHUNK
:
case
DMUS_FOURCC_GUID_CHUNK
:
if
((
supported
&
DMUS_OBJ_OBJECT
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_OBJECT
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
&
desc
->
guidObject
,
sizeof
(
desc
->
guidObject
))
==
S_OK
)
&
desc
->
guidObject
,
sizeof
(
desc
->
guidObject
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_OBJECT
;
desc
->
dwValidData
|=
DMUS_OBJ_OBJECT
;
break
;
break
;
case
DMUS_FOURCC_
CATEGORY
_CHUNK
:
case
DMUS_FOURCC_
NAME
_CHUNK
:
if
((
supported
&
DMUS_OBJ_
CATEGORY
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_
NAME
)
&&
stream_chunk_get_wstr
(
stream
,
&
chunk
,
desc
->
wsz
Category
,
sizeof
(
desc
->
wszCategory
))
==
S_OK
)
desc
->
wsz
Name
,
sizeof
(
desc
->
wszName
))
==
S_OK
)
desc
->
dwValidData
|=
DMUS_OBJ_
CATEGORY
;
desc
->
dwValidData
|=
DMUS_OBJ_
NAME
;
break
;
break
;
case
DMUS_FOURCC_VERSION_CHUNK
:
case
DMUS_FOURCC_VERSION_CHUNK
:
if
((
supported
&
DMUS_OBJ_VERSION
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
if
((
supported
&
DMUS_OBJ_VERSION
)
&&
stream_chunk_get_data
(
stream
,
&
chunk
,
...
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
return
hr
;
return
hr
;
}
}
HRESULT
dmobj_parsereference
(
IStream
*
stream
,
const
struct
chunk_entry
*
list
,
IDirectMusicObject
**
dmobj
)
{
struct
chunk_entry
chunk
=
{.
parent
=
list
};
IDirectMusicGetLoader
*
getloader
;
IDirectMusicLoader
*
loader
;
DMUS_OBJECTDESC
desc
;
DMUS_IO_REFERENCE
reference
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
stream_next_chunk
(
stream
,
&
chunk
)))
return
hr
;
if
(
chunk
.
id
!=
DMUS_FOURCC_REF_CHUNK
)
return
DMUS_E_UNSUPPORTED_STREAM
;
if
(
FAILED
(
hr
=
stream_chunk_get_data
(
stream
,
&
chunk
,
&
reference
,
sizeof
(
reference
))))
{
WARN
(
"Failed to read data of %s
\n
"
,
debugstr_chunk
(
&
chunk
));
return
hr
;
}
TRACE
(
"REFERENCE guidClassID %s, dwValidData %#x
\n
"
,
debugstr_dmguid
(
&
reference
.
guidClassID
),
reference
.
dwValidData
);
if
(
FAILED
(
hr
=
dmobj_parsedescriptor
(
stream
,
list
,
&
desc
,
reference
.
dwValidData
)))
return
hr
;
desc
.
guidClass
=
reference
.
guidClassID
;
desc
.
dwValidData
|=
DMUS_OBJ_CLASS
;
dump_DMUS_OBJECTDESC
(
&
desc
);
if
(
FAILED
(
hr
=
IStream_QueryInterface
(
stream
,
&
IID_IDirectMusicGetLoader
,
(
void
**
)
&
getloader
)))
return
hr
;
hr
=
IDirectMusicGetLoader_GetLoader
(
getloader
,
&
loader
);
IDirectMusicGetLoader_Release
(
getloader
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IDirectMusicLoader_GetObject
(
loader
,
&
desc
,
&
IID_IDirectMusicObject
,
(
void
**
)
dmobj
);
IDirectMusicLoader_Release
(
loader
);
return
hr
;
}
/* Generic IPersistStream methods */
/* Generic IPersistStream methods */
static
inline
struct
dmobject
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
static
inline
struct
dmobject
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
{
{
...
...
dlls/dswave/dmobject.h
View file @
9f9fce44
...
@@ -33,8 +33,10 @@ struct chunk_entry {
...
@@ -33,8 +33,10 @@ struct chunk_entry {
HRESULT
stream_get_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_get_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_next_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_next_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_skip_chunk
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_array
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
**
array
,
unsigned
int
*
count
,
DWORD
elem_size
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
HRESULT
stream_chunk_get_data
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
void
*
data
,
ULONG
size
)
DECLSPEC_HIDDEN
;
ULONG
size
)
DECLSPEC_HIDDEN
;
HRESULT
stream_chunk_get_wstr
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
WCHAR
*
str
,
HRESULT
stream_chunk_get_wstr
(
IStream
*
stream
,
const
struct
chunk_entry
*
chunk
,
WCHAR
*
str
,
...
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
...
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
#define DMUS_OBJ_NAME_INAM 0x1000
/* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INAM 0x1000
/* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INFO 0x2000
/* 'INAM' chunk in INFO list */
#define DMUS_OBJ_NAME_INFO 0x2000
/* 'INAM' chunk in INFO list */
/* 'DMRF' (reference list) helper */
HRESULT
dmobj_parsereference
(
IStream
*
stream
,
const
struct
chunk_entry
*
list
,
IDirectMusicObject
**
dmobj
)
DECLSPEC_HIDDEN
;
/* Generic IPersistStream methods */
/* Generic IPersistStream methods */
HRESULT
WINAPI
dmobj_IPersistStream_QueryInterface
(
IPersistStream
*
iface
,
REFIID
riid
,
HRESULT
WINAPI
dmobj_IPersistStream_QueryInterface
(
IPersistStream
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
DECLSPEC_HIDDEN
;
void
**
ret_iface
)
DECLSPEC_HIDDEN
;
...
...
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