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
1c77528a
Commit
1c77528a
authored
Jan 09, 2013
by
Christian Costa
Committed by
Alexandre Julliard
Jan 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: COM cleanup of IDirectMusicDownload.
parent
ba693245
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
53 deletions
+67
-53
dmusic_private.h
dlls/dmusic/dmusic_private.h
+4
-4
download.c
dlls/dmusic/download.c
+63
-49
No files found.
dlls/dmusic/dmusic_private.h
View file @
1c77528a
...
...
@@ -148,11 +148,11 @@ struct IDirectMusicDownloadedInstrumentImpl {
* IDirectMusicDownloadImpl implementation structure
*/
struct
IDirectMusicDownloadImpl
{
/* IUnknown fields */
const
IDirectMusicDownloadVtbl
*
lpVtbl
;
LONG
ref
;
/* IUnknown fields */
IDirectMusicDownload
IDirectMusicDownload_iface
;
LONG
ref
;
/* IDirectMusicDownloadImpl fields */
/* IDirectMusicDownloadImpl fields */
};
/*****************************************************************************
...
...
dlls/dmusic/download.c
View file @
1c77528a
/* IDirectMusicDownload Implementation
/*
* IDirectMusicDownload Implementation
*
* Copyright (C) 2003-2004 Rok Mandeljc
*
...
...
@@ -21,72 +22,85 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dmusic
);
static
inline
IDirectMusicDownloadImpl
*
impl_from_IDirectMusicDownload
(
IDirectMusicDownload
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectMusicDownloadImpl
,
IDirectMusicDownload_iface
);
}
/* IDirectMusicDownloadImpl IUnknown part: */
static
HRESULT
WINAPI
IDirectMusicDownloadImpl_QueryInterface
(
LPDIRECTMUSICDOWNLOAD
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IDirectMusicDownloadImpl
*
This
=
(
IDirectMusicDownloadImpl
*
)
iface
;
TRACE
(
"(%p, %s, %p)
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ppobj
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IDirectMusicDownload
))
{
IUnknown_AddRef
(
iface
);
*
ppobj
=
This
;
return
S_OK
;
}
WARN
(
"(%p, %s, %p): not found
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
static
HRESULT
WINAPI
IDirectMusicDownloadImpl_QueryInterface
(
IDirectMusicDownload
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
{
TRACE
(
"(%p, %s, %p)
\n
"
,
iface
,
debugstr_dmguid
(
riid
),
ret_iface
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IDirectMusicDownload
))
{
IDirectMusicDownload_AddRef
(
iface
);
*
ret_iface
=
iface
;
return
S_OK
;
}
*
ret_iface
=
NULL
;
WARN
(
"(%p, %s, %p): not found
\n
"
,
iface
,
debugstr_dmguid
(
riid
),
ret_iface
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
IDirectMusicDownloadImpl_AddRef
(
LPDIRECTMUSICDOWNLOAD
iface
)
{
IDirectMusicDownloadImpl
*
This
=
(
IDirectMusicDownloadImpl
*
)
iface
;
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
static
ULONG
WINAPI
IDirectMusicDownloadImpl_AddRef
(
IDirectMusicDownload
*
iface
)
{
IDirectMusicDownloadImpl
*
This
=
impl_from_IDirectMusicDownload
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(ref before=%u)
\n
"
,
This
,
refCount
-
1
);
TRACE
(
"(%p)->(): new ref = %u
\n
"
,
iface
,
ref
);
DMUSIC_LockModule
();
DMUSIC_LockModule
();
return
refCount
;
return
ref
;
}
static
ULONG
WINAPI
IDirectMusicDownloadImpl_Release
(
LPDIRECTMUSICDOWNLOAD
iface
)
{
IDirectMusicDownloadImpl
*
This
=
(
IDirectMusicDownloadImpl
*
)
iface
;
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
static
ULONG
WINAPI
IDirectMusicDownloadImpl_Release
(
IDirectMusicDownload
*
iface
)
{
IDirectMusicDownloadImpl
*
This
=
impl_from_IDirectMusicDownload
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): new ref = %u
\n
"
,
iface
,
ref
);
TRACE
(
"(%p)->(ref before=%u)
\n
"
,
This
,
refCount
+
1
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
!
refCount
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
DMUSIC_UnlockModule
();
DMUSIC_UnlockModule
();
return
refCount
;
return
ref
;
}
/* IDirectMusicDownloadImpl IDirectMusicDownload part: */
static
HRESULT
WINAPI
IDirectMusicDownloadImpl_GetBuffer
(
LPDIRECTMUSICDOWNLOAD
iface
,
void
**
ppvBuffer
,
DWORD
*
pdwSize
)
{
IDirectMusicDownloadImpl
*
This
=
(
IDirectMusicDownloadImpl
*
)
iface
;
FIXME
(
"(%p, %p, %p): stub
\n
"
,
This
,
ppvBuffer
,
pdwSize
);
return
S_OK
;
static
HRESULT
WINAPI
IDirectMusicDownloadImpl_GetBuffer
(
IDirectMusicDownload
*
iface
,
void
**
buffer
,
DWORD
*
size
)
{
FIXME
(
"(%p, %p, %p): stub
\n
"
,
iface
,
buffer
,
size
);
return
S_OK
;
}
static
const
IDirectMusicDownloadVtbl
DirectMusicDownload_Vtbl
=
{
IDirectMusicDownloadImpl_QueryInterface
,
IDirectMusicDownloadImpl_AddRef
,
IDirectMusicDownloadImpl_Release
,
IDirectMusicDownloadImpl_GetBuffer
IDirectMusicDownloadImpl_QueryInterface
,
IDirectMusicDownloadImpl_AddRef
,
IDirectMusicDownloadImpl_Release
,
IDirectMusicDownloadImpl_GetBuffer
};
/* for ClassFactory */
HRESULT
DMUSIC_CreateDirectMusicDownloadImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
)
{
IDirectMusicDownloadImpl
*
dmdl
;
dmdl
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectMusicDownloadImpl
));
if
(
NULL
==
dmdl
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
dmdl
->
lpVtbl
=
&
DirectMusicDownload_Vtbl
;
dmdl
->
ref
=
0
;
/* will be inited by QueryInterface */
return
IDirectMusicDownloadImpl_QueryInterface
((
LPDIRECTMUSICDOWNLOAD
)
dmdl
,
lpcGUID
,
ppobj
);
HRESULT
DMUSIC_CreateDirectMusicDownloadImpl
(
const
GUID
*
guid
,
void
**
ret_iface
,
IUnknown
*
unk_outer
)
{
IDirectMusicDownloadImpl
*
download
;
download
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
download
));
if
(
!
download
)
{
*
ret_iface
=
NULL
;
return
E_OUTOFMEMORY
;
}
download
->
IDirectMusicDownload_iface
.
lpVtbl
=
&
DirectMusicDownload_Vtbl
;
download
->
ref
=
1
;
return
S_OK
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment