ReactOS  0.4.13-dev-73-gcfe54aa
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

 _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 11 of file comsupp.cpp.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 10 of file comsupp.cpp.

Typedef Documentation

◆ COM_ERROR_HANDLER

typedef void WINAPI COM_ERROR_HANDLER(HRESULT, IErrorInfo *)

Definition at line 18 of file comsupp.cpp.

Function Documentation

◆ _com_issue_error()

void WINAPI _com_issue_error ( HRESULT  hr)

Definition at line 31 of file comsupp.cpp.

32 {
34 }
HRESULT hr
Definition: shlfolder.c:183
smooth NULL
Definition: ftsmooth.c:416
static COM_ERROR_HANDLER * com_error_handler
Definition: comsupp.cpp:19

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 36 of file comsupp.cpp.

37 {
38  void *pv;
39  IErrorInfo *perrinfo = NULL;
40 
41  if (SUCCEEDED(punk->QueryInterface(riid, &pv)))
42  {
43  ISupportErrorInfo *pserrinfo = static_cast<ISupportErrorInfo *>(pv);
44  if (pserrinfo->InterfaceSupportsErrorInfo(riid) == S_OK)
45  (void)GetErrorInfo(0, &perrinfo);
46  pserrinfo->Release();
47  }
48 
49  com_error_handler(hr, perrinfo);
50 }
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
ULONG Release()
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI GetErrorInfo(ULONG dwReserved, IErrorInfo **pperrinfo)
Definition: errorinfo.c:418
#define S_OK
Definition: intsafe.h:59
HRESULT InterfaceSupportsErrorInfo([in] REFIID riid)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
static COM_ERROR_HANDLER * com_error_handler
Definition: comsupp.cpp:19
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ _com_raise_error()

void WINAPI _com_raise_error ( HRESULT  hr,
IErrorInfo perrinfo 
)

Definition at line 21 of file comsupp.cpp.

22 {
23  throw _com_error(hr, perrinfo);
24 }
HRESULT hr
Definition: shlfolder.c:183

◆ _set_com_error_handler()

void WINAPI _set_com_error_handler ( COM_ERROR_HANDLER phandler)

Definition at line 26 of file comsupp.cpp.

27 {
28  com_error_handler = phandler;
29 }
static COM_ERROR_HANDLER * com_error_handler
Definition: comsupp.cpp:19

◆ vtMissing()

_variant_t vtMissing ( DISP_E_PARAMNOTFOUND  ,
VT_ERROR   
)

Variable Documentation

◆ com_error_handler

COM_ERROR_HANDLER* com_error_handler
static

Definition at line 19 of file comsupp.cpp.

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