STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Functions
_com_util Namespace Reference

Functions

void CheckError (HRESULT hr)
 
static HRESULT UIntAdd (UINT uAugend, UINT uAddend, UINT *puResult)
 
static HRESULT UIntMult (UINT uMultiplicand, UINT uMultiplier, UINT *puResult)
 
BSTR __stdcall ConvertStringToBSTR (const char *pSrc)
 
char *__stdcall ConvertBSTRToString (BSTR pSrc)
 

Function Documentation

void _com_util::CheckError ( HRESULT  hr)
inline
95  {
96  if (FAILED(hr)) {
97  _com_issue_error(hr);
98  }
99  }
void __stdcall _com_issue_error(HRESULT)
#define FAILED(hr)
Definition: comutil.h:71
char* __stdcall _com_util::ConvertBSTRToString ( BSTR  pSrc)
BSTR __stdcall _com_util::ConvertStringToBSTR ( const char pSrc)
static HRESULT _com_util::UIntAdd ( UINT  uAugend,
UINT  uAddend,
UINT *  puResult 
)
static
101  {
102  if((uAugend + uAddend) < uAddend)
103  {
105  }
106  *puResult = uAugend + uAddend;
107  return S_OK;
108  }
#define S_OK
Definition: comutil.h:62
#define INTSAFE_E_ARITHMETIC_OVERFLOW
Definition: comutil.h:65
static HRESULT _com_util::UIntMult ( UINT  uMultiplicand,
UINT  uMultiplier,
UINT *  puResult 
)
static
111  {
112  ULONGLONG ull64Result = UInt32x32To64(uMultiplicand, uMultiplier);
113  if(ull64Result <= INTSAFE_UINT_MAX)
114  {
115  *puResult = (UINT)ull64Result;
116  return S_OK;
117  }
119  }
#define S_OK
Definition: comutil.h:62
#define INTSAFE_UINT_MAX
Definition: comutil.h:68
#define INTSAFE_E_ARITHMETIC_OVERFLOW
Definition: comutil.h:65