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
73d1e066
Commit
73d1e066
authored
Aug 31, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Implement IDirectMusicPortDownload_(Download|Unload).
parent
30df87af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
9 deletions
+67
-9
port.c
dlls/dmusic/port.c
+64
-6
dmusic.c
dlls/dmusic/tests/dmusic.c
+3
-3
No files found.
dlls/dmusic/port.c
View file @
73d1e066
...
...
@@ -25,6 +25,14 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dmusic
);
struct
download_entry
{
struct
list
entry
;
IDirectMusicDownload
*
download
;
HANDLE
handle
;
DWORD
id
;
};
struct
synth_port
{
IDirectMusicPort
IDirectMusicPort_iface
;
IDirectMusicPortDownload
IDirectMusicPortDownload_iface
;
...
...
@@ -41,6 +49,7 @@ struct synth_port {
int
nrofgroups
;
DMUSIC_PRIVATE_CHANNEL_GROUP
group
[
1
];
struct
list
downloads
;
DWORD
next_dlid
;
};
...
...
@@ -190,6 +199,15 @@ static ULONG WINAPI synth_port_Release(IDirectMusicPort *iface)
if
(
!
ref
)
{
struct
download_entry
*
entry
,
*
next
;
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
next
,
&
This
->
downloads
,
struct
download_entry
,
entry
)
{
list_remove
(
&
entry
->
entry
);
IDirectMusicDownload_Release
(
entry
->
download
);
free
(
entry
);
}
dmusic_remove_port
(
This
->
parent
,
iface
);
IDirectMusicSynthSink_Release
(
This
->
synth_sink
);
IDirectMusicSynth_Activate
(
This
->
synth
,
FALSE
);
...
...
@@ -624,22 +642,61 @@ static HRESULT WINAPI synth_port_download_GetAppend(IDirectMusicPortDownload *if
return
S_OK
;
}
static
HRESULT
WINAPI
synth_port_download_Download
(
IDirectMusicPortDownload
*
iface
,
IDirectMusicDownload
*
IDMD
ownload
)
static
HRESULT
WINAPI
synth_port_download_Download
(
IDirectMusicPortDownload
*
iface
,
IDirectMusicDownload
*
d
ownload
)
{
struct
synth_port
*
This
=
synth_from_IDirectMusicPortDownload
(
iface
);
struct
download_entry
*
entry
;
DMUS_DOWNLOADINFO
*
info
;
HANDLE
handle
;
BOOL
can_free
;
DWORD
size
;
HRESULT
hr
;
FIXME
(
"(%p/%p)->(%p): stub
\n
"
,
iface
,
This
,
IDMD
ownload
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
iface
,
This
,
d
ownload
);
return
S_OK
;
if
(
!
download
)
return
E_POINTER
;
LIST_FOR_EACH_ENTRY
(
entry
,
&
This
->
downloads
,
struct
download_entry
,
entry
)
if
(
entry
->
download
==
download
)
return
DMUS_E_ALREADY_DOWNLOADED
;
if
(
!
(
entry
=
malloc
(
sizeof
(
*
entry
))))
return
E_OUTOFMEMORY
;
if
(
SUCCEEDED
(
hr
=
IDirectMusicDownload_GetBuffer
(
download
,
(
void
**
)
&
info
,
&
size
))
&&
SUCCEEDED
(
hr
=
IDirectMusicSynth_Download
(
This
->
synth
,
&
handle
,
info
,
&
can_free
)))
{
entry
->
download
=
download
;
IDirectMusicDownload_AddRef
(
download
);
entry
->
id
=
info
->
dwDLId
;
entry
->
handle
=
handle
;
list_add_tail
(
&
This
->
downloads
,
&
entry
->
entry
);
}
if
(
FAILED
(
hr
))
free
(
entry
);
return
hr
;
}
static
HRESULT
WINAPI
synth_port_download_Unload
(
IDirectMusicPortDownload
*
iface
,
IDirectMusicDownload
*
IDMD
ownload
)
static
HRESULT
WINAPI
synth_port_download_Unload
(
IDirectMusicPortDownload
*
iface
,
IDirectMusicDownload
*
d
ownload
)
{
struct
synth_port
*
This
=
synth_from_IDirectMusicPortDownload
(
iface
);
struct
download_entry
*
entry
;
HANDLE
handle
=
0
;
FIXME
(
"(%p/%p)->(%p): stub
\n
"
,
iface
,
This
,
IDMD
ownload
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
iface
,
This
,
d
ownload
);
return
S_OK
;
if
(
!
download
)
return
E_POINTER
;
LIST_FOR_EACH_ENTRY
(
entry
,
&
This
->
downloads
,
struct
download_entry
,
entry
)
{
if
(
entry
->
download
==
download
)
{
list_remove
(
&
entry
->
entry
);
IDirectMusicDownload_Release
(
entry
->
download
);
handle
=
entry
->
handle
;
free
(
entry
);
break
;
}
}
return
IDirectMusicSynth_Unload
(
This
->
synth
,
handle
,
NULL
,
NULL
);
}
static
const
IDirectMusicPortDownloadVtbl
synth_port_download_vtbl
=
{
...
...
@@ -795,6 +852,7 @@ HRESULT synth_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_param
obj
->
parent
=
parent
;
obj
->
active
=
FALSE
;
obj
->
params
=
*
port_params
;
list_init
(
&
obj
->
downloads
);
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynth
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicSynth
,
(
void
**
)
&
obj
->
synth
);
...
...
dlls/dmusic/tests/dmusic.c
View file @
73d1e066
...
...
@@ -1122,7 +1122,7 @@ static void test_port_download(void)
todo_wine
ok
(
hr
==
DMUS_E_NOT_DOWNLOADED_TO_PORT
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicPortDownload_Download
(
port
,
NULL
);
todo_wine
ok
(
hr
==
E_POINTER
,
"got %#lx
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicPortDownload_Download
(
port
,
download
);
todo_wine
ok
(
hr
==
DMUS_E_UNKNOWNDOWNLOAD
,
"got %#lx
\n
"
,
hr
);
...
...
@@ -1145,7 +1145,7 @@ static void test_port_download(void)
hr
=
IDirectMusicPortDownload_Download
(
port
,
download
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicPortDownload_Download
(
port
,
download
);
todo_wine
ok
(
hr
==
DMUS_E_ALREADY_DOWNLOADED
,
"got %#lx
\n
"
,
hr
);
ok
(
hr
==
DMUS_E_ALREADY_DOWNLOADED
,
"got %#lx
\n
"
,
hr
);
tmp_download
=
invalid_ptr
;
hr
=
IDirectMusicPortDownload_GetBuffer
(
port
,
2
,
&
tmp_download
);
...
...
@@ -1154,7 +1154,7 @@ static void test_port_download(void)
if
(
tmp_download
!=
invalid_ptr
)
IDirectMusicDownload_Release
(
tmp_download
);
hr
=
IDirectMusicPortDownload_Unload
(
port
,
NULL
);
todo_wine
ok
(
hr
==
E_POINTER
,
"got %#lx
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicPortDownload_Unload
(
port
,
download
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
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