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
9ab1cfb5
Commit
9ab1cfb5
authored
Jun 04, 2014
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jun 12, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmloader: COM cleanup for IDirectMusicContainer.
parent
8a15ea11
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
71 deletions
+71
-71
container.c
dlls/dmloader/container.c
+71
-50
dmloader_private.h
dlls/dmloader/dmloader_private.h
+0
-21
No files found.
dlls/dmloader/container.c
View file @
9ab1cfb5
...
@@ -27,14 +27,24 @@ WINE_DECLARE_DEBUG_CHANNEL(dmdump);
...
@@ -27,14 +27,24 @@ WINE_DECLARE_DEBUG_CHANNEL(dmdump);
#define DMUS_MAX_NAME_SIZE DMUS_MAX_NAME*sizeof(WCHAR)
#define DMUS_MAX_NAME_SIZE DMUS_MAX_NAME*sizeof(WCHAR)
#define DMUS_MAX_FILENAME_SIZE DMUS_MAX_FILENAME*sizeof(WCHAR)
#define DMUS_MAX_FILENAME_SIZE DMUS_MAX_FILENAME*sizeof(WCHAR)
static
ULONG
WINAPI
IDirectMusicContainerImpl_IDirectMusicContainer_AddRef
(
LPDIRECTMUSICCONTAINER
iface
);
static
ULONG
WINAPI
IDirectMusicContainerImpl_IDirectMusicObject_AddRef
(
LPDIRECTMUSICOBJECT
iface
);
static
ULONG
WINAPI
IDirectMusicContainerImpl_IPersistStream_AddRef
(
LPPERSISTSTREAM
iface
);
/*****************************************************************************
/*****************************************************************************
* IDirectMusicContainerImpl implementation
* IDirectMusicContainerImpl implementation
*/
*/
/* IUnknown/IDirectMusicContainer part: */
typedef
struct
IDirectMusicContainerImpl
{
IDirectMusicContainer
IDirectMusicContainer_iface
;
const
IDirectMusicObjectVtbl
*
ObjectVtbl
;
const
IPersistStreamVtbl
*
PersistStreamVtbl
;
LONG
ref
;
IStream
*
pStream
;
DMUS_IO_CONTAINER_HEADER
Header
;
/* header */
struct
list
*
pContainedObjects
;
/* data */
DMUS_OBJECTDESC
Desc
;
}
IDirectMusicContainerImpl
;
static
inline
IDirectMusicContainerImpl
*
impl_from_IDirectMusicContainer
(
IDirectMusicContainer
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectMusicContainerImpl
,
IDirectMusicContainer_iface
);
}
static
HRESULT
destroy_dmcontainer
(
IDirectMusicContainerImpl
*
This
)
static
HRESULT
destroy_dmcontainer
(
IDirectMusicContainerImpl
*
This
)
{
{
...
@@ -72,52 +82,59 @@ static HRESULT destroy_dmcontainer(IDirectMusicContainerImpl *This)
...
@@ -72,52 +82,59 @@ static HRESULT destroy_dmcontainer(IDirectMusicContainerImpl *This)
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
IDirectMusicContainerImpl_IDirectMusicContainer_QueryInterface
(
LPDIRECTMUSICCONTAINER
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
static
HRESULT
WINAPI
IDirectMusicContainerImpl_QueryInterface
(
IDirectMusicContainer
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
ContainerVtbl
,
iface
);
{
IDirectMusicContainerImpl
*
This
=
impl_from_IDirectMusicContainer
(
iface
);
TRACE
(
"(%p, %s, %p)
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ppobj
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
TRACE
(
"(%p, %s, %p)
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ret_iface
);
IsEqualIID
(
riid
,
&
IID_IDirectMusicContainer
))
{
*
ppobj
=
&
This
->
ContainerVtbl
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IDirectMusicContainer
))
IDirectMusicContainerImpl_IDirectMusicContainer_AddRef
((
LPDIRECTMUSICCONTAINER
)
&
This
->
ContainerVtbl
);
*
ret_iface
=
&
This
->
IDirectMusicContainer_iface
;
return
S_OK
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IDirectMusicObject
))
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IDirectMusicObject
))
{
*
ret_iface
=
&
This
->
ObjectVtbl
;
*
ppobj
=
&
This
->
ObjectVtbl
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IPersistStream
))
IDirectMusicContainerImpl_IDirectMusicObject_AddRef
((
LPDIRECTMUSICOBJECT
)
&
This
->
ObjectVtbl
);
*
ret_iface
=
&
This
->
PersistStreamVtbl
;
return
S_OK
;
else
{
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IPersistStream
))
{
WARN
(
"Unknown interface %s
\n
"
,
debugstr_dmguid
(
riid
));
*
ppobj
=
&
This
->
PersistStreamVtbl
;
*
ret_iface
=
NULL
;
IDirectMusicContainerImpl_IPersistStream_AddRef
((
LPPERSISTSTREAM
)
&
This
->
PersistStreamVtbl
);
return
E_NOINTERFACE
;
return
S_OK
;
}
}
WARN
(
": not found
\n
"
);
IUnknown_AddRef
((
IUnknown
*
)
*
ret_iface
);
return
E_NOINTERFACE
;
return
S_OK
;
}
}
static
ULONG
WINAPI
IDirectMusicContainerImpl_IDirectMusicContainer_AddRef
(
LPDIRECTMUSICCONTAINER
iface
)
{
static
ULONG
WINAPI
IDirectMusicContainerImpl_AddRef
(
IDirectMusicContainer
*
iface
)
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
ContainerVtbl
,
iface
);
{
TRACE
(
"(%p): AddRef from %d
\n
"
,
This
,
This
->
dwRef
);
IDirectMusicContainerImpl
*
This
=
impl_from_IDirectMusicContainer
(
iface
);
return
InterlockedIncrement
(
&
This
->
dwRef
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
return
ref
;
}
}
static
ULONG
WINAPI
IDirectMusicContainerImpl_IDirectMusicContainer_Release
(
LPDIRECTMUSICCONTAINER
iface
)
{
static
ULONG
WINAPI
IDirectMusicContainerImpl_Release
(
IDirectMusicContainer
*
iface
)
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
ContainerVtbl
,
iface
);
{
IDirectMusicContainerImpl
*
This
=
impl_from_IDirectMusicContainer
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
DWORD
dwRef
=
InterlockedDecrement
(
&
This
->
dwRef
);
if
(
!
ref
)
{
TRACE
(
"(%p): ReleaseRef to %d
\n
"
,
This
,
dwRef
);
if
(
dwRef
==
0
)
{
if
(
This
->
pStream
)
if
(
This
->
pStream
)
destroy_dmcontainer
(
This
);
destroy_dmcontainer
(
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
unlock_module
();
unlock_module
();
}
}
return
dwR
ef
;
return
r
ef
;
}
}
static
HRESULT
WINAPI
IDirectMusicContainerImpl_IDirectMusicContainer_EnumObject
(
LPDIRECTMUSICCONTAINER
iface
,
REFGUID
rguidClass
,
DWORD
dwIndex
,
LPDMUS_OBJECTDESC
pDesc
,
WCHAR
*
pwszAlias
)
{
static
HRESULT
WINAPI
IDirectMusicContainerImpl_EnumObject
(
IDirectMusicContainer
*
iface
,
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
ContainerVtbl
,
iface
);
REFGUID
rguidClass
,
DWORD
dwIndex
,
DMUS_OBJECTDESC
*
pDesc
,
WCHAR
*
pwszAlias
)
{
IDirectMusicContainerImpl
*
This
=
impl_from_IDirectMusicContainer
(
iface
);
struct
list
*
pEntry
;
struct
list
*
pEntry
;
LPWINE_CONTAINER_ENTRY
pContainedObject
;
LPWINE_CONTAINER_ENTRY
pContainedObject
;
DWORD
dwCount
=
0
;
DWORD
dwCount
=
0
;
...
@@ -155,27 +172,27 @@ static HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_EnumObject
...
@@ -155,27 +172,27 @@ static HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_EnumObject
return
S_FALSE
;
return
S_FALSE
;
}
}
static
const
IDirectMusicContainerVtbl
DirectMusicContainer_Container_V
tbl
=
{
static
const
IDirectMusicContainerVtbl
dmcontainer_v
tbl
=
{
IDirectMusicContainerImpl_IDirectMusicContainer
_QueryInterface
,
IDirectMusicContainerImpl
_QueryInterface
,
IDirectMusicContainerImpl_IDirectMusicContainer
_AddRef
,
IDirectMusicContainerImpl
_AddRef
,
IDirectMusicContainerImpl_IDirectMusicContainer
_Release
,
IDirectMusicContainerImpl
_Release
,
IDirectMusicContainerImpl_IDirectMusicContainer
_EnumObject
IDirectMusicContainerImpl
_EnumObject
};
};
/* IDirectMusicObject part: */
/* IDirectMusicObject part: */
static
HRESULT
WINAPI
IDirectMusicContainerImpl_IDirectMusicObject_QueryInterface
(
LPDIRECTMUSICOBJECT
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
static
HRESULT
WINAPI
IDirectMusicContainerImpl_IDirectMusicObject_QueryInterface
(
LPDIRECTMUSICOBJECT
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
ObjectVtbl
,
iface
);
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
ObjectVtbl
,
iface
);
return
IDirectMusicContainerImpl_
IDirectMusicContainer_QueryInterface
((
LPDIRECTMUSICCONTAINER
)
&
This
->
ContainerVtbl
,
riid
,
ppobj
);
return
IDirectMusicContainerImpl_
QueryInterface
(
&
This
->
IDirectMusicContainer_iface
,
riid
,
ppobj
);
}
}
static
ULONG
WINAPI
IDirectMusicContainerImpl_IDirectMusicObject_AddRef
(
LPDIRECTMUSICOBJECT
iface
)
{
static
ULONG
WINAPI
IDirectMusicContainerImpl_IDirectMusicObject_AddRef
(
LPDIRECTMUSICOBJECT
iface
)
{
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
ObjectVtbl
,
iface
);
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
ObjectVtbl
,
iface
);
return
IDirectMusicContainer
Impl_IDirectMusicContainer_AddRef
((
LPDIRECTMUSICCONTAINER
)
&
This
->
ContainerVtbl
);
return
IDirectMusicContainer
_AddRef
(
&
This
->
IDirectMusicContainer_iface
);
}
}
static
ULONG
WINAPI
IDirectMusicContainerImpl_IDirectMusicObject_Release
(
LPDIRECTMUSICOBJECT
iface
)
{
static
ULONG
WINAPI
IDirectMusicContainerImpl_IDirectMusicObject_Release
(
LPDIRECTMUSICOBJECT
iface
)
{
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
ObjectVtbl
,
iface
);
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
ObjectVtbl
,
iface
);
return
IDirectMusicContainerImpl_
IDirectMusicContainer_Release
((
LPDIRECTMUSICCONTAINER
)
&
This
->
ContainerVtbl
);
return
IDirectMusicContainerImpl_
Release
(
&
This
->
IDirectMusicContainer_iface
);
}
}
static
HRESULT
WINAPI
IDirectMusicContainerImpl_IDirectMusicObject_GetDescriptor
(
LPDIRECTMUSICOBJECT
iface
,
LPDMUS_OBJECTDESC
pDesc
)
{
static
HRESULT
WINAPI
IDirectMusicContainerImpl_IDirectMusicObject_GetDescriptor
(
LPDIRECTMUSICOBJECT
iface
,
LPDMUS_OBJECTDESC
pDesc
)
{
...
@@ -439,17 +456,17 @@ static const IDirectMusicObjectVtbl DirectMusicContainer_Object_Vtbl = {
...
@@ -439,17 +456,17 @@ static const IDirectMusicObjectVtbl DirectMusicContainer_Object_Vtbl = {
/* IPersistStream part: */
/* IPersistStream part: */
static
HRESULT
WINAPI
IDirectMusicContainerImpl_IPersistStream_QueryInterface
(
LPPERSISTSTREAM
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
static
HRESULT
WINAPI
IDirectMusicContainerImpl_IPersistStream_QueryInterface
(
LPPERSISTSTREAM
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
PersistStreamVtbl
,
iface
);
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
PersistStreamVtbl
,
iface
);
return
IDirectMusicContainerImpl_
IDirectMusicContainer_QueryInterface
((
LPDIRECTMUSICCONTAINER
)
&
This
->
ContainerVtbl
,
riid
,
ppobj
);
return
IDirectMusicContainerImpl_
QueryInterface
(
&
This
->
IDirectMusicContainer_iface
,
riid
,
ppobj
);
}
}
static
ULONG
WINAPI
IDirectMusicContainerImpl_IPersistStream_AddRef
(
LPPERSISTSTREAM
iface
)
{
static
ULONG
WINAPI
IDirectMusicContainerImpl_IPersistStream_AddRef
(
LPPERSISTSTREAM
iface
)
{
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
PersistStreamVtbl
,
iface
);
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
PersistStreamVtbl
,
iface
);
return
IDirectMusicContainer
Impl_IDirectMusicContainer_AddRef
((
LPDIRECTMUSICCONTAINER
)
&
This
->
ContainerVtbl
);
return
IDirectMusicContainer
_AddRef
(
&
This
->
IDirectMusicContainer_iface
);
}
}
static
ULONG
WINAPI
IDirectMusicContainerImpl_IPersistStream_Release
(
LPPERSISTSTREAM
iface
)
{
static
ULONG
WINAPI
IDirectMusicContainerImpl_IPersistStream_Release
(
LPPERSISTSTREAM
iface
)
{
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
PersistStreamVtbl
,
iface
);
ICOM_THIS_MULTI
(
IDirectMusicContainerImpl
,
PersistStreamVtbl
,
iface
);
return
IDirectMusicContainerImpl_
IDirectMusicContainer_Release
((
LPDIRECTMUSICCONTAINER
)
&
This
->
ContainerVtbl
);
return
IDirectMusicContainerImpl_
Release
(
&
This
->
IDirectMusicContainer_iface
);
}
}
static
HRESULT
WINAPI
IDirectMusicContainerImpl_IPersistStream_GetClassID
(
LPPERSISTSTREAM
iface
,
CLSID
*
pClassID
)
{
static
HRESULT
WINAPI
IDirectMusicContainerImpl_IPersistStream_GetClassID
(
LPPERSISTSTREAM
iface
,
CLSID
*
pClassID
)
{
...
@@ -913,20 +930,24 @@ static const IPersistStreamVtbl DirectMusicContainer_PersistStream_Vtbl = {
...
@@ -913,20 +930,24 @@ static const IPersistStreamVtbl DirectMusicContainer_PersistStream_Vtbl = {
HRESULT
WINAPI
create_dmcontainer
(
REFIID
lpcGUID
,
void
**
ppobj
)
HRESULT
WINAPI
create_dmcontainer
(
REFIID
lpcGUID
,
void
**
ppobj
)
{
{
IDirectMusicContainerImpl
*
obj
;
IDirectMusicContainerImpl
*
obj
;
HRESULT
hr
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectMusicContainerImpl
));
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectMusicContainerImpl
));
if
(
NULL
==
obj
)
{
if
(
NULL
==
obj
)
{
*
ppobj
=
NULL
;
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
}
obj
->
ContainerVtbl
=
&
DirectMusicContainer_Container_V
tbl
;
obj
->
IDirectMusicContainer_iface
.
lpVtbl
=
&
dmcontainer_v
tbl
;
obj
->
ObjectVtbl
=
&
DirectMusicContainer_Object_Vtbl
;
obj
->
ObjectVtbl
=
&
DirectMusicContainer_Object_Vtbl
;
obj
->
PersistStreamVtbl
=
&
DirectMusicContainer_PersistStream_Vtbl
;
obj
->
PersistStreamVtbl
=
&
DirectMusicContainer_PersistStream_Vtbl
;
obj
->
dwRef
=
0
;
/* will be inited by QueryInterface */
obj
->
ref
=
1
;
obj
->
pContainedObjects
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
list
));
obj
->
pContainedObjects
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
list
));
list_init
(
obj
->
pContainedObjects
);
list_init
(
obj
->
pContainedObjects
);
lock_module
();
lock_module
();
return
IDirectMusicContainerImpl_IDirectMusicContainer_QueryInterface
((
LPDIRECTMUSICCONTAINER
)
&
obj
->
ContainerVtbl
,
lpcGUID
,
ppobj
);
hr
=
IDirectMusicContainer_QueryInterface
(
&
obj
->
IDirectMusicContainer_iface
,
lpcGUID
,
ppobj
);
IDirectMusicContainer_Release
(
&
obj
->
IDirectMusicContainer_iface
);
return
hr
;
}
}
dlls/dmloader/dmloader_private.h
View file @
9ab1cfb5
...
@@ -56,7 +56,6 @@ typedef struct IDirectMusicLoaderCF IDirectMusicLoaderCF;
...
@@ -56,7 +56,6 @@ typedef struct IDirectMusicLoaderCF IDirectMusicLoaderCF;
typedef
struct
IDirectMusicContainerCF
IDirectMusicContainerCF
;
typedef
struct
IDirectMusicContainerCF
IDirectMusicContainerCF
;
typedef
struct
IDirectMusicLoaderImpl
IDirectMusicLoaderImpl
;
typedef
struct
IDirectMusicLoaderImpl
IDirectMusicLoaderImpl
;
typedef
struct
IDirectMusicContainerImpl
IDirectMusicContainerImpl
;
typedef
struct
IDirectMusicLoaderFileStream
IDirectMusicLoaderFileStream
;
typedef
struct
IDirectMusicLoaderFileStream
IDirectMusicLoaderFileStream
;
typedef
struct
IDirectMusicLoaderResourceStream
IDirectMusicLoaderResourceStream
;
typedef
struct
IDirectMusicLoaderResourceStream
IDirectMusicLoaderResourceStream
;
...
@@ -110,26 +109,6 @@ typedef struct _WINE_CONTAINER_ENTRY {
...
@@ -110,26 +109,6 @@ typedef struct _WINE_CONTAINER_ENTRY {
}
WINE_CONTAINER_ENTRY
,
*
LPWINE_CONTAINER_ENTRY
;
}
WINE_CONTAINER_ENTRY
,
*
LPWINE_CONTAINER_ENTRY
;
/*****************************************************************************
/*****************************************************************************
* IDirectMusicContainerImpl implementation structure
*/
struct
IDirectMusicContainerImpl
{
/* VTABLEs */
const
IDirectMusicContainerVtbl
*
ContainerVtbl
;
const
IDirectMusicObjectVtbl
*
ObjectVtbl
;
const
IPersistStreamVtbl
*
PersistStreamVtbl
;
/* reference counter */
LONG
dwRef
;
/* stream */
LPSTREAM
pStream
;
/* header */
DMUS_IO_CONTAINER_HEADER
Header
;
/* data */
struct
list
*
pContainedObjects
;
/* descriptor */
DMUS_OBJECTDESC
Desc
;
};
/*****************************************************************************
* IDirectMusicLoaderFileStream implementation structure
* IDirectMusicLoaderFileStream implementation structure
*/
*/
struct
IDirectMusicLoaderFileStream
{
struct
IDirectMusicLoaderFileStream
{
...
...
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