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
885e205a
Commit
885e205a
authored
Aug 16, 2012
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Cleanup the DirectSoundFullDuplex create functions.
parent
0aeaa83a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
108 deletions
+50
-108
dsound_main.c
dlls/dsound/dsound_main.c
+1
-1
dsound_private.h
dlls/dsound/dsound_private.h
+2
-2
duplex.c
dlls/dsound/duplex.c
+47
-105
No files found.
dlls/dsound/dsound_main.c
View file @
885e205a
...
...
@@ -723,7 +723,7 @@ static IClassFactoryImpl DSOUND_CF[] = {
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSound8
,
DSOUND_Create8
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundCapture
,
DSOUND_CaptureCreate
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundCapture8
,
DSOUND_CaptureCreate8
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundFullDuplex
,
(
FnCreateInstance
)
DSOUND_FullDuplexCreate
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundFullDuplex
,
DSOUND_FullDuplexCreate
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundPrivate
,
(
FnCreateInstance
)
IKsPrivatePropertySetImpl_Create
},
{
{
NULL
},
NULL
,
NULL
}
};
...
...
dlls/dsound/dsound_private.h
View file @
885e205a
...
...
@@ -280,8 +280,8 @@ HRESULT primarybuffer_SetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex)
LONG
capped_refcount_dec
(
LONG
*
ref
)
DECLSPEC_HIDDEN
;
/* duplex.c */
HRESULT
DSOUND_FullDuplexCreate
(
REFIID
riid
,
LPDIRECTSOUNDFULLDUPLEX
*
ppDSFD
)
DECLSPEC_HIDDEN
;
HRESULT
DSOUND_FullDuplexCreate
(
REFIID
riid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
/* mixer.c */
void
DSOUND_CheckEvent
(
const
IDirectSoundBufferImpl
*
dsb
,
DWORD
playpos
,
int
len
)
DECLSPEC_HIDDEN
;
...
...
dlls/dsound/duplex.c
View file @
885e205a
...
...
@@ -613,44 +613,29 @@ static const IDirectSoundFullDuplexVtbl dsfdvt =
IDirectSoundFullDuplexImpl_Initialize
};
HRESULT
DSOUND_FullDuplexCreate
(
REFIID
riid
,
LPDIRECTSOUNDFULLDUPLEX
*
ppDSFD
)
HRESULT
DSOUND_FullDuplexCreate
(
REFIID
riid
,
void
**
ppv
)
{
IDirectSoundFullDuplexImpl
*
This
=
NULL
;
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
ppDSFD
);
if
(
ppDSFD
==
NULL
)
{
WARN
(
"invalid parameter: ppDSFD == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
}
if
(
!
IsEqualIID
(
riid
,
&
IID_IUnknown
)
&&
!
IsEqualIID
(
riid
,
&
IID_IDirectSoundFullDuplex
))
{
*
ppDSFD
=
0
;
return
E_NOINTERFACE
;
}
/* Get dsound configuration */
setup_dsound_options
();
IDirectSoundFullDuplexImpl
*
obj
;
HRESULT
hr
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectSoundFullDuplexImpl
));
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
ppv
);
if
(
This
==
NULL
)
{
*
ppv
=
NULL
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
obj
));
if
(
!
obj
)
{
WARN
(
"out of memory
\n
"
);
*
ppDSFD
=
NULL
;
return
DSERR_OUTOFMEMORY
;
}
This
->
lpVtbl
=
&
dsfdvt
;
This
->
ref
=
1
;
This
->
capture_device
=
NULL
;
This
->
renderer_device
=
NULL
;
setup_dsound_options
()
;
obj
->
lpVtbl
=
&
dsfdvt
;
obj
->
ref
=
1
;
*
ppDSFD
=
(
LPDIRECTSOUNDFULLDUPLEX
)
This
;
hr
=
IUnknown_QueryInterface
((
IUnknown
*
)
obj
,
riid
,
ppv
);
IUnknown_Release
((
IUnknown
*
)
obj
);
return
DS_OK
;
return
hr
;
}
/***************************************************************************
...
...
@@ -659,93 +644,50 @@ HRESULT DSOUND_FullDuplexCreate(
* Create and initialize a DirectSoundFullDuplex interface.
*
* PARAMS
*
pcGuidCaptureDevice
[I] Address of sound capture device GUID.
*
pcGuidRenderDevice
[I] Address of sound render device GUID.
*
pcDSCBufferDesc
[I] Address of capture buffer description.
*
pcDSBufferDesc
[I] Address of render buffer description.
* h
W
nd [I] Handle to application window.
*
dwLevel
[I] Cooperative level.
*
ppDSFD
[O] Address where full duplex interface returned.
*
ppDSCBuffer8
[0] Address where capture buffer interface returned.
*
ppDSBuffer8
[0] Address where render buffer interface returned.
*
pUnkOuter
[I] Must be NULL.
*
capture_dev
[I] Address of sound capture device GUID.
*
render_dev
[I] Address of sound render device GUID.
*
cbufdesc
[I] Address of capture buffer description.
*
bufdesc
[I] Address of render buffer description.
* h
w
nd [I] Handle to application window.
*
level
[I] Cooperative level.
*
dsfd
[O] Address where full duplex interface returned.
*
dscb8
[0] Address where capture buffer interface returned.
*
dsb8
[0] Address where render buffer interface returned.
*
outer_unk
[I] Must be NULL.
*
* RETURNS
* Success: DS_OK
* Failure: DSERR_NOAGGREGATION, DSERR_ALLOCATED, DSERR_INVALIDPARAM,
* DSERR_OUTOFMEMORY DSERR_INVALIDCALL DSERR_NODRIVER
*/
HRESULT
WINAPI
DirectSoundFullDuplexCreate
(
LPCGUID
pcGuidCaptureDevice
,
LPCGUID
pcGuidRenderDevice
,
LPCDSCBUFFERDESC
pcDSCBufferDesc
,
LPCDSBUFFERDESC
pcDSBufferDesc
,
HWND
hWnd
,
DWORD
dwLevel
,
LPDIRECTSOUNDFULLDUPLEX
*
ppDSFD
,
LPDIRECTSOUNDCAPTUREBUFFER8
*
ppDSCBuffer8
,
LPDIRECTSOUNDBUFFER8
*
ppDSBuffer8
,
LPUNKNOWN
pUnkOuter
)
{
HRESULT
hres
;
IDirectSoundFullDuplexImpl
*
This
=
NULL
;
TRACE
(
"(%s,%s,%p,%p,%p,%x,%p,%p,%p,%p)
\n
"
,
debugstr_guid
(
pcGuidCaptureDevice
),
debugstr_guid
(
pcGuidRenderDevice
),
pcDSCBufferDesc
,
pcDSBufferDesc
,
hWnd
,
dwLevel
,
ppDSFD
,
ppDSCBuffer8
,
ppDSBuffer8
,
pUnkOuter
);
if
(
pUnkOuter
)
{
WARN
(
"pUnkOuter != 0
\n
"
);
*
ppDSFD
=
NULL
;
return
DSERR_NOAGGREGATION
;
}
if
(
pcDSCBufferDesc
==
NULL
)
{
WARN
(
"invalid parameter: pcDSCBufferDesc == NULL
\n
"
);
*
ppDSFD
=
NULL
;
return
DSERR_INVALIDPARAM
;
}
if
(
pcDSBufferDesc
==
NULL
)
{
WARN
(
"invalid parameter: pcDSBufferDesc == NULL
\n
"
);
*
ppDSFD
=
NULL
;
return
DSERR_INVALIDPARAM
;
}
HRESULT
WINAPI
DirectSoundFullDuplexCreate
(
const
GUID
*
capture_dev
,
const
GUID
*
render_dev
,
const
DSCBUFFERDESC
*
cbufdesc
,
const
DSBUFFERDESC
*
bufdesc
,
HWND
hwnd
,
DWORD
level
,
IDirectSoundFullDuplex
**
dsfd
,
IDirectSoundCaptureBuffer8
**
dscb8
,
IDirectSoundBuffer8
**
dsb8
,
IUnknown
*
outer_unk
)
{
HRESULT
hr
;
if
(
ppDSFD
==
NULL
)
{
WARN
(
"invalid parameter: ppDSFD == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
}
TRACE
(
"(%s,%s,%p,%p,%p,%x,%p,%p,%p,%p)
\n
"
,
debugstr_guid
(
capture_dev
),
debugstr_guid
(
render_dev
),
cbufdesc
,
bufdesc
,
hwnd
,
level
,
dsfd
,
dscb8
,
dsb8
,
outer_unk
);
if
(
ppDSCBuffer8
==
NULL
)
{
WARN
(
"invalid parameter: ppDSCBuffer8 == NULL
\n
"
);
*
ppDSFD
=
NULL
;
if
(
!
dsfd
)
return
DSERR_INVALIDPARAM
;
if
(
outer_unk
)
{
*
dsfd
=
NULL
;
return
DSERR_NOAGGREGATION
;
}
if
(
ppDSBuffer8
==
NULL
)
{
WARN
(
"invalid parameter: ppDSBuffer8 == NULL
\n
"
);
*
ppDSFD
=
NULL
;
return
DSERR_INVALIDPARAM
;
hr
=
DSOUND_FullDuplexCreate
(
&
IID_IDirectSoundFullDuplex
,
(
void
**
)
dsfd
);
if
(
hr
==
DS_OK
)
{
hr
=
IDirectSoundFullDuplex_Initialize
(
*
dsfd
,
capture_dev
,
render_dev
,
cbufdesc
,
bufdesc
,
hwnd
,
level
,
dscb8
,
dsb8
);
if
(
hr
!=
DS_OK
)
{
IDirectSoundFullDuplex_Release
(
*
dsfd
);
*
dsfd
=
NULL
;
WARN
(
"IDirectSoundFullDuplexImpl_Initialize failed
\n
"
);
}
}
hres
=
DSOUND_FullDuplexCreate
(
&
IID_IDirectSoundFullDuplex
,
(
LPDIRECTSOUNDFULLDUPLEX
*
)
&
This
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
IDirectSoundFullDuplexImpl_Initialize
((
LPDIRECTSOUNDFULLDUPLEX
)
This
,
pcGuidCaptureDevice
,
pcGuidRenderDevice
,
pcDSCBufferDesc
,
pcDSBufferDesc
,
hWnd
,
dwLevel
,
ppDSCBuffer8
,
ppDSBuffer8
);
if
(
hres
!=
DS_OK
)
{
IUnknown_Release
((
LPDIRECTSOUNDFULLDUPLEX
)
This
);
WARN
(
"IDirectSoundFullDuplexImpl_Initialize failed
\n
"
);
*
ppDSFD
=
NULL
;
}
else
*
ppDSFD
=
(
LPDIRECTSOUNDFULLDUPLEX
)
This
;
return
hres
;
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