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
2348e7a0
Commit
2348e7a0
authored
Jul 02, 2003
by
Christian Costa
Committed by
Alexandre Julliard
Jul 02, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Init and InitAudio return an error when no audio driver is
available. Fix crash in InitAudio when releasing the dsound object.
parent
b15ff072
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
dmusic_performance.c
dlls/dmusic/dmusic_performance.c
+17
-10
No files found.
dlls/dmusic/dmusic_performance.c
View file @
2348e7a0
...
...
@@ -80,6 +80,15 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_Init (LPDIRECTMUSICPERFORMANCE8 ifac
if
(
This
->
dmusic
||
This
->
dsound
)
return
DMUS_E_ALREADY_INITED
;
if
(
NULL
!=
pDirectSound
)
{
This
->
dsound
=
(
IDirectSound
*
)
pDirectSound
;
IDirectSound_AddRef
((
LPDIRECTSOUND
)
This
->
dsound
);
}
else
{
DirectSoundCreate8
(
&
IID_IDirectSound8
,
(
LPDIRECTSOUND8
*
)
&
This
->
dsound
,
NULL
);
if
(
!
This
->
dsound
)
return
DSERR_NODRIVER
;
}
if
(
NULL
!=
ppDirectMusic
&&
NULL
!=
*
ppDirectMusic
)
{
/* app creates it's own dmusic object and gives it to performance */
This
->
dmusic
=
(
IDirectMusic8
*
)
*
ppDirectMusic
;
...
...
@@ -94,12 +103,6 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_Init (LPDIRECTMUSICPERFORMANCE8 ifac
}
}
if
(
NULL
!=
pDirectSound
)
{
This
->
dsound
=
(
IDirectSound
*
)
pDirectSound
;
IDirectSound_AddRef
((
LPDIRECTSOUND
)
This
->
dsound
);
}
else
{
DirectSoundCreate8
(
&
IID_IDirectSound8
,
(
LPDIRECTSOUND8
*
)
&
This
->
dsound
,
NULL
);
}
return
S_OK
;
}
...
...
@@ -532,6 +535,8 @@ HRESULT WINAPI IDirectMusicPerformance8ImplInitAudio (LPDIRECTMUSICPERFORMANCE8
DWORD
dwFlags
,
DMUS_AUDIOPARAMS
*
pParams
)
{
IDirectSound
*
dsound
;
ICOM_THIS
(
IDirectMusicPerformance8Impl
,
iface
);
FIXME
(
"(%p, %p, %p, %p, %lx, %lu, %lx, %p): to check
\n
"
,
This
,
ppDirectMusic
,
ppDirectSound
,
hWnd
,
dwDefaultPathType
,
dwPChannelCount
,
dwFlags
,
pParams
);
...
...
@@ -539,14 +544,16 @@ HRESULT WINAPI IDirectMusicPerformance8ImplInitAudio (LPDIRECTMUSICPERFORMANCE8
return
DMUS_E_ALREADY_INITED
;
if
(
NULL
!=
ppDirectSound
&&
NULL
!=
*
ppDirectSound
)
{
This
->
dsound
=
*
ppDirectSound
;
dsound
=
*
ppDirectSound
;
}
else
{
DirectSoundCreate8
(
&
IID_IDirectSound8
,
(
LPDIRECTSOUND8
*
)
&
This
->
dsound
,
NULL
);
DirectSoundCreate8
(
&
IID_IDirectSound8
,
(
LPDIRECTSOUND8
*
)
&
dsound
,
NULL
);
if
(
!
dsound
)
return
DSERR_NODRIVER
;
if
(
ppDirectSound
)
*
ppDirectSound
=
This
->
dsound
;
*
ppDirectSound
=
dsound
;
}
IDirectMusicPerformance8Impl_Init
(
iface
,
ppDirectMusic
,
This
->
dsound
,
hWnd
);
IDirectMusicPerformance8Impl_Init
(
iface
,
ppDirectMusic
,
dsound
,
hWnd
);
/* Init increases the ref count of the dsound object. Decremente it if the app don't want a pointer to the object. */
if
(
!
ppDirectSound
)
...
...
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