combase: Move SetErrorInfo().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-08-17 10:20:52 +03:00 committed by Alexandre Julliard
parent ed092274c4
commit f26b1f0392
5 changed files with 28 additions and 80 deletions

View File

@ -317,7 +317,7 @@
@ stdcall RoUninitialize()
@ stub RoUnregisterForApartmentShutdown
@ stub SetCleanupFlag
@ stdcall SetErrorInfo(long ptr) ole32.SetErrorInfo
@ stdcall SetErrorInfo(long ptr)
@ stub SetRestrictedErrorInfo
@ stdcall StringFromCLSID(ptr ptr)
@ stdcall StringFromGUID2(ptr ptr long)

View File

@ -384,3 +384,29 @@ HRESULT WINAPI GetErrorInfo(ULONG reserved, IErrorInfo **error_info)
return S_OK;
}
/***********************************************************************
* SetErrorInfo (combase.@)
*/
HRESULT WINAPI SetErrorInfo(ULONG reserved, IErrorInfo *error_info)
{
struct tlsdata *tlsdata;
HRESULT hr;
TRACE("%u, %p\n", reserved, error_info);
if (reserved)
return E_INVALIDARG;
if (FAILED(hr = com_get_tlsdata(&tlsdata)))
return hr;
if (tlsdata->errorinfo)
IErrorInfo_Release(tlsdata->errorinfo);
tlsdata->errorinfo = error_info;
if (error_info)
IErrorInfo_AddRef(error_info);
return S_OK;
}

View File

@ -17,7 +17,6 @@ C_SRCS = \
datacache.c \
defaulthandler.c \
dictionary.c \
errorinfo.c \
filelockbytes.c \
filemoniker.c \
ftmarshal.c \

View File

@ -1,77 +0,0 @@
/*
* ErrorInfo API
*
* Copyright 2000 Patrik Stridvall, Juergen Schmied
*
* 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
*
* NOTES:
*
* The errorinfo is a per-thread object. The reference is stored in the
* TEB at offset 0xf80.
*/
#include <stdarg.h>
#include <string.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "oleauto.h"
#include "winerror.h"
#include "compobj_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole);
/***********************************************************************
* 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;
}

View File

@ -262,7 +262,7 @@
@ stdcall STGMEDIUM_UserUnmarshal(ptr ptr ptr)
@ stdcall SetConvertStg(ptr long)
@ stub SetDocumentBitStg
@ stdcall SetErrorInfo(long ptr)
@ stdcall SetErrorInfo(long ptr) combase.SetErrorInfo
@ stdcall StgConvertPropertyToVariant(ptr long ptr ptr)
@ stdcall StgConvertVariantToProperty(ptr long ptr ptr long long ptr)
@ stdcall StgCreateDocfile(wstr long long ptr)