Defines

src/Common/Exception/Macros.h File Reference

Go to the source code of this file.

Defines

#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)

Define 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()); \
        } \
}
#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()); \
        } \
}
#define CHECK_WIN32_BOOL (   func,
  message 
)
Value:
{ \
        if ( FALSE == ( func ) ) \
        { \
                std::wstringstream ss_message; ss_message << message; \
        throw std::exception(AppSecInc::Exception::Win32Exception::GetLastErrorString( \
            ss_message.str().c_str()).c_str()); \
        } \
}
#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()); \
        } \
}
#define THROW (   message)
Value:
{ \
        std::wstringstream ss_message; ss_message << message; \
        throw std::exception(AppSecInc::StringUtils::wc2mb(ss_message.str()).c_str()); \
}


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