wineoss.drv: Standardize the COM usage in dscapture.c.
This commit is contained in:
parent
5a3c146d0a
commit
22d645ab4d
|
@ -73,7 +73,7 @@ typedef struct IDsCaptureDriverBufferImpl IDsCaptureDriverBufferImpl;
|
||||||
struct IDsCaptureDriverPropertySetImpl
|
struct IDsCaptureDriverPropertySetImpl
|
||||||
{
|
{
|
||||||
/* IUnknown fields */
|
/* IUnknown fields */
|
||||||
const IDsDriverPropertySetVtbl *lpVtbl;
|
IDsDriverPropertySet IDsDriverPropertySet_iface;
|
||||||
LONG ref;
|
LONG ref;
|
||||||
|
|
||||||
IDsCaptureDriverBufferImpl* capture_buffer;
|
IDsCaptureDriverBufferImpl* capture_buffer;
|
||||||
|
@ -82,7 +82,7 @@ struct IDsCaptureDriverPropertySetImpl
|
||||||
struct IDsCaptureDriverNotifyImpl
|
struct IDsCaptureDriverNotifyImpl
|
||||||
{
|
{
|
||||||
/* IUnknown fields */
|
/* IUnknown fields */
|
||||||
const IDsDriverNotifyVtbl *lpVtbl;
|
IDsDriverNotify IDsDriverNotify_iface;
|
||||||
LONG ref;
|
LONG ref;
|
||||||
|
|
||||||
IDsCaptureDriverBufferImpl* capture_buffer;
|
IDsCaptureDriverBufferImpl* capture_buffer;
|
||||||
|
@ -91,7 +91,7 @@ struct IDsCaptureDriverNotifyImpl
|
||||||
struct IDsCaptureDriverImpl
|
struct IDsCaptureDriverImpl
|
||||||
{
|
{
|
||||||
/* IUnknown fields */
|
/* IUnknown fields */
|
||||||
const IDsCaptureDriverVtbl *lpVtbl;
|
IDsCaptureDriver IDsCaptureDriver_iface;
|
||||||
LONG ref;
|
LONG ref;
|
||||||
|
|
||||||
/* IDsCaptureDriverImpl fields */
|
/* IDsCaptureDriverImpl fields */
|
||||||
|
@ -102,7 +102,7 @@ struct IDsCaptureDriverImpl
|
||||||
struct IDsCaptureDriverBufferImpl
|
struct IDsCaptureDriverBufferImpl
|
||||||
{
|
{
|
||||||
/* IUnknown fields */
|
/* IUnknown fields */
|
||||||
const IDsCaptureDriverBufferVtbl *lpVtbl;
|
IDsCaptureDriverBuffer IDsCaptureDriverBuffer_iface;
|
||||||
LONG ref;
|
LONG ref;
|
||||||
|
|
||||||
/* IDsCaptureDriverBufferImpl fields */
|
/* IDsCaptureDriverBufferImpl fields */
|
||||||
|
@ -138,6 +138,26 @@ struct IDsCaptureDriverBufferImpl
|
||||||
int fd;
|
int fd;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static inline IDsCaptureDriverPropertySetImpl *impl_from_IDsDriverPropertySet(IDsDriverPropertySet *iface)
|
||||||
|
{
|
||||||
|
return CONTAINING_RECORD(iface, IDsCaptureDriverPropertySetImpl, IDsDriverPropertySet_iface);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline IDsCaptureDriverNotifyImpl *impl_from_IDsDriverNotify(IDsDriverNotify *iface)
|
||||||
|
{
|
||||||
|
return CONTAINING_RECORD(iface, IDsCaptureDriverNotifyImpl, IDsDriverNotify_iface);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline IDsCaptureDriverImpl *impl_from_IDsCaptureDriver(IDsCaptureDriver *iface)
|
||||||
|
{
|
||||||
|
return CONTAINING_RECORD(iface, IDsCaptureDriverImpl, IDsCaptureDriver_iface);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline IDsCaptureDriverBufferImpl *impl_from_IDsCaptureDriverBuffer(IDsCaptureDriverBuffer *iface)
|
||||||
|
{
|
||||||
|
return CONTAINING_RECORD(iface, IDsCaptureDriverBufferImpl, IDsCaptureDriverBuffer_iface);
|
||||||
|
}
|
||||||
|
|
||||||
static HRESULT IDsCaptureDriverPropertySetImpl_Create(
|
static HRESULT IDsCaptureDriverPropertySetImpl_Create(
|
||||||
IDsCaptureDriverBufferImpl * dscdb,
|
IDsCaptureDriverBufferImpl * dscdb,
|
||||||
IDsCaptureDriverPropertySetImpl **pdscdps);
|
IDsCaptureDriverPropertySetImpl **pdscdps);
|
||||||
|
@ -155,7 +175,7 @@ static HRESULT WINAPI IDsCaptureDriverPropertySetImpl_QueryInterface(
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
LPVOID *ppobj)
|
LPVOID *ppobj)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverPropertySetImpl *This = (IDsCaptureDriverPropertySetImpl *)iface;
|
IDsCaptureDriverPropertySetImpl *This = impl_from_IDsDriverPropertySet(iface);
|
||||||
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
|
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
|
||||||
|
|
||||||
if ( IsEqualGUID(riid, &IID_IUnknown) ||
|
if ( IsEqualGUID(riid, &IID_IUnknown) ||
|
||||||
|
@ -174,7 +194,7 @@ static HRESULT WINAPI IDsCaptureDriverPropertySetImpl_QueryInterface(
|
||||||
static ULONG WINAPI IDsCaptureDriverPropertySetImpl_AddRef(
|
static ULONG WINAPI IDsCaptureDriverPropertySetImpl_AddRef(
|
||||||
PIDSDRIVERPROPERTYSET iface)
|
PIDSDRIVERPROPERTYSET iface)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverPropertySetImpl *This = (IDsCaptureDriverPropertySetImpl *)iface;
|
IDsCaptureDriverPropertySetImpl *This = impl_from_IDsDriverPropertySet(iface);
|
||||||
ULONG refCount = InterlockedIncrement(&This->ref);
|
ULONG refCount = InterlockedIncrement(&This->ref);
|
||||||
|
|
||||||
TRACE("(%p) ref was %d\n", This, refCount - 1);
|
TRACE("(%p) ref was %d\n", This, refCount - 1);
|
||||||
|
@ -185,7 +205,7 @@ static ULONG WINAPI IDsCaptureDriverPropertySetImpl_AddRef(
|
||||||
static ULONG WINAPI IDsCaptureDriverPropertySetImpl_Release(
|
static ULONG WINAPI IDsCaptureDriverPropertySetImpl_Release(
|
||||||
PIDSDRIVERPROPERTYSET iface)
|
PIDSDRIVERPROPERTYSET iface)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverPropertySetImpl *This = (IDsCaptureDriverPropertySetImpl *)iface;
|
IDsCaptureDriverPropertySetImpl *This = impl_from_IDsDriverPropertySet(iface);
|
||||||
ULONG refCount = InterlockedDecrement(&This->ref);
|
ULONG refCount = InterlockedDecrement(&This->ref);
|
||||||
|
|
||||||
TRACE("(%p) ref was %d\n", This, refCount + 1);
|
TRACE("(%p) ref was %d\n", This, refCount + 1);
|
||||||
|
@ -208,7 +228,7 @@ static HRESULT WINAPI IDsCaptureDriverPropertySetImpl_Get(
|
||||||
ULONG cbPropertyData,
|
ULONG cbPropertyData,
|
||||||
PULONG pcbReturnedData )
|
PULONG pcbReturnedData )
|
||||||
{
|
{
|
||||||
IDsCaptureDriverPropertySetImpl *This = (IDsCaptureDriverPropertySetImpl *)iface;
|
IDsCaptureDriverPropertySetImpl *This = impl_from_IDsDriverPropertySet(iface);
|
||||||
FIXME("(%p,%p,%p,%x,%p,%x,%p)\n",This,pDsProperty,pPropertyParams,
|
FIXME("(%p,%p,%p,%x,%p,%x,%p)\n",This,pDsProperty,pPropertyParams,
|
||||||
cbPropertyParams,pPropertyData,cbPropertyData,pcbReturnedData);
|
cbPropertyParams,pPropertyData,cbPropertyData,pcbReturnedData);
|
||||||
return DSERR_UNSUPPORTED;
|
return DSERR_UNSUPPORTED;
|
||||||
|
@ -222,7 +242,7 @@ static HRESULT WINAPI IDsCaptureDriverPropertySetImpl_Set(
|
||||||
LPVOID pPropertyData,
|
LPVOID pPropertyData,
|
||||||
ULONG cbPropertyData )
|
ULONG cbPropertyData )
|
||||||
{
|
{
|
||||||
IDsCaptureDriverPropertySetImpl *This = (IDsCaptureDriverPropertySetImpl *)iface;
|
IDsCaptureDriverPropertySetImpl *This = impl_from_IDsDriverPropertySet(iface);
|
||||||
FIXME("(%p,%p,%p,%x,%p,%x)\n",This,pDsProperty,pPropertyParams,
|
FIXME("(%p,%p,%p,%x,%p,%x)\n",This,pDsProperty,pPropertyParams,
|
||||||
cbPropertyParams,pPropertyData,cbPropertyData);
|
cbPropertyParams,pPropertyData,cbPropertyData);
|
||||||
return DSERR_UNSUPPORTED;
|
return DSERR_UNSUPPORTED;
|
||||||
|
@ -234,7 +254,7 @@ static HRESULT WINAPI IDsCaptureDriverPropertySetImpl_QuerySupport(
|
||||||
ULONG PropertyId,
|
ULONG PropertyId,
|
||||||
PULONG pSupport )
|
PULONG pSupport )
|
||||||
{
|
{
|
||||||
IDsCaptureDriverPropertySetImpl *This = (IDsCaptureDriverPropertySetImpl *)iface;
|
IDsCaptureDriverPropertySetImpl *This = impl_from_IDsDriverPropertySet(iface);
|
||||||
FIXME("(%p,%s,%x,%p)\n",This,debugstr_guid(PropertySetId),PropertyId,
|
FIXME("(%p,%s,%x,%p)\n",This,debugstr_guid(PropertySetId),PropertyId,
|
||||||
pSupport);
|
pSupport);
|
||||||
return DSERR_UNSUPPORTED;
|
return DSERR_UNSUPPORTED;
|
||||||
|
@ -259,7 +279,7 @@ static HRESULT WINAPI IDsCaptureDriverNotifyImpl_QueryInterface(
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
LPVOID *ppobj)
|
LPVOID *ppobj)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverNotifyImpl *This = (IDsCaptureDriverNotifyImpl *)iface;
|
IDsCaptureDriverNotifyImpl *This = impl_from_IDsDriverNotify(iface);
|
||||||
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
|
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
|
||||||
|
|
||||||
if ( IsEqualGUID(riid, &IID_IUnknown) ||
|
if ( IsEqualGUID(riid, &IID_IUnknown) ||
|
||||||
|
@ -278,7 +298,7 @@ static HRESULT WINAPI IDsCaptureDriverNotifyImpl_QueryInterface(
|
||||||
static ULONG WINAPI IDsCaptureDriverNotifyImpl_AddRef(
|
static ULONG WINAPI IDsCaptureDriverNotifyImpl_AddRef(
|
||||||
PIDSDRIVERNOTIFY iface)
|
PIDSDRIVERNOTIFY iface)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverNotifyImpl *This = (IDsCaptureDriverNotifyImpl *)iface;
|
IDsCaptureDriverNotifyImpl *This = impl_from_IDsDriverNotify(iface);
|
||||||
ULONG refCount = InterlockedIncrement(&This->ref);
|
ULONG refCount = InterlockedIncrement(&This->ref);
|
||||||
|
|
||||||
TRACE("(%p) ref was %d\n", This, refCount - 1);
|
TRACE("(%p) ref was %d\n", This, refCount - 1);
|
||||||
|
@ -289,7 +309,7 @@ static ULONG WINAPI IDsCaptureDriverNotifyImpl_AddRef(
|
||||||
static ULONG WINAPI IDsCaptureDriverNotifyImpl_Release(
|
static ULONG WINAPI IDsCaptureDriverNotifyImpl_Release(
|
||||||
PIDSDRIVERNOTIFY iface)
|
PIDSDRIVERNOTIFY iface)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverNotifyImpl *This = (IDsCaptureDriverNotifyImpl *)iface;
|
IDsCaptureDriverNotifyImpl *This = impl_from_IDsDriverNotify(iface);
|
||||||
ULONG refCount = InterlockedDecrement(&This->ref);
|
ULONG refCount = InterlockedDecrement(&This->ref);
|
||||||
|
|
||||||
TRACE("(%p) ref was %d\n", This, refCount + 1);
|
TRACE("(%p) ref was %d\n", This, refCount + 1);
|
||||||
|
@ -308,7 +328,7 @@ static HRESULT WINAPI IDsCaptureDriverNotifyImpl_SetNotificationPositions(
|
||||||
DWORD howmuch,
|
DWORD howmuch,
|
||||||
LPCDSBPOSITIONNOTIFY notify)
|
LPCDSBPOSITIONNOTIFY notify)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverNotifyImpl *This = (IDsCaptureDriverNotifyImpl *)iface;
|
IDsCaptureDriverNotifyImpl *This = impl_from_IDsDriverNotify(iface);
|
||||||
TRACE("(%p,0x%08x,%p)\n",This,howmuch,notify);
|
TRACE("(%p,0x%08x,%p)\n",This,howmuch,notify);
|
||||||
|
|
||||||
if (!notify) {
|
if (!notify) {
|
||||||
|
@ -387,7 +407,7 @@ static HRESULT WINAPI IDsCaptureDriverBufferImpl_QueryInterface(
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
LPVOID *ppobj)
|
LPVOID *ppobj)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverBufferImpl *This = (IDsCaptureDriverBufferImpl *)iface;
|
IDsCaptureDriverBufferImpl *This = impl_from_IDsCaptureDriverBuffer(iface);
|
||||||
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
|
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
|
||||||
|
|
||||||
*ppobj = 0;
|
*ppobj = 0;
|
||||||
|
@ -427,7 +447,7 @@ static HRESULT WINAPI IDsCaptureDriverBufferImpl_QueryInterface(
|
||||||
|
|
||||||
static ULONG WINAPI IDsCaptureDriverBufferImpl_AddRef(PIDSCDRIVERBUFFER iface)
|
static ULONG WINAPI IDsCaptureDriverBufferImpl_AddRef(PIDSCDRIVERBUFFER iface)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverBufferImpl *This = (IDsCaptureDriverBufferImpl *)iface;
|
IDsCaptureDriverBufferImpl *This = impl_from_IDsCaptureDriverBuffer(iface);
|
||||||
ULONG refCount = InterlockedIncrement(&This->ref);
|
ULONG refCount = InterlockedIncrement(&This->ref);
|
||||||
|
|
||||||
TRACE("(%p) ref was %d\n", This, refCount - 1);
|
TRACE("(%p) ref was %d\n", This, refCount - 1);
|
||||||
|
@ -437,7 +457,7 @@ static ULONG WINAPI IDsCaptureDriverBufferImpl_AddRef(PIDSCDRIVERBUFFER iface)
|
||||||
|
|
||||||
static ULONG WINAPI IDsCaptureDriverBufferImpl_Release(PIDSCDRIVERBUFFER iface)
|
static ULONG WINAPI IDsCaptureDriverBufferImpl_Release(PIDSCDRIVERBUFFER iface)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverBufferImpl *This = (IDsCaptureDriverBufferImpl *)iface;
|
IDsCaptureDriverBufferImpl *This = impl_from_IDsCaptureDriverBuffer(iface);
|
||||||
ULONG refCount = InterlockedDecrement(&This->ref);
|
ULONG refCount = InterlockedDecrement(&This->ref);
|
||||||
TRACE("(%p) ref was %d\n", This, refCount + 1);
|
TRACE("(%p) ref was %d\n", This, refCount + 1);
|
||||||
|
|
||||||
|
@ -484,7 +504,7 @@ static HRESULT WINAPI IDsCaptureDriverBufferImpl_Lock(
|
||||||
DWORD dwWriteLen,
|
DWORD dwWriteLen,
|
||||||
DWORD dwFlags)
|
DWORD dwFlags)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverBufferImpl *This = (IDsCaptureDriverBufferImpl *)iface;
|
IDsCaptureDriverBufferImpl *This = impl_from_IDsCaptureDriverBuffer(iface);
|
||||||
TRACE("(%p,%p,%p,%p,%p,%d,%d,0x%08x)\n",This,ppvAudio1,pdwLen1,
|
TRACE("(%p,%p,%p,%p,%p,%d,%d,0x%08x)\n",This,ppvAudio1,pdwLen1,
|
||||||
ppvAudio2,pdwLen2,dwWritePosition,dwWriteLen,dwFlags);
|
ppvAudio2,pdwLen2,dwWritePosition,dwWriteLen,dwFlags);
|
||||||
|
|
||||||
|
@ -538,7 +558,7 @@ static HRESULT WINAPI IDsCaptureDriverBufferImpl_Unlock(
|
||||||
LPVOID pvAudio2,
|
LPVOID pvAudio2,
|
||||||
DWORD dwLen2)
|
DWORD dwLen2)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverBufferImpl *This = (IDsCaptureDriverBufferImpl *)iface;
|
IDsCaptureDriverBufferImpl *This = impl_from_IDsCaptureDriverBuffer(iface);
|
||||||
TRACE("(%p,%p,%d,%p,%d)\n",This,pvAudio1,dwLen1,pvAudio2,dwLen2);
|
TRACE("(%p,%p,%d,%p,%d)\n",This,pvAudio1,dwLen1,pvAudio2,dwLen2);
|
||||||
|
|
||||||
if (This->is_direct_map)
|
if (This->is_direct_map)
|
||||||
|
@ -554,7 +574,7 @@ static HRESULT WINAPI IDsCaptureDriverBufferImpl_GetPosition(
|
||||||
LPDWORD lpdwCapture,
|
LPDWORD lpdwCapture,
|
||||||
LPDWORD lpdwRead)
|
LPDWORD lpdwRead)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverBufferImpl *This = (IDsCaptureDriverBufferImpl *)iface;
|
IDsCaptureDriverBufferImpl *This = impl_from_IDsCaptureDriverBuffer(iface);
|
||||||
TRACE("(%p,%p,%p)\n",This,lpdwCapture,lpdwRead);
|
TRACE("(%p,%p,%p)\n",This,lpdwCapture,lpdwRead);
|
||||||
|
|
||||||
if (WInDev[This->drv->wDevID].state == WINE_WS_CLOSED) {
|
if (WInDev[This->drv->wDevID].state == WINE_WS_CLOSED) {
|
||||||
|
@ -591,7 +611,7 @@ static HRESULT WINAPI IDsCaptureDriverBufferImpl_GetStatus(
|
||||||
PIDSCDRIVERBUFFER iface,
|
PIDSCDRIVERBUFFER iface,
|
||||||
LPDWORD lpdwStatus)
|
LPDWORD lpdwStatus)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverBufferImpl *This = (IDsCaptureDriverBufferImpl *)iface;
|
IDsCaptureDriverBufferImpl *This = impl_from_IDsCaptureDriverBuffer(iface);
|
||||||
TRACE("(%p,%p)\n",This,lpdwStatus);
|
TRACE("(%p,%p)\n",This,lpdwStatus);
|
||||||
|
|
||||||
if (This->is_capturing) {
|
if (This->is_capturing) {
|
||||||
|
@ -609,7 +629,7 @@ static HRESULT WINAPI IDsCaptureDriverBufferImpl_Start(
|
||||||
PIDSCDRIVERBUFFER iface,
|
PIDSCDRIVERBUFFER iface,
|
||||||
DWORD dwFlags)
|
DWORD dwFlags)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverBufferImpl *This = (IDsCaptureDriverBufferImpl *)iface;
|
IDsCaptureDriverBufferImpl *This = impl_from_IDsCaptureDriverBuffer(iface);
|
||||||
int enable;
|
int enable;
|
||||||
TRACE("(%p,%x)\n",This,dwFlags);
|
TRACE("(%p,%x)\n",This,dwFlags);
|
||||||
|
|
||||||
|
@ -650,7 +670,7 @@ static HRESULT WINAPI IDsCaptureDriverBufferImpl_Start(
|
||||||
|
|
||||||
static HRESULT WINAPI IDsCaptureDriverBufferImpl_Stop(PIDSCDRIVERBUFFER iface)
|
static HRESULT WINAPI IDsCaptureDriverBufferImpl_Stop(PIDSCDRIVERBUFFER iface)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverBufferImpl *This = (IDsCaptureDriverBufferImpl *)iface;
|
IDsCaptureDriverBufferImpl *This = impl_from_IDsCaptureDriverBuffer(iface);
|
||||||
int enable;
|
int enable;
|
||||||
TRACE("(%p)\n",This);
|
TRACE("(%p)\n",This);
|
||||||
|
|
||||||
|
@ -691,7 +711,7 @@ static HRESULT WINAPI IDsCaptureDriverBufferImpl_SetFormat(
|
||||||
PIDSCDRIVERBUFFER iface,
|
PIDSCDRIVERBUFFER iface,
|
||||||
LPWAVEFORMATEX pwfx)
|
LPWAVEFORMATEX pwfx)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverBufferImpl *This = (IDsCaptureDriverBufferImpl *)iface;
|
IDsCaptureDriverBufferImpl *This = impl_from_IDsCaptureDriverBuffer(iface);
|
||||||
FIXME("(%p): stub!\n",This);
|
FIXME("(%p): stub!\n",This);
|
||||||
return DSERR_UNSUPPORTED;
|
return DSERR_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
@ -715,7 +735,7 @@ static HRESULT WINAPI IDsCaptureDriverImpl_QueryInterface(
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
LPVOID *ppobj)
|
LPVOID *ppobj)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverImpl *This = (IDsCaptureDriverImpl *)iface;
|
IDsCaptureDriverImpl *This = impl_from_IDsCaptureDriver(iface);
|
||||||
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
|
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
|
||||||
|
|
||||||
if ( IsEqualGUID(riid, &IID_IUnknown) ||
|
if ( IsEqualGUID(riid, &IID_IUnknown) ||
|
||||||
|
@ -734,7 +754,7 @@ static HRESULT WINAPI IDsCaptureDriverImpl_QueryInterface(
|
||||||
|
|
||||||
static ULONG WINAPI IDsCaptureDriverImpl_AddRef(PIDSCDRIVER iface)
|
static ULONG WINAPI IDsCaptureDriverImpl_AddRef(PIDSCDRIVER iface)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverImpl *This = (IDsCaptureDriverImpl *)iface;
|
IDsCaptureDriverImpl *This = impl_from_IDsCaptureDriver(iface);
|
||||||
ULONG refCount = InterlockedIncrement(&This->ref);
|
ULONG refCount = InterlockedIncrement(&This->ref);
|
||||||
|
|
||||||
TRACE("(%p) ref was %d\n", This, refCount - 1);
|
TRACE("(%p) ref was %d\n", This, refCount - 1);
|
||||||
|
@ -744,7 +764,7 @@ static ULONG WINAPI IDsCaptureDriverImpl_AddRef(PIDSCDRIVER iface)
|
||||||
|
|
||||||
static ULONG WINAPI IDsCaptureDriverImpl_Release(PIDSCDRIVER iface)
|
static ULONG WINAPI IDsCaptureDriverImpl_Release(PIDSCDRIVER iface)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverImpl *This = (IDsCaptureDriverImpl *)iface;
|
IDsCaptureDriverImpl *This = impl_from_IDsCaptureDriver(iface);
|
||||||
ULONG refCount = InterlockedDecrement(&This->ref);
|
ULONG refCount = InterlockedDecrement(&This->ref);
|
||||||
|
|
||||||
TRACE("(%p) ref was %d\n", This, refCount + 1);
|
TRACE("(%p) ref was %d\n", This, refCount + 1);
|
||||||
|
@ -760,7 +780,7 @@ static HRESULT WINAPI IDsCaptureDriverImpl_GetDriverDesc(
|
||||||
PIDSCDRIVER iface,
|
PIDSCDRIVER iface,
|
||||||
PDSDRIVERDESC pDesc)
|
PDSDRIVERDESC pDesc)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverImpl *This = (IDsCaptureDriverImpl *)iface;
|
IDsCaptureDriverImpl *This = impl_from_IDsCaptureDriver(iface);
|
||||||
TRACE("(%p,%p)\n",This,pDesc);
|
TRACE("(%p,%p)\n",This,pDesc);
|
||||||
|
|
||||||
if (!pDesc) {
|
if (!pDesc) {
|
||||||
|
@ -787,14 +807,14 @@ static HRESULT WINAPI IDsCaptureDriverImpl_GetDriverDesc(
|
||||||
|
|
||||||
static HRESULT WINAPI IDsCaptureDriverImpl_Open(PIDSCDRIVER iface)
|
static HRESULT WINAPI IDsCaptureDriverImpl_Open(PIDSCDRIVER iface)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverImpl *This = (IDsCaptureDriverImpl *)iface;
|
IDsCaptureDriverImpl *This = impl_from_IDsCaptureDriver(iface);
|
||||||
TRACE("(%p)\n",This);
|
TRACE("(%p)\n",This);
|
||||||
return DS_OK;
|
return DS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IDsCaptureDriverImpl_Close(PIDSCDRIVER iface)
|
static HRESULT WINAPI IDsCaptureDriverImpl_Close(PIDSCDRIVER iface)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverImpl *This = (IDsCaptureDriverImpl *)iface;
|
IDsCaptureDriverImpl *This = impl_from_IDsCaptureDriver(iface);
|
||||||
TRACE("(%p)\n",This);
|
TRACE("(%p)\n",This);
|
||||||
if (This->capture_buffer) {
|
if (This->capture_buffer) {
|
||||||
ERR("problem with DirectSound: capture buffer not released\n");
|
ERR("problem with DirectSound: capture buffer not released\n");
|
||||||
|
@ -807,7 +827,7 @@ static HRESULT WINAPI IDsCaptureDriverImpl_GetCaps(
|
||||||
PIDSCDRIVER iface,
|
PIDSCDRIVER iface,
|
||||||
PDSCDRIVERCAPS pCaps)
|
PDSCDRIVERCAPS pCaps)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverImpl *This = (IDsCaptureDriverImpl *)iface;
|
IDsCaptureDriverImpl *This = impl_from_IDsCaptureDriver(iface);
|
||||||
TRACE("(%p,%p)\n",This,pCaps);
|
TRACE("(%p,%p)\n",This,pCaps);
|
||||||
*pCaps = WInDev[This->wDevID].ossdev.dsc_caps;
|
*pCaps = WInDev[This->wDevID].ossdev.dsc_caps;
|
||||||
return DS_OK;
|
return DS_OK;
|
||||||
|
@ -981,7 +1001,7 @@ static HRESULT WINAPI IDsCaptureDriverImpl_CreateCaptureBuffer(
|
||||||
LPBYTE *ppbBuffer,
|
LPBYTE *ppbBuffer,
|
||||||
LPVOID *ppvObj)
|
LPVOID *ppvObj)
|
||||||
{
|
{
|
||||||
IDsCaptureDriverImpl *This = (IDsCaptureDriverImpl *)iface;
|
IDsCaptureDriverImpl *This = impl_from_IDsCaptureDriver(iface);
|
||||||
IDsCaptureDriverBufferImpl** ippdscdb = (IDsCaptureDriverBufferImpl**)ppvObj;
|
IDsCaptureDriverBufferImpl** ippdscdb = (IDsCaptureDriverBufferImpl**)ppvObj;
|
||||||
HRESULT err;
|
HRESULT err;
|
||||||
audio_buf_info info;
|
audio_buf_info info;
|
||||||
|
@ -1021,7 +1041,7 @@ static HRESULT WINAPI IDsCaptureDriverImpl_CreateCaptureBuffer(
|
||||||
return DSERR_OUTOFMEMORY;
|
return DSERR_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
(*ippdscdb)->lpVtbl = &dscdbvt;
|
(*ippdscdb)->IDsCaptureDriverBuffer_iface.lpVtbl = &dscdbvt;
|
||||||
(*ippdscdb)->ref = 1;
|
(*ippdscdb)->ref = 1;
|
||||||
(*ippdscdb)->drv = This;
|
(*ippdscdb)->drv = This;
|
||||||
(*ippdscdb)->notify = NULL;
|
(*ippdscdb)->notify = NULL;
|
||||||
|
@ -1246,7 +1266,7 @@ static HRESULT IDsCaptureDriverPropertySetImpl_Create(
|
||||||
}
|
}
|
||||||
|
|
||||||
dscdps->ref = 0;
|
dscdps->ref = 0;
|
||||||
dscdps->lpVtbl = &dscdpsvt;
|
dscdps->IDsDriverPropertySet_iface.lpVtbl = &dscdpsvt;
|
||||||
dscdps->capture_buffer = dscdb;
|
dscdps->capture_buffer = dscdb;
|
||||||
dscdb->property_set = dscdps;
|
dscdb->property_set = dscdps;
|
||||||
IDsCaptureDriverBuffer_AddRef((PIDSCDRIVER)dscdb);
|
IDsCaptureDriverBuffer_AddRef((PIDSCDRIVER)dscdb);
|
||||||
|
@ -1269,7 +1289,7 @@ static HRESULT IDsCaptureDriverNotifyImpl_Create(
|
||||||
}
|
}
|
||||||
|
|
||||||
dscdn->ref = 0;
|
dscdn->ref = 0;
|
||||||
dscdn->lpVtbl = &dscdnvt;
|
dscdn->IDsDriverNotify_iface.lpVtbl = &dscdnvt;
|
||||||
dscdn->capture_buffer = dscdb;
|
dscdn->capture_buffer = dscdb;
|
||||||
dscdb->notify = dscdn;
|
dscdb->notify = dscdn;
|
||||||
IDsCaptureDriverBuffer_AddRef((PIDSCDRIVER)dscdb);
|
IDsCaptureDriverBuffer_AddRef((PIDSCDRIVER)dscdb);
|
||||||
|
@ -1294,7 +1314,7 @@ DWORD widDsCreate(UINT wDevID, PIDSCDRIVER* drv)
|
||||||
*idrv = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDsCaptureDriverImpl));
|
*idrv = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDsCaptureDriverImpl));
|
||||||
if (!*idrv)
|
if (!*idrv)
|
||||||
return MMSYSERR_NOMEM;
|
return MMSYSERR_NOMEM;
|
||||||
(*idrv)->lpVtbl = &dscdvt;
|
(*idrv)->IDsCaptureDriver_iface.lpVtbl = &dscdvt;
|
||||||
(*idrv)->ref = 1;
|
(*idrv)->ref = 1;
|
||||||
|
|
||||||
(*idrv)->wDevID = wDevID;
|
(*idrv)->wDevID = wDevID;
|
||||||
|
|
Loading…
Reference in New Issue