Skip to content
Snippets Groups Projects
Commit 96e96157 authored by Hidenori Takeshima's avatar Hidenori Takeshima Committed by Alexandre Julliard
Browse files

Added some stubs.

Started implementing some interfaces in FilterGraph.
parent c52a11ef
No related branches found
No related tags found
No related merge requests found
Showing
with 1306 additions and 51 deletions
......@@ -12,6 +12,10 @@ C_SRCS = \
amerror.c \
complist.c \
devenum.c \
devmon.c \
enumunk.c \
fgclsid.c \
fgidisp.c \
fgraph.c \
fmap.c \
fmap2.c \
......@@ -21,9 +25,12 @@ C_SRCS = \
ifgraph.c \
ifmap.c \
ifmap3.c \
igrver.c \
imcntl.c \
imem.c \
imesink.c \
imevent.c \
imfilter.c \
impos.c \
imseek.c \
irclock.c \
......@@ -31,6 +38,7 @@ C_SRCS = \
ividwin.c \
main.c \
memalloc.c \
monprop.c \
regsvr.c \
sysclock.c
......
......@@ -25,6 +25,7 @@ struct QUARTZ_CompList
{
QUARTZ_CompListItem* pFirst;
QUARTZ_CompListItem* pLast;
CRITICAL_SECTION csList;
};
struct QUARTZ_CompListItem
......@@ -32,6 +33,8 @@ struct QUARTZ_CompListItem
IUnknown* punk;
QUARTZ_CompListItem* pNext;
QUARTZ_CompListItem* pPrev;
void* pvData;
DWORD dwDataLen;
};
......@@ -45,6 +48,8 @@ QUARTZ_CompList* QUARTZ_CompList_Alloc( void )
/* construct. */
pList->pFirst = NULL;
pList->pLast = NULL;
InitializeCriticalSection( &pList->csList );
}
return pList;
......@@ -63,17 +68,33 @@ void QUARTZ_CompList_Free( QUARTZ_CompList* pList )
pNext = pCur->pNext;
if ( pCur->punk != NULL )
IUnknown_Release( pCur->punk );
if ( pCur->pvData != NULL )
QUARTZ_FreeMem( pCur->pvData );
QUARTZ_FreeMem( pCur );
pCur = pNext;
}
DeleteCriticalSection( &pList->csList );
QUARTZ_FreeMem( pList );
}
}
QUARTZ_CompList* QUARTZ_CompList_Dup( QUARTZ_CompList* pList )
void QUARTZ_CompList_Lock( QUARTZ_CompList* pList )
{
EnterCriticalSection( &pList->csList );
}
void QUARTZ_CompList_Unlock( QUARTZ_CompList* pList )
{
LeaveCriticalSection( &pList->csList );
}
QUARTZ_CompList* QUARTZ_CompList_Dup(
const QUARTZ_CompList* pList, BOOL fDupData )
{
QUARTZ_CompList* pNewList;
QUARTZ_CompListItem* pCur;
const QUARTZ_CompListItem* pCur;
HRESULT hr;
pNewList = QUARTZ_CompList_Alloc();
......@@ -85,7 +106,13 @@ QUARTZ_CompList* QUARTZ_CompList_Dup( QUARTZ_CompList* pList )
{
if ( pCur->punk != NULL )
{
hr = QUARTZ_CompList_AddComp( pNewList, pCur->punk );
if ( fDupData )
hr = QUARTZ_CompList_AddComp(
pNewList, pCur->punk,
pCur->pvData, pCur->dwDataLen );
else
hr = QUARTZ_CompList_AddComp(
pNewList, pCur->punk, NULL, 0 );
if ( FAILED(hr) )
{
QUARTZ_CompList_Free( pNewList );
......@@ -98,21 +125,38 @@ QUARTZ_CompList* QUARTZ_CompList_Dup( QUARTZ_CompList* pList )
return pNewList;
}
HRESULT QUARTZ_CompList_AddComp( QUARTZ_CompList* pList, IUnknown* punk )
HRESULT QUARTZ_CompList_AddComp(
QUARTZ_CompList* pList, IUnknown* punk,
const void* pvData, DWORD dwDataLen )
{
QUARTZ_CompListItem* pItem;
pItem = (QUARTZ_CompListItem*)QUARTZ_AllocMem( sizeof(QUARTZ_CompListItem) );
if ( pItem == NULL )
return E_OUTOFMEMORY; /* out of memory. */
pItem->pvData = NULL;
pItem->dwDataLen = 0;
if ( pvData != NULL )
{
pItem->pvData = (void*)QUARTZ_AllocMem( dwDataLen );
if ( pItem->pvData == NULL )
{
QUARTZ_FreeMem( pItem );
return E_OUTOFMEMORY;
}
memcpy( pItem->pvData, pvData, dwDataLen );
pItem->dwDataLen = dwDataLen;
}
pItem->punk = punk; IUnknown_AddRef(punk);
if ( pList->pFirst != NULL )
pList->pFirst->pPrev = pItem;
else
pList->pLast = pItem;
pList->pFirst = pItem;
pItem->pNext = pList->pFirst;
pList->pFirst = pItem;
pItem->pPrev = NULL;
return S_OK;
......@@ -139,6 +183,8 @@ HRESULT QUARTZ_CompList_RemoveComp( QUARTZ_CompList* pList, IUnknown* punk )
/* release this item. */
if ( pCur->punk != NULL )
IUnknown_Release( pCur->punk );
if ( pCur->pvData != NULL )
QUARTZ_FreeMem( pCur->pvData );
QUARTZ_FreeMem( pCur );
return S_OK;
......@@ -160,6 +206,23 @@ QUARTZ_CompListItem* QUARTZ_CompList_SearchComp(
return NULL;
}
QUARTZ_CompListItem* QUARTZ_CompList_SearchData(
QUARTZ_CompList* pList, const void* pvData, DWORD dwDataLen )
{
QUARTZ_CompListItem* pCur;
pCur = pList->pFirst;
while ( pCur != NULL )
{
if ( pCur->dwDataLen == dwDataLen &&
!memcmp( pCur->pvData, pvData, dwDataLen ) )
return pCur;
pCur = pCur->pNext;
}
return NULL;
}
QUARTZ_CompListItem* QUARTZ_CompList_GetFirst(
QUARTZ_CompList* pList )
{
......@@ -176,3 +239,13 @@ IUnknown* QUARTZ_CompList_GetItemPtr( QUARTZ_CompListItem* pItem )
{
return pItem->punk;
}
const void* QUARTZ_CompList_GetDataPtr( QUARTZ_CompListItem* pItem )
{
return pItem->pvData;
}
DWORD QUARTZ_CompList_GetDataLength( QUARTZ_CompListItem* pItem )
{
return pItem->dwDataLen;
}
......@@ -12,16 +12,26 @@ typedef struct QUARTZ_CompListItem QUARTZ_CompListItem;
QUARTZ_CompList* QUARTZ_CompList_Alloc( void );
void QUARTZ_CompList_Free( QUARTZ_CompList* pList );
QUARTZ_CompList* QUARTZ_CompList_Dup( QUARTZ_CompList* pList );
HRESULT QUARTZ_CompList_AddComp( QUARTZ_CompList* pList, IUnknown* punk );
void QUARTZ_CompList_Lock( QUARTZ_CompList* pList );
void QUARTZ_CompList_Unlock( QUARTZ_CompList* pList );
QUARTZ_CompList* QUARTZ_CompList_Dup(
const QUARTZ_CompList* pList, BOOL fDupData );
HRESULT QUARTZ_CompList_AddComp(
QUARTZ_CompList* pList, IUnknown* punk,
const void* pvData, DWORD dwDataLen );
HRESULT QUARTZ_CompList_RemoveComp( QUARTZ_CompList* pList, IUnknown* punk );
QUARTZ_CompListItem* QUARTZ_CompList_SearchComp(
QUARTZ_CompList* pList, IUnknown* punk );
QUARTZ_CompListItem* QUARTZ_CompList_SearchData(
QUARTZ_CompList* pList, const void* pvData, DWORD dwDataLen );
QUARTZ_CompListItem* QUARTZ_CompList_GetFirst(
QUARTZ_CompList* pList );
QUARTZ_CompListItem* QUARTZ_CompList_GetNext(
QUARTZ_CompList* pList, QUARTZ_CompListItem* pPrev );
IUnknown* QUARTZ_CompList_GetItemPtr( QUARTZ_CompListItem* pItem );
const void* QUARTZ_CompList_GetDataPtr( QUARTZ_CompListItem* pItem );
DWORD QUARTZ_CompList_GetDataLength( QUARTZ_CompListItem* pItem );
#endif /* QUARTZ_COMPLIST_H */
......@@ -41,6 +41,7 @@ static void QUARTZ_DestroySystemDeviceEnum(IUnknown* punk)
HRESULT QUARTZ_CreateSystemDeviceEnum(IUnknown* punkOuter,void** ppobj)
{
CSysDevEnum* psde;
HRESULT hr;
TRACE("(%p,%p)\n",punkOuter,ppobj);
......@@ -50,7 +51,12 @@ HRESULT QUARTZ_CreateSystemDeviceEnum(IUnknown* punkOuter,void** ppobj)
QUARTZ_IUnkInit( &psde->unk, punkOuter );
CSysDevEnum_InitICreateDevEnum( psde );
hr = CSysDevEnum_InitICreateDevEnum( psde );
if ( FAILED(hr) )
{
QUARTZ_FreeObj( psde );
return hr;
}
psde->unk.pEntries = IFEntries;
psde->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
......
......@@ -28,7 +28,7 @@ typedef struct CSysDevEnum
HRESULT QUARTZ_CreateSystemDeviceEnum(IUnknown* punkOuter,void** ppobj);
void CSysDevEnum_InitICreateDevEnum( CSysDevEnum* psde );
HRESULT CSysDevEnum_InitICreateDevEnum( CSysDevEnum* psde );
void CSysDevEnum_UninitICreateDevEnum( CSysDevEnum* psde );
......
/*
* Implements IMoniker for CLSID_CDeviceMoniker.
*
* hidenori@a2.ctktv.ne.jp
*/
#include "config.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "objidl.h"
#include "oleidl.h"
#include "ocidl.h"
#include "oleauto.h"
#include "strmif.h"
#include "uuids.h"
#include "wine/unicode.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
#include "quartz_private.h"
#include "devmon.h"
#include "monprop.h"
#include "regsvr.h"
static HRESULT WINAPI
IMoniker_fnQueryInterface(IMoniker* iface,REFIID riid,void** ppobj)
{
CDeviceMoniker_THIS(iface,moniker);
TRACE("(%p)->()\n",This);
return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
}
static ULONG WINAPI
IMoniker_fnAddRef(IMoniker* iface)
{
CDeviceMoniker_THIS(iface,moniker);
TRACE("(%p)->()\n",This);
return IUnknown_AddRef(This->unk.punkControl);
}
static ULONG WINAPI
IMoniker_fnRelease(IMoniker* iface)
{
CDeviceMoniker_THIS(iface,moniker);
TRACE("(%p)->()\n",This);
return IUnknown_Release(This->unk.punkControl);
}
static HRESULT WINAPI IMoniker_fnGetClassID(IMoniker* iface, CLSID *pClassID)
{
CDeviceMoniker_THIS(iface,moniker);
TRACE("(%p)->()\n",This);
if ( pClassID == NULL )
return E_POINTER;
memcpy( pClassID, &CLSID_CDeviceMoniker, sizeof(CLSID) );
return NOERROR;
}
static HRESULT WINAPI IMoniker_fnIsDirty(IMoniker* iface)
{
CDeviceMoniker_THIS(iface,moniker);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IMoniker_fnLoad(IMoniker* iface, IStream* pStm)
{
CDeviceMoniker_THIS(iface,moniker);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IMoniker_fnSave(IMoniker* iface, IStream* pStm, BOOL fClearDirty)
{
CDeviceMoniker_THIS(iface,moniker);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IMoniker_fnGetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize)
{
CDeviceMoniker_THIS(iface,moniker);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IMoniker_fnBindToObject(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult)
{
CDeviceMoniker_THIS(iface,moniker);
HRESULT hr;
IPropertyBag* pPropBag;
VARIANT vClsid;
CLSID clsid;
TRACE("(%p)->(%p,%p,%s,%p)\n",This,
pbc,pmkToLeft,debugstr_guid(riid),ppvResult);
if ( pbc != NULL )
{
FIXME("IBindCtx* pbc != NULL not implemented.\n");
return E_FAIL;
}
if ( pmkToLeft != NULL )
{
FIXME("IMoniker* pmkToLeft != NULL not implemented.\n");
return E_FAIL;
}
if ( ppvResult == NULL )
return E_POINTER;
hr = QUARTZ_CreateRegPropertyBag(
This->m_hkRoot, This->m_pwszPath, &pPropBag );
if ( FAILED(hr) )
return hr;
vClsid.n1.n2.vt = VT_BSTR;
hr = IPropertyBag_Read(
pPropBag, QUARTZ_wszCLSID, &vClsid, NULL );
IPropertyBag_Release( pPropBag );
if ( FAILED(hr) )
return hr;
hr = CLSIDFromString( vClsid.n1.n2.n3.bstrVal, &clsid );
SysFreeString(vClsid.n1.n2.n3.bstrVal);
if ( FAILED(hr) )
return hr;
return CoCreateInstance(
&clsid, NULL, CLSCTX_INPROC_SERVER, riid, ppvResult );
}
static HRESULT WINAPI IMoniker_fnBindToStorage(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult)
{
CDeviceMoniker_THIS(iface,moniker);
HRESULT hr;
TRACE("(%p)->(%p,%p,%s,%p)\n",This,
pbc,pmkToLeft,debugstr_guid(riid),ppvResult);
if ( pbc != NULL )
{
FIXME("IBindCtx* pbc != NULL not implemented.\n");
return E_FAIL;
}
if ( pmkToLeft != NULL )
{
FIXME("IMoniker* pmkToLeft != NULL not implemented.\n");
return E_FAIL;
}
if ( ppvResult == NULL )
return E_POINTER;
hr = E_NOINTERFACE;
if ( IsEqualGUID(riid,&IID_IUnknown) ||
IsEqualGUID(riid,&IID_IPropertyBag) )
{
hr = QUARTZ_CreateRegPropertyBag(
This->m_hkRoot, This->m_pwszPath,
(IPropertyBag**)ppvResult );
}
return hr;
}
static HRESULT WINAPI IMoniker_fnReduce(IMoniker* iface,IBindCtx* pbc, DWORD dwReduceHowFar,IMoniker** ppmkToLeft, IMoniker** ppmkReduced)
{
CDeviceMoniker_THIS(iface,moniker);
TRACE("(%p)->()\n",This);
if ( ppmkReduced == NULL )
return E_POINTER;
*ppmkReduced = iface; IMoniker_AddRef(iface);
return MK_S_REDUCED_TO_SELF;
}
static HRESULT WINAPI IMoniker_fnComposeWith(IMoniker* iface,IMoniker* pmkRight,BOOL fOnlyIfNotGeneric, IMoniker** ppmkComposite)
{
CDeviceMoniker_THIS(iface,moniker);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IMoniker_fnEnum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker)
{
CDeviceMoniker_THIS(iface,moniker);
TRACE("(%p)->()\n",This);
if ( ppenumMoniker == NULL )
return E_POINTER;
*ppenumMoniker = NULL;
return NOERROR;
}
static HRESULT WINAPI IMoniker_fnIsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker)
{
CDeviceMoniker_THIS(iface,moniker);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IMoniker_fnHash(IMoniker* iface,DWORD* pdwHash)
{
CDeviceMoniker_THIS(iface,moniker);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IMoniker_fnIsRunning(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, IMoniker* pmkNewlyRunning)
{
CDeviceMoniker_THIS(iface,moniker);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IMoniker_fnGetTimeOfLastChange(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft, FILETIME* pCompositeTime)
{
CDeviceMoniker_THIS(iface,moniker);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IMoniker_fnInverse(IMoniker* iface,IMoniker** ppmk)
{
CDeviceMoniker_THIS(iface,moniker);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IMoniker_fnCommonPrefixWith(IMoniker* iface,IMoniker* pmkOther, IMoniker** ppmkPrefix)
{
CDeviceMoniker_THIS(iface,moniker);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IMoniker_fnRelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppmkRelPath)
{
CDeviceMoniker_THIS(iface,moniker);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IMoniker_fnGetDisplayName(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, LPOLESTR *ppszDisplayName)
{
CDeviceMoniker_THIS(iface,moniker);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IMoniker_fnParseDisplayName(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, LPOLESTR pszDisplayName, ULONG* pchEaten, IMoniker** ppmkOut)
{
CDeviceMoniker_THIS(iface,moniker);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IMoniker_fnIsSystemMoniker(IMoniker* iface,DWORD* pdwMksys)
{
CDeviceMoniker_THIS(iface,moniker);
TRACE("(%p)->()\n",This);
if ( pdwMksys == NULL )
return E_POINTER;
*pdwMksys = MKSYS_NONE;
return S_FALSE;
}
static ICOM_VTABLE(IMoniker) imoniker =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/* IUnknown fields */
IMoniker_fnQueryInterface,
IMoniker_fnAddRef,
IMoniker_fnRelease,
/* IPersist fields */
IMoniker_fnGetClassID,
/* IPersistStream fields */
IMoniker_fnIsDirty,
IMoniker_fnLoad,
IMoniker_fnSave,
IMoniker_fnGetSizeMax,
/* IMoniker fields */
IMoniker_fnBindToObject,
IMoniker_fnBindToStorage,
IMoniker_fnReduce,
IMoniker_fnComposeWith,
IMoniker_fnEnum,
IMoniker_fnIsEqual,
IMoniker_fnHash,
IMoniker_fnIsRunning,
IMoniker_fnGetTimeOfLastChange,
IMoniker_fnInverse,
IMoniker_fnCommonPrefixWith,
IMoniker_fnRelativePathTo,
IMoniker_fnGetDisplayName,
IMoniker_fnParseDisplayName,
IMoniker_fnIsSystemMoniker,
};
static HRESULT CDeviceMoniker_InitIMoniker(
CDeviceMoniker* pdm, HKEY hkRoot, LPCWSTR lpKeyPath )
{
DWORD dwLen;
ICOM_VTBL(&pdm->moniker) = &imoniker;
pdm->m_hkRoot = hkRoot;
pdm->m_pwszPath = NULL;
dwLen = sizeof(WCHAR)*(strlenW(lpKeyPath)+1);
pdm->m_pwszPath = (WCHAR*)QUARTZ_AllocMem( dwLen );
if ( pdm->m_pwszPath == NULL )
return E_OUTOFMEMORY;
memcpy( pdm->m_pwszPath, lpKeyPath, dwLen );
return NOERROR;
}
static void CDeviceMoniker_UninitIMoniker(
CDeviceMoniker* pdm )
{
if ( pdm->m_pwszPath != NULL )
QUARTZ_FreeMem( pdm->m_pwszPath );
}
static void QUARTZ_DestroyDeviceMoniker(IUnknown* punk)
{
CDeviceMoniker_THIS(punk,unk);
CDeviceMoniker_UninitIMoniker( This );
}
/* can I use offsetof safely? - FIXME? */
static QUARTZ_IFEntry IFEntries[] =
{
{ &IID_IPersist, offsetof(CDeviceMoniker,moniker)-offsetof(CDeviceMoniker,unk) },
{ &IID_IPersistStream, offsetof(CDeviceMoniker,moniker)-offsetof(CDeviceMoniker,unk) },
{ &IID_IMoniker, offsetof(CDeviceMoniker,moniker)-offsetof(CDeviceMoniker,unk) },
};
HRESULT QUARTZ_CreateDeviceMoniker(
HKEY hkRoot, LPCWSTR lpKeyPath,
IMoniker** ppMoniker )
{
CDeviceMoniker* pdm;
HRESULT hr;
TRACE("(%08x,%s,%p)\n",hkRoot,debugstr_w(lpKeyPath),ppMoniker );
pdm = (CDeviceMoniker*)QUARTZ_AllocObj( sizeof(CDeviceMoniker) );
if ( pdm == NULL )
return E_OUTOFMEMORY;
QUARTZ_IUnkInit( &pdm->unk, NULL );
hr = CDeviceMoniker_InitIMoniker( pdm, hkRoot, lpKeyPath );
if ( FAILED(hr) )
{
QUARTZ_FreeObj( pdm );
return hr;
}
pdm->unk.pEntries = IFEntries;
pdm->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
pdm->unk.pOnFinalRelease = &QUARTZ_DestroyDeviceMoniker;
*ppMoniker = (IMoniker*)(&pdm->moniker);
return S_OK;
}
#ifndef WINE_DSHOW_DEVMON_H
#define WINE_DSHOW_DEVMON_H
/*
implements CLSID_CDeviceMoniker.
- At least, the following interfaces should be implemented:
IUnknown
+ IPersist - IPersistStream - IMoniker
*/
#include "iunk.h"
typedef struct DMON_IMonikerImpl
{
ICOM_VFIELD(IMoniker);
} DMON_IMonikerImpl;
typedef struct CDeviceMoniker
{
QUARTZ_IUnkImpl unk;
DMON_IMonikerImpl moniker;
/* IMoniker fields */
HKEY m_hkRoot;
WCHAR* m_pwszPath;
} CDeviceMoniker;
#define CDeviceMoniker_THIS(iface,member) CDeviceMoniker* This = (CDeviceMoniker*)(((char*)iface)-offsetof(CDeviceMoniker,member))
HRESULT QUARTZ_CreateDeviceMoniker(
HKEY hkRoot, LPCWSTR lpKeyPath,
IMoniker** ppMoniker );
#endif /* WINE_DSHOW_DEVMON_H */
/*
* Implementation of IEnumUnknown (for internal use).
*
* hidenori@a2.ctktv.ne.jp
*/
#include "config.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
#include "quartz_private.h"
#include "enumunk.h"
#include "iunk.h"
typedef struct IEnumUnknownImpl
{
ICOM_VFIELD(IEnumUnknown);
} IEnumUnknownImpl;
typedef struct
{
QUARTZ_IUnkImpl unk;
IEnumUnknownImpl enumunk;
struct QUARTZ_IFEntry IFEntries[1];
QUARTZ_CompList* pCompList;
QUARTZ_CompListItem* pItemCur;
} CEnumUnknown;
#define CEnumUnknown_THIS(iface,member) CEnumUnknown* This = ((CEnumUnknown*)(((char*)iface)-offsetof(CEnumUnknown,member)))
static HRESULT WINAPI
IEnumUnknown_fnQueryInterface(IEnumUnknown* iface,REFIID riid,void** ppobj)
{
CEnumUnknown_THIS(iface,enumunk);
TRACE("(%p)->()\n",This);
return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
}
static ULONG WINAPI
IEnumUnknown_fnAddRef(IEnumUnknown* iface)
{
CEnumUnknown_THIS(iface,enumunk);
TRACE("(%p)->()\n",This);
return IUnknown_AddRef(This->unk.punkControl);
}
static ULONG WINAPI
IEnumUnknown_fnRelease(IEnumUnknown* iface)
{
CEnumUnknown_THIS(iface,enumunk);
TRACE("(%p)->()\n",This);
return IUnknown_Release(This->unk.punkControl);
}
static HRESULT WINAPI
IEnumUnknown_fnNext(IEnumUnknown* iface,ULONG cReq,IUnknown** ppunk,ULONG* pcFetched)
{
CEnumUnknown_THIS(iface,enumunk);
HRESULT hr;
ULONG cFetched;
TRACE("(%p)->(%lu,%p,%p)\n",This,cReq,ppunk,pcFetched);
if ( pcFetched == NULL && cReq > 1 )
return E_INVALIDARG;
if ( ppunk == NULL )
return E_POINTER;
QUARTZ_CompList_Lock( This->pCompList );
hr = NOERROR;
cFetched = 0;
while ( cReq > 0 )
{
if ( This->pItemCur == NULL )
{
hr = S_FALSE;
break;
}
ppunk[ cFetched ++ ] = QUARTZ_CompList_GetItemPtr( This->pItemCur );
IUnknown_AddRef( *ppunk );
This->pItemCur =
QUARTZ_CompList_GetNext( This->pCompList, This->pItemCur );
cReq --;
}
QUARTZ_CompList_Unlock( This->pCompList );
if ( pcFetched != NULL )
*pcFetched = cFetched;
return hr;
}
static HRESULT WINAPI
IEnumUnknown_fnSkip(IEnumUnknown* iface,ULONG cSkip)
{
CEnumUnknown_THIS(iface,enumunk);
HRESULT hr;
TRACE("(%p)->()\n",This);
QUARTZ_CompList_Lock( This->pCompList );
hr = NOERROR;
while ( cSkip > 0 )
{
if ( This->pItemCur == NULL )
{
hr = S_FALSE;
break;
}
This->pItemCur =
QUARTZ_CompList_GetNext( This->pCompList, This->pItemCur );
cSkip --;
}
QUARTZ_CompList_Unlock( This->pCompList );
return hr;
}
static HRESULT WINAPI
IEnumUnknown_fnReset(IEnumUnknown* iface)
{
CEnumUnknown_THIS(iface,enumunk);
TRACE("(%p)->()\n",This);
QUARTZ_CompList_Lock( This->pCompList );
This->pItemCur = QUARTZ_CompList_GetFirst( This->pCompList );
QUARTZ_CompList_Unlock( This->pCompList );
return NOERROR;
}
static HRESULT WINAPI
IEnumUnknown_fnClone(IEnumUnknown* iface,IEnumUnknown** ppunk)
{
CEnumUnknown_THIS(iface,enumunk);
HRESULT hr;
TRACE("(%p)->()\n",This);
if ( ppunk == NULL )
return E_POINTER;
QUARTZ_CompList_Lock( This->pCompList );
hr = QUARTZ_CreateEnumUnknown(
This->IFEntries[0].piid,
(void**)ppunk,
This->pCompList );
QUARTZ_CompList_Unlock( This->pCompList );
return hr;
}
static ICOM_VTABLE(IEnumUnknown) ienumunk =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/* IUnknown fields */
IEnumUnknown_fnQueryInterface,
IEnumUnknown_fnAddRef,
IEnumUnknown_fnRelease,
/* IEnumUnknown fields */
IEnumUnknown_fnNext,
IEnumUnknown_fnSkip,
IEnumUnknown_fnReset,
IEnumUnknown_fnClone,
};
void QUARTZ_DestroyEnumUnknown(IUnknown* punk)
{
CEnumUnknown_THIS(punk,unk);
if ( This->pCompList != NULL )
QUARTZ_CompList_Free( This->pCompList );
}
HRESULT QUARTZ_CreateEnumUnknown(
REFIID riidEnum, void** ppobj, const QUARTZ_CompList* pCompList )
{
CEnumUnknown* penum;
QUARTZ_CompList* pCompListDup;
TRACE("(%s,%p,%p)\n",debugstr_guid(riidEnum),ppobj,pCompList);
pCompListDup = QUARTZ_CompList_Dup( pCompList, FALSE );
if ( pCompListDup == NULL )
return E_OUTOFMEMORY;
penum = (CEnumUnknown*)QUARTZ_AllocObj( sizeof(CEnumUnknown) );
if ( penum == NULL )
{
QUARTZ_CompList_Free( pCompListDup );
return E_OUTOFMEMORY;
}
QUARTZ_IUnkInit( &penum->unk, NULL );
ICOM_VTBL(&penum->enumunk) = &ienumunk;
penum->IFEntries[0].piid = riidEnum;
penum->IFEntries[0].ofsVTPtr =
offsetof(CEnumUnknown,enumunk)-offsetof(CEnumUnknown,unk);
penum->pCompList = pCompListDup;
penum->pItemCur = QUARTZ_CompList_GetFirst( pCompListDup );
penum->unk.pEntries = penum->IFEntries;
penum->unk.dwEntries = 1;
penum->unk.pOnFinalRelease = QUARTZ_DestroyEnumUnknown;
*ppobj = (void*)(&penum->enumunk);
return S_OK;
}
/*
* Implementation of IEnumUnknown (for internal use).
*
* hidenori@a2.ctktv.ne.jp
*/
#ifndef QUARTZ_ENUMUNK_H
#define QUARTZ_ENUMUNK_H
#include "complist.h"
HRESULT QUARTZ_CreateEnumUnknown(
REFIID riidEnum, void** ppobj, const QUARTZ_CompList* pCompList );
#endif /* QUARTZ_ENUMUNK_H */
/*
* Implementation of IPersist for FilterGraph.
*
* FIXME - stub.
*
* hidenori@a2.ctktv.ne.jp
*/
#include "config.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
#include "quartz_private.h"
#include "fgraph.h"
static HRESULT WINAPI
IPersist_fnQueryInterface(IPersist* iface,REFIID riid,void** ppobj)
{
CFilterGraph_THIS(iface,persist);
TRACE("(%p)->()\n",This);
return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
}
static ULONG WINAPI
IPersist_fnAddRef(IPersist* iface)
{
CFilterGraph_THIS(iface,persist);
TRACE("(%p)->()\n",This);
return IUnknown_AddRef(This->unk.punkControl);
}
static ULONG WINAPI
IPersist_fnRelease(IPersist* iface)
{
CFilterGraph_THIS(iface,persist);
TRACE("(%p)->()\n",This);
return IUnknown_Release(This->unk.punkControl);
}
static HRESULT WINAPI
IPersist_fnGetClassID(IPersist* iface,CLSID* pclsid)
{
CFilterGraph_THIS(iface,persist);
TRACE("(%p)->()\n",This);
if ( pclsid == NULL )
return E_POINTER;
memcpy( pclsid, &CLSID_FilterGraph, sizeof(CLSID) );
return E_NOTIMPL;
}
static ICOM_VTABLE(IPersist) ipersist =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/* IUnknown fields */
IPersist_fnQueryInterface,
IPersist_fnAddRef,
IPersist_fnRelease,
/* IPersist fields */
IPersist_fnGetClassID,
};
HRESULT CFilterGraph_InitIPersist( CFilterGraph* pfg )
{
TRACE("(%p)\n",pfg);
ICOM_VTBL(&pfg->persist) = &ipersist;
return NOERROR;
}
void CFilterGraph_UninitIPersist( CFilterGraph* pfg )
{
TRACE("(%p)\n",pfg);
}
/*
* Implementation of IDispatch for FilterGraph.
*
* FIXME - stub.
*
* hidenori@a2.ctktv.ne.jp
*/
#include "config.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
#include "quartz_private.h"
#include "fgraph.h"
static HRESULT WINAPI
IDispatch_fnQueryInterface(IDispatch* iface,REFIID riid,void** ppobj)
{
CFilterGraph_THIS(iface,disp);
TRACE("(%p)->()\n",This);
return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
}
static ULONG WINAPI
IDispatch_fnAddRef(IDispatch* iface)
{
CFilterGraph_THIS(iface,disp);
TRACE("(%p)->()\n",This);
return IUnknown_AddRef(This->unk.punkControl);
}
static ULONG WINAPI
IDispatch_fnRelease(IDispatch* iface)
{
CFilterGraph_THIS(iface,disp);
TRACE("(%p)->()\n",This);
return IUnknown_Release(This->unk.punkControl);
}
static HRESULT WINAPI
IDispatch_fnGetTypeInfoCount(IDispatch* iface,UINT* pcTypeInfo)
{
CFilterGraph_THIS(iface,disp);
FIXME("(%p)->()\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI
IDispatch_fnGetTypeInfo(IDispatch* iface,UINT iTypeInfo, LCID lcid, ITypeInfo** ppobj)
{
CFilterGraph_THIS(iface,disp);
FIXME("(%p)->()\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI
IDispatch_fnGetIDsOfNames(IDispatch* iface,REFIID riid, LPOLESTR* ppwszName, UINT cNames, LCID lcid, DISPID* pDispId)
{
CFilterGraph_THIS(iface,disp);
FIXME("(%p)->()\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI
IDispatch_fnInvoke(IDispatch* iface,DISPID DispId, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarRes, EXCEPINFO* pExcepInfo, UINT* puArgErr)
{
CFilterGraph_THIS(iface,disp);
FIXME("(%p)->()\n",This);
return E_NOTIMPL;
}
static ICOM_VTABLE(IDispatch) idispatch =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/* IUnknown fields */
IDispatch_fnQueryInterface,
IDispatch_fnAddRef,
IDispatch_fnRelease,
/* IDispatch fields */
IDispatch_fnGetTypeInfoCount,
IDispatch_fnGetTypeInfo,
IDispatch_fnGetIDsOfNames,
IDispatch_fnInvoke,
};
HRESULT CFilterGraph_InitIDispatch( CFilterGraph* pfg )
{
TRACE("(%p)\n",pfg);
ICOM_VTBL(&pfg->disp) = &idispatch;
return NOERROR;
}
void CFilterGraph_UninitIDispatch( CFilterGraph* pfg )
{
TRACE("(%p)\n",pfg);
}
/*
* Implementation of CLSID_FilterGraph.
*
* FIXME - stub.
*
* hidenori@a2.ctktv.ne.jp
*/
......@@ -27,12 +25,17 @@ DEFAULT_DEBUG_CHANNEL(quartz);
/* can I use offsetof safely? - FIXME? */
static QUARTZ_IFEntry IFEntries[] =
{
{ &IID_IPersist, offsetof(CFilterGraph,persist)-offsetof(CFilterGraph,unk) },
{ &IID_IDispatch, offsetof(CFilterGraph,disp)-offsetof(CFilterGraph,unk) },
{ &IID_IFilterGraph, offsetof(CFilterGraph,fgraph)-offsetof(CFilterGraph,unk) },
{ &IID_IGraphBuilder, offsetof(CFilterGraph,fgraph)-offsetof(CFilterGraph,unk) },
{ &IID_IFilterGraph2, offsetof(CFilterGraph,fgraph)-offsetof(CFilterGraph,unk) },
{ &IID_IGraphVersion, offsetof(CFilterGraph,graphversion)-offsetof(CFilterGraph,unk) },
{ &IID_IMediaControl, offsetof(CFilterGraph,mediacontrol)-offsetof(CFilterGraph,unk) },
{ &IID_IMediaFilter, offsetof(CFilterGraph,mediafilter)-offsetof(CFilterGraph,unk) },
{ &IID_IMediaEvent, offsetof(CFilterGraph,mediaevent)-offsetof(CFilterGraph,unk) },
{ &IID_IMediaEventEx, offsetof(CFilterGraph,mediaevent)-offsetof(CFilterGraph,unk) },
{ &IID_IMediaEventSink, offsetof(CFilterGraph,mediaeventsink)-offsetof(CFilterGraph,unk) },
{ &IID_IMediaPosition, offsetof(CFilterGraph,mediaposition)-offsetof(CFilterGraph,unk) },
{ &IID_IMediaSeeking, offsetof(CFilterGraph,mediaseeking)-offsetof(CFilterGraph,unk) },
{ &IID_IBasicVideo, offsetof(CFilterGraph,basvid)-offsetof(CFilterGraph,unk) },
......@@ -42,23 +45,55 @@ static QUARTZ_IFEntry IFEntries[] =
};
struct FGInitEntry
{
HRESULT (*pInit)(CFilterGraph*);
void (*pUninit)(CFilterGraph*);
};
static const struct FGInitEntry FGRAPH_Init[] =
{
#define FGENT(a) {&CFilterGraph_Init##a,&CFilterGraph_Uninit##a},
FGENT(IPersist)
FGENT(IDispatch)
FGENT(IFilterGraph2)
FGENT(IGraphVersion)
FGENT(IMediaControl)
FGENT(IMediaFilter)
FGENT(IMediaEventEx)
FGENT(IMediaEventSink)
FGENT(IMediaPosition)
FGENT(IMediaSeeking)
FGENT(IBasicVideo2)
FGENT(IBasicAudio)
FGENT(IVideoWindow)
#undef FGENT
{ NULL, NULL },
};
static void QUARTZ_DestroyFilterGraph(IUnknown* punk)
{
CFilterGraph_THIS(punk,unk);
int i;
CFilterGraph_UninitIFilterGraph2( This );
CFilterGraph_UninitIMediaControl( This );
CFilterGraph_UninitIMediaEventEx( This );
CFilterGraph_UninitIMediaPosition( This );
CFilterGraph_UninitIMediaSeeking( This );
CFilterGraph_UninitIBasicVideo2( This );
CFilterGraph_UninitIBasicAudio( This );
CFilterGraph_UninitIVideoWindow( This );
i = 0;
while ( FGRAPH_Init[i].pInit != NULL )
{
FGRAPH_Init[i].pUninit( This );
i++;
}
TRACE( "succeeded.\n" );
}
HRESULT QUARTZ_CreateFilterGraph(IUnknown* punkOuter,void** ppobj)
{
CFilterGraph* pfg;
HRESULT hr;
int i;
TRACE("(%p,%p)\n",punkOuter,ppobj);
......@@ -67,14 +102,24 @@ HRESULT QUARTZ_CreateFilterGraph(IUnknown* punkOuter,void** ppobj)
return E_OUTOFMEMORY;
QUARTZ_IUnkInit( &pfg->unk, punkOuter );
CFilterGraph_InitIFilterGraph2( pfg );
CFilterGraph_InitIMediaControl( pfg );
CFilterGraph_InitIMediaEventEx( pfg );
CFilterGraph_InitIMediaPosition( pfg );
CFilterGraph_InitIMediaSeeking( pfg );
CFilterGraph_InitIBasicVideo2( pfg );
CFilterGraph_InitIBasicAudio( pfg );
CFilterGraph_InitIVideoWindow( pfg );
i = 0;
hr = NOERROR;
while ( FGRAPH_Init[i].pInit != NULL )
{
hr = FGRAPH_Init[i].pInit( pfg );
if ( FAILED(hr) )
break;
i++;
}
if ( FAILED(hr) )
{
while ( --i >= 0 )
FGRAPH_Init[i].pUninit( pfg );
QUARTZ_FreeObj( pfg );
return hr;
}
pfg->unk.pEntries = IFEntries;
pfg->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
......
......@@ -7,37 +7,69 @@
- At least, the following interfaces should be implemented:
IUnknown
+ IPersist
+ IDispatch
+ IFilterGraph - IGraphBuilder - IFilterGraph2
+ IGraphVersion
+ IDispatch - IMediaControl
+ IPersist - IMediaFilter
+ IDispatch - IMediaEvent - IMediaEventEx
+ IMediaEventSink
+ IDispatch - IMediaPosition
+ IMediaSeeking
+ IDispatch - IBasicVideo (pass to a renderer)
+ IDispatch - IBasicVideo[2] (pass to a renderer)
+ IDispatch - IBasicAudio (pass to a renderer)
+ IDispatch - IVideoWindow (pass to a renderer)
(following interfaces are not implemented)
+ IDispatch
+ IMediaEventSink
+ IGraphVerson
+ IMarshal
+ IFilterMapper2 - IFilterMapper3
FIXME - Are there any missing interfaces???
*/
#include "iunk.h"
#include "complist.h"
typedef struct FG_IPersistImpl
{
ICOM_VFIELD(IPersist);
} FG_IPersistImpl;
typedef struct FG_IDispatchImpl
{
ICOM_VFIELD(IDispatch);
} FG_IDispatchImpl;
typedef struct FG_IFilterGraph2Impl
{
ICOM_VFIELD(IFilterGraph2);
} FG_IFilterGraph2Impl;
typedef struct FG_IGraphVersionImpl
{
ICOM_VFIELD(IGraphVersion);
} FG_IGraphVersionImpl;
typedef struct FG_IMediaControlImpl
{
ICOM_VFIELD(IMediaControl);
} FG_IMediaControlImpl;
typedef struct FG_IMediaFilterImpl
{
ICOM_VFIELD(IMediaFilter);
} FG_IMediaFilterImpl;
typedef struct FG_IMediaEventImpl
{
ICOM_VFIELD(IMediaEventEx);
} FG_IMediaEventImpl;
typedef struct FG_IMediaEventSinkImpl
{
ICOM_VFIELD(IMediaEventSink);
} FG_IMediaEventSinkImpl;
typedef struct FG_IMediaPositionImpl
{
ICOM_VFIELD(IMediaPosition);
......@@ -67,18 +99,30 @@ typedef struct FG_IVideoWindowImpl
typedef struct CFilterGraph
{
QUARTZ_IUnkImpl unk;
FG_IPersistImpl persist;
FG_IDispatchImpl disp;
FG_IFilterGraph2Impl fgraph;
FG_IGraphVersionImpl graphversion;
FG_IMediaControlImpl mediacontrol;
FG_IMediaFilterImpl mediafilter;
FG_IMediaEventImpl mediaevent;
FG_IMediaEventSinkImpl mediaeventsink;
FG_IMediaPositionImpl mediaposition;
FG_IMediaSeekingImpl mediaseeking;
FG_IBasicVideoImpl basvid;
FG_IBasicAudioImpl basaud;
FG_IVideoWindowImpl vidwin;
/* IDispatch fields. */
/* IFilterGraph2 fields. */
QUARTZ_CompList* m_pFilterList;
/* IGraphVersion fields. */
CRITICAL_SECTION m_csGraphVersion;
LONG m_lGraphVersion;
/* IMediaControl fields. */
/* IMediaEvent fields. */
HANDLE m_hMediaEvent;
/* IMediaEventSink fields. */
/* IMediaPosition fields. */
/* IMediaSeeking fields. */
/* IBasicVideo2 fields. */
......@@ -87,24 +131,36 @@ typedef struct CFilterGraph
} CFilterGraph;
#define CFilterGraph_THIS(iface,member) CFilterGraph* This = ((CFilterGraph*)(((char*)iface)-offsetof(CFilterGraph,member)))
#define CFilterGraph_IPersist(th) ((IPersist*)&((th)->persist))
#define CFilterGraph_IDispatch(th) ((IDispatch*)&((th)->disp))
HRESULT QUARTZ_CreateFilterGraph(IUnknown* punkOuter,void** ppobj);
void CFilterGraph_InitIFilterGraph2( CFilterGraph* pfg );
HRESULT CFilterGraph_InitIPersist( CFilterGraph* pfg );
void CFilterGraph_UninitIPersist( CFilterGraph* pfg );
HRESULT CFilterGraph_InitIDispatch( CFilterGraph* pfg );
void CFilterGraph_UninitIDispatch( CFilterGraph* pfg );
HRESULT CFilterGraph_InitIFilterGraph2( CFilterGraph* pfg );
void CFilterGraph_UninitIFilterGraph2( CFilterGraph* pfg );
void CFilterGraph_InitIMediaControl( CFilterGraph* pfg );
HRESULT CFilterGraph_InitIGraphVersion( CFilterGraph* pfg );
void CFilterGraph_UninitIGraphVersion( CFilterGraph* pfg );
HRESULT CFilterGraph_InitIMediaControl( CFilterGraph* pfg );
void CFilterGraph_UninitIMediaControl( CFilterGraph* pfg );
void CFilterGraph_InitIMediaEventEx( CFilterGraph* pfg );
HRESULT CFilterGraph_InitIMediaFilter( CFilterGraph* pfg );
void CFilterGraph_UninitIMediaFilter( CFilterGraph* pfg );
HRESULT CFilterGraph_InitIMediaEventEx( CFilterGraph* pfg );
void CFilterGraph_UninitIMediaEventEx( CFilterGraph* pfg );
void CFilterGraph_InitIMediaPosition( CFilterGraph* pfg );
HRESULT CFilterGraph_InitIMediaEventSink( CFilterGraph* pfg );
void CFilterGraph_UninitIMediaEventSink( CFilterGraph* pfg );
HRESULT CFilterGraph_InitIMediaPosition( CFilterGraph* pfg );
void CFilterGraph_UninitIMediaPosition( CFilterGraph* pfg );
void CFilterGraph_InitIMediaSeeking( CFilterGraph* pfg );
HRESULT CFilterGraph_InitIMediaSeeking( CFilterGraph* pfg );
void CFilterGraph_UninitIMediaSeeking( CFilterGraph* pfg );
void CFilterGraph_InitIBasicVideo2( CFilterGraph* pfg );
HRESULT CFilterGraph_InitIBasicVideo2( CFilterGraph* pfg );
void CFilterGraph_UninitIBasicVideo2( CFilterGraph* pfg );
void CFilterGraph_InitIBasicAudio( CFilterGraph* pfg );
HRESULT CFilterGraph_InitIBasicAudio( CFilterGraph* pfg );
void CFilterGraph_UninitIBasicAudio( CFilterGraph* pfg );
void CFilterGraph_InitIVideoWindow( CFilterGraph* pfg );
HRESULT CFilterGraph_InitIVideoWindow( CFilterGraph* pfg );
void CFilterGraph_UninitIVideoWindow( CFilterGraph* pfg );
......
......@@ -41,6 +41,7 @@ static void QUARTZ_DestroyFilterMapper(IUnknown* punk)
HRESULT QUARTZ_CreateFilterMapper(IUnknown* punkOuter,void** ppobj)
{
CFilterMapper* pfm;
HRESULT hr;
TRACE("(%p,%p)\n",punkOuter,ppobj);
......@@ -49,7 +50,12 @@ HRESULT QUARTZ_CreateFilterMapper(IUnknown* punkOuter,void** ppobj)
return E_OUTOFMEMORY;
QUARTZ_IUnkInit( &pfm->unk, punkOuter );
CFilterMapper_InitIFilterMapper( pfm );
hr = CFilterMapper_InitIFilterMapper( pfm );
if ( FAILED(hr) )
{
QUARTZ_FreeObj( pfm );
return hr;
}
pfm->unk.pEntries = IFEntries;
pfm->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
......
......@@ -29,7 +29,7 @@ typedef struct CFilterMapper
HRESULT QUARTZ_CreateFilterMapper(IUnknown* punkOuter,void** ppobj);
void CFilterMapper_InitIFilterMapper( CFilterMapper* pfm );
HRESULT CFilterMapper_InitIFilterMapper( CFilterMapper* pfm );
void CFilterMapper_UninitIFilterMapper( CFilterMapper* pfm );
......
......@@ -42,6 +42,7 @@ static void QUARTZ_DestroyFilterMapper2(IUnknown* punk)
HRESULT QUARTZ_CreateFilterMapper2(IUnknown* punkOuter,void** ppobj)
{
CFilterMapper2* pfm;
HRESULT hr;
TRACE("(%p,%p)\n",punkOuter,ppobj);
......@@ -50,7 +51,12 @@ HRESULT QUARTZ_CreateFilterMapper2(IUnknown* punkOuter,void** ppobj)
return E_OUTOFMEMORY;
QUARTZ_IUnkInit( &pfm->unk, punkOuter );
CFilterMapper2_InitIFilterMapper3( pfm );
hr = CFilterMapper2_InitIFilterMapper3( pfm );
if ( FAILED(hr) )
{
QUARTZ_FreeObj( pfm );
return hr;
}
pfm->unk.pEntries = IFEntries;
pfm->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
......
......@@ -22,6 +22,7 @@ typedef struct CFilterMapper2
{
QUARTZ_IUnkImpl unk;
FM2_IFilterMapper3Impl fmap3;
/* IFilterMapper3 fields */
} CFilterMapper2;
#define CFilterMapper2_THIS(iface,member) CFilterMapper2* This = ((CFilterMapper2*)(((char*)iface)-offsetof(CFilterMapper2,member)))
......@@ -29,7 +30,7 @@ typedef struct CFilterMapper2
HRESULT QUARTZ_CreateFilterMapper2(IUnknown* punkOuter,void** ppobj);
void CFilterMapper2_InitIFilterMapper3( CFilterMapper2* psde );
HRESULT CFilterMapper2_InitIFilterMapper3( CFilterMapper2* psde );
void CFilterMapper2_UninitIFilterMapper3( CFilterMapper2* psde );
......
......@@ -158,10 +158,12 @@ static ICOM_VTABLE(IBasicAudio) ibasicaudio =
};
void CFilterGraph_InitIBasicAudio( CFilterGraph* pfg )
HRESULT CFilterGraph_InitIBasicAudio( CFilterGraph* pfg )
{
TRACE("(%p)\n",pfg);
ICOM_VTBL(&pfg->basaud) = &ibasicaudio;
return NOERROR;
}
void CFilterGraph_UninitIBasicAudio( CFilterGraph* pfg )
......
......@@ -479,10 +479,12 @@ static ICOM_VTABLE(IBasicVideo2) ibasicvideo =
};
void CFilterGraph_InitIBasicVideo2( CFilterGraph* pfg )
HRESULT CFilterGraph_InitIBasicVideo2( CFilterGraph* pfg )
{
TRACE("(%p)\n",pfg);
ICOM_VTBL(&pfg->basvid) = &ibasicvideo;
return NOERROR;
}
void CFilterGraph_UninitIBasicVideo2( CFilterGraph* pfg )
......
......@@ -11,18 +11,28 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "objidl.h"
#include "oleidl.h"
#include "ocidl.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
#include "wine/unicode.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
#include "quartz_private.h"
#include "devenum.h"
#include "regsvr.h"
#include "enumunk.h"
#include "complist.h"
#include "devmon.h"
static HRESULT WINAPI
ICreateDevEnum_fnQueryInterface(ICreateDevEnum* iface,REFIID riid,void** ppobj)
......@@ -58,10 +68,95 @@ static HRESULT WINAPI
ICreateDevEnum_fnCreateClassEnumerator(ICreateDevEnum* iface,REFCLSID rclsidDeviceClass,IEnumMoniker** ppobj, DWORD dwFlags)
{
CSysDevEnum_THIS(iface,createdevenum);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
HRESULT hr;
HKEY hKey;
QUARTZ_CompList* pMonList;
IMoniker* pMon;
DWORD dwIndex;
LONG lr;
WCHAR wszPath[ 1024 ];
DWORD dwLen;
DWORD dwNameMax;
DWORD cbName;
FILETIME ftLastWrite;
TRACE("(%p)->(%s,%p,%08lx)\n",This,
debugstr_guid(rclsidDeviceClass),ppobj,dwFlags);
if ( dwFlags != 0 )
{
FIXME("unknown flags %08lx\n",dwFlags);
return E_NOTIMPL;
}
if ( ppobj == NULL )
return E_POINTER;
*ppobj = NULL;
hr = QUARTZ_CreateCLSIDPath(
wszPath, sizeof(wszPath)/sizeof(wszPath[0]),
rclsidDeviceClass, QUARTZ_wszInstance );
if ( FAILED(hr) )
return hr;
if ( RegOpenKeyExW( HKEY_CLASSES_ROOT, wszPath,
0, KEY_READ, &hKey ) != ERROR_SUCCESS )
return E_FAIL;
dwLen = strlenW(wszPath);
wszPath[dwLen++] = '\\'; wszPath[dwLen] = 0;
dwNameMax = sizeof(wszPath)/sizeof(wszPath[0]) - dwLen - 8;
pMonList = QUARTZ_CompList_Alloc();
if ( pMonList == NULL )
{
hr = E_OUTOFMEMORY;
goto err;
}
/* enumerate all subkeys. */
dwIndex = 0;
while ( 1 )
{
cbName = dwNameMax;
lr = RegEnumKeyExW(
hKey, dwIndex, &wszPath[dwLen], &cbName,
NULL, NULL, NULL, &ftLastWrite );
if ( lr == ERROR_NO_MORE_ITEMS )
break;
if ( lr != ERROR_SUCCESS )
{
hr = E_FAIL;
goto err;
}
hr = QUARTZ_CreateDeviceMoniker(
HKEY_CLASSES_ROOT, wszPath, &pMon );
if ( FAILED(hr) )
goto err;
hr = QUARTZ_CompList_AddComp(
pMonList, (IUnknown*)pMon, NULL, 0 );
IMoniker_Release( pMon );
if ( FAILED(hr) )
goto err;
dwIndex ++;
}
/* create an enumerator. */
hr = QUARTZ_CreateEnumUnknown(
&IID_IEnumMoniker, (void**)ppobj, pMonList );
if ( FAILED(hr) )
goto err;
hr = S_OK;
err:
if ( pMonList != NULL )
QUARTZ_CompList_Free( pMonList );
RegCloseKey( hKey );
return hr;
}
static ICOM_VTABLE(ICreateDevEnum) icreatedevenum =
......@@ -75,10 +170,12 @@ static ICOM_VTABLE(ICreateDevEnum) icreatedevenum =
ICreateDevEnum_fnCreateClassEnumerator,
};
void CSysDevEnum_InitICreateDevEnum( CSysDevEnum* psde )
HRESULT CSysDevEnum_InitICreateDevEnum( CSysDevEnum* psde )
{
TRACE("(%p)\n",psde);
ICOM_VTBL(&psde->createdevenum) = &icreatedevenum;
return NOERROR;
}
void CSysDevEnum_UninitICreateDevEnum( CSysDevEnum* psde )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment