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
30df87af
Commit
30df87af
authored
Sep 04, 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_AllocateBuffer.
parent
45f61965
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
17 deletions
+29
-17
dmusic_private.h
dlls/dmusic/dmusic_private.h
+1
-1
download.c
dlls/dmusic/download.c
+14
-3
port.c
dlls/dmusic/port.c
+7
-4
dmusic.c
dlls/dmusic/tests/dmusic.c
+7
-9
No files found.
dlls/dmusic/dmusic_private.h
View file @
30df87af
...
...
@@ -99,7 +99,7 @@ extern HRESULT DMUSIC_CreateDirectMusicBufferImpl(LPDMUS_BUFFERDESC desc, LPVOID
extern
HRESULT
DMUSIC_CreateReferenceClockImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
);
extern
HRESULT
DMUSIC_CreateDirectMusicInstrumentImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
);
extern
HRESULT
download_create
(
IDirectMusicDownload
**
ret_iface
);
extern
HRESULT
download_create
(
DWORD
size
,
IDirectMusicDownload
**
ret_iface
);
/*****************************************************************************
* IDirectMusic8Impl implementation structure
...
...
dlls/dmusic/download.c
View file @
30df87af
...
...
@@ -27,8 +27,13 @@ struct download
{
IDirectMusicDownload
IDirectMusicDownload_iface
;
LONG
ref
;
DWORD
size
;
BYTE
data
[];
};
C_ASSERT
(
sizeof
(
struct
download
)
==
offsetof
(
struct
download
,
data
[
0
]));
static
inline
struct
download
*
impl_from_IDirectMusicDownload
(
IDirectMusicDownload
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
download
,
IDirectMusicDownload_iface
);
...
...
@@ -77,7 +82,12 @@ static ULONG WINAPI download_Release(IDirectMusicDownload *iface)
static
HRESULT
WINAPI
download_GetBuffer
(
IDirectMusicDownload
*
iface
,
void
**
buffer
,
DWORD
*
size
)
{
FIXME
(
"(%p, %p, %p): stub
\n
"
,
iface
,
buffer
,
size
);
struct
download
*
This
=
impl_from_IDirectMusicDownload
(
iface
);
TRACE
(
"(%p, %p, %p)
\n
"
,
iface
,
buffer
,
size
);
*
buffer
=
This
->
data
;
*
size
=
This
->
size
;
return
S_OK
;
}
...
...
@@ -90,14 +100,15 @@ static const IDirectMusicDownloadVtbl download_vtbl =
download_GetBuffer
,
};
HRESULT
download_create
(
IDirectMusicDownload
**
ret_iface
)
HRESULT
download_create
(
DWORD
size
,
IDirectMusicDownload
**
ret_iface
)
{
struct
download
*
download
;
*
ret_iface
=
NULL
;
if
(
!
(
download
=
calloc
(
1
,
sizeof
(
*
download
))))
return
E_OUTOFMEMORY
;
if
(
!
(
download
=
malloc
(
offsetof
(
struct
download
,
data
[
size
]
))))
return
E_OUTOFMEMORY
;
download
->
IDirectMusicDownload_iface
.
lpVtbl
=
&
download_vtbl
;
download
->
ref
=
1
;
download
->
size
=
size
;
TRACE
(
"Created DirectMusicDownload %p
\n
"
,
download
);
*
ret_iface
=
&
download
->
IDirectMusicDownload_iface
;
...
...
dlls/dmusic/port.c
View file @
30df87af
...
...
@@ -584,17 +584,20 @@ static HRESULT WINAPI synth_port_download_GetBuffer(IDirectMusicPortDownload *if
if
(
!
IDMDownload
)
return
E_POINTER
;
return
download_create
(
IDMDownload
);
return
download_create
(
0
,
IDMDownload
);
}
static
HRESULT
WINAPI
synth_port_download_AllocateBuffer
(
IDirectMusicPortDownload
*
iface
,
DWORD
size
,
IDirectMusicDownload
**
IDMD
ownload
)
IDirectMusicDownload
**
d
ownload
)
{
struct
synth_port
*
This
=
synth_from_IDirectMusicPortDownload
(
iface
);
FIXME
(
"(%p/%p, %lu, %p): stub
\n
"
,
iface
,
This
,
size
,
IDMD
ownload
);
TRACE
(
"(%p/%p, %lu, %p)
\n
"
,
iface
,
This
,
size
,
d
ownload
);
return
S_OK
;
if
(
!
download
)
return
E_POINTER
;
if
(
!
size
)
return
E_INVALIDARG
;
return
download_create
(
size
,
download
);
}
static
HRESULT
WINAPI
synth_port_download_GetDLId
(
IDirectMusicPortDownload
*
iface
,
DWORD
*
first
,
DWORD
count
)
...
...
dlls/dmusic/tests/dmusic.c
View file @
30df87af
...
...
@@ -1065,9 +1065,9 @@ static void test_port_download(void)
/* AllocateBuffer use the exact requested size */
hr
=
IDirectMusicPortDownload_AllocateBuffer
(
port
,
0
,
NULL
);
todo_wine
ok
(
hr
==
E_POINTER
,
"got %#lx
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicPortDownload_AllocateBuffer
(
port
,
0
,
&
download
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"got %#lx
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicPortDownload_AllocateBuffer
(
port
,
1
,
&
download
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
...
...
@@ -1075,8 +1075,8 @@ static void test_port_download(void)
buffer
=
invalid_ptr
;
hr
=
IDirectMusicDownload_GetBuffer
(
download
,
(
void
**
)
&
buffer
,
&
size
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
size
==
1
,
"got %#lx
\n
"
,
size
);
todo_wine
ok
(
buffer
!=
invalid_ptr
,
"got %p
\n
"
,
buffer
);
ok
(
size
==
1
,
"got %#lx
\n
"
,
size
);
ok
(
buffer
!=
invalid_ptr
,
"got %p
\n
"
,
buffer
);
IDirectMusicDownload_Release
(
download
);
/* GetDLId allocates the given number of slots and returns only the first */
...
...
@@ -1107,14 +1107,13 @@ static void test_port_download(void)
download
=
invalid_ptr
;
hr
=
IDirectMusicPortDownload_AllocateBuffer
(
port
,
sizeof
(
struct
wave_download
),
&
download
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
download
!=
invalid_ptr
,
"got %p
\n
"
,
download
);
if
(
download
==
invalid_ptr
)
goto
skip_tests
;
ok
(
download
!=
invalid_ptr
,
"got %p
\n
"
,
download
);
size
=
0xdeadbeef
;
wave_download
=
invalid_ptr
;
hr
=
IDirectMusicDownload_GetBuffer
(
download
,
(
void
**
)
&
wave_download
,
&
size
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
size
==
sizeof
(
struct
wave_download
),
"got %#lx
\n
"
,
size
);
todo_wine
ok
(
wave_download
!=
invalid_ptr
,
"got %p
\n
"
,
wave_download
);
ok
(
size
==
sizeof
(
struct
wave_download
),
"got %#lx
\n
"
,
size
);
ok
(
wave_download
!=
invalid_ptr
,
"got %p
\n
"
,
wave_download
);
wave_download
->
info
.
cbSize
=
sizeof
(
struct
wave_download
);
wave_download
->
info
.
dwDLId
=
2
;
wave_download
->
info
.
dwDLType
=
0
;
...
...
@@ -1172,7 +1171,6 @@ static void test_port_download(void)
IDirectMusicDownload_Release
(
download
);
skip_tests:
IDirectMusicPortDownload_Release
(
port
);
}
...
...
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