2015-04-25 10:25:10 +00:00
|
|
|
#ifndef __EXCEPT_H
|
|
|
|
#define __EXCEPT_H
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CheckException
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
#ifndef FACILITY_VISUALCPP
|
|
|
|
#define FACILITY_VISUALCPP ((LONG)0x6d)
|
|
|
|
#endif
|
|
|
|
#define VcppException(sev,err) ((sev) | (FACILITY_VISUALCPP<<16) | err)
|
|
|
|
|
|
|
|
inline int CheckException(DWORD code)
|
|
|
|
{
|
|
|
|
if (code == VcppException(ERROR_SEVERITY_ERROR,ERROR_MOD_NOT_FOUND) ||
|
|
|
|
code == VcppException(ERROR_SEVERITY_ERROR,ERROR_PROC_NOT_FOUND))
|
|
|
|
{
|
|
|
|
return EXCEPTION_EXECUTE_HANDLER;
|
|
|
|
}
|
|
|
|
return EXCEPTION_CONTINUE_SEARCH;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2015-04-27 11:19:34 +00:00
|
|
|
#ifdef __try
|
|
|
|
#undef __try
|
|
|
|
#endif
|
2015-04-25 10:25:10 +00:00
|
|
|
#define __try
|
2015-04-27 11:19:34 +00:00
|
|
|
|
|
|
|
#ifdef __except
|
|
|
|
#undef __except
|
|
|
|
#endif
|
2015-04-25 10:25:10 +00:00
|
|
|
#define __except(a) if (0)
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|