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
b47facb4
Commit
b47facb4
authored
Dec 18, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Dec 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmloader: COM cleanup of IDirectMusicLoader object.
parent
bbf3e862
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
111 additions
and
85 deletions
+111
-85
dmloader_private.h
dlls/dmloader/dmloader_private.h
+6
-8
loader.c
dlls/dmloader/loader.c
+105
-77
No files found.
dlls/dmloader/dmloader_private.h
View file @
b47facb4
...
@@ -91,14 +91,12 @@ typedef struct _WINE_LOADER_OPTION {
...
@@ -91,14 +91,12 @@ typedef struct _WINE_LOADER_OPTION {
* IDirectMusicLoaderImpl implementation structure
* IDirectMusicLoaderImpl implementation structure
*/
*/
struct
IDirectMusicLoaderImpl
{
struct
IDirectMusicLoaderImpl
{
/* VTABLEs */
IDirectMusicLoader8
IDirectMusicLoader8_iface
;
const
IDirectMusicLoader8Vtbl
*
LoaderVtbl
;
LONG
ref
;
/* reference counter */
/* simple cache (linked list) */
LONG
dwRef
;
struct
list
*
pObjects
;
/* simple cache (linked list) */
/* settings for certain object classes */
struct
list
*
pObjects
;
struct
list
*
pClassSettings
;
/* settings for certain object classes */
struct
list
*
pClassSettings
;
};
};
/* contained object entry */
/* contained object entry */
...
...
dlls/dmloader/loader.c
View file @
b47facb4
...
@@ -21,11 +21,17 @@
...
@@ -21,11 +21,17 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dmloader
);
WINE_DEFAULT_DEBUG_CHANNEL
(
dmloader
);
static
HRESULT
DMUSIC_InitLoaderSettings
(
LPDIRECTMUSICLOADER8
iface
);
static
inline
IDirectMusicLoaderImpl
*
impl_from_IDirectMusicLoader8
(
IDirectMusicLoader8
*
iface
)
static
HRESULT
DMUSIC_GetLoaderSettings
(
LPDIRECTMUSICLOADER8
iface
,
REFGUID
pClassID
,
WCHAR
*
wszSearchPath
,
LPBOOL
pbCache
);
{
static
HRESULT
DMUSIC_SetLoaderSettings
(
LPDIRECTMUSICLOADER8
iface
,
REFGUID
pClassID
,
WCHAR
*
wszSearchPath
,
LPBOOL
pbCache
);
return
CONTAINING_RECORD
(
iface
,
IDirectMusicLoaderImpl
,
IDirectMusicLoader8_iface
);
}
static
HRESULT
DMUSIC_InitLoaderSettings
(
IDirectMusicLoader8
*
iface
);
static
HRESULT
DMUSIC_GetLoaderSettings
(
IDirectMusicLoader8
*
iface
,
REFGUID
class_id
,
WCHAR
*
search_path
,
BOOL
*
cache
);
static
HRESULT
DMUSIC_SetLoaderSettings
(
IDirectMusicLoader8
*
iface
,
REFGUID
class_id
,
WCHAR
*
search_path
,
BOOL
*
cache
);
static
HRESULT
DMUSIC_CopyDescriptor
(
LPDMUS_OBJECTDESC
pDst
,
LPDMUS_OBJECTDESC
pSrc
)
{
static
HRESULT
DMUSIC_CopyDescriptor
(
DMUS_OBJECTDESC
*
pDst
,
DMUS_OBJECTDESC
*
pSrc
)
{
TRACE
(
": copy
\n
%s
\n
"
,
debugstr_DMUS_OBJECTDESC
(
pSrc
));
TRACE
(
": copy
\n
%s
\n
"
,
debugstr_DMUS_OBJECTDESC
(
pSrc
));
/* copy field by field */
/* copy field by field */
if
(
pSrc
->
dwValidData
&
DMUS_OBJ_CLASS
)
pDst
->
guidClass
=
pSrc
->
guidClass
;
if
(
pSrc
->
dwValidData
&
DMUS_OBJ_CLASS
)
pDst
->
guidClass
=
pSrc
->
guidClass
;
...
@@ -69,8 +75,9 @@ static BOOL DMUSIC_IsValidLoadableClass (REFCLSID pClassID) {
...
@@ -69,8 +75,9 @@ static BOOL DMUSIC_IsValidLoadableClass (REFCLSID pClassID) {
*/
*/
/* IUnknown/IDirectMusicLoader(8) part: */
/* IUnknown/IDirectMusicLoader(8) part: */
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_IDirectMusicLoader_QueryInterface
(
LPDIRECTMUSICLOADER8
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_QueryInterface
(
IDirectMusicLoader8
*
iface
,
REFIID
riid
,
void
**
ppobj
)
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
TRACE
(
"(%p, %s, %p)
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ppobj
);
TRACE
(
"(%p, %s, %p)
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ppobj
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
...
@@ -85,30 +92,37 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_QueryInterface (
...
@@ -85,30 +92,37 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_QueryInterface (
return
E_NOINTERFACE
;
return
E_NOINTERFACE
;
}
}
static
ULONG
WINAPI
IDirectMusicLoaderImpl_IDirectMusicLoader_AddRef
(
LPDIRECTMUSICLOADER8
iface
)
{
static
ULONG
WINAPI
IDirectMusicLoaderImpl_AddRef
(
IDirectMusicLoader8
*
iface
)
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
{
TRACE
(
"(%p): AddRef from %d
\n
"
,
This
,
This
->
dwRef
);
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
return
InterlockedIncrement
(
&
This
->
dwRef
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): new ref = %u
\n
"
,
iface
,
ref
);
return
ref
;
}
}
static
ULONG
WINAPI
IDirectMusicLoaderImpl_IDirectMusicLoader_Release
(
LPDIRECTMUSICLOADER8
iface
)
{
static
ULONG
WINAPI
IDirectMusicLoaderImpl_Release
(
IDirectMusicLoader8
*
iface
)
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
DWORD
dwRef
=
InterlockedDecrement
(
&
This
->
dwRef
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p): ReleaseRef to %d
\n
"
,
This
,
This
->
dwRef
);
if
(
dwRef
==
0
)
{
TRACE
(
"(%p)->(): new ref = %u
\n
"
,
iface
,
ref
);
/* firstly, release the cache */
IDirectMusicLoader8_ClearCache
(
iface
,
&
GUID_DirectMusicAllTypes
);
if
(
!
ref
)
{
/* FIXME: release all allocated entries */
/* Firstly, release the cache */
HeapFree
(
GetProcessHeap
(),
0
,
This
);
IDirectMusicLoader8_ClearCache
(
iface
,
&
GUID_DirectMusicAllTypes
);
unlock_module
();
/* FIXME: Release all allocated entries */
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
unlock_module
();
}
return
dwR
ef
;
return
r
ef
;
}
}
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_IDirectMusicLoader_GetObject
(
LPDIRECTMUSICLOADER8
iface
,
LPDMUS_OBJECTDESC
pDesc
,
REFIID
riid
,
LPVOID
*
ppv
)
{
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_GetObject
(
IDirectMusicLoader8
*
iface
,
DMUS_OBJECTDESC
*
pDesc
,
REFIID
riid
,
void
**
ppv
)
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
HRESULT
result
=
S_OK
;
HRESULT
result
=
S_OK
;
HRESULT
ret
=
S_OK
;
/* used at the end of function, to determine whether everything went OK */
HRESULT
ret
=
S_OK
;
/* used at the end of function, to determine whether everything went OK */
...
@@ -361,8 +375,9 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_GetObject (LPDIR
...
@@ -361,8 +375,9 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_GetObject (LPDIR
return
result
;
return
result
;
}
}
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_IDirectMusicLoader_SetObject
(
LPDIRECTMUSICLOADER8
iface
,
LPDMUS_OBJECTDESC
pDesc
)
{
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_SetObject
(
IDirectMusicLoader8
*
iface
,
DMUS_OBJECTDESC
*
pDesc
)
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
LPSTREAM
pStream
;
LPSTREAM
pStream
;
LPDIRECTMUSICOBJECT
pObject
;
LPDIRECTMUSICOBJECT
pObject
;
DMUS_OBJECTDESC
Desc
;
DMUS_OBJECTDESC
Desc
;
...
@@ -483,9 +498,10 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_SetObject (LPDIR
...
@@ -483,9 +498,10 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_SetObject (LPDIR
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_IDirectMusicLoader_SetSearchDirectory
(
LPDIRECTMUSICLOADER8
iface
,
REFGUID
rguidClass
,
WCHAR
*
pwzPath
,
BOOL
fClear
)
{
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_SetSearchDirectory
(
IDirectMusicLoader8
*
iface
,
REFGUID
rguidClass
,
WCHAR
*
pwzPath
,
BOOL
fClear
)
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
WCHAR
wszCurrentPath
[
MAX_PATH
];
WCHAR
wszCurrentPath
[
MAX_PATH
];
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
TRACE
(
"(%p, %s, %s, %d)
\n
"
,
This
,
debugstr_dmguid
(
rguidClass
),
debugstr_w
(
pwzPath
),
fClear
);
TRACE
(
"(%p, %s, %s, %d)
\n
"
,
This
,
debugstr_dmguid
(
rguidClass
),
debugstr_w
(
pwzPath
),
fClear
);
FIXME
(
": fClear ignored
\n
"
);
FIXME
(
": fClear ignored
\n
"
);
DMUSIC_GetLoaderSettings
(
iface
,
rguidClass
,
wszCurrentPath
,
NULL
);
DMUSIC_GetLoaderSettings
(
iface
,
rguidClass
,
wszCurrentPath
,
NULL
);
...
@@ -496,14 +512,15 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_SetSearchDirecto
...
@@ -496,14 +512,15 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_SetSearchDirecto
return
DMUSIC_SetLoaderSettings
(
iface
,
rguidClass
,
pwzPath
,
NULL
);
return
DMUSIC_SetLoaderSettings
(
iface
,
rguidClass
,
pwzPath
,
NULL
);
}
}
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_IDirectMusicLoader_ScanDirectory
(
LPDIRECTMUSICLOADER8
iface
,
REFGUID
rguidClass
,
WCHAR
*
pwzFileExtension
,
WCHAR
*
pwzScanFileName
)
{
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_ScanDirectory
(
IDirectMusicLoader8
*
iface
,
REFGUID
rguidClass
,
WCHAR
*
pwzFileExtension
,
WCHAR
*
pwzScanFileName
)
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
static
const
WCHAR
wszAny
[]
=
{
'*'
,
0
};
static
const
WCHAR
wszAny
[]
=
{
'*'
,
0
};
WIN32_FIND_DATAW
FileData
;
WIN32_FIND_DATAW
FileData
;
HANDLE
hSearch
;
HANDLE
hSearch
;
WCHAR
wszSearchString
[
MAX_PATH
];
WCHAR
wszSearchString
[
MAX_PATH
];
WCHAR
*
p
;
WCHAR
*
p
;
HRESULT
result
;
HRESULT
result
;
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
TRACE
(
"(%p, %s, %p, %p)
\n
"
,
This
,
debugstr_dmguid
(
rguidClass
),
pwzFileExtension
,
pwzScanFileName
);
TRACE
(
"(%p, %s, %p, %p)
\n
"
,
This
,
debugstr_dmguid
(
rguidClass
),
pwzFileExtension
,
pwzScanFileName
);
if
(
IsEqualGUID
(
rguidClass
,
&
GUID_DirectMusicAllTypes
)
||
!
DMUSIC_IsValidLoadableClass
(
rguidClass
))
{
if
(
IsEqualGUID
(
rguidClass
,
&
GUID_DirectMusicAllTypes
)
||
!
DMUSIC_IsValidLoadableClass
(
rguidClass
))
{
ERR
(
": rguidClass invalid CLSID
\n
"
);
ERR
(
": rguidClass invalid CLSID
\n
"
);
...
@@ -550,13 +567,14 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ScanDirectory (L
...
@@ -550,13 +567,14 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ScanDirectory (L
}
while
(
1
);
}
while
(
1
);
}
}
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_IDirectMusicLoader_CacheObject
(
LPDIRECTMUSICLOADER8
iface
,
IDirectMusicObject
*
pObject
)
{
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_CacheObject
(
IDirectMusicLoader8
*
iface
,
IDirectMusicObject
*
pObject
)
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
DMUS_OBJECTDESC
Desc
;
DMUS_OBJECTDESC
Desc
;
HRESULT
result
=
DMUS_E_LOADER_OBJECTNOTFOUND
;
HRESULT
result
=
DMUS_E_LOADER_OBJECTNOTFOUND
;
struct
list
*
pEntry
;
struct
list
*
pEntry
;
LPWINE_LOADER_ENTRY
pObjectEntry
=
NULL
;
LPWINE_LOADER_ENTRY
pObjectEntry
=
NULL
;
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
TRACE
(
"(%p, %p)
\n
"
,
This
,
pObject
);
TRACE
(
"(%p, %p)
\n
"
,
This
,
pObject
);
/* get descriptor */
/* get descriptor */
...
@@ -630,13 +648,14 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_CacheObject (LPD
...
@@ -630,13 +648,14 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_CacheObject (LPD
return
result
;
return
result
;
}
}
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObject
(
LPDIRECTMUSICLOADER8
iface
,
IDirectMusicObject
*
pObject
)
{
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_ReleaseObject
(
IDirectMusicLoader8
*
iface
,
IDirectMusicObject
*
pObject
)
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
DMUS_OBJECTDESC
Desc
;
DMUS_OBJECTDESC
Desc
;
struct
list
*
pEntry
;
struct
list
*
pEntry
;
LPWINE_LOADER_ENTRY
pObjectEntry
=
NULL
;
LPWINE_LOADER_ENTRY
pObjectEntry
=
NULL
;
HRESULT
result
=
S_FALSE
;
HRESULT
result
=
S_FALSE
;
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
TRACE
(
"(%p, %p)
\n
"
,
This
,
pObject
);
TRACE
(
"(%p, %p)
\n
"
,
This
,
pObject
);
if
(
!
pObject
)
return
E_POINTER
;
if
(
!
pObject
)
return
E_POINTER
;
...
@@ -695,10 +714,11 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObject (L
...
@@ -695,10 +714,11 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObject (L
return
result
;
return
result
;
}
}
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_IDirectMusicLoader_ClearCache
(
LPDIRECTMUSICLOADER8
iface
,
REFGUID
rguidClass
)
{
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_ClearCache
(
IDirectMusicLoader8
*
iface
,
REFGUID
rguidClass
)
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
struct
list
*
pEntry
;
struct
list
*
pEntry
;
LPWINE_LOADER_ENTRY
pObjectEntry
;
LPWINE_LOADER_ENTRY
pObjectEntry
;
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
TRACE
(
"(%p, %s)
\n
"
,
This
,
debugstr_dmguid
(
rguidClass
));
TRACE
(
"(%p, %s)
\n
"
,
This
,
debugstr_dmguid
(
rguidClass
));
LIST_FOR_EACH
(
pEntry
,
This
->
pObjects
)
{
LIST_FOR_EACH
(
pEntry
,
This
->
pObjects
)
{
...
@@ -714,8 +734,9 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ClearCache (LPDI
...
@@ -714,8 +734,9 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ClearCache (LPDI
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_IDirectMusicLoader_EnableCache
(
LPDIRECTMUSICLOADER8
iface
,
REFGUID
rguidClass
,
BOOL
fEnable
)
{
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_EnableCache
(
IDirectMusicLoader8
*
iface
,
REFGUID
rguidClass
,
BOOL
fEnable
)
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
BOOL
bCurrent
;
BOOL
bCurrent
;
TRACE
(
"(%p, %s, %d)
\n
"
,
This
,
debugstr_dmguid
(
rguidClass
),
fEnable
);
TRACE
(
"(%p, %s, %d)
\n
"
,
This
,
debugstr_dmguid
(
rguidClass
),
fEnable
);
DMUSIC_GetLoaderSettings
(
iface
,
rguidClass
,
NULL
,
&
bCurrent
);
DMUSIC_GetLoaderSettings
(
iface
,
rguidClass
,
NULL
,
&
bCurrent
);
...
@@ -725,11 +746,12 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_EnableCache (LPD
...
@@ -725,11 +746,12 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_EnableCache (LPD
return
DMUSIC_SetLoaderSettings
(
iface
,
rguidClass
,
NULL
,
&
fEnable
);
return
DMUSIC_SetLoaderSettings
(
iface
,
rguidClass
,
NULL
,
&
fEnable
);
}
}
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_IDirectMusicLoader_EnumObject
(
LPDIRECTMUSICLOADER8
iface
,
REFGUID
rguidClass
,
DWORD
dwIndex
,
LPDMUS_OBJECTDESC
pDesc
)
{
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_EnumObject
(
IDirectMusicLoader8
*
iface
,
REFGUID
rguidClass
,
DWORD
dwIndex
,
DMUS_OBJECTDESC
*
pDesc
)
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
DWORD
dwCount
=
0
;
DWORD
dwCount
=
0
;
struct
list
*
pEntry
;
struct
list
*
pEntry
;
LPWINE_LOADER_ENTRY
pObjectEntry
;
LPWINE_LOADER_ENTRY
pObjectEntry
;
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
TRACE
(
"(%p, %s, %d, %p)
\n
"
,
This
,
debugstr_dmguid
(
rguidClass
),
dwIndex
,
pDesc
);
TRACE
(
"(%p, %s, %d, %p)
\n
"
,
This
,
debugstr_dmguid
(
rguidClass
),
dwIndex
,
pDesc
);
DM_STRUCT_INIT
(
pDesc
);
DM_STRUCT_INIT
(
pDesc
);
...
@@ -755,13 +777,14 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_EnumObject (LPDI
...
@@ -755,13 +777,14 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_EnumObject (LPDI
return
S_FALSE
;
return
S_FALSE
;
}
}
static
void
WINAPI
IDirectMusicLoaderImpl_
IDirectMusicLoader_CollectGarbage
(
LPDIRECTMUSICLOADER8
iface
)
{
static
void
WINAPI
IDirectMusicLoaderImpl_
CollectGarbage
(
IDirectMusicLoader8
*
iface
)
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
{
FIXME
(
"(%p): stub
\n
"
,
This
);
FIXME
(
"(%p)->(): stub
\n
"
,
iface
);
}
}
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObjectByUnknown
(
LPDIRECTMUSICLOADER8
iface
,
IUnknown
*
pObject
)
{
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_ReleaseObjectByUnknown
(
IDirectMusicLoader8
*
iface
,
IUnknown
*
pObject
)
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
HRESULT
result
;
HRESULT
result
;
LPDIRECTMUSICOBJECT
pObjectInterface
;
LPDIRECTMUSICOBJECT
pObjectInterface
;
...
@@ -781,8 +804,9 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObjectByU
...
@@ -781,8 +804,9 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObjectByU
return
result
;
return
result
;
}
}
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_IDirectMusicLoader_LoadObjectFromFile
(
LPDIRECTMUSICLOADER8
iface
,
REFGUID
rguidClassID
,
REFIID
iidInterfaceID
,
WCHAR
*
pwzFilePath
,
void
**
ppObject
)
{
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_LoadObjectFromFile
(
IDirectMusicLoader8
*
iface
,
REFGUID
rguidClassID
,
REFIID
iidInterfaceID
,
WCHAR
*
pwzFilePath
,
void
**
ppObject
)
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
DMUS_OBJECTDESC
ObjDesc
;
DMUS_OBJECTDESC
ObjDesc
;
WCHAR
wszLoaderSearchPath
[
MAX_PATH
];
WCHAR
wszLoaderSearchPath
[
MAX_PATH
];
...
@@ -808,25 +832,25 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_LoadObjectFromFi
...
@@ -808,25 +832,25 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_LoadObjectFromFi
TRACE
(
": full file path = %s
\n
"
,
debugstr_w
(
ObjDesc
.
wszFileName
));
TRACE
(
": full file path = %s
\n
"
,
debugstr_w
(
ObjDesc
.
wszFileName
));
return
IDirectMusicLoader
Impl_IDirectMusicLoader_GetObject
(
iface
,
&
ObjDesc
,
iidInterfaceID
,
ppObject
);
return
IDirectMusicLoader
_GetObject
(
iface
,
&
ObjDesc
,
iidInterfaceID
,
ppObject
);
}
}
static
const
IDirectMusicLoader8Vtbl
DirectMusicLoader_Loader_Vtbl
=
{
static
const
IDirectMusicLoader8Vtbl
DirectMusicLoader_Loader_Vtbl
=
{
IDirectMusicLoaderImpl_IDirectMusicLoader
_QueryInterface
,
IDirectMusicLoaderImpl
_QueryInterface
,
IDirectMusicLoaderImpl_IDirectMusicLoader
_AddRef
,
IDirectMusicLoaderImpl
_AddRef
,
IDirectMusicLoaderImpl_IDirectMusicLoader
_Release
,
IDirectMusicLoaderImpl
_Release
,
IDirectMusicLoaderImpl_IDirectMusicLoader
_GetObject
,
IDirectMusicLoaderImpl
_GetObject
,
IDirectMusicLoaderImpl_IDirectMusicLoader
_SetObject
,
IDirectMusicLoaderImpl
_SetObject
,
IDirectMusicLoaderImpl_IDirectMusicLoader
_SetSearchDirectory
,
IDirectMusicLoaderImpl
_SetSearchDirectory
,
IDirectMusicLoaderImpl_IDirectMusicLoader
_ScanDirectory
,
IDirectMusicLoaderImpl
_ScanDirectory
,
IDirectMusicLoaderImpl_IDirectMusicLoader
_CacheObject
,
IDirectMusicLoaderImpl
_CacheObject
,
IDirectMusicLoaderImpl_IDirectMusicLoader
_ReleaseObject
,
IDirectMusicLoaderImpl
_ReleaseObject
,
IDirectMusicLoaderImpl_IDirectMusicLoader
_ClearCache
,
IDirectMusicLoaderImpl
_ClearCache
,
IDirectMusicLoaderImpl_IDirectMusicLoader
_EnableCache
,
IDirectMusicLoaderImpl
_EnableCache
,
IDirectMusicLoaderImpl_IDirectMusicLoader
_EnumObject
,
IDirectMusicLoaderImpl
_EnumObject
,
IDirectMusicLoaderImpl_IDirectMusicLoader
_CollectGarbage
,
IDirectMusicLoaderImpl
_CollectGarbage
,
IDirectMusicLoaderImpl_IDirectMusicLoader
_ReleaseObjectByUnknown
,
IDirectMusicLoaderImpl
_ReleaseObjectByUnknown
,
IDirectMusicLoaderImpl_IDirectMusicLoader
_LoadObjectFromFile
IDirectMusicLoaderImpl
_LoadObjectFromFile
};
};
/* help function for DMUSIC_SetDefaultDLS */
/* help function for DMUSIC_SetDefaultDLS */
...
@@ -847,7 +871,8 @@ static HRESULT DMUSIC_GetDefaultGMPath (WCHAR wszPath[MAX_PATH]) {
...
@@ -847,7 +871,8 @@ static HRESULT DMUSIC_GetDefaultGMPath (WCHAR wszPath[MAX_PATH]) {
}
}
/* for ClassFactory */
/* for ClassFactory */
HRESULT
WINAPI
DMUSIC_CreateDirectMusicLoaderImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
)
{
HRESULT
WINAPI
DMUSIC_CreateDirectMusicLoaderImpl
(
const
GUID
*
lpcGUID
,
void
**
ppobj
,
IUnknown
*
pUnkOuter
)
{
IDirectMusicLoaderImpl
*
obj
;
IDirectMusicLoaderImpl
*
obj
;
DMUS_OBJECTDESC
Desc
;
DMUS_OBJECTDESC
Desc
;
LPWINE_LOADER_ENTRY
pDefaultDLSEntry
;
LPWINE_LOADER_ENTRY
pDefaultDLSEntry
;
...
@@ -859,15 +884,15 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl (LPCGUID lpcGUID, LPVOID *ppob
...
@@ -859,15 +884,15 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl (LPCGUID lpcGUID, LPVOID *ppob
*
ppobj
=
NULL
;
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
}
obj
->
Loader
Vtbl
=
&
DirectMusicLoader_Loader_Vtbl
;
obj
->
IDirectMusicLoader8_iface
.
lp
Vtbl
=
&
DirectMusicLoader_Loader_Vtbl
;
obj
->
dwRef
=
0
;
/* w
ill be inited with QueryInterface */
obj
->
ref
=
0
;
/* W
ill be inited with QueryInterface */
/* init cache/alias list */
/* init cache/alias list */
obj
->
pObjects
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
list
));
obj
->
pObjects
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
list
));
list_init
(
obj
->
pObjects
);
list_init
(
obj
->
pObjects
);
/* init settings */
/* init settings */
obj
->
pClassSettings
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
list
));
obj
->
pClassSettings
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
list
));
list_init
(
obj
->
pClassSettings
);
list_init
(
obj
->
pClassSettings
);
DMUSIC_InitLoaderSettings
((
LPDIRECTMUSICLOADER8
)
obj
);
DMUSIC_InitLoaderSettings
(
&
obj
->
IDirectMusicLoader8_iface
);
/* set default DLS collection (via SetObject... so that loading via DMUS_OBJ_OBJECT is possible) */
/* set default DLS collection (via SetObject... so that loading via DMUS_OBJ_OBJECT is possible) */
DM_STRUCT_INIT
(
&
Desc
);
DM_STRUCT_INIT
(
&
Desc
);
...
@@ -875,7 +900,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl (LPCGUID lpcGUID, LPVOID *ppob
...
@@ -875,7 +900,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl (LPCGUID lpcGUID, LPVOID *ppob
Desc
.
guidClass
=
CLSID_DirectMusicCollection
;
Desc
.
guidClass
=
CLSID_DirectMusicCollection
;
Desc
.
guidObject
=
GUID_DefaultGMCollection
;
Desc
.
guidObject
=
GUID_DefaultGMCollection
;
DMUSIC_GetDefaultGMPath
(
Desc
.
wszFileName
);
DMUSIC_GetDefaultGMPath
(
Desc
.
wszFileName
);
IDirectMusicLoader_SetObject
((
LPDIRECTMUSICLOADER8
)
obj
,
&
Desc
);
IDirectMusicLoader_SetObject
(
&
obj
->
IDirectMusicLoader8_iface
,
&
Desc
);
/* and now the workaroundTM for "invalid" default DLS; basically,
/* and now the workaroundTM for "invalid" default DLS; basically,
my tests showed that if GUID chunk is present in default DLS
my tests showed that if GUID chunk is present in default DLS
collection, loader treats it as "invalid" and returns
collection, loader treats it as "invalid" and returns
...
@@ -889,12 +914,13 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl (LPCGUID lpcGUID, LPVOID *ppob
...
@@ -889,12 +914,13 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl (LPCGUID lpcGUID, LPVOID *ppob
lock_module
();
lock_module
();
return
IDirectMusicLoader
Impl_IDirectMusicLoader_QueryInterface
((
LPDIRECTMUSICLOADER8
)
obj
,
lpcGUID
,
ppobj
);
return
IDirectMusicLoader
_QueryInterface
(
&
obj
->
IDirectMusicLoader8_iface
,
lpcGUID
,
ppobj
);
}
}
/* help function for retrieval of search path and caching option for certain class */
/* help function for retrieval of search path and caching option for certain class */
static
HRESULT
DMUSIC_GetLoaderSettings
(
LPDIRECTMUSICLOADER8
iface
,
REFGUID
pClassID
,
WCHAR
*
wszSearchPath
,
LPBOOL
pbCache
)
{
static
HRESULT
DMUSIC_GetLoaderSettings
(
IDirectMusicLoader8
*
iface
,
REFGUID
pClassID
,
WCHAR
*
wszSearchPath
,
BOOL
*
pbCache
)
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
struct
list
*
pEntry
;
struct
list
*
pEntry
;
TRACE
(
": (%p, %s, %p, %p)
\n
"
,
This
,
debugstr_dmguid
(
pClassID
),
wszSearchPath
,
pbCache
);
TRACE
(
": (%p, %s, %p, %p)
\n
"
,
This
,
debugstr_dmguid
(
pClassID
),
wszSearchPath
,
pbCache
);
...
@@ -912,8 +938,9 @@ static HRESULT DMUSIC_GetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pCl
...
@@ -912,8 +938,9 @@ static HRESULT DMUSIC_GetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pCl
}
}
/* help function for setting search path and caching option for certain class */
/* help function for setting search path and caching option for certain class */
static
HRESULT
DMUSIC_SetLoaderSettings
(
LPDIRECTMUSICLOADER8
iface
,
REFGUID
pClassID
,
WCHAR
*
wszSearchPath
,
LPBOOL
pbCache
)
{
static
HRESULT
DMUSIC_SetLoaderSettings
(
IDirectMusicLoader8
*
iface
,
REFGUID
pClassID
,
WCHAR
*
wszSearchPath
,
BOOL
*
pbCache
)
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
struct
list
*
pEntry
;
struct
list
*
pEntry
;
HRESULT
result
=
S_FALSE
;
/* in case pClassID != GUID_DirectMusicAllTypes and not a valid CLSID */
HRESULT
result
=
S_FALSE
;
/* in case pClassID != GUID_DirectMusicAllTypes and not a valid CLSID */
TRACE
(
": (%p, %s, %p, %p)
\n
"
,
This
,
debugstr_dmguid
(
pClassID
),
wszSearchPath
,
pbCache
);
TRACE
(
": (%p, %s, %p, %p)
\n
"
,
This
,
debugstr_dmguid
(
pClassID
),
wszSearchPath
,
pbCache
);
...
@@ -935,9 +962,10 @@ static HRESULT DMUSIC_SetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pCl
...
@@ -935,9 +962,10 @@ static HRESULT DMUSIC_SetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pCl
return
result
;
return
result
;
}
}
static
HRESULT
DMUSIC_InitLoaderSettings
(
LPDIRECTMUSICLOADER8
iface
)
{
static
HRESULT
DMUSIC_InitLoaderSettings
(
IDirectMusicLoader8
*
iface
)
ICOM_THIS_MULTI
(
IDirectMusicLoaderImpl
,
LoaderVtbl
,
iface
);
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
/* hard-coded list of classes */
/* hard-coded list of classes */
static
REFCLSID
classes
[]
=
{
static
REFCLSID
classes
[]
=
{
&
CLSID_DirectMusicAudioPathConfig
,
&
CLSID_DirectMusicAudioPathConfig
,
...
...
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