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
3505137d
Commit
3505137d
authored
May 12, 2017
by
Michael Stefaniuc
Committed by
Alexandre Julliard
May 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Add proper error handling to InitAudio().
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
62bf2078
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
11 deletions
+31
-11
performance.c
dlls/dmime/performance.c
+31
-11
No files found.
dlls/dmime/performance.c
View file @
3505137d
...
...
@@ -877,25 +877,23 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_InitAudio(IDirectMusicPerform
(
void
**
)
&
This
->
dmusic
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
dmusic
)
*
dmusic
=
(
IDirectMusic
*
)
This
->
dmusic
;
}
else
}
else
{
This
->
dmusic
=
(
IDirectMusic8
*
)
*
dmusic
;
if
(
dmusic
)
IDirectMusic8_AddRef
(
This
->
dmusic
);
}
if
(
!
dsound
||
!*
dsound
)
{
hr
=
DirectSoundCreate8
(
NULL
,
(
IDirectSound8
**
)
&
This
->
dsound
,
NULL
);
if
(
FAILED
(
hr
))
return
h
r
;
IDirectSound_SetCooperativeLevel
(
This
->
dsound
,
hwnd
?
hwnd
:
GetForegroundWindow
(),
goto
erro
r
;
hr
=
IDirectSound_SetCooperativeLevel
(
This
->
dsound
,
hwnd
?
hwnd
:
GetForegroundWindow
(),
DSSCL_PRIORITY
);
if
(
dsound
)
*
dsound
=
This
->
dsound
;
}
else
if
(
FAILED
(
hr
)
)
goto
error
;
}
else
{
This
->
dsound
=
*
dsound
;
if
(
dsound
)
IDirectSound_AddRef
(
This
->
dsound
);
}
if
(
!
params
)
{
This
->
params
.
dwSize
=
sizeof
(
DMUS_AUDIOPARAMS
);
...
...
@@ -909,12 +907,34 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_InitAudio(IDirectMusicPerform
}
else
This
->
params
=
*
params
;
if
(
default_path_type
)
if
(
default_path_type
)
{
hr
=
IDirectMusicPerformance8_CreateStandardAudioPath
(
iface
,
default_path_type
,
num_channels
,
FALSE
,
&
This
->
pDefaultPath
);
if
(
FAILED
(
hr
))
goto
error
;
}
if
(
dsound
&&
!*
dsound
)
{
*
dsound
=
This
->
dsound
;
IDirectSound_AddRef
(
*
dsound
);
}
if
(
dmusic
&&
!*
dmusic
)
{
*
dmusic
=
(
IDirectMusic
*
)
This
->
dmusic
;
IDirectMusic_AddRef
(
*
dmusic
);
}
PostMessageToProcessMsgThread
(
This
,
PROCESSMSG_START
);
return
S_OK
;
error:
if
(
This
->
dsound
)
{
IDirectSound_Release
(
This
->
dsound
);
This
->
dsound
=
NULL
;
}
if
(
This
->
dmusic
)
{
IDirectMusic8_Release
(
This
->
dmusic
);
This
->
dmusic
=
NULL
;
}
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