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
3ce9c5f4
Commit
3ce9c5f4
authored
Jul 19, 2004
by
Robert Reif
Committed by
Alexandre Julliard
Jul 19, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do initialization to match windows behavior (with test).
parent
aaafbc79
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
115 additions
and
21 deletions
+115
-21
dsound.c
dlls/dsound/dsound.c
+94
-19
dsound_main.c
dlls/dsound/dsound_main.c
+2
-2
dsound_private.h
dlls/dsound/dsound_private.h
+11
-0
dsound.c
dlls/dsound/tests/dsound.c
+8
-0
No files found.
dlls/dsound/dsound.c
View file @
3ce9c5f4
...
...
@@ -303,6 +303,11 @@ static HRESULT WINAPI IDirectSoundImpl_CreateSoundBuffer(
return
DSERR_INVALIDPARAM
;
}
if
(
This
->
initialized
==
FALSE
)
{
WARN
(
"not initialized
\n
"
);
return
DSERR_UNINITIALIZED
;
}
if
(
dsbd
==
NULL
)
{
WARN
(
"invalid parameter: dsbd == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
...
...
@@ -379,6 +384,11 @@ static HRESULT WINAPI IDirectSoundImpl_GetCaps(
return
DSERR_INVALIDPARAM
;
}
if
(
This
->
initialized
==
FALSE
)
{
WARN
(
"not initialized
\n
"
);
return
DSERR_UNINITIALIZED
;
}
if
(
lpDSCaps
==
NULL
)
{
WARN
(
"invalid parameter: lpDSCaps = NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
...
...
@@ -436,6 +446,11 @@ static HRESULT WINAPI IDirectSoundImpl_DuplicateSoundBuffer(
return
DSERR_INVALIDPARAM
;
}
if
(
This
->
initialized
==
FALSE
)
{
WARN
(
"not initialized
\n
"
);
return
DSERR_UNINITIALIZED
;
}
if
(
psb
==
NULL
)
{
WARN
(
"invalid parameter: psb == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
...
...
@@ -577,6 +592,11 @@ static HRESULT WINAPI IDirectSoundImpl_GetSpeakerConfig(
ICOM_THIS
(
IDirectSoundImpl
,
iface
);
TRACE
(
"(%p, %p)
\n
"
,
This
,
lpdwSpeakerConfig
);
if
(
This
->
initialized
==
FALSE
)
{
WARN
(
"not initialized
\n
"
);
return
DSERR_UNINITIALIZED
;
}
if
(
lpdwSpeakerConfig
==
NULL
)
{
WARN
(
"invalid parameter: lpdwSpeakerConfig == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
...
...
@@ -594,6 +614,11 @@ static HRESULT WINAPI IDirectSoundImpl_SetSpeakerConfig(
ICOM_THIS
(
IDirectSoundImpl
,
iface
);
TRACE
(
"(%p,0x%08lx)
\n
"
,
This
,
config
);
if
(
This
->
initialized
==
FALSE
)
{
WARN
(
"not initialized
\n
"
);
return
DSERR_UNINITIALIZED
;
}
This
->
speaker_config
=
config
;
WARN
(
"not fully functional
\n
"
);
return
DS_OK
;
...
...
@@ -606,6 +631,8 @@ static HRESULT WINAPI IDirectSoundImpl_Initialize(
ICOM_THIS
(
IDirectSoundImpl
,
iface
);
TRACE
(
"(%p,%s)
\n
"
,
This
,
debugstr_guid
(
lpcGuid
));
This
->
initialized
=
TRUE
;
return
DS_OK
;
}
...
...
@@ -616,6 +643,11 @@ static HRESULT WINAPI IDirectSoundImpl_VerifyCertification(
ICOM_THIS
(
IDirectSoundImpl
,
iface
);
TRACE
(
"(%p, %p)
\n
"
,
This
,
pdwCertified
);
if
(
This
->
initialized
==
FALSE
)
{
WARN
(
"not initialized
\n
"
);
return
DSERR_UNINITIALIZED
;
}
if
(
This
->
drvcaps
.
dwFlags
&
DSCAPS_CERTIFIED
)
*
pdwCertified
=
DS_CERTIFIED
;
else
...
...
@@ -718,6 +750,7 @@ HRESULT WINAPI IDirectSoundImpl_Create(
pDS
->
buffers
=
NULL
;
pDS
->
primary
=
NULL
;
pDS
->
speaker_config
=
DSSPEAKER_STEREO
|
(
DSSPEAKER_GEOMETRY_NARROW
<<
16
);
pDS
->
initialized
=
FALSE
;
/* 3D listener initial parameters */
pDS
->
listener
=
NULL
;
...
...
@@ -1524,22 +1557,7 @@ HRESULT WINAPI IDirectSound8_IDirectSound8_Create(
return
DS_OK
;
}
/*******************************************************************************
* DirectSoundCreate (DSOUND.1)
*
* Creates and initializes a DirectSound interface.
*
* PARAMS
* lpcGUID [I] Address of the GUID that identifies the sound device.
* ppDS [O] Address of a variable to receive the interface pointer.
* pUnkOuter [I] Must be NULL.
*
* RETURNS
* Success: DS_OK
* Failure: DSERR_ALLOCATED, DSERR_INVALIDPARAM, DSERR_NOAGGREGATION,
* DSERR_NODRIVER, DSERR_OUTOFMEMORY
*/
HRESULT
WINAPI
DirectSoundCreate
(
HRESULT
WINAPI
DSOUND_Create
(
LPCGUID
lpcGUID
,
LPDIRECTSOUND
*
ppDS
,
IUnknown
*
pUnkOuter
)
...
...
@@ -1549,6 +1567,11 @@ HRESULT WINAPI DirectSoundCreate(
TRACE
(
"(%s,%p,%p)
\n
"
,
debugstr_guid
(
lpcGUID
),
ppDS
,
pUnkOuter
);
if
(
pUnkOuter
!=
NULL
)
{
WARN
(
"invalid parameter: pUnkOuter != NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
}
if
(
ppDS
==
NULL
)
{
WARN
(
"invalid parameter: ppDS == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
...
...
@@ -1609,9 +1632,9 @@ HRESULT WINAPI DirectSoundCreate(
}
/*******************************************************************************
*
DirectSoundCreate8 (DSOUND.1
1)
*
DirectSoundCreate (DSOUND.
1)
*
* Creates and initializes a DirectSound
8
interface.
* Creates and initializes a DirectSound interface.
*
* PARAMS
* lpcGUID [I] Address of the GUID that identifies the sound device.
...
...
@@ -1623,7 +1646,23 @@ HRESULT WINAPI DirectSoundCreate(
* Failure: DSERR_ALLOCATED, DSERR_INVALIDPARAM, DSERR_NOAGGREGATION,
* DSERR_NODRIVER, DSERR_OUTOFMEMORY
*/
HRESULT
WINAPI
DirectSoundCreate8
(
HRESULT
WINAPI
DirectSoundCreate
(
LPCGUID
lpcGUID
,
LPDIRECTSOUND
*
ppDS
,
IUnknown
*
pUnkOuter
)
{
HRESULT
hr
;
TRACE
(
"(%s,%p,%p)
\n
"
,
debugstr_guid
(
lpcGUID
),
ppDS
,
pUnkOuter
);
hr
=
DSOUND_Create
(
lpcGUID
,
ppDS
,
pUnkOuter
);
if
(
hr
==
DS_OK
)
IDirectSoundImpl_Initialize
((
LPDIRECTSOUND8
)
dsound
,
lpcGUID
);
return
hr
;
}
HRESULT
WINAPI
DSOUND_Create8
(
LPCGUID
lpcGUID
,
LPDIRECTSOUND8
*
ppDS
,
IUnknown
*
pUnkOuter
)
...
...
@@ -1633,6 +1672,11 @@ HRESULT WINAPI DirectSoundCreate8(
TRACE
(
"(%s,%p,%p)
\n
"
,
debugstr_guid
(
lpcGUID
),
ppDS
,
pUnkOuter
);
if
(
pUnkOuter
!=
NULL
)
{
WARN
(
"invalid parameter: pUnkOuter != NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
}
if
(
ppDS
==
NULL
)
{
WARN
(
"invalid parameter: ppDS == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
...
...
@@ -1691,3 +1735,34 @@ HRESULT WINAPI DirectSoundCreate8(
return
hr
;
}
/*******************************************************************************
* DirectSoundCreate8 (DSOUND.11)
*
* Creates and initializes a DirectSound8 interface.
*
* PARAMS
* lpcGUID [I] Address of the GUID that identifies the sound device.
* ppDS [O] Address of a variable to receive the interface pointer.
* pUnkOuter [I] Must be NULL.
*
* RETURNS
* Success: DS_OK
* Failure: DSERR_ALLOCATED, DSERR_INVALIDPARAM, DSERR_NOAGGREGATION,
* DSERR_NODRIVER, DSERR_OUTOFMEMORY
*/
HRESULT
WINAPI
DirectSoundCreate8
(
LPCGUID
lpcGUID
,
LPDIRECTSOUND8
*
ppDS
,
IUnknown
*
pUnkOuter
)
{
HRESULT
hr
;
TRACE
(
"(%s,%p,%p)
\n
"
,
debugstr_guid
(
lpcGUID
),
ppDS
,
pUnkOuter
);
hr
=
DSOUND_Create8
(
lpcGUID
,
ppDS
,
pUnkOuter
);
if
(
hr
==
DS_OK
)
IDirectSoundImpl_Initialize
((
LPDIRECTSOUND8
)
dsound
,
lpcGUID
);
return
hr
;
}
dlls/dsound/dsound_main.c
View file @
3ce9c5f4
...
...
@@ -478,10 +478,10 @@ static HRESULT WINAPI DSCF_CreateInstance(
*
ppobj
=
NULL
;
if
(
IsEqualIID
(
&
IID_IDirectSound
,
riid
)
)
return
D
irectSound
Create
(
0
,(
LPDIRECTSOUND
*
)
ppobj
,
pOuter
);
return
D
SOUND_
Create
(
0
,(
LPDIRECTSOUND
*
)
ppobj
,
pOuter
);
if
(
IsEqualIID
(
&
IID_IDirectSound8
,
riid
)
)
return
D
irectSound
Create8
(
0
,(
LPDIRECTSOUND8
*
)
ppobj
,
pOuter
);
return
D
SOUND_
Create8
(
0
,(
LPDIRECTSOUND8
*
)
ppobj
,
pOuter
);
WARN
(
"(%p,%p,%s,%p) Interface not found!
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
...
...
dlls/dsound/dsound_private.h
View file @
3ce9c5f4
...
...
@@ -95,6 +95,7 @@ struct IDirectSoundImpl
PrimaryBufferImpl
*
primary
;
DSBUFFERDESC
dsbd
;
DWORD
speaker_config
;
BOOL
initialized
;
/* DirectSound3DListener fields */
IDirectSound3DListenerImpl
*
listener
;
...
...
@@ -117,6 +118,16 @@ HRESULT WINAPI IDirectSoundImpl_Create(
LPCGUID
lpcGUID
,
LPDIRECTSOUND8
*
ppds
);
HRESULT
WINAPI
DSOUND_Create
(
LPCGUID
lpcGUID
,
LPDIRECTSOUND
*
ppDS
,
IUnknown
*
pUnkOuter
);
HRESULT
WINAPI
DSOUND_Create8
(
LPCGUID
lpcGUID
,
LPDIRECTSOUND8
*
ppDS
,
IUnknown
*
pUnkOuter
);
/*****************************************************************************
* IDirectSound COM components
*/
...
...
dlls/dsound/tests/dsound.c
View file @
3ce9c5f4
...
...
@@ -69,6 +69,10 @@ static void dsound_dsound_tests()
if
(
rc
==
DS_OK
)
IDirectSound8_Release
(
ds8
);
/* try unitialized object */
rc
=
IDirectSound_GetCaps
(
dso
,
0
);
ok
(
rc
==
DSERR_UNINITIALIZED
,
"GetCaps should have returned DSERR_UNINITIALIZED, returned: %s
\n
"
,
DXGetErrorString9
(
rc
));
rc
=
IDirectSound_Initialize
(
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSound_Initialize(NULL) failed: %s
\n
"
,
DXGetErrorString9
(
rc
));
...
...
@@ -171,6 +175,10 @@ static void dsound_dsound8_tests()
if
(
rc
==
DS_OK
)
IDirectSound8_Release
(
ds8
);
/* try unitialized object */
rc
=
IDirectSound8_GetCaps
(
dso
,
0
);
ok
(
rc
==
DSERR_UNINITIALIZED
,
"GetCaps should have returned DSERR_UNINITIALIZED, returned: %s
\n
"
,
DXGetErrorString9
(
rc
));
rc
=
IDirectSound8_Initialize
(
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"IDirectSound_Initialize(NULL) failed: %s
\n
"
,
DXGetErrorString9
(
rc
));
...
...
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