strmbase: Implement BaseDispatch.
This commit is contained in:
parent
7eacf27e20
commit
a37d4b79ab
@ -1,6 +1,7 @@
|
|||||||
MODULE = libstrmbase.a
|
MODULE = libstrmbase.a
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
|
dispatch.c \
|
||||||
dllfunc.c \
|
dllfunc.c \
|
||||||
enumpins.c \
|
enumpins.c \
|
||||||
filter.c \
|
filter.c \
|
||||||
|
82
dlls/strmbase/dispatch.c
Normal file
82
dlls/strmbase/dispatch.c
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* Generic Implementation of IDispatch for strmbase classes
|
||||||
|
*
|
||||||
|
* Copyright 2012 Aric Stewart, CodeWeavers
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define COBJMACROS
|
||||||
|
|
||||||
|
#include "dshow.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
#include "wine/unicode.h"
|
||||||
|
#include "wine/strmbase.h"
|
||||||
|
#include "uuids.h"
|
||||||
|
#include "vfwmsgs.h"
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(strmbase);
|
||||||
|
|
||||||
|
HRESULT WINAPI BaseDispatch_Init(BaseDispatch *This, REFIID riid)
|
||||||
|
{
|
||||||
|
HRESULT hr = E_FAIL;
|
||||||
|
ITypeLib *pTypeLib;
|
||||||
|
|
||||||
|
This->pTypeInfo = NULL;
|
||||||
|
hr = LoadRegTypeLib(&LIBID_QuartzTypeLib, 1, 0, LOCALE_SYSTEM_DEFAULT, &pTypeLib);
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
hr = ITypeLib_GetTypeInfoOfGuid(pTypeLib, riid, &This->pTypeInfo);
|
||||||
|
|
||||||
|
if (pTypeLib)
|
||||||
|
ITypeLib_Release(pTypeLib);
|
||||||
|
}
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI BaseDispatch_Destroy(BaseDispatch *This)
|
||||||
|
{
|
||||||
|
if (This->pTypeInfo)
|
||||||
|
ITypeInfo_Release(This->pTypeInfo);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI BaseDispatchImpl_GetIDsOfNames(BaseDispatch *This, REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid)
|
||||||
|
{
|
||||||
|
if (This->pTypeInfo)
|
||||||
|
return ITypeInfo_GetIDsOfNames(This->pTypeInfo, rgszNames, cNames, rgdispid);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI BaseDispatchImpl_GetTypeInfo(BaseDispatch *This, REFIID riid, UINT itinfo, LCID lcid, ITypeInfo **pptinfo)
|
||||||
|
{
|
||||||
|
if (This->pTypeInfo)
|
||||||
|
{
|
||||||
|
ITypeInfo_AddRef(This->pTypeInfo);
|
||||||
|
*pptinfo = This->pTypeInfo;
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI BaseDispatchImpl_GetTypeInfoCount(BaseDispatch *This, UINT *pctinfo)
|
||||||
|
{
|
||||||
|
if (This->pTypeInfo)
|
||||||
|
*pctinfo = 1;
|
||||||
|
else
|
||||||
|
*pctinfo = 0;
|
||||||
|
return S_OK;
|
||||||
|
}
|
@ -403,6 +403,16 @@ RECT WINAPI BaseWindowImpl_GetDefaultRect(BaseWindow *This);
|
|||||||
LRESULT WINAPI BaseWindowImpl_OnReceiveMessage(BaseWindow *This, HWND hwnd, INT uMsg, WPARAM wParam, LPARAM lParam);
|
LRESULT WINAPI BaseWindowImpl_OnReceiveMessage(BaseWindow *This, HWND hwnd, INT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
BOOL WINAPI BaseWindowImpl_OnSize(BaseWindow *This, LONG Height, LONG Width);
|
BOOL WINAPI BaseWindowImpl_OnSize(BaseWindow *This, LONG Height, LONG Width);
|
||||||
|
|
||||||
|
typedef struct{
|
||||||
|
ITypeInfo *pTypeInfo;
|
||||||
|
} BaseDispatch;
|
||||||
|
|
||||||
|
HRESULT WINAPI BaseDispatch_Init(BaseDispatch *This, REFIID riid);
|
||||||
|
HRESULT WINAPI BaseDispatch_Destroy(BaseDispatch *This);
|
||||||
|
HRESULT WINAPI BaseDispatchImpl_GetIDsOfNames(BaseDispatch *This, REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid);
|
||||||
|
HRESULT WINAPI BaseDispatchImpl_GetTypeInfo(BaseDispatch *This, REFIID riid, UINT itinfo, LCID lcid, ITypeInfo **pptinfo);
|
||||||
|
HRESULT WINAPI BaseDispatchImpl_GetTypeInfoCount(BaseDispatch *This, UINT *pctinfo);
|
||||||
|
|
||||||
#ifdef __IVideoWindow_FWD_DEFINED__
|
#ifdef __IVideoWindow_FWD_DEFINED__
|
||||||
typedef struct tagBaseControlWindow
|
typedef struct tagBaseControlWindow
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user