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
595d6aa6
Commit
595d6aa6
authored
Aug 18, 2006
by
Robert Reif
Committed by
Alexandre Julliard
Aug 18, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Class factory cleanup.
Consolidate all class factories into a single implementation. Fixes a problem discovered by oleview.
parent
21645023
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
114 additions
and
322 deletions
+114
-322
capture.c
dlls/dsound/capture.c
+22
-87
dsound.c
dlls/dsound/dsound.c
+20
-8
dsound_main.c
dlls/dsound/dsound_main.c
+45
-128
dsound_private.h
dlls/dsound/dsound_private.h
+9
-16
duplex.c
dlls/dsound/duplex.c
+10
-83
propset.c
dlls/dsound/propset.c
+8
-0
No files found.
dlls/dsound/capture.c
View file @
595d6aa6
...
...
@@ -85,13 +85,19 @@ static const char * captureStateString[] = {
"STATE_STOPPING"
};
static
HRESULT
DSOUND_CaptureCreate
(
LPDIRECTSOUNDCAPTURE
*
ppDSC
,
IUnknown
*
pUnkOuter
)
HRESULT
DSOUND_CaptureCreate
(
REFIID
riid
,
LPDIRECTSOUNDCAPTURE
*
ppDSC
)
{
LPDIRECTSOUNDCAPTURE
pDSC
;
HRESULT
hr
;
TRACE
(
"(%p,%p)
\n
"
,
ppDSC
,
pUnkOuter
);
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
ppDSC
);
if
(
!
IsEqualIID
(
riid
,
&
IID_IUnknown
)
&&
!
IsEqualIID
(
riid
,
&
IID_IDirectSoundCapture
))
{
*
ppDSC
=
0
;
return
E_NOINTERFACE
;
}
/* Get dsound configuration */
setup_dsound_options
();
...
...
@@ -108,13 +114,19 @@ static HRESULT DSOUND_CaptureCreate(
return
hr
;
}
static
HRESULT
DSOUND_CaptureCreate8
(
LPDIRECTSOUNDCAPTURE8
*
ppDSC8
,
IUnknown
*
pUnkOuter
)
HRESULT
DSOUND_CaptureCreate8
(
REFIID
riid
,
LPDIRECTSOUNDCAPTURE8
*
ppDSC8
)
{
LPDIRECTSOUNDCAPTURE8
pDSC8
;
HRESULT
hr
;
TRACE
(
"(%p,%p)
\n
"
,
ppDSC8
,
pUnkOuter
);
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
ppDSC8
);
if
(
!
IsEqualIID
(
riid
,
&
IID_IUnknown
)
&&
!
IsEqualIID
(
riid
,
&
IID_IDirectSoundCapture8
))
{
*
ppDSC8
=
0
;
return
E_NOINTERFACE
;
}
/* Get dsound configuration */
setup_dsound_options
();
...
...
@@ -173,7 +185,7 @@ HRESULT WINAPI DirectSoundCaptureCreate(
return
DSERR_NOAGGREGATION
;
}
hr
=
DSOUND_CaptureCreate
(
&
pDSC
,
(
IUnknown
*
)
pUnkOuter
);
hr
=
DSOUND_CaptureCreate
(
&
IID_IDirectSoundCapture
,
&
pDSC
);
if
(
hr
==
DS_OK
)
{
hr
=
IDirectSoundCapture_Initialize
(
pDSC
,
lpcGUID
);
if
(
hr
!=
DS_OK
)
{
...
...
@@ -229,7 +241,7 @@ HRESULT WINAPI DirectSoundCaptureCreate8(
return
DSERR_NOAGGREGATION
;
}
hr
=
DSOUND_CaptureCreate8
(
&
pDSC8
,
(
IUnknown
*
)
pUnkOuter
);
hr
=
DSOUND_CaptureCreate8
(
&
IID_IDirectSoundCapture8
,
&
pDSC8
);
if
(
hr
==
DS_OK
)
{
hr
=
IDirectSoundCapture_Initialize
(
pDSC8
,
lpcGUID
);
if
(
hr
!=
DS_OK
)
{
...
...
@@ -1694,80 +1706,3 @@ ULONG DirectSoundCaptureDevice_Release(
}
return
ref
;
}
/*******************************************************************************
* DirectSoundCapture ClassFactory
*/
static
HRESULT
WINAPI
DSCCF_QueryInterface
(
LPCLASSFACTORY
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p)->(%s,%p),stub!
\n
"
,
This
,
debugstr_guid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
DSCCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
ref
-
1
);
return
ref
;
}
static
ULONG
WINAPI
DSCCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
ref
+
1
);
/* static class, won't be freed */
return
ref
;
}
static
HRESULT
WINAPI
DSCCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p)->(%p,%s,%p)
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
if
(
pOuter
)
{
WARN
(
"aggregation not supported
\n
"
);
return
CLASS_E_NOAGGREGATION
;
}
if
(
ppobj
==
NULL
)
{
WARN
(
"invalid parameter
\n
"
);
return
E_INVALIDARG
;
}
*
ppobj
=
NULL
;
if
(
IsEqualGUID
(
&
IID_IDirectSoundCapture
,
riid
)
)
return
DSOUND_CaptureCreate8
((
LPDIRECTSOUNDCAPTURE
*
)
ppobj
,
pOuter
);
WARN
(
"(%p,%p,%s,%p) Interface not found!
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
}
static
HRESULT
WINAPI
DSCCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p)->(%d),stub!
\n
"
,
This
,
dolock
);
return
S_OK
;
}
static
const
IClassFactoryVtbl
DSCCF_Vtbl
=
{
DSCCF_QueryInterface
,
DSCCF_AddRef
,
DSCCF_Release
,
DSCCF_CreateInstance
,
DSCCF_LockServer
};
IClassFactoryImpl
DSOUND_CAPTURE_CF
=
{
&
DSCCF_Vtbl
,
1
};
dlls/dsound/dsound.c
View file @
595d6aa6
...
...
@@ -977,12 +977,18 @@ static HRESULT IDirectSound8_IDirectSound8_Create(
}
HRESULT
DSOUND_Create
(
LPDIRECTSOUND
*
ppDS
,
IUnknown
*
pUnkOuter
)
REFIID
riid
,
LPDIRECTSOUND
*
ppDS
)
{
LPDIRECTSOUND8
pDS
;
HRESULT
hr
;
TRACE
(
"(%p,%p)
\n
"
,
ppDS
,
pUnkOuter
);
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
ppDS
);
if
(
!
IsEqualIID
(
riid
,
&
IID_IUnknown
)
&&
!
IsEqualIID
(
riid
,
&
IID_IDirectSound
))
{
*
ppDS
=
0
;
return
E_NOINTERFACE
;
}
/* Get dsound configuration */
setup_dsound_options
();
...
...
@@ -1040,7 +1046,7 @@ HRESULT WINAPI DirectSoundCreate(
return
DSERR_INVALIDPARAM
;
}
hr
=
DSOUND_Create
(
&
pDS
,
pUnkOuter
);
hr
=
DSOUND_Create
(
&
IID_IDirectSound
,
&
pDS
);
if
(
hr
==
DS_OK
)
{
hr
=
IDirectSound_Initialize
(
pDS
,
lpcGUID
);
if
(
hr
!=
DS_OK
)
{
...
...
@@ -1058,12 +1064,18 @@ HRESULT WINAPI DirectSoundCreate(
}
HRESULT
DSOUND_Create8
(
LPDIRECTSOUND8
*
ppDS
,
IUnknown
*
pUnkOuter
)
REFIID
riid
,
LPDIRECTSOUND8
*
ppDS
)
{
LPDIRECTSOUND8
pDS
;
HRESULT
hr
;
TRACE
(
"(%p,%p)
\n
"
,
ppDS
,
pUnkOuter
);
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
ppDS
);
if
(
!
IsEqualIID
(
riid
,
&
IID_IUnknown
)
&&
!
IsEqualIID
(
riid
,
&
IID_IDirectSound8
))
{
*
ppDS
=
0
;
return
E_NOINTERFACE
;
}
/* Get dsound configuration */
setup_dsound_options
();
...
...
@@ -1121,7 +1133,7 @@ HRESULT WINAPI DirectSoundCreate8(
return
DSERR_INVALIDPARAM
;
}
hr
=
DSOUND_Create8
(
&
pDS
,
pUnkOuter
);
hr
=
DSOUND_Create8
(
&
IID_IDirectSound8
,
&
pDS
);
if
(
hr
==
DS_OK
)
{
hr
=
IDirectSound8_Initialize
(
pDS
,
lpcGUID
);
if
(
hr
!=
DS_OK
)
{
...
...
dlls/dsound/dsound_main.c
View file @
595d6aa6
...
...
@@ -426,11 +426,22 @@ HRESULT WINAPI DirectSoundEnumerateW(
* DirectSound ClassFactory
*/
typedef
HRESULT
(
*
FnCreateInstance
)(
REFIID
riid
,
LPVOID
*
ppobj
);
typedef
struct
{
const
IClassFactoryVtbl
*
lpVtbl
;
LONG
ref
;
REFCLSID
rclsid
;
FnCreateInstance
pfnCreateInstance
;
}
IClassFactoryImpl
;
static
HRESULT
WINAPI
DSCF_QueryInterface
(
LPCLASSFACTORY
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
DSCF_QueryInterface
(
LPCLASSFACTORY
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p)->(%s,%p),stub!
\n
"
,
This
,
debugstr_guid
(
riid
),
ppobj
);
FIXME
(
"(%p, %s, %p) stub!
\n
"
,
This
,
debugstr_guid
(
riid
),
ppobj
);
if
(
ppobj
==
NULL
)
return
E_POINTER
;
return
E_NOINTERFACE
;
}
...
...
@@ -452,10 +463,13 @@ static ULONG WINAPI DSCF_Release(LPCLASSFACTORY iface)
}
static
HRESULT
WINAPI
DSCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p)->(%p,%s,%p)
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
TRACE
(
"(%p, %p, %s, %p)
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
if
(
pOuter
)
return
CLASS_E_NOAGGREGATION
;
...
...
@@ -464,22 +478,14 @@ static HRESULT WINAPI DSCF_CreateInstance(
WARN
(
"invalid parameter
\n
"
);
return
DSERR_INVALIDPARAM
;
}
*
ppobj
=
NULL
;
if
(
IsEqualIID
(
&
IID_IDirectSound
,
riid
)
)
return
DSOUND_Create
((
LPDIRECTSOUND
*
)
ppobj
,
pOuter
);
if
(
IsEqualIID
(
&
IID_IDirectSound8
,
riid
)
)
return
DSOUND_Create8
((
LPDIRECTSOUND8
*
)
ppobj
,
pOuter
);
WARN
(
"(%p,%p,%s,%p) Interface not found!
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
return
This
->
pfnCreateInstance
(
riid
,
ppobj
);
}
static
HRESULT
WINAPI
DSCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
static
HRESULT
WINAPI
DSCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p)->(%d),stub!
\n
"
,
This
,
dolock
);
FIXME
(
"(%p, %d) stub!
\n
"
,
This
,
dolock
);
return
S_OK
;
}
...
...
@@ -491,76 +497,16 @@ static const IClassFactoryVtbl DSCF_Vtbl = {
DSCF_LockServer
};
static
IClassFactoryImpl
DSOUND_CF
=
{
&
DSCF_Vtbl
,
1
};
/*******************************************************************************
* DirectSoundPrivate ClassFactory
*/
static
HRESULT
WINAPI
DSPCF_QueryInterface
(
LPCLASSFACTORY
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p)->(%s,%p),stub!
\n
"
,
This
,
debugstr_guid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
DSPCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
ref
-
1
);
return
ref
;
}
static
ULONG
WINAPI
DSPCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
ref
+
1
);
/* static class, won't be freed */
return
ref
;
}
static
HRESULT
WINAPI
DSPCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p)->(%p,%s,%p)
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
if
(
ppobj
==
NULL
)
{
WARN
(
"invalid parameter
\n
"
);
return
DSERR_INVALIDPARAM
;
}
*
ppobj
=
NULL
;
if
(
IsEqualGUID
(
&
IID_IKsPropertySet
,
riid
)
)
{
return
IKsPrivatePropertySetImpl_Create
((
IKsPrivatePropertySetImpl
**
)
ppobj
);
}
WARN
(
"(%p,%p,%s,%p) Interface not found!
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
}
static
HRESULT
WINAPI
DSPCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p)->(%d),stub!
\n
"
,
This
,
dolock
);
return
S_OK
;
}
static
const
IClassFactoryVtbl
DSPCF_Vtbl
=
{
DSPCF_QueryInterface
,
DSPCF_AddRef
,
DSPCF_Release
,
DSPCF_CreateInstance
,
DSPCF_LockServer
static
IClassFactoryImpl
DSOUND_CF
[]
=
{
{
&
DSCF_Vtbl
,
1
,
&
CLSID_DirectSound
,
(
FnCreateInstance
)
DSOUND_Create
},
{
&
DSCF_Vtbl
,
1
,
&
CLSID_DirectSound8
,
(
FnCreateInstance
)
DSOUND_Create8
},
{
&
DSCF_Vtbl
,
1
,
&
CLSID_DirectSoundCapture
,
(
FnCreateInstance
)
DSOUND_CaptureCreate
},
{
&
DSCF_Vtbl
,
1
,
&
CLSID_DirectSoundCapture8
,
(
FnCreateInstance
)
DSOUND_CaptureCreate8
},
{
&
DSCF_Vtbl
,
1
,
&
CLSID_DirectSoundFullDuplex
,
(
FnCreateInstance
)
DSOUND_FullDuplexCreate
},
{
&
DSCF_Vtbl
,
1
,
&
CLSID_DirectSoundPrivate
,
(
FnCreateInstance
)
IKsPrivatePropertySetImpl_Create
},
{
NULL
,
0
,
NULL
,
NULL
}
};
static
IClassFactoryImpl
DSOUND_PRIVATE_CF
=
{
&
DSPCF_Vtbl
,
1
};
/*******************************************************************************
* DllGetClassObject [DSOUND.@]
* Retrieves class object from a DLL object
...
...
@@ -580,7 +526,8 @@ static IClassFactoryImpl DSOUND_PRIVATE_CF = { &DSPCF_Vtbl, 1 };
*/
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
LPVOID
*
ppv
)
{
TRACE
(
"(%s,%s,%p)
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
int
i
=
0
;
TRACE
(
"(%s, %s, %p)
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
if
(
ppv
==
NULL
)
{
WARN
(
"invalid parameter
\n
"
);
...
...
@@ -589,53 +536,23 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
*
ppv
=
NULL
;
if
(
IsEqualCLSID
(
&
CLSID_DirectSound
,
rclsid
)
||
IsEqualCLSID
(
&
CLSID_DirectSound8
,
rclsid
)
)
{
if
(
IsEqualCLSID
(
&
IID_IClassFactory
,
riid
)
)
{
*
ppv
=
(
LPVOID
)
&
DSOUND_CF
;
IClassFactory_AddRef
((
IClassFactory
*
)
*
ppv
);
return
S_OK
;
}
WARN
(
"(%s,%s,%p): no interface found.
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
return
S_FALSE
;
}
if
(
IsEqualCLSID
(
&
CLSID_DirectSoundCapture
,
rclsid
)
||
IsEqualCLSID
(
&
CLSID_DirectSoundCapture8
,
rclsid
)
)
{
if
(
IsEqualCLSID
(
&
IID_IClassFactory
,
riid
)
)
{
*
ppv
=
(
LPVOID
)
&
DSOUND_CAPTURE_CF
;
IClassFactory_AddRef
((
IClassFactory
*
)
*
ppv
);
return
S_OK
;
}
WARN
(
"(%s,%s,%p): no interface found.
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
return
S_FALSE
;
}
if
(
IsEqualCLSID
(
&
CLSID_DirectSoundFullDuplex
,
rclsid
)
)
{
if
(
IsEqualCLSID
(
&
IID_IClassFactory
,
riid
)
)
{
*
ppv
=
(
LPVOID
)
&
DSOUND_FULLDUPLEX_CF
;
IClassFactory_AddRef
((
IClassFactory
*
)
*
ppv
);
return
S_OK
;
}
WARN
(
"(%s,%s,%p): no interface found.
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
return
S_FALSE
;
if
(
!
IsEqualIID
(
riid
,
&
IID_IClassFactory
)
&&
!
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
WARN
(
"no interface for %s
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
if
(
IsEqualCLSID
(
&
CLSID_DirectSoundPrivate
,
rclsid
)
)
{
if
(
IsEqualCLSID
(
&
IID_IClassFactory
,
riid
)
)
{
*
ppv
=
(
LPVOID
)
&
DSOUND_PRIVATE_CF
;
IClassFactory_AddRef
((
IClassFactory
*
)
*
ppv
)
;
while
(
NULL
!=
DSOUND_CF
[
i
].
rclsid
)
{
if
(
IsEqualGUID
(
rclsid
,
DSOUND_CF
[
i
].
rclsid
)
)
{
DSCF_AddRef
((
IClassFactory
*
)
&
DSOUND_CF
[
i
])
;
*
ppv
=
&
DSOUND_CF
[
i
]
;
return
S_OK
;
}
WARN
(
"(%s,%s,%p): no interface found.
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
return
S_FALSE
;
i
++
;
}
WARN
(
"(%s,%s,%p): no class found.
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
WARN
(
"(%s, %s, %p): no class found.
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
return
CLASS_E_CLASSNOTAVAILABLE
;
}
...
...
dlls/dsound/dsound_private.h
View file @
595d6aa6
...
...
@@ -68,7 +68,6 @@ typedef struct IKsBufferPropertySetImpl IKsBufferPropertySetImpl;
typedef
struct
IKsPrivatePropertySetImpl
IKsPrivatePropertySetImpl
;
typedef
struct
PrimaryBufferImpl
PrimaryBufferImpl
;
typedef
struct
SecondaryBufferImpl
SecondaryBufferImpl
;
typedef
struct
IClassFactoryImpl
IClassFactoryImpl
;
typedef
struct
DirectSoundDevice
DirectSoundDevice
;
typedef
struct
DirectSoundCaptureDevice
DirectSoundCaptureDevice
;
...
...
@@ -391,6 +390,7 @@ struct IKsPrivatePropertySetImpl
};
HRESULT
IKsPrivatePropertySetImpl_Create
(
REFIID
riid
,
IKsPrivatePropertySetImpl
**
piks
);
/*****************************************************************************
...
...
@@ -412,25 +412,12 @@ HRESULT IDirectSound3DBufferImpl_Destroy(
IDirectSound3DBufferImpl
*
pds3db
);
/*******************************************************************************
* DirectSound ClassFactory implementation structure
*/
struct
IClassFactoryImpl
{
/* IUnknown fields */
const
IClassFactoryVtbl
*
lpVtbl
;
LONG
ref
;
};
extern
IClassFactoryImpl
DSOUND_CAPTURE_CF
;
extern
IClassFactoryImpl
DSOUND_FULLDUPLEX_CF
;
/*******************************************************************************
*/
/* dsound.c */
HRESULT
DSOUND_Create
(
LPDIRECTSOUND
*
ppDS
,
IUnknown
*
pUnkOuter
);
HRESULT
DSOUND_Create8
(
LPDIRECTSOUND8
*
ppDS
,
IUnknown
*
pUnkOuter
);
HRESULT
DSOUND_Create
(
REFIID
riid
,
LPDIRECTSOUND
*
ppDS
);
HRESULT
DSOUND_Create8
(
REFIID
riid
,
LPDIRECTSOUND8
*
ppDS
);
/* primary.c */
...
...
@@ -441,6 +428,10 @@ HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device);
HRESULT
DSOUND_PrimaryGetPosition
(
DirectSoundDevice
*
device
,
LPDWORD
playpos
,
LPDWORD
writepos
);
HRESULT
DSOUND_PrimarySetFormat
(
DirectSoundDevice
*
device
,
LPCWAVEFORMATEX
wfex
);
/* duplex.c */
HRESULT
DSOUND_FullDuplexCreate
(
REFIID
riid
,
LPDIRECTSOUNDFULLDUPLEX
*
ppDSFD
);
/* buffer.c */
DWORD
DSOUND_CalcPlayPosition
(
IDirectSoundBufferImpl
*
This
,
DWORD
pplay
,
DWORD
pwrite
);
...
...
@@ -463,6 +454,8 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb);
/* capture.c */
HRESULT
DSOUND_CaptureCreate
(
REFIID
riid
,
LPDIRECTSOUNDCAPTURE
*
ppDSC
);
HRESULT
DSOUND_CaptureCreate8
(
REFIID
riid
,
LPDIRECTSOUNDCAPTURE8
*
ppDSC8
);
HRESULT
WINAPI
IDirectSoundCaptureImpl_CreateCaptureBuffer
(
LPDIRECTSOUNDCAPTURE
iface
,
LPCDSCBUFFERDESC
lpcDSCBufferDesc
,
...
...
dlls/dsound/duplex.c
View file @
595d6aa6
...
...
@@ -760,21 +760,24 @@ static const IDirectSoundFullDuplexVtbl dsfdvt =
IDirectSoundFullDuplexImpl_Initialize
};
static
HRESULT
DSOUND_FullDuplexCreate
(
LPDIRECTSOUNDFULLDUPLEX
*
ppDSFD
,
IUnknown
*
pUnkOuter
)
HRESULT
DSOUND_FullDuplexCreate
(
REFIID
riid
,
LPDIRECTSOUNDFULLDUPLEX
*
ppDSFD
)
{
IDirectSoundFullDuplexImpl
*
This
=
NULL
;
if
(
pUnkOuter
)
{
WARN
(
"pUnkOuter != 0
\n
"
);
*
ppDSFD
=
NULL
;
return
DSERR_NOAGGREGATION
;
}
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
();
...
...
@@ -907,79 +910,3 @@ DirectSoundFullDuplexCreate(
return
hres
;
}
/*******************************************************************************
* DirectSoundFullDuplex ClassFactory
*/
static
HRESULT
WINAPI
DSFDCF_QueryInterface
(
LPCLASSFACTORY
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p)->(%s,%p),stub!
\n
"
,
This
,
debugstr_guid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
DSFDCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
return
InterlockedIncrement
(
&
(
This
->
ref
));
}
static
ULONG
WINAPI
DSFDCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
TRACE
(
"(%p) ref was %ld
\n
"
,
This
,
This
->
ref
);
return
InterlockedDecrement
(
&
(
This
->
ref
));
}
static
HRESULT
WINAPI
DSFDCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p)->(%p,%s,%p)
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
if
(
pOuter
)
{
WARN
(
"aggregation not supported
\n
"
);
return
CLASS_E_NOAGGREGATION
;
}
if
(
ppobj
==
NULL
)
{
WARN
(
"invalid parameter
\n
"
);
return
E_INVALIDARG
;
}
*
ppobj
=
NULL
;
if
(
IsEqualGUID
(
&
IID_IDirectSoundFullDuplex
,
riid
)
)
return
DSOUND_FullDuplexCreate
((
LPDIRECTSOUNDFULLDUPLEX
*
)
ppobj
,
pOuter
);
WARN
(
"(%p,%p,%s,%p) Interface not found!
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
}
static
HRESULT
WINAPI
DSFDCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p)->(%d),stub!
\n
"
,
This
,
dolock
);
return
S_OK
;
}
static
const
IClassFactoryVtbl
DSFDCF_Vtbl
=
{
DSFDCF_QueryInterface
,
DSFDCF_AddRef
,
DSFDCF_Release
,
DSFDCF_CreateInstance
,
DSFDCF_LockServer
};
IClassFactoryImpl
DSOUND_FULLDUPLEX_CF
=
{
&
DSFDCF_Vtbl
,
1
};
dlls/dsound/propset.c
View file @
595d6aa6
...
...
@@ -1504,9 +1504,17 @@ static const IKsPropertySetVtbl ikspvt = {
};
HRESULT
IKsPrivatePropertySetImpl_Create
(
REFIID
riid
,
IKsPrivatePropertySetImpl
**
piks
)
{
IKsPrivatePropertySetImpl
*
iks
;
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
piks
);
if
(
!
IsEqualIID
(
riid
,
&
IID_IUnknown
)
&&
!
IsEqualIID
(
riid
,
&
IID_IKsPropertySet
))
{
*
piks
=
0
;
return
E_NOINTERFACE
;
}
iks
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
iks
));
iks
->
ref
=
1
;
...
...
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