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
f66807f2
Commit
f66807f2
authored
Jul 09, 2004
by
Robert Reif
Committed by
Alexandre Julliard
Jul 09, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better error checking and recovery.
parent
a98beddc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
39 deletions
+53
-39
dsound.c
dlls/dsound/dsound.c
+53
-39
No files found.
dlls/dsound/dsound.c
View file @
f66807f2
...
...
@@ -574,7 +574,7 @@ static HRESULT WINAPI IDirectSoundImpl_GetSpeakerConfig(
TRACE
(
"(%p, %p)
\n
"
,
This
,
lpdwSpeakerConfig
);
if
(
lpdwSpeakerConfig
==
NULL
)
{
WARN
(
"invalid parameter
\n
"
);
WARN
(
"invalid parameter
: lpdwSpeakerConfig == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
}
...
...
@@ -918,12 +918,12 @@ HRESULT WINAPI IDirectSound_IUnknown_Create(
TRACE
(
"(%p,%p)
\n
"
,
pds
,
ppunk
);
if
(
ppunk
==
NULL
)
{
ERR
(
"invalid parameter
\n
"
);
ERR
(
"invalid parameter
: ppunk == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
}
if
(
pds
==
NULL
)
{
ERR
(
"invalid parameter
\n
"
);
ERR
(
"invalid parameter
: pds == NULL
\n
"
);
*
ppunk
=
NULL
;
return
DSERR_INVALIDPARAM
;
}
...
...
@@ -1080,12 +1080,12 @@ HRESULT WINAPI IDirectSound_IDirectSound_Create(
TRACE
(
"(%p,%p)
\n
"
,
pds
,
ppds
);
if
(
ppds
==
NULL
)
{
ERR
(
"invalid parameter
\n
"
);
ERR
(
"invalid parameter
: ppds == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
}
if
(
pds
==
NULL
)
{
ERR
(
"invalid parameter
\n
"
);
ERR
(
"invalid parameter
: pds == NULL
\n
"
);
*
ppds
=
NULL
;
return
DSERR_INVALIDPARAM
;
}
...
...
@@ -1159,12 +1159,12 @@ HRESULT WINAPI IDirectSound8_IUnknown_Create(
TRACE
(
"(%p,%p)
\n
"
,
pds
,
ppunk
);
if
(
ppunk
==
NULL
)
{
ERR
(
"invalid parameter
\n
"
);
ERR
(
"invalid parameter
: ppunk == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
}
if
(
pds
==
NULL
)
{
ERR
(
"invalid parameter
\n
"
);
ERR
(
"invalid parameter
: pds == NULL
\n
"
);
*
ppunk
=
NULL
;
return
DSERR_INVALIDPARAM
;
}
...
...
@@ -1321,12 +1321,12 @@ HRESULT WINAPI IDirectSound8_IDirectSound_Create(
TRACE
(
"(%p,%p)
\n
"
,
pds
,
ppds
);
if
(
ppds
==
NULL
)
{
ERR
(
"invalid parameter
\n
"
);
ERR
(
"invalid parameter
: ppds == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
}
if
(
pds
==
NULL
)
{
ERR
(
"invalid parameter
\n
"
);
ERR
(
"invalid parameter
: pds == NULL
\n
"
);
*
ppds
=
NULL
;
return
DSERR_INVALIDPARAM
;
}
...
...
@@ -1493,12 +1493,12 @@ HRESULT WINAPI IDirectSound8_IDirectSound8_Create(
TRACE
(
"(%p,%p)
\n
"
,
pds
,
ppds
);
if
(
ppds
==
NULL
)
{
ERR
(
"invalid parameter
\n
"
);
ERR
(
"invalid parameter
: ppds == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
}
if
(
pds
==
NULL
)
{
ERR
(
"invalid parameter
\n
"
);
ERR
(
"invalid parameter
: pds == NULL
\n
"
);
*
ppds
=
NULL
;
return
DSERR_INVALIDPARAM
;
}
...
...
@@ -1568,7 +1568,8 @@ HRESULT WINAPI DirectSoundCreate(
hr
=
IDirectSound_IDirectSound_Create
((
LPDIRECTSOUND8
)
dsound
,
ppDS
);
if
(
*
ppDS
)
IDirectSound_IDirectSound_AddRef
(
*
ppDS
);
return
hr
;
else
WARN
(
"IDirectSound_IDirectSound_Create failed
\n
"
);
}
else
{
ERR
(
"different dsound already opened (only support one sound card at a time now)
\n
"
);
*
ppDS
=
NULL
;
...
...
@@ -1578,22 +1579,28 @@ HRESULT WINAPI DirectSoundCreate(
LPDIRECTSOUND8
pDS
;
hr
=
IDirectSoundImpl_Create
(
&
devGuid
,
&
pDS
);
if
(
pDS
)
{
HRESULT
hres
;
dsound
=
(
IDirectSoundImpl
*
)
pDS
;
hres
=
DSOUND_PrimaryCreate
(
dsound
);
if
(
hres
!=
DS_OK
)
{
hr
=
DSOUND_PrimaryCreate
((
IDirectSoundImpl
*
)
pDS
);
if
(
hr
==
DS_OK
)
{
hr
=
IDirectSound_IDirectSound_Create
(
pDS
,
ppDS
);
if
(
*
ppDS
)
{
IDirectSound_IDirectSound_AddRef
(
*
ppDS
);
dsound
=
(
IDirectSoundImpl
*
)
pDS
;
timeBeginPeriod
(
DS_TIME_RES
);
dsound
->
timerID
=
timeSetEvent
(
DS_TIME_DEL
,
DS_TIME_RES
,
DSOUND_timer
,
(
DWORD
)
dsound
,
TIME_PERIODIC
|
TIME_CALLBACK_FUNCTION
);
}
else
{
WARN
(
"IDirectSound_IDirectSound_Create failed
\n
"
);
IDirectSound8_Release
(
pDS
);
}
}
else
{
WARN
(
"DSOUND_PrimaryCreate failed
\n
"
);
return
hres
;
IDirectSound8_Release
(
pDS
)
;
}
timeBeginPeriod
(
DS_TIME_RES
);
dsound
->
timerID
=
timeSetEvent
(
DS_TIME_DEL
,
DS_TIME_RES
,
DSOUND_timer
,
(
DWORD
)
dsound
,
TIME_PERIODIC
|
TIME_CALLBACK_FUNCTION
);
}
hr
=
IDirectSound_IDirectSound_Create
(
pDS
,
ppDS
);
if
(
*
ppDS
)
IDirectSound_IDirectSound_AddRef
(
*
ppDS
);
}
else
WARN
(
"IDirectSoundImpl_Create failed
\n
"
);
}
return
hr
;
}
...
...
@@ -1645,7 +1652,8 @@ HRESULT WINAPI DirectSoundCreate8(
hr
=
IDirectSound8_IDirectSound8_Create
((
LPDIRECTSOUND8
)
dsound
,
ppDS
);
if
(
*
ppDS
)
IDirectSound8_IDirectSound8_AddRef
(
*
ppDS
);
return
hr
;
else
WARN
(
"IDirectSound8_IDirectSound8_Create failed
\n
"
);
}
else
{
ERR
(
"different dsound already opened (only support one sound card at a time now)
\n
"
);
*
ppDS
=
NULL
;
...
...
@@ -1655,21 +1663,27 @@ HRESULT WINAPI DirectSoundCreate8(
LPDIRECTSOUND8
pDS
;
hr
=
IDirectSoundImpl_Create
(
&
devGuid
,
&
pDS
);
if
(
pDS
)
{
HRESULT
hres
;
dsound
=
(
IDirectSoundImpl
*
)
pDS
;
hres
=
DSOUND_PrimaryCreate
(
dsound
);
if
(
hres
!=
DS_OK
)
{
hr
=
DSOUND_PrimaryCreate
((
IDirectSoundImpl
*
)
pDS
);
if
(
hr
==
DS_OK
)
{
hr
=
IDirectSound8_IDirectSound8_Create
(
pDS
,
ppDS
);
if
(
*
ppDS
)
{
IDirectSound8_IDirectSound8_AddRef
(
*
ppDS
);
dsound
=
(
IDirectSoundImpl
*
)
pDS
;
timeBeginPeriod
(
DS_TIME_RES
);
dsound
->
timerID
=
timeSetEvent
(
DS_TIME_DEL
,
DS_TIME_RES
,
DSOUND_timer
,
(
DWORD
)
dsound
,
TIME_PERIODIC
|
TIME_CALLBACK_FUNCTION
);
}
else
{
WARN
(
"IDirectSound8_IDirectSound8_Create failed
\n
"
);
IDirectSound8_Release
(
pDS
);
}
}
else
{
WARN
(
"DSOUND_PrimaryCreate failed
\n
"
);
return
hres
;
IDirectSound8_Release
(
pDS
)
;
}
timeBeginPeriod
(
DS_TIME_RES
);
dsound
->
timerID
=
timeSetEvent
(
DS_TIME_DEL
,
DS_TIME_RES
,
DSOUND_timer
,
(
DWORD
)
dsound
,
TIME_PERIODIC
|
TIME_CALLBACK_FUNCTION
);
}
hr
=
IDirectSound8_IDirectSound8_Create
(
pDS
,
ppDS
);
if
(
*
ppDS
)
IDirectSound8_IDirectSound8_AddRef
(
*
ppDS
);
}
else
WARN
(
"IDirectSoundImpl_Create failed
\n
"
);
}
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