mirror of
https://github.com/reactos/reactos.git
synced 2025-06-25 11:49:42 +00:00
[SHELL/EXPERIMENTS]
* Create a branch for some evul shell experiments. svn path=/branches/shell-experiments/; revision=61927
This commit is contained in:
parent
d09f611410
commit
527f2f9057
20177 changed files with 0 additions and 1312061 deletions
53
lib/sdk/comsupp/comsupp.cpp
Normal file
53
lib/sdk/comsupp/comsupp.cpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* PROJECT: ReactOS crt library
|
||||
* LICENSE: GPLv2+ - See COPYING in the top level directory
|
||||
* PURPOSE: Compiler support for COM
|
||||
* PROGRAMMER: Thomas Faber (thomas.faber@reactos.org)
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#define WIN32_NO_STATUS
|
||||
#define _INC_WINDOWS
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <comdef.h>
|
||||
|
||||
/* comdef.h */
|
||||
typedef void WINAPI COM_ERROR_HANDLER(HRESULT, IErrorInfo *);
|
||||
static COM_ERROR_HANDLER *com_error_handler;
|
||||
|
||||
void WINAPI _com_raise_error(HRESULT hr, IErrorInfo *perrinfo)
|
||||
{
|
||||
throw _com_error(hr, perrinfo);
|
||||
}
|
||||
|
||||
void WINAPI _set_com_error_handler(COM_ERROR_HANDLER *phandler)
|
||||
{
|
||||
com_error_handler = phandler;
|
||||
}
|
||||
|
||||
void WINAPI _com_issue_error(HRESULT hr)
|
||||
{
|
||||
com_error_handler(hr, NULL);
|
||||
}
|
||||
|
||||
void WINAPI _com_issue_errorex(HRESULT hr, IUnknown *punk, REFIID riid)
|
||||
{
|
||||
void *pv;
|
||||
IErrorInfo *perrinfo = NULL;
|
||||
|
||||
if (SUCCEEDED(punk->QueryInterface(riid, &pv)))
|
||||
{
|
||||
ISupportErrorInfo *pserrinfo = static_cast<ISupportErrorInfo *>(pv);
|
||||
if (pserrinfo->InterfaceSupportsErrorInfo(riid) == S_OK)
|
||||
(void)GetErrorInfo(0, &perrinfo);
|
||||
pserrinfo->Release();
|
||||
}
|
||||
|
||||
com_error_handler(hr, perrinfo);
|
||||
}
|
||||
|
||||
/* comutil.h */
|
||||
_variant_t vtMissing(DISP_E_PARAMNOTFOUND, VT_ERROR);
|
Loading…
Add table
Add a link
Reference in a new issue