/*********************************************************************** * SetErrorInfo (OLE32.@) * * Sets the error information object for the current thread. * * PARAMS * dwReserved [I] Reserved. Must be zero. * perrinfo [I] Error info object. * * RETURNS * Success: S_OK. * Failure: E_INVALIDARG if dwReserved is not zero. */ HRESULT WINAPI SetErrorInfo(ULONG dwReserved, IErrorInfo *perrinfo) { IErrorInfo * pei; TRACE("(%d, %p)\n", dwReserved, perrinfo); if (dwReserved) { ERR("dwReserved (0x%x) != 0\n", dwReserved); return E_INVALIDARG; } /* release old errorinfo */ pei = COM_CurrentInfo()->errorinfo; if (pei) IErrorInfo_Release(pei); /* set to new value */ COM_CurrentInfo()->errorinfo = perrinfo; if (perrinfo) IErrorInfo_AddRef(perrinfo); return S_OK; }
static ULONG WINAPI ISupportErrorInfoImpl_AddRef(ISupportErrorInfo* iface) { ErrorInfoImpl *This = impl_from_ISupportErrorInfo(iface); return IErrorInfo_AddRef(&This->IErrorInfo_iface); }
static ULONG WINAPI WINAPI errorrec_AddRef(IErrorRecords *iface) { errorrecords *This = impl_from_IErrorRecords(iface); return IErrorInfo_AddRef(&This->IErrorInfo_iface); }