Added IOleAdviseHoler interface (still a dummy) and fixed

CreateOleAdviseHolder().
This commit is contained in:
Eric Kohl 1998-11-22 18:06:33 +00:00 committed by Alexandre Julliard
parent 8d1a2ff12c
commit f9d92882f0
5 changed files with 289 additions and 2 deletions

71
include/oleobj.h Normal file
View File

@ -0,0 +1,71 @@
#ifndef _WINE_OLEOBJ_H
#define _WINE_OLEOBJ_H
#include "ole.h"
#include "ole2.h"
#include "compobj.h"
// #include "interfaces.h"
#define STDMETHOD(xfn) HRESULT (CALLBACK *fn##xfn)
#define STDMETHOD_(type,xfn) type (CALLBACK *fn##xfn)
#define PURE
#define FAR
#define THIS_ THIS,
#define __T(x) x
#define _T(x) __T(x)
#define TEXT _T
/* forward declaration of the objects*/
typedef struct tagOLEADVISEHOLDER *LPOLEADVISEHOLDER, IOleAdviseHolder;
typedef struct tagADVISESINK *LPADVISESINK, IAdviseSink;
typedef struct tagENUMSTATDATA *LPENUMSTATDATA, IEnumSTATDATA;
/****************************************************************************
* OLE ID
*/
DEFINE_OLEGUID(IID_IOleAdviseHolder, 0x00000111L, 0, 0);
/*****************************************************************************
* IOleAdviseHolder interface
*/
#define THIS LPOLEADVISEHOLDER this
typedef struct IOleAdviseHolder_VTable
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IOleAdviseHolder methods ***/
STDMETHOD(Advise)(THIS_ IAdviseSink *pAdvise, DWORD *pdwConnection) PURE;
STDMETHOD(Unadvise)(THIS_ DWORD dwConnection) PURE;
STDMETHOD(Enum_Advise)(THIS_ IEnumSTATDATA**ppenumAdvise) PURE;
STDMETHOD(SendOnRename)(THIS_ IMoniker *pmk) PURE;
STDMETHOD(SendOnSave)(THIS) PURE;
STDMETHOD(SendOnClose)(THIS) PURE;
} IOleAdviseHolder_VTable, *LPOLEADVISEHOLDER_VTABLE;
struct tagOLEADVISEHOLDER
{
LPOLEADVISEHOLDER_VTABLE lpvtbl;
DWORD ref;
};
#undef THIS
#undef PURE
#undef FAR
#undef THIS
#undef THIS_
#undef STDMETHOD
#undef STDMETHOD_
#endif /*_WINE_OLEOBJ_H*/

View File

@ -5,6 +5,7 @@
#include "ole.h" #include "ole.h"
#include "ole2.h" #include "ole2.h"
#include "compobj.h" #include "compobj.h"
#include "oleobj.h"
#include "storage.h" #include "storage.h"
#include "commctrl.h" #include "commctrl.h"
#include "interfaces.h" #include "interfaces.h"
@ -41,8 +42,6 @@ typedef struct tagSERVICEPROVIDER *LPSERVICEPROVIDER, IServiceProvider;
typedef struct tagCOMMDLGBROWSER *LPCOMMDLGBROWSER, ICommDlgBrowser; typedef struct tagCOMMDLGBROWSER *LPCOMMDLGBROWSER, ICommDlgBrowser;
typedef struct tagENUMFORMATETC *LPENUMFORMATETC, IEnumFORMATETC; typedef struct tagENUMFORMATETC *LPENUMFORMATETC, IEnumFORMATETC;
typedef struct IAdviseSink IAdviseSink, *LPIADVISESINK;
typedef struct IEnumSTATDATA IEnumSTATDATA, *LPENUMSTATDATA;
/**************************************************************************** /****************************************************************************
* SHELL ID * SHELL ID
*/ */

View File

@ -14,6 +14,7 @@ C_SRCS = \
ole2nls.c \ ole2nls.c \
olecli.c \ olecli.c \
oledlg.c \ oledlg.c \
oleobj.c \
olesvr.c \ olesvr.c \
storage.c \ storage.c \
typelib.c typelib.c

View File

@ -41,6 +41,7 @@
#include "ldt.h" #include "ldt.h"
#include "interfaces.h" #include "interfaces.h"
#include "shlobj.h" #include "shlobj.h"
#include "oleobj.h"
#include "ddraw.h" #include "ddraw.h"
#include "dsound.h" #include "dsound.h"
#include "dinput.h" #include "dinput.h"

215
ole/oleobj.c Normal file
View File

@ -0,0 +1,215 @@
/*
* OLE2 COM objects
*
* Copyright 1998 Eric Kohl
*/
#include "ole.h"
#include "ole2.h"
#include "winerror.h"
#include "interfaces.h"
#include "oleobj.h"
#include "debug.h"
#define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
#define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
#define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
/**************************************************************************
* IOleAdviseHolder Implementation
*/
static HRESULT WINAPI IOleAdviseHolder_QueryInterface(LPOLEADVISEHOLDER,REFIID,LPVOID*);
static ULONG WINAPI IOleAdviseHolder_AddRef(LPOLEADVISEHOLDER);
static ULONG WINAPI IOleAdviseHolder_Release(LPOLEADVISEHOLDER);
static HRESULT WINAPI IOleAdviseHolder_Advise(LPOLEADVISEHOLDER, IAdviseSink*, DWORD*);
static HRESULT WINAPI IOleAdviseHolder_Unadvise (LPOLEADVISEHOLDER, DWORD);
static HRESULT WINAPI IOleAdviseHolder_EnumAdvise (LPOLEADVISEHOLDER, IEnumSTATDATA **);
static HRESULT WINAPI IOleAdviseHolder_SendOnRename (LPOLEADVISEHOLDER, IMoniker *);
static HRESULT WINAPI IOleAdviseHolder_SendOnSave (LPOLEADVISEHOLDER this);
static HRESULT WINAPI IOleAdviseHolder_SendOnClose (LPOLEADVISEHOLDER this);
/**************************************************************************
* IOleAdviseHolder_VTable
*/
static IOleAdviseHolder_VTable oahvt =
{
IOleAdviseHolder_QueryInterface,
IOleAdviseHolder_AddRef,
IOleAdviseHolder_Release,
IOleAdviseHolder_Advise,
IOleAdviseHolder_Unadvise,
IOleAdviseHolder_EnumAdvise,
IOleAdviseHolder_SendOnRename,
IOleAdviseHolder_SendOnSave,
IOleAdviseHolder_SendOnClose
};
/**************************************************************************
* IOleAdviseHolder_Constructor
*/
LPOLEADVISEHOLDER IOleAdviseHolder_Constructor()
{
LPOLEADVISEHOLDER lpoah;
lpoah= (LPOLEADVISEHOLDER)HeapAlloc(GetProcessHeap(),0,sizeof(IOleAdviseHolder));
lpoah->ref = 1;
lpoah->lpvtbl = &oahvt;
FIXME (ole, "(%p)->()\n", lpoah);
return lpoah;
}
/**************************************************************************
* IOleAdviseHolder_QueryInterface
*/
static HRESULT WINAPI
IOleAdviseHolder_QueryInterface (LPOLEADVISEHOLDER this, REFIID riid, LPVOID *ppvObj)
{
char xriid[50];
WINE_StringFromCLSID((LPCLSID)riid,xriid);
FIXME (ole, "(%p)->(\n\tIID:\t%s)\n", this, xriid);
*ppvObj = NULL;
if(IsEqualIID(riid, &IID_IUnknown)) {
/* IUnknown */
*ppvObj = this;
}
else if(IsEqualIID(riid, &IID_IOleAdviseHolder)) {
/* IOleAdviseHolder */
*ppvObj = (IOleAdviseHolder*) this;
}
if(*ppvObj) {
(*(LPOLEADVISEHOLDER*)ppvObj)->lpvtbl->fnAddRef(this);
FIXME (ole, "-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
return S_OK;
}
FIXME (ole, "-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
/******************************************************************************
* IOleAdviseHolder_AddRef
*/
static ULONG WINAPI
IOleAdviseHolder_AddRef (LPOLEADVISEHOLDER this)
{
FIXME (ole, "(%p)->(count=%lu)\n", this, this->ref);
return ++(this->ref);
}
/******************************************************************************
* IOleAdviseHolder_Release
*/
static ULONG WINAPI
IOleAdviseHolder_Release (LPOLEADVISEHOLDER this)
{
FIXME (ole, "(%p)->(count=%lu)\n", this, this->ref);
if (!--(this->ref)) {
FIXME (ole, "-- destroying IOleAdviseHolder(%p)\n", this);
HeapFree(GetProcessHeap(),0,this);
return 0;
}
return this->ref;
}
/******************************************************************************
* IOleAdviseHolder_Advise
*/
static HRESULT WINAPI
IOleAdviseHolder_Advise (LPOLEADVISEHOLDER this,
IAdviseSink *pAdvise, DWORD *pdwConnection)
{
FIXME (ole, "(%p)->(%p %p)\n", this, pAdvise, pdwConnection);
*pdwConnection = 0;
return S_OK;
}
/******************************************************************************
* IOleAdviseHolder_Unadvise
*/
static HRESULT WINAPI
IOleAdviseHolder_Unadvise (LPOLEADVISEHOLDER this, DWORD dwConnection)
{
FIXME (ole, "(%p)->(%lu)\n", this, dwConnection);
return S_OK;
}
/******************************************************************************
* IOleAdviseHolder_EnumAdvise
*/
static HRESULT WINAPI
IOleAdviseHolder_EnumAdvise (LPOLEADVISEHOLDER this, IEnumSTATDATA **ppenumAdvise)
{
FIXME (ole, "(%p)->(%p)\n", this, ppenumAdvise);
*ppenumAdvise = NULL;
return S_OK;
}
/******************************************************************************
* IOleAdviseHolder_SendOnRename
*/
static HRESULT WINAPI
IOleAdviseHolder_SendOnRename (LPOLEADVISEHOLDER this, IMoniker *pmk)
{
FIXME (ole, "(%p)->(%p)\n", this, pmk);
return S_OK;
}
/******************************************************************************
* IOleAdviseHolder_SendOnSave
*/
static HRESULT WINAPI
IOleAdviseHolder_SendOnSave (LPOLEADVISEHOLDER this)
{
FIXME (ole, "(%p)\n", this);
return S_OK;
}
/******************************************************************************
* IOleAdviseHolder_SendOnClose
*/
static HRESULT WINAPI
IOleAdviseHolder_SendOnClose (LPOLEADVISEHOLDER this)
{
FIXME (ole, "(%p)\n", this);
return S_OK;
}
/***********************************************************************
* API functions
*/
/***********************************************************************
* CreateOleAdviseHolder [OLE32.59]
*/
HRESULT WINAPI CreateOleAdviseHolder32 (LPOLEADVISEHOLDER *ppOAHolder)
{
FIXME(ole,"(%p): stub!\n", ppOAHolder);
*ppOAHolder = IOleAdviseHolder_Constructor ();
if (*ppOAHolder)
return S_OK;
*ppOAHolder = 0;
return E_OUTOFMEMORY;
}