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
49c6e57d
Commit
49c6e57d
authored
Sep 26, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmloader: Remove invalid default DLS collection check.
parent
767c5ddb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
35 deletions
+19
-35
loader.c
dlls/dmloader/loader.c
+19
-35
No files found.
dlls/dmloader/loader.c
View file @
49c6e57d
...
...
@@ -40,7 +40,6 @@ struct cache_entry {
struct
list
entry
;
DMUS_OBJECTDESC
Desc
;
IDirectMusicObject
*
pObject
;
BOOL
bInvalidDefaultDLS
;
/* workaround for enabling caching of "faulty" default dls collection */
};
struct
loader
...
...
@@ -276,12 +275,6 @@ static HRESULT WINAPI loader_GetObject(IDirectMusicLoader8 *iface, DMUS_OBJECTDE
TRACE
(
": looking if we have object in the cache or if it can be found via alias
\n
"
);
pExistingEntry
=
find_cache_object
(
This
,
pDesc
);
if
(
pExistingEntry
)
{
if
(
pExistingEntry
->
bInvalidDefaultDLS
)
{
TRACE
(
": found faulty default DLS collection... enabling M$ compliant behaviour
\n
"
);
return
DMUS_E_LOADER_NOFILENAME
;
}
if
(
pExistingEntry
->
Desc
.
dwValidData
&
DMUS_OBJ_LOADED
)
{
TRACE
(
": already loaded
\n
"
);
return
IDirectMusicObject_QueryInterface
(
pExistingEntry
->
pObject
,
riid
,
ppv
);
...
...
@@ -404,23 +397,26 @@ static HRESULT WINAPI loader_GetObject(IDirectMusicLoader8 *iface, DMUS_OBJECTDE
IStream_Release
(
pStream
);
IPersistStream_Release
(
pPersistStream
);
/* add object to cache/overwrite existing info (if cache is enabled) */
bCache
=
is_cache_enabled
(
This
,
&
pDesc
->
guidClass
);
if
(
bCache
)
{
if
(
!
pObjectEntry
)
{
/* add object to cache/overwrite existing info (if cache is enabled) */
bCache
=
is_cache_enabled
(
This
,
&
pDesc
->
guidClass
);
if
(
!
bCache
)
TRACE
(
": caching disabled
\n
"
);
else
{
if
(
!
pObjectEntry
)
{
pObjectEntry
=
calloc
(
1
,
sizeof
(
*
pObjectEntry
));
DM_STRUCT_INIT
(
&
pObjectEntry
->
Desc
);
DMUSIC_CopyDescriptor
(
&
pObjectEntry
->
Desc
,
&
GotDesc
);
pObjectEntry
->
pObject
=
pObject
;
pObjectEntry
->
bInvalidDefaultDLS
=
FALSE
;
list_add_head
(
&
This
->
cache
,
&
pObjectEntry
->
entry
);
}
else
{
DMUSIC_CopyDescriptor
(
&
pObjectEntry
->
Desc
,
&
GotDesc
);
pObjectEntry
->
pObject
=
pObject
;
pObjectEntry
->
bInvalidDefaultDLS
=
FALSE
;
}
TRACE
(
": filled in cache entry
\n
"
);
}
else
TRACE
(
": caching disabled
\n
"
);
DM_STRUCT_INIT
(
&
pObjectEntry
->
Desc
);
DMUSIC_CopyDescriptor
(
&
pObjectEntry
->
Desc
,
&
GotDesc
);
pObjectEntry
->
pObject
=
pObject
;
list_add_head
(
&
This
->
cache
,
&
pObjectEntry
->
entry
)
;
}
else
{
DMUSIC_CopyDescriptor
(
&
pObjectEntry
->
Desc
,
&
GotDesc
)
;
pObjectEntry
->
pObject
=
pObject
;
}
TRACE
(
": filled in cache entry
\n
"
);
}
result
=
IDirectMusicObject_QueryInterface
(
pObject
,
riid
,
ppv
);
if
(
!
bCache
)
IDirectMusicObject_Release
(
pObject
);
/* since loader's reference is not needed */
...
...
@@ -873,8 +869,6 @@ HRESULT create_dmloader(REFIID lpcGUID, void **ppobj)
{
struct
loader
*
obj
;
DMUS_OBJECTDESC
Desc
;
struct
cache_entry
*
dls
;
struct
list
*
pEntry
;
HRESULT
hr
;
TRACE
(
"(%s, %p)
\n
"
,
debugstr_dmguid
(
lpcGUID
),
ppobj
);
...
...
@@ -895,16 +889,6 @@ HRESULT create_dmloader(REFIID lpcGUID, void **ppobj)
DMUSIC_GetDefaultGMPath
(
Desc
.
wszFileName
);
IDirectMusicLoader_SetObject
(
&
obj
->
IDirectMusicLoader8_iface
,
&
Desc
);
/* and now the workaroundTM for "invalid" default DLS; basically,
my tests showed that if GUID chunk is present in default DLS
collection, loader treats it as "invalid" and returns
DMUS_E_LOADER_NOFILENAME for all requests for it; basically, we check
if out input guidObject was overwritten */
pEntry
=
list_head
(
&
obj
->
cache
);
dls
=
LIST_ENTRY
(
pEntry
,
struct
cache_entry
,
entry
);
if
(
!
IsEqualGUID
(
&
Desc
.
guidObject
,
&
GUID_DefaultGMCollection
))
dls
->
bInvalidDefaultDLS
=
TRUE
;
hr
=
IDirectMusicLoader_QueryInterface
(
&
obj
->
IDirectMusicLoader8_iface
,
lpcGUID
,
ppobj
);
IDirectMusicLoader_Release
(
&
obj
->
IDirectMusicLoader8_iface
);
return
hr
;
...
...
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