Handlers.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace AppSecInc
4 {
5  namespace Msi
6  {
7  namespace Exceptions
8  {
9  void MSI_EXCEPTION_HANDLER_PROLOG_impl(MSIHANDLE h, LPCTSTR func);
10  DWORD MSI_COM_EXCEPTION_HANDLER_BLOCK_impl(MSIHANDLE h, LPCTSTR func, _com_error& e);
11  DWORD MSI_STD_EXCEPTION_HANDLER_BLOCK_impl(MSIHANDLE h, LPCTSTR func, std::exception& e);
12  DWORD MSI_ELLIPSIS_EXCEPTION_HANDLER_BLOCK_impl(MSIHANDLE h, LPCTSTR func);
13  const DWORD default_error_code = ERROR_FUNCTION_FAILED;
14  }
15  }
16 }
17 
18 #define MSI_STD_EXCEPTION_HANDLER_BLOCK catch (std::exception& e) \
19 { \
20  return AppSecInc::Msi::Exceptions::MSI_STD_EXCEPTION_HANDLER_BLOCK_impl(hInstall, _T(__FUNCTION__), e); \
21 }
22 
23 #define MSI_COM_EXCEPTION_HANDLER_BLOCK catch (_com_error& e) \
24 { \
25  return AppSecInc::Msi::Exceptions::MSI_COM_EXCEPTION_HANDLER_BLOCK_impl(hInstall, _T(__FUNCTION__), e); \
26 }
27 
28 #define MSI_ELLIPSIS_EXCEPTION_HANDLER_BLOCK catch (...) \
29 { \
30  return AppSecInc::Msi::Exceptions::MSI_ELLIPSIS_EXCEPTION_HANDLER_BLOCK_impl(hInstall, _T(__FUNCTION__)); \
31 }
32 
33 #define MSI_EXCEPTION_HANDLER_PROLOG try { \
34  AppSecInc::Msi::Exceptions::MSI_EXCEPTION_HANDLER_PROLOG_impl(hInstall, _T(__FUNCTION__));
35 
36 #define MSI_EXCEPTION_HANDLER_EPILOG } \
37  MSI_STD_EXCEPTION_HANDLER_BLOCK \
38  MSI_COM_EXCEPTION_HANDLER_BLOCK \
39  MSI_ELLIPSIS_EXCEPTION_HANDLER_BLOCK
DWORD MSI_COM_EXCEPTION_HANDLER_BLOCK_impl(MSIHANDLE h, LPCTSTR func, _com_error &e)
Definition: Handlers.cpp:4
const DWORD default_error_code
Definition: Handlers.h:13
void MSI_EXCEPTION_HANDLER_PROLOG_impl(MSIHANDLE h, LPCTSTR func)
Definition: Handlers.cpp:55
DWORD MSI_ELLIPSIS_EXCEPTION_HANDLER_BLOCK_impl(MSIHANDLE h, LPCTSTR func)
Definition: Handlers.cpp:40
DWORD MSI_STD_EXCEPTION_HANDLER_BLOCK_impl(MSIHANDLE h, LPCTSTR func, std::exception &e)
Definition: Handlers.cpp:25


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