Go to the documentation of this file.00001 #pragma once
00002
00003 namespace AppSecInc
00004 {
00005 namespace Msi
00006 {
00007 namespace Exceptions
00008 {
00009 void MSI_EXCEPTION_HANDLER_PROLOG_impl(MSIHANDLE h, LPCTSTR func);
00010 DWORD MSI_COM_EXCEPTION_HANDLER_BLOCK_impl(MSIHANDLE h, LPCTSTR func, _com_error& e);
00011 DWORD MSI_STD_EXCEPTION_HANDLER_BLOCK_impl(MSIHANDLE h, LPCTSTR func, std::exception& e);
00012 DWORD MSI_ELLIPSIS_EXCEPTION_HANDLER_BLOCK_impl(MSIHANDLE h, LPCTSTR func);
00013 const DWORD default_error_code = ERROR_FUNCTION_FAILED;
00014 }
00015 }
00016 }
00017
00018 #define MSI_STD_EXCEPTION_HANDLER_BLOCK catch (std::exception& e) \
00019 { \
00020 return AppSecInc::Msi::Exceptions::MSI_STD_EXCEPTION_HANDLER_BLOCK_impl(hInstall, _T(__FUNCTION__), e); \
00021 }
00022
00023 #define MSI_COM_EXCEPTION_HANDLER_BLOCK catch (_com_error& e) \
00024 { \
00025 return AppSecInc::Msi::Exceptions::MSI_COM_EXCEPTION_HANDLER_BLOCK_impl(hInstall, _T(__FUNCTION__), e); \
00026 }
00027
00028 #define MSI_ELLIPSIS_EXCEPTION_HANDLER_BLOCK catch (...) \
00029 { \
00030 return AppSecInc::Msi::Exceptions::MSI_ELLIPSIS_EXCEPTION_HANDLER_BLOCK_impl(hInstall, _T(__FUNCTION__)); \
00031 }
00032
00033 #define MSI_EXCEPTION_HANDLER_PROLOG try { \
00034 AppSecInc::Msi::Exceptions::MSI_EXCEPTION_HANDLER_PROLOG_impl(hInstall, _T(__FUNCTION__));
00035
00036 #define MSI_EXCEPTION_HANDLER_EPILOG } \
00037 MSI_STD_EXCEPTION_HANDLER_BLOCK \
00038 MSI_COM_EXCEPTION_HANDLER_BLOCK \
00039 MSI_ELLIPSIS_EXCEPTION_HANDLER_BLOCK