Implemented the ErrorInfo interfaces.
This commit is contained in:
parent
9d3f93d965
commit
ec85c6be75
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* ErrorInfo API
|
* ErrorInfo API
|
||||||
*
|
*
|
||||||
* Copyright 2000 Patrik Stridvall
|
* Copyright 2000 Patrik Stridvall, Juergen Schmied
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* The errorinfo is a per-thread object. The reference is stored in the
|
* The errorinfo is a per-thread object. The reference is stored in the
|
||||||
|
@ -9,20 +9,504 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "debugtools.h"
|
#include "debugtools.h"
|
||||||
#include "oleauto.h"
|
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
|
#include "heap.h"
|
||||||
#include "winerror.h"
|
#include "winerror.h"
|
||||||
|
#include "thread.h"
|
||||||
|
#include "debugtools.h"
|
||||||
|
#include "wine/obj_errorinfo.h"
|
||||||
|
|
||||||
DEFAULT_DEBUG_CHANNEL(ole)
|
DEFAULT_DEBUG_CHANNEL(ole)
|
||||||
|
|
||||||
|
typedef struct ErrorInfoImpl
|
||||||
|
{
|
||||||
|
ICOM_VTABLE(IErrorInfo) *lpvtei;
|
||||||
|
ICOM_VTABLE(ICreateErrorInfo) *lpvtcei;
|
||||||
|
ICOM_VTABLE(ISupportErrorInfo) *lpvtsei;
|
||||||
|
DWORD ref;
|
||||||
|
|
||||||
|
const GUID *pGuid;
|
||||||
|
} ErrorInfoImpl;
|
||||||
|
|
||||||
|
static ICOM_VTABLE(IErrorInfo) IErrorInfoImpl_VTable;
|
||||||
|
static ICOM_VTABLE(ICreateErrorInfo) ICreateErrorInfoImpl_VTable;
|
||||||
|
static ICOM_VTABLE(ISupportErrorInfo) ISupportErrorInfoImpl_VTable;
|
||||||
|
|
||||||
|
/*
|
||||||
|
converts a objectpointer to This
|
||||||
|
*/
|
||||||
|
#define _IErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtei)))
|
||||||
|
#define _ICOM_THIS_From_IErrorInfo(class, name) class* This = (class*)(((char*)name)-_IErrorInfo_Offset);
|
||||||
|
|
||||||
|
#define _ICreateErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtcei)))
|
||||||
|
#define _ICOM_THIS_From_ICreateErrorInfo(class, name) class* This = (class*)(((char*)name)-_ICreateErrorInfo_Offset);
|
||||||
|
|
||||||
|
#define _ISupportErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtsei)))
|
||||||
|
#define _ICOM_THIS_From_ISupportErrorInfo(class, name) class* This = (class*)(((char*)name)-_ISupportErrorInfo_Offset);
|
||||||
|
|
||||||
|
/*
|
||||||
|
converts This to a objectpointer
|
||||||
|
*/
|
||||||
|
#define _IErrorInfo_(This) (IErrorInfo*)&(This->lpvtei)
|
||||||
|
#define _ICreateErrorInfo_(This) (ICreateErrorInfo*)&(This->lpvtcei)
|
||||||
|
#define _ISupportErrorInfo_(This) (ISupportErrorInfo*)&(This->lpvtsei)
|
||||||
|
|
||||||
|
IErrorInfo * IErrorInfoImpl_Constructor()
|
||||||
|
{
|
||||||
|
ErrorInfoImpl * ei = HeapAlloc(GetProcessHeap(), 0, sizeof(ErrorInfoImpl));
|
||||||
|
if (ei)
|
||||||
|
{
|
||||||
|
ei->lpvtei = &IErrorInfoImpl_VTable;
|
||||||
|
ei->lpvtcei = &ICreateErrorInfoImpl_VTable;
|
||||||
|
ei->lpvtsei = &ISupportErrorInfoImpl_VTable;
|
||||||
|
ei->ref = 1;
|
||||||
|
}
|
||||||
|
return (IErrorInfo *)ei;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static HRESULT WINAPI IErrorInfoImpl_QueryInterface(
|
||||||
|
IErrorInfo* iface,
|
||||||
|
REFIID riid,
|
||||||
|
VOID** ppvoid)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvoid);
|
||||||
|
|
||||||
|
*ppvoid = NULL;
|
||||||
|
|
||||||
|
if(IsEqualIID(riid, &IID_IErrorInfo))
|
||||||
|
{
|
||||||
|
*ppvoid = _IErrorInfo_(This);
|
||||||
|
}
|
||||||
|
else if(IsEqualIID(riid, &IID_ICreateErrorInfo))
|
||||||
|
{
|
||||||
|
*ppvoid = _ICreateErrorInfo_(This);
|
||||||
|
}
|
||||||
|
else if(IsEqualIID(riid, &IID_ISupportErrorInfo))
|
||||||
|
{
|
||||||
|
*ppvoid = _ISupportErrorInfo_(This);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(*ppvoid)
|
||||||
|
{
|
||||||
|
IUnknown_AddRef( (IUnknown*)*ppvoid );
|
||||||
|
TRACE("-- Interface: (%p)->(%p)\n",ppvoid,*ppvoid);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
TRACE("-- Interface: E_NOINTERFACE\n");
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI IErrorInfoImpl_AddRef(
|
||||||
|
IErrorInfo* iface)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)->(count=%lu)\n",This,This->ref);
|
||||||
|
return InterlockedIncrement(&This->ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI IErrorInfoImpl_Release(
|
||||||
|
IErrorInfo* iface)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)->(count=%lu)\n",This,This->ref);
|
||||||
|
|
||||||
|
if (!InterlockedDecrement(&This->ref))
|
||||||
|
{
|
||||||
|
TRACE("-- destroying IErrorInfo(%p)\n",This);
|
||||||
|
HeapFree(GetProcessHeap(),0,This);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return This->ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI IErrorInfoImpl_GetTypeInfoCount(
|
||||||
|
IErrorInfo* iface,
|
||||||
|
unsigned int* pctinfo)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI IErrorInfoImpl_GetTypeInfo(
|
||||||
|
IErrorInfo* iface,
|
||||||
|
UINT iTInfo,
|
||||||
|
LCID lcid,
|
||||||
|
ITypeInfo** ppTInfo)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI IErrorInfoImpl_GetIDsOfNames(
|
||||||
|
IErrorInfo* iface,
|
||||||
|
REFIID riid,
|
||||||
|
LPOLESTR* rgszNames,
|
||||||
|
UINT cNames,
|
||||||
|
LCID lcid,
|
||||||
|
DISPID* rgDispId)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI IErrorInfoImpl_Invoke(
|
||||||
|
IErrorInfo* iface,
|
||||||
|
DISPID dispIdMember,
|
||||||
|
REFIID riid,
|
||||||
|
LCID lcid,
|
||||||
|
WORD wFlags,
|
||||||
|
DISPPARAMS* pDispParams,
|
||||||
|
VARIANT* pVarResult,
|
||||||
|
EXCEPINFO* pExepInfo,
|
||||||
|
UINT* puArgErr)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FIXME: is this OK? Original is GUID* pGUID! This can't work! (js) */
|
||||||
|
static HRESULT WINAPI IErrorInfoImpl_GetGUID(
|
||||||
|
IErrorInfo* iface,
|
||||||
|
GUID const ** pGUID)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
FIXME("(%p) check function prototype\n", This);
|
||||||
|
|
||||||
|
if(!pGUID || !*pGUID)return E_INVALIDARG;
|
||||||
|
*pGUID = This->pGuid;
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI IErrorInfoImpl_GetSource(
|
||||||
|
IErrorInfo* iface,
|
||||||
|
BSTR *pBstrSource)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI IErrorInfoImpl_GetDescription(
|
||||||
|
IErrorInfo* iface,
|
||||||
|
BSTR *pBstrDescription)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI IErrorInfoImpl_GetHelpFile(
|
||||||
|
IErrorInfo* iface,
|
||||||
|
BSTR *pBstrHelpFile)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI IErrorInfoImpl_GetHelpContext(
|
||||||
|
IErrorInfo* iface,
|
||||||
|
DWORD *pdwHelpContext)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ICOM_VTABLE(IErrorInfo) IErrorInfoImpl_VTable =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
IErrorInfoImpl_QueryInterface,
|
||||||
|
IErrorInfoImpl_AddRef,
|
||||||
|
IErrorInfoImpl_Release,
|
||||||
|
IErrorInfoImpl_GetTypeInfoCount,
|
||||||
|
IErrorInfoImpl_GetTypeInfo,
|
||||||
|
IErrorInfoImpl_GetIDsOfNames,
|
||||||
|
IErrorInfoImpl_Invoke,
|
||||||
|
|
||||||
|
IErrorInfoImpl_GetGUID,
|
||||||
|
IErrorInfoImpl_GetSource,
|
||||||
|
IErrorInfoImpl_GetDescription,
|
||||||
|
IErrorInfoImpl_GetHelpFile,
|
||||||
|
IErrorInfoImpl_GetHelpContext
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static HRESULT WINAPI ICreateErrorInfoImpl_QueryInterface(
|
||||||
|
ICreateErrorInfo* iface,
|
||||||
|
REFIID riid,
|
||||||
|
VOID** ppvoid)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
return IErrorInfo_QueryInterface(_IErrorInfo_(This), riid, ppvoid);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI ICreateErrorInfoImpl_AddRef(
|
||||||
|
ICreateErrorInfo* iface)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
return IErrorInfo_AddRef(_IErrorInfo_(This));
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI ICreateErrorInfoImpl_Release(
|
||||||
|
ICreateErrorInfo* iface)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
return IErrorInfo_Release(_IErrorInfo_(This));
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ICreateErrorInfoImpl_GetTypeInfoCount(
|
||||||
|
ICreateErrorInfo* iface,
|
||||||
|
unsigned int* pctinfo)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
return IErrorInfo_GetTypeInfoCount(_IErrorInfo_(This), pctinfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ICreateErrorInfoImpl_GetTypeInfo(
|
||||||
|
ICreateErrorInfo* iface,
|
||||||
|
UINT iTInfo,
|
||||||
|
LCID lcid,
|
||||||
|
ITypeInfo** ppTInfo)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
return IErrorInfo_GetTypeInfo(_IErrorInfo_(This),iTInfo,lcid,ppTInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ICreateErrorInfoImpl_GetIDsOfNames(
|
||||||
|
ICreateErrorInfo* iface,
|
||||||
|
REFIID riid,
|
||||||
|
LPOLESTR* rgszNames,
|
||||||
|
UINT cNames,
|
||||||
|
LCID lcid,
|
||||||
|
DISPID* rgDispId)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
return IErrorInfo_GetIDsOfNames(_IErrorInfo_(This),riid,rgszNames,cNames,lcid,rgDispId);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ICreateErrorInfoImpl_Invoke(
|
||||||
|
ICreateErrorInfo* iface,
|
||||||
|
DISPID dispIdMember,
|
||||||
|
REFIID riid,
|
||||||
|
LCID lcid,
|
||||||
|
WORD wFlags,
|
||||||
|
DISPPARAMS* pDispParams,
|
||||||
|
VARIANT* pVarResult,
|
||||||
|
EXCEPINFO* pExepInfo,
|
||||||
|
UINT* puArgErr)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
return IErrorInfo_Invoke(_IErrorInfo_(This),dispIdMember,riid,lcid,wFlags,pDispParams,
|
||||||
|
pVarResult,pExepInfo,puArgErr);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ICreateErrorInfoImpl_SetGUID(
|
||||||
|
ICreateErrorInfo* iface,
|
||||||
|
REFGUID rguid)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)->(%s)\n", This, debugstr_guid(rguid));
|
||||||
|
This->pGuid = rguid;
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ICreateErrorInfoImpl_SetSource(
|
||||||
|
ICreateErrorInfo* iface,
|
||||||
|
LPOLESTR szSource)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ICreateErrorInfoImpl_SetDescription(
|
||||||
|
ICreateErrorInfo* iface,
|
||||||
|
LPOLESTR szDescription)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ICreateErrorInfoImpl_SetHelpFile(
|
||||||
|
ICreateErrorInfo* iface,
|
||||||
|
LPOLESTR szHelpFile)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ICreateErrorInfoImpl_SetHelpContext(
|
||||||
|
ICreateErrorInfo* iface,
|
||||||
|
DWORD dwHelpContext)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ICOM_VTABLE(ICreateErrorInfo) ICreateErrorInfoImpl_VTable =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
ICreateErrorInfoImpl_QueryInterface,
|
||||||
|
ICreateErrorInfoImpl_AddRef,
|
||||||
|
ICreateErrorInfoImpl_Release,
|
||||||
|
|
||||||
|
ICreateErrorInfoImpl_GetTypeInfoCount,
|
||||||
|
ICreateErrorInfoImpl_GetTypeInfo,
|
||||||
|
ICreateErrorInfoImpl_GetIDsOfNames,
|
||||||
|
ICreateErrorInfoImpl_Invoke,
|
||||||
|
|
||||||
|
ICreateErrorInfoImpl_SetGUID,
|
||||||
|
ICreateErrorInfoImpl_SetSource,
|
||||||
|
ICreateErrorInfoImpl_SetDescription,
|
||||||
|
ICreateErrorInfoImpl_SetHelpFile,
|
||||||
|
ICreateErrorInfoImpl_SetHelpContext
|
||||||
|
};
|
||||||
|
|
||||||
|
static HRESULT WINAPI ISupportErrorInfoImpl_QueryInterface(
|
||||||
|
ISupportErrorInfo* iface,
|
||||||
|
REFIID riid,
|
||||||
|
VOID** ppvoid)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ISupportErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
|
return IErrorInfo_QueryInterface(_IErrorInfo_(This), riid, ppvoid);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI ISupportErrorInfoImpl_AddRef(
|
||||||
|
ISupportErrorInfo* iface)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ISupportErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
return IErrorInfo_AddRef(_IErrorInfo_(This));
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI ISupportErrorInfoImpl_Release(
|
||||||
|
ISupportErrorInfo* iface)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ISupportErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
return IErrorInfo_Release(_IErrorInfo_(This));
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ISupportErrorInfoImpl_GetTypeInfoCount(
|
||||||
|
ISupportErrorInfo* iface,
|
||||||
|
unsigned int* pctinfo)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ISupportErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
return IErrorInfo_GetTypeInfoCount(_IErrorInfo_(This), pctinfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ISupportErrorInfoImpl_GetTypeInfo(
|
||||||
|
ISupportErrorInfo* iface,
|
||||||
|
UINT iTInfo,
|
||||||
|
LCID lcid,
|
||||||
|
ITypeInfo** ppTInfo)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ISupportErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
return IErrorInfo_GetTypeInfo(_IErrorInfo_(This),iTInfo,lcid,ppTInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ISupportErrorInfoImpl_GetIDsOfNames(
|
||||||
|
ISupportErrorInfo* iface,
|
||||||
|
REFIID riid,
|
||||||
|
LPOLESTR* rgszNames,
|
||||||
|
UINT cNames,
|
||||||
|
LCID lcid,
|
||||||
|
DISPID* rgDispId)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ISupportErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
return IErrorInfo_GetIDsOfNames(_IErrorInfo_(This),riid,rgszNames,cNames,lcid,rgDispId);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ISupportErrorInfoImpl_Invoke(
|
||||||
|
ISupportErrorInfo* iface,
|
||||||
|
DISPID dispIdMember,
|
||||||
|
REFIID riid,
|
||||||
|
LCID lcid,
|
||||||
|
WORD wFlags,
|
||||||
|
DISPPARAMS* pDispParams,
|
||||||
|
VARIANT* pVarResult,
|
||||||
|
EXCEPINFO* pExepInfo,
|
||||||
|
UINT* puArgErr)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ISupportErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
return IErrorInfo_Invoke(_IErrorInfo_(This),dispIdMember,riid,lcid,wFlags,pDispParams,
|
||||||
|
pVarResult,pExepInfo,puArgErr);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ISupportErrorInfoImpl_InterfaceSupportsErrorInfo(
|
||||||
|
ISupportErrorInfo* iface,
|
||||||
|
REFIID riid)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_ISupportErrorInfo(ErrorInfoImpl, iface);
|
||||||
|
TRACE("(%p)->(%s)\n", This, debugstr_guid(riid));
|
||||||
|
return (riid == This->pGuid) ? S_OK : S_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ICOM_VTABLE(ISupportErrorInfo) ISupportErrorInfoImpl_VTable =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
ISupportErrorInfoImpl_QueryInterface,
|
||||||
|
ISupportErrorInfoImpl_AddRef,
|
||||||
|
ISupportErrorInfoImpl_Release,
|
||||||
|
|
||||||
|
ISupportErrorInfoImpl_GetTypeInfoCount,
|
||||||
|
ISupportErrorInfoImpl_GetTypeInfo,
|
||||||
|
ISupportErrorInfoImpl_GetIDsOfNames,
|
||||||
|
ISupportErrorInfoImpl_Invoke,
|
||||||
|
|
||||||
|
ISupportErrorInfoImpl_InterfaceSupportsErrorInfo
|
||||||
|
};
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* CreateErrorInfo
|
* CreateErrorInfo
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI CreateErrorInfo(ICreateErrorInfo **pperrinfo)
|
HRESULT WINAPI CreateErrorInfo(ICreateErrorInfo **pperrinfo)
|
||||||
{
|
{
|
||||||
FIXME("(%p): stub:\n", pperrinfo);
|
IErrorInfo * pei;
|
||||||
|
HRESULT res;
|
||||||
return S_OK;
|
|
||||||
|
TRACE("(%p): stub:\n", pperrinfo);
|
||||||
|
|
||||||
|
if(! pperrinfo || !*pperrinfo) return E_INVALIDARG;
|
||||||
|
if(!(pei=IErrorInfoImpl_Constructor()))return E_OUTOFMEMORY;
|
||||||
|
|
||||||
|
res = IErrorInfo_QueryInterface(pei, &IID_ICreateErrorInfo, (LPVOID*)pperrinfo);
|
||||||
|
IErrorInfo_Release(pei);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -30,9 +514,14 @@ HRESULT WINAPI CreateErrorInfo(ICreateErrorInfo **pperrinfo)
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI GetErrorInfo(ULONG dwReserved, IErrorInfo **pperrinfo)
|
HRESULT WINAPI GetErrorInfo(ULONG dwReserved, IErrorInfo **pperrinfo)
|
||||||
{
|
{
|
||||||
FIXME("(%ld, %p): stub:\n", dwReserved, pperrinfo);
|
TRACE("(%ld, %p): stub:\n", dwReserved, pperrinfo);
|
||||||
|
|
||||||
return S_OK;
|
if(! pperrinfo || !*pperrinfo) return E_INVALIDARG;
|
||||||
|
if(!(*pperrinfo = (IErrorInfo*)(NtCurrentTeb()->ErrorInfo))) return S_FALSE;
|
||||||
|
|
||||||
|
/* clear thread error state */
|
||||||
|
NtCurrentTeb()->ErrorInfo = NULL;
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -40,7 +529,15 @@ HRESULT WINAPI GetErrorInfo(ULONG dwReserved, IErrorInfo **pperrinfo)
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI SetErrorInfo(ULONG dwReserved, IErrorInfo *perrinfo)
|
HRESULT WINAPI SetErrorInfo(ULONG dwReserved, IErrorInfo *perrinfo)
|
||||||
{
|
{
|
||||||
FIXME("(%ld, %p): stub:\n", dwReserved, perrinfo);
|
IErrorInfo * pei;
|
||||||
|
TRACE("(%ld, %p): stub:\n", dwReserved, perrinfo);
|
||||||
return S_OK;
|
|
||||||
|
/* release old errorinfo */
|
||||||
|
pei = (IErrorInfo*)NtCurrentTeb()->ErrorInfo;
|
||||||
|
if(pei) IErrorInfo_Release(pei);
|
||||||
|
|
||||||
|
/* set to new value */
|
||||||
|
NtCurrentTeb()->ErrorInfo = perrinfo;
|
||||||
|
if(perrinfo) IErrorInfo_AddRef(perrinfo);
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#include "wtypes.h"
|
#include "wtypes.h"
|
||||||
#include "wine/obj_oleaut.h"
|
#include "wine/obj_oleaut.h"
|
||||||
|
#include "wine/obj_errorinfo.h"
|
||||||
|
|
||||||
#ifndef __WINE__
|
#ifndef __WINE__
|
||||||
#include "oaidl.h"
|
#include "oaidl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "wine/obj_cache.h"
|
#include "wine/obj_cache.h"
|
||||||
#include "wine/obj_oleobj.h"
|
#include "wine/obj_oleobj.h"
|
||||||
#include "wine/obj_oleview.h"
|
#include "wine/obj_oleview.h"
|
||||||
|
#include "wine/obj_errorinfo.h"
|
||||||
|
|
||||||
#endif /* __WINE_OLEIDL_H */
|
#endif /* __WINE_OLEIDL_H */
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ typedef struct _TEB
|
||||||
DWORD pad8[3]; /* --n f10 */
|
DWORD pad8[3]; /* --n f10 */
|
||||||
PVOID ReservedForNtRpc; /* -2- f1c used by rpcrt4 */
|
PVOID ReservedForNtRpc; /* -2- f1c used by rpcrt4 */
|
||||||
DWORD pad9[24]; /* --n f20 */
|
DWORD pad9[24]; /* --n f20 */
|
||||||
PVOID ReservedForOle; /* -2- f80 used by ole32 (IErrorInfo*) */
|
PVOID ErrorInfo; /* -2- f80 used by ole32 (IErrorInfo*) */
|
||||||
} TEB;
|
} TEB;
|
||||||
|
|
||||||
/* Thread exception flags */
|
/* Thread exception flags */
|
||||||
|
|
|
@ -0,0 +1,115 @@
|
||||||
|
/*
|
||||||
|
* Defines the COM interfaces and APIs related to ErrorInfo
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __WINE_WINE_OBJ_ERRORINFO_H
|
||||||
|
#define __WINE_WINE_OBJ_ERRORINFO_H
|
||||||
|
|
||||||
|
#include "wine/obj_base.h"
|
||||||
|
#include "wine/obj_oleaut.h"
|
||||||
|
|
||||||
|
DEFINE_GUID(IID_IErrorInfo,0x1CF2B120,0x547D,0x101B,0x8E,0x65,0x08,0x00,0x2B,0x2B,0xD1,0x19);
|
||||||
|
typedef struct IErrorInfo IErrorInfo,*LPERRORINFO;
|
||||||
|
|
||||||
|
DEFINE_GUID(IID_ICreateErrorInfo,0x22F03340,0x547D,0x101B,0x8E,0x65,0x08,0x00,0x2B,0x2B,0xD1,0x19);
|
||||||
|
typedef struct ICreateErrorInfo ICreateErrorInfo,*LPCREATEERRORINFO;
|
||||||
|
|
||||||
|
DEFINE_GUID(IID_ISupportErrorInfo,0xDF0B3D60,0x547D,0x101B,0x8E,0x65,0x08,0x00,0x2B,0x2B,0xD1,0x19);
|
||||||
|
typedef struct ISupportErrorInfo ISupportErrorInfo,*LPSUPPORTERRORINFO;
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* IErrorInfo
|
||||||
|
*/
|
||||||
|
#define ICOM_INTERFACE IErrorInfo
|
||||||
|
#define IErrorInfo_METHODS \
|
||||||
|
ICOM_METHOD1(HRESULT, GetGUID, const GUID ** , pGUID) \
|
||||||
|
ICOM_METHOD1(HRESULT, GetSource, BSTR* ,pBstrSource) \
|
||||||
|
ICOM_METHOD1(HRESULT, GetDescription, BSTR*, pBstrDescription) \
|
||||||
|
ICOM_METHOD1(HRESULT, GetHelpFile, BSTR*, pBstrHelpFile) \
|
||||||
|
ICOM_METHOD1(HRESULT, GetHelpContext, DWORD*, pdwHelpContext)
|
||||||
|
#define IErrorInfo_IMETHODS \
|
||||||
|
IUnknown_IMETHODS \
|
||||||
|
IDispatch_IMETHODS \
|
||||||
|
IErrorInfo_METHODS
|
||||||
|
|
||||||
|
ICOM_DEFINE(IErrorInfo, IDispatch)
|
||||||
|
#undef ICOM_INTERFACE
|
||||||
|
|
||||||
|
/*** IUnknown methods ***/
|
||||||
|
#define IErrorInfo_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
|
||||||
|
#define IErrorInfo_AddRef(p) ICOM_CALL (AddRef,p)
|
||||||
|
#define IErrorInfo_Release(p) ICOM_CALL (Release,p)
|
||||||
|
/*** IDispatch methods ***/
|
||||||
|
#define IErrorInfo_GetTypeInfoCount(p,a) ICOM_CALL1 (GetTypeInfoCount,p,a)
|
||||||
|
#define IErrorInfo_GetTypeInfo(p,a,b,c) ICOM_CALL3 (GetTypeInfo,p,a,b,c)
|
||||||
|
#define IErrorInfo_GetIDsOfNames(p,a,b,c,d,e) ICOM_CALL5 (GetIDsOfNames,p,a,b,c,d,e)
|
||||||
|
#define IErrorInfo_Invoke(p,a,b,c,d,e,f,g,h) ICOM_CALL8 (Invoke,p,a,b,c,d,e,f,g,h)
|
||||||
|
/*** IErrorInfo methods ***/
|
||||||
|
#define IErrorInfo_GetGUID(p,a) ICOM_CALL1 (GetGUID,p,a)
|
||||||
|
#define IErrorInfo_GetSource(p,a) ICOM_CALL1 (GetSource,p,a)
|
||||||
|
#define IErrorInfo_GetDescription(p,a) ICOM_CALL1 (GetDescription,p,a)
|
||||||
|
#define IErrorInfo_GetHelpFile(p,a) ICOM_CALL1 (GetHelpFile,p,a)
|
||||||
|
#define IErrorInfo_GetHelpContext(p,a) ICOM_CALL1 (GetHelpContext,p,a)
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* ICreateErrorInfo
|
||||||
|
*/
|
||||||
|
#define ICOM_INTERFACE ICreateErrorInfo
|
||||||
|
#define ICreateErrorInfo_METHODS \
|
||||||
|
ICOM_METHOD1(HRESULT, SetGUID, REFGUID, rguid) \
|
||||||
|
ICOM_METHOD1(HRESULT, SetSource, LPOLESTR, szSource) \
|
||||||
|
ICOM_METHOD1(HRESULT, SetDescription, LPOLESTR, szDescription) \
|
||||||
|
ICOM_METHOD1(HRESULT, SetHelpFile, LPOLESTR, szHelpFile) \
|
||||||
|
ICOM_METHOD1(HRESULT, SetHelpContext, DWORD, dwHelpContext)
|
||||||
|
#define ICreateErrorInfo_IMETHODS \
|
||||||
|
IUnknown_IMETHODS \
|
||||||
|
IDispatch_IMETHODS \
|
||||||
|
ICreateErrorInfo_METHODS
|
||||||
|
|
||||||
|
ICOM_DEFINE(ICreateErrorInfo, IDispatch)
|
||||||
|
#undef ICOM_INTERFACE
|
||||||
|
|
||||||
|
/*** IUnknown methods ***/
|
||||||
|
#define ICreateErrorInfo_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
|
||||||
|
#define ICreateErrorInfo_AddRef(p) ICOM_CALL (AddRef,p)
|
||||||
|
#define ICreateErrorInfo_Release(p) ICOM_CALL (Release,p)
|
||||||
|
/*** ICreateErrorInfo methods ***/
|
||||||
|
#define ICreateErrorInfo_GetTypeInfoCount(p,a) ICOM_CALL1 (GetTypeInfoCount,p,a)
|
||||||
|
#define ICreateErrorInfo_GetTypeInfo(p,a,b,c) ICOM_CALL3 (GetTypeInfo,p,a,b,c)
|
||||||
|
#define ICreateErrorInfo_GetIDsOfNames(p,a,b,c,d,e) ICOM_CALL5 (GetIDsOfNames,p,a,b,c,d,e)
|
||||||
|
#define ICreateErrorInfo_Invoke(p,a,b,c,d,e,f,g,h) ICOM_CALL8 (Invoke,p,a,b,c,d,e,f,g,h)
|
||||||
|
/*** ICreateErrorInfo methods ***/
|
||||||
|
#define ICreateErrorInfo_SetGUID(p,a) ICOM_CALL1 (SetGUID,p,a)
|
||||||
|
#define ICreateErrorInfo_SetSource(p,a) ICOM_CALL1 (SetSource,p,a)
|
||||||
|
#define ICreateErrorInfo_SetDescription(p,a) ICOM_CALL1 (SetDescription,p,a)
|
||||||
|
#define ICreateErrorInfo_SetHelpFile(p,a) ICOM_CALL1 (SetHelpFile,p,a)
|
||||||
|
#define ICreateErrorInfo_SetHelpContext(p,a) ICOM_CALL1 (SetHelpContext,p,a)
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* ISupportErrorInfo
|
||||||
|
*/
|
||||||
|
#define ICOM_INTERFACE ISupportErrorInfo
|
||||||
|
#define ISupportErrorInfo_METHODS \
|
||||||
|
ICOM_METHOD1(HRESULT, InterfaceSupportsErrorInfo, REFIID, riid )
|
||||||
|
#define ISupportErrorInfo_IMETHODS \
|
||||||
|
IUnknown_IMETHODS \
|
||||||
|
IDispatch_IMETHODS \
|
||||||
|
ISupportErrorInfo_METHODS
|
||||||
|
|
||||||
|
ICOM_DEFINE(ISupportErrorInfo, IDispatch)
|
||||||
|
#undef ICOM_INTERFACE
|
||||||
|
|
||||||
|
/*** IUnknown methods ***/
|
||||||
|
#define ISupportErrorInfo_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
|
||||||
|
#define ISupportErrorInfo_AddRef(p) ICOM_CALL (AddRef,p)
|
||||||
|
#define ISupportErrorInfo_Release(p) ICOM_CALL (Release,p)
|
||||||
|
/*** ISupportErrorInfo methods ***/
|
||||||
|
#define ISupportErrorInfo_GetTypeInfoCount(p,a) ICOM_CALL1 (GetTypeInfoCount,p,a)
|
||||||
|
#define ISupportErrorInfo_GetTypeInfo(p,a,b,c) ICOM_CALL3 (GetTypeInfo,p,a,b,c)
|
||||||
|
#define ISupportErrorInfo_GetIDsOfNames(p,a,b,c,d,e) ICOM_CALL5 (GetIDsOfNames,p,a,b,c,d,e)
|
||||||
|
#define ISupportErrorInfo_Invoke(p,a,b,c,d,e,f,g,h) ICOM_CALL8 (Invoke,p,a,b,c,d,e,f,g,h)
|
||||||
|
/*** ISupportErrorInfo methods ***/
|
||||||
|
#define ISupportErrorInfo_InterfaceSupportsErrorInfo(p,a) ICOM_CALL1 (InterfaceSupportsErrorInfo,p,a)
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __WINE_WINE_OBJ_ERRORINFO_H */
|
|
@ -46,18 +46,6 @@ typedef struct ITypeLib2 ITypeLib2,*LPTYPELIB2;
|
||||||
DEFINE_OLEGUID(IID_ITypeInfo2, 0x00020412,0,0);
|
DEFINE_OLEGUID(IID_ITypeInfo2, 0x00020412,0,0);
|
||||||
typedef struct ITypeInfo2 ITypeInfo2,*LPTYPEINFO2;
|
typedef struct ITypeInfo2 ITypeInfo2,*LPTYPEINFO2;
|
||||||
|
|
||||||
DEFINE_GUID(IID_IErrorInfo, 0x1CF2B120,0x547D,0x101B,0x8E,0x65,
|
|
||||||
0x08,0x00, 0x2B,0x2B,0xD1,0x19);
|
|
||||||
typedef struct IErrorInfo IErrorInfo,*LPERRORINFO;
|
|
||||||
|
|
||||||
DEFINE_GUID(IID_ICreateErrorInfo, 0x22F03340,0x547D,0x101B,0x8E,0x65,
|
|
||||||
0x08,0x00, 0x2B,0x2B,0xD1,0x19);
|
|
||||||
typedef struct ICreateErrorInfo ICreateErrorInfo,*LPCREATEERRORINFO;
|
|
||||||
|
|
||||||
DEFINE_GUID(IID_ISupportErrorInfo, 0xDF0B3D60,0x547D,0x101B,0x8E,0x65,
|
|
||||||
0x08,0x00, 0x2B,0x2B,0xD1,0x19);
|
|
||||||
typedef struct ISupportErrorInfo ISupportErrorInfo,*LPSUPPORTERRORINFO;
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Automation data types
|
* Automation data types
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue