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
57eb95a2
Commit
57eb95a2
authored
May 31, 2014
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jun 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Simplify the creation of a DirectMusicBuffer object.
Also lock/unlock the module only on creation/destruction of the object.
parent
19b6c4cf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
13 deletions
+5
-13
buffer.c
dlls/dmusic/buffer.c
+5
-13
No files found.
dlls/dmusic/buffer.c
View file @
57eb95a2
...
...
@@ -57,8 +57,6 @@ static ULONG WINAPI IDirectMusicBufferImpl_AddRef(LPDIRECTMUSICBUFFER iface)
TRACE
(
"(%p)->(): new ref = %u
\n
"
,
iface
,
ref
);
DMUSIC_LockModule
();
return
ref
;
}
...
...
@@ -72,9 +70,8 @@ static ULONG WINAPI IDirectMusicBufferImpl_Release(LPDIRECTMUSICBUFFER iface)
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
data
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
DMUSIC_UnlockModule
();
}
return
ref
;
}
...
...
@@ -279,7 +276,6 @@ static const IDirectMusicBufferVtbl DirectMusicBuffer_Vtbl = {
HRESULT
DMUSIC_CreateDirectMusicBufferImpl
(
LPDMUS_BUFFERDESC
desc
,
LPVOID
*
ret_iface
)
{
IDirectMusicBufferImpl
*
dmbuffer
;
HRESULT
hr
;
TRACE
(
"(%p, %p)
\n
"
,
desc
,
ret_iface
);
...
...
@@ -290,7 +286,7 @@ HRESULT DMUSIC_CreateDirectMusicBufferImpl(LPDMUS_BUFFERDESC desc, LPVOID* ret_i
return
E_OUTOFMEMORY
;
dmbuffer
->
IDirectMusicBuffer_iface
.
lpVtbl
=
&
DirectMusicBuffer_Vtbl
;
dmbuffer
->
ref
=
0
;
/* Will be inited by QueryInterface */
dmbuffer
->
ref
=
1
;
if
(
IsEqualGUID
(
&
desc
->
guidBufferFormat
,
&
GUID_NULL
))
dmbuffer
->
format
=
KSDATAFORMAT_SUBTYPE_MIDI
;
...
...
@@ -304,12 +300,8 @@ HRESULT DMUSIC_CreateDirectMusicBufferImpl(LPDMUS_BUFFERDESC desc, LPVOID* ret_i
return
E_OUTOFMEMORY
;
}
hr
=
IDirectMusicBufferImpl_QueryInterface
((
LPDIRECTMUSICBUFFER
)
dmbuffer
,
&
IID_IDirectMusicBuffer
,
ret_iface
);
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
dmbuffer
->
data
);
HeapFree
(
GetProcessHeap
(),
0
,
dmbuffer
);
}
DMUSIC_LockModule
();
*
ret_iface
=
&
dmbuffer
->
IDirectMusicBuffer_iface
;
return
hr
;
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