资源简介
WinDbg 从SDK中安装,Debugging Tools for Windows (x86)目录所有文件,绿色含帮助文档
代码片段和文件信息
//----------------------------------------------------------------------------
//
// C++ dbgeng extension framework.
//
// Copyright (C) Microsoft Corporation 2005-2006.
//
//----------------------------------------------------------------------------
#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))
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);
}
m_ProcessId =
- 上一篇:微信小程序红包源代码
- 下一篇:ECOS开发文档详细档案
相关资源
- windbg (Debugging Tools for Windows)
- Windows 高级调试 (带书签目录)
- Debugging Tools for WindowsX86+X64
- windbg x64官方安装包
- Debugging Tools for Windows (x64)
- windbg 10.0版本 适用于win10
- windbg windebug 最新版 for win10
- VistaLKD Vista下动态打开本机内核调试功
- Windbg 10.0.18362.1__win10 1903版 (最新版)
- WinDbg 6.11.0001.404汉化版
- WingDbg_v1.0.zip
评论
共有 条评论