Macros
Macros.h File Reference

Go to the source code of this file.

Macros

#define CHECK_WIN32_DWORD(func, message)
 
#define CHECK_WIN32_BOOL(func, message)
 
#define CHECK_BOOL(func, message)
 
#define THROW(message)
 
#define CHECK_HR(func, message)
 

Macro Definition Documentation

#define CHECK_BOOL (   func,
  message 
)
Value:
{ \
if ( FALSE == ( func ) ) \
{ \
std::wstringstream ss_message; ss_message << message; \
throw std::exception(AppSecInc::StringUtils::wc2mb(ss_message.str()).c_str()); \
} \
}
std::string wc2mb(const std::wstring &from)
Definition: StringUtils.cpp:184
#define CHECK_HR (   func,
  message 
)
Value:
{ \
HRESULT asi_macro_hr_ = ( func ); \
if (FAILED(asi_macro_hr_)) \
{ \
std::wstringstream ss_message; ss_message << message; \
throw std::exception(AppSecInc::Exception::Win32Exception::GetErrorString(asi_macro_hr_, \
ss_message.str().c_str()).c_str()); \
} \
}
std::string GetErrorString(DWORD dwErr, LPCTSTR error=NULL)
Exception from an error code.
Definition: Win32Exception.cpp:21
#define CHECK_WIN32_BOOL (   func,
  message 
)
Value:
{ \
if ( FALSE == ( func ) ) \
{ \
std::wstringstream ss_message; ss_message << message; \
ss_message.str().c_str()).c_str()); \
} \
}
std::string GetLastErrorString(LPCTSTR error=NULL)
Exception from GetLastError.
Definition: Win32Exception.cpp:26
#define CHECK_WIN32_DWORD (   func,
  message 
)
Value:
{ \
DWORD asi_macro_dw_err_ = ( func ); \
if ( asi_macro_dw_err_ != 0 ) \
{ \
std::wstringstream ss_message; ss_message << message; \
throw std::exception(AppSecInc::Exception::Win32Exception::GetErrorString(asi_macro_dw_err_, \
ss_message.str().c_str()).c_str()); \
} \
}
std::string GetErrorString(DWORD dwErr, LPCTSTR error=NULL)
Exception from an error code.
Definition: Win32Exception.cpp:21
#define THROW (   message)
Value:
{ \
std::wstringstream ss_message; ss_message << message; \
throw std::exception(AppSecInc::StringUtils::wc2mb(ss_message.str()).c_str()); \
}
std::string wc2mb(const std::wstring &from)
Definition: StringUtils.cpp:184


© Application Security Inc. - All Rights Reserved http://msiext.codeplex.com