ReactOS 0.4.15-dev-8419-g7f0e8a3
comsupp.cpp File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <comdef.h>
Include dependency graph for comsupp.cpp:

Go to the source code of this file.

Namespaces

namespace  _com_util
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 

Typedefs

typedef void WINAPI COM_ERROR_HANDLER(HRESULT, IErrorInfo *)
 

Functions

void WINAPI _com_raise_error (HRESULT hr, IErrorInfo *perrinfo)
 
void WINAPI _set_com_error_handler (COM_ERROR_HANDLER *phandler)
 
void WINAPI _com_issue_error (HRESULT hr)
 
void WINAPI _com_issue_errorex (HRESULT hr, IUnknown *punk, REFIID riid)
 
_variant_t vtMissing (DISP_E_PARAMNOTFOUND, VT_ERROR)
 
BSTR WINAPI _com_util::ConvertStringToBSTR (const char *pSrc)
 
char *WINAPI _com_util::ConvertBSTRToString (BSTR pSrc)
 

Variables

static COM_ERROR_HANDLERcom_error_handler
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 12 of file comsupp.cpp.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 11 of file comsupp.cpp.

Typedef Documentation

◆ COM_ERROR_HANDLER

typedef void WINAPI COM_ERROR_HANDLER(HRESULT, IErrorInfo *)

Definition at line 19 of file comsupp.cpp.

Function Documentation

◆ _com_issue_error()

void WINAPI _com_issue_error ( HRESULT  hr)

Definition at line 32 of file comsupp.cpp.

33{
35}
static COM_ERROR_HANDLER * com_error_handler
Definition: comsupp.cpp:20
#define NULL
Definition: types.h:112
HRESULT hr
Definition: shlfolder.c:183

Referenced by _com_util::ConvertBSTRToString(), _com_util::ConvertStringToBSTR(), and ConvertUTF8StringToBSTR().

◆ _com_issue_errorex()

void WINAPI _com_issue_errorex ( HRESULT  hr,
IUnknown punk,
REFIID  riid 
)

Definition at line 37 of file comsupp.cpp.

38{
39 void *pv;
40 IErrorInfo *perrinfo = NULL;
41
42 if (SUCCEEDED(punk->QueryInterface(riid, &pv)))
43 {
44 ISupportErrorInfo *pserrinfo = static_cast<ISupportErrorInfo *>(pv);
45 if (pserrinfo->InterfaceSupportsErrorInfo(riid) == S_OK)
46 (void)GetErrorInfo(0, &perrinfo);
47 pserrinfo->Release();
48 }
49
50 com_error_handler(hr, perrinfo);
51}
HRESULT WINAPI GetErrorInfo(ULONG dwReserved, IErrorInfo **pperrinfo)
Definition: errorinfo.c:417
REFIID riid
Definition: atlbase.h:39
HRESULT InterfaceSupportsErrorInfo([in] REFIID riid)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
ULONG Release()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50

◆ _com_raise_error()

void WINAPI _com_raise_error ( HRESULT  hr,
IErrorInfo perrinfo 
)

Definition at line 22 of file comsupp.cpp.

23{
24 throw _com_error(hr, perrinfo);
25}

◆ _set_com_error_handler()

void WINAPI _set_com_error_handler ( COM_ERROR_HANDLER phandler)

Definition at line 27 of file comsupp.cpp.

28{
29 com_error_handler = phandler;
30}

◆ vtMissing()

_variant_t vtMissing ( DISP_E_PARAMNOTFOUND  ,
VT_ERROR   
)

Variable Documentation

◆ com_error_handler

COM_ERROR_HANDLER* com_error_handler
static

Definition at line 20 of file comsupp.cpp.

Referenced by _com_issue_error(), _com_issue_errorex(), and _set_com_error_handler().