src/Common/Exception/Handlers.h

Go to the documentation of this file.
00001 #pragma once
00002 
00003 namespace AppSecInc
00004 {
00005         namespace Exceptions
00006         {
00007                 void COM_EXCEPTION_HANDLER_BLOCK_impl(_com_error& e);
00008                 void STD_EXCEPTION_HANDLER_BLOCK_impl(std::exception& e);
00009                 void ELLIPSIS_EXCEPTION_HANDLER_BLOCK_impl();
00010                 const HRESULT default_error_code = E_FAIL;
00011         }
00012 }
00013 
00014 #define STD_EXCEPTION_HANDLER_BLOCK catch (std::exception& e) { AppSecInc::Exceptions::STD_EXCEPTION_HANDLER_BLOCK_impl(e); return AppSecInc::Exceptions::default_error_code; }
00015 #define COM_EXCEPTION_HANDLER_BLOCK catch (_com_error& e) { AppSecInc::Exceptions::COM_EXCEPTION_HANDLER_BLOCK_impl(e); return e.Error(); }
00016 #define ELLIPSIS_EXCEPTION_HANDLER_BLOCK catch (...) { AppSecInc::Exceptions::ELLIPSIS_EXCEPTION_HANDLER_BLOCK_impl(); return E_UNEXPECTED; }
00017 
00018 #define EXCEPTION_HANDLER_PROLOG try {
00019 #define EXCEPTION_HANDLER_EPILOG  } STD_EXCEPTION_HANDLER_BLOCK COM_EXCEPTION_HANDLER_BLOCK ELLIPSIS_EXCEPTION_HANDLER_BLOCK


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