資源簡介
1. 程序崩潰后,讓它能自動重啟,繼續運行。
2. 對崩潰的程序,在退出前,自動在控制臺上輸出其退出堆棧詳情,以便調試。(適合自動測試程序)

代碼片段和文件信息
//----------------------------------------------------------------------------
//
//?C++?dbgeng?extension?framework.
//
//?Copyright?(C)?Microsoft?Corporation?2005-2009.
//
//----------------------------------------------------------------------------
#include?
#include?
#include?
#if?defined(_PREFAST_)?||?defined(_PREFIX_)
#define?PRE_ASSUME(_Cond)?__analysis_assume(_Cond)
#else
#define?PRE_ASSUME(_Cond)
#endif
#define?IsSpace(_Char)?isspace((UCHAR)(_Char))
PEXT_DLL_MAIN?g_ExtDllMain;
WINDBG_EXTENSION_APIS64?ExtensionApis;
ExtCheckedPointer
????g_Ext(“g_Ext?not?set?used?outside?of?a?command“);
//----------------------------------------------------------------------------
//
//?ExtException?family.
//
//----------------------------------------------------------------------------
void
ExtException::PrintMessageVa(__in_ecount(BufferChars)?PSTR?Buffer
?????????????????????????????__in?ULONG?BufferChars
?????????????????????????????__in?PCSTR?Format
?????????????????????????????__in?va_list?Args)
{
????StringCchVPrintfA(Buffer?BufferChars?Format?Args);
????m_Message?=?Buffer;
}
void?WINAPIV
ExtException::PrintMessage(__in_ecount(BufferChars)?PSTR?Buffer
???????????????????????????__in?ULONG?BufferChars
???????????????????????????__in?PCSTR?Format
???????????????????????????...)
{
????va_list?Args;
????va_start(Args?Format);
????PrintMessageVa(Buffer?BufferChars?Format?Args);
????va_end(Args);
}
//----------------------------------------------------------------------------
//
//?Holders.
//
//----------------------------------------------------------------------------
void
ExtCurrentThreadHolder::Refresh(void)
{
????HRESULT?Status;
????
????if?((Status?=?g_Ext->m_System->
?????????GetCurrentThreadId(&m_ThreadId))?!=?S_OK)
????{
????????throw?ExtStatusException(Status
?????????????????????????????????“ExtCurrentThreadHolder::Refresh?failed“);
????}
}
void
ExtCurrentThreadHolder::Restore(void)
{
????if?(m_ThreadId?!=?DEBUG_ANY_ID)
????{
????????PRE_ASSUME(g_Ext.IsSet());
????????if?(g_Ext.IsSet())
????????{
????????????//?Ensure?that?g_Ext->?operator?will?not?throw?exception.
????????????g_Ext->m_System->SetCurrentThreadId(m_ThreadId);
????????}
????????m_ThreadId?=?DEBUG_ANY_ID;
????}
}
void
ExtCurrentProcessHolder::Refresh(void)
{
????HRESULT?Status;
????
????if?((Status?=?g_Ext->m_System->
?????????GetCurrentProcessId(&m_ProcessId))?!=?S_OK)
????{
????????throw?ExtStatusException(Status
?????????????????????????????????“ExtCurrentProcessHolder::Refresh?failed“);
????}
}
void
ExtCurrentProcessHolder::Restore(void)
{
????if?(m_ProcessId?!=?DEBUG_ANY_ID)
????{
????????PRE_ASSUME(g_Ext.IsSet());
????????if?(g_Ext.IsSet())
????????{
????????????//?Ensure?that?g_Ext->?operator?will?not?throw?exception.
????????????g_Ext->m_System->SetCurrentProcessId(m_ProcessId);
?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????418558??2009-08-24?14:38??Prj_Lib\Debuggers\sdk\help\dbghelp.chm
?????文件?????534968??2009-09-18?11:35??Prj_Lib\Debuggers\sdk\inc\dbgeng.h
?????文件?????129227??2010-06-12?16:56??Prj_Lib\Debuggers\sdk\inc\dbghelp.h
?????文件?????133066??2009-09-18?11:35??Prj_Lib\Debuggers\sdk\inc\engextcpp.cpp
?????文件?????105869??2010-02-01?12:00??Prj_Lib\Debuggers\sdk\inc\engextcpp.hpp
?????文件??????60824??2010-01-19?14:42??Prj_Lib\Debuggers\sdk\inc\extsfns.h
?????文件??????76601??2009-09-18?11:35??Prj_Lib\Debuggers\sdk\inc\wdbgexts.h
?????文件???????2094??2010-02-01?12:14??Prj_Lib\Debuggers\sdk\lib\amd64\dbgeng.lib
?????文件??????43712??2010-02-01?12:14??Prj_Lib\Debuggers\sdk\lib\amd64\dbghelp.lib
?????文件????1081276??2010-02-01?12:15??Prj_Lib\Debuggers\sdk\lib\amd64\engextcpp.lib
?????文件???????2140??2010-02-01?12:07??Prj_Lib\Debuggers\sdk\lib\i386\dbgeng.lib
?????文件??????48050??2010-02-01?12:07??Prj_Lib\Debuggers\sdk\lib\i386\dbghelp.lib
?????文件?????814508??2010-02-01?12:06??Prj_Lib\Debuggers\sdk\lib\i386\engextcpp.lib
?????文件???????2204??2010-02-01?12:21??Prj_Lib\Debuggers\sdk\lib\ia64\dbgeng.lib
?????文件??????52464??2010-02-01?12:21??Prj_Lib\Debuggers\sdk\lib\ia64\dbghelp.lib
?????文件????1405292??2010-02-01?12:22??Prj_Lib\Debuggers\sdk\lib\ia64\engextcpp.lib
?????文件??????12445??2009-08-24?14:38??Prj_Lib\Debuggers\sdk\samples\adp_ext\adp_ext.cpp
?????文件????????310??2009-08-24?14:38??Prj_Lib\Debuggers\sdk\samples\adp_ext\adp_ext.def
?????文件????????342??2009-08-24?14:38??Prj_Lib\Debuggers\sdk\samples\adp_ext\adp_ext.rc
?????文件???????2564??2009-08-24?14:38??Prj_Lib\Debuggers\sdk\samples\adp_ext\dbgexts.cpp
?????文件???????1324??2009-08-24?14:38??Prj_Lib\Debuggers\sdk\samples\adp_ext\dbgexts.h
?????文件????????247??2009-08-24?14:38??Prj_Lib\Debuggers\sdk\samples\adp_ext\makefile
?????文件????????599??2009-08-24?14:38??Prj_Lib\Debuggers\sdk\samples\adp_ext\sources
?????文件???????1655??2009-08-24?14:38??Prj_Lib\Debuggers\sdk\samples\analyze_continue\continue_known.xm
?????文件???????1186??2009-08-24?14:38??Prj_Lib\Debuggers\sdk\samples\analyze_continue\continue_known.xsd
?????文件???????8185??2009-08-24?14:38??Prj_Lib\Debuggers\sdk\samples\assert\assert.cpp
?????文件????????247??2009-08-24?14:38??Prj_Lib\Debuggers\sdk\samples\assert\makefile
?????文件???????1365??2009-08-24?14:38??Prj_Lib\Debuggers\sdk\samples\assert\out.cpp
?????文件????????843??2009-08-24?14:38??Prj_Lib\Debuggers\sdk\samples\assert\out.hpp
?????文件????????536??2009-08-24?14:38??Prj_Lib\Debuggers\sdk\samples\assert\sources
............此處省略77個文件信息
- 上一篇:日語句型地道表達500例
- 下一篇:net小區物業管理系統源碼.rar
評論
共有 條評論