Headers diff for dbgeng.dll between 6.1.7601.17514-Windows_7.0 and 6.3.9600.17415-Windows_8.1 versions



 dbgeng.h (6.1.7601.17514-Windows_7.0)   dbgeng.h (6.3.9600.17415-Windows_8.1) 
skipping to change at line 12 skipping to change at line 12
// //
// Debugger engine interfaces. // Debugger engine interfaces.
// //
// Copyright (c) Microsoft Corporation. All rights reserved. // Copyright (c) Microsoft Corporation. All rights reserved.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#ifndef __DBGENG_H__ #ifndef __DBGENG_H__
#define __DBGENG_H__ #define __DBGENG_H__
#include <winapifamily.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#include <stdarg.h> #include <stdarg.h>
#include <objbase.h> #include <objbase.h>
#ifndef _WDBGEXTS_ #ifndef _WDBGEXTS_
typedef struct _WINDBG_EXTENSION_APIS32* PWINDBG_EXTENSION_APIS32; typedef struct _WINDBG_EXTENSION_APIS32* PWINDBG_EXTENSION_APIS32;
typedef struct _WINDBG_EXTENSION_APIS64* PWINDBG_EXTENSION_APIS64; typedef struct _WINDBG_EXTENSION_APIS64* PWINDBG_EXTENSION_APIS64;
#endif #endif
#ifndef _CRASHLIB_ #ifndef _CRASHLIB_
typedef struct _MEMORY_BASIC_INFORMATION64* PMEMORY_BASIC_INFORMATION64; typedef struct _MEMORY_BASIC_INFORMATION64* PMEMORY_BASIC_INFORMATION64;
#endif #endif
#ifndef __specstrings
// Should include SpecStrings.h to get proper definitions.
#define __in
#define __in_opt
#define __in_bcount(x)
#define __in_bcount_opt(x)
#define __in_ecount(x)
#define __in_ecount_opt(x)
#define __out
#define __out_opt
#define __out_bcount(x)
#define __out_bcount_opt(x)
#define __out_ecount(x)
#define __out_ecount_opt(x)
#define __out_xcount(x)
#define __inout
#define __inout_opt
#define __reserved
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// Special exception code extensions could throw
//
//----------------------------------------------------------------------------
#define ERROR_DBG_CANCELLED 0xC00004C7 // 0xC0000000 + ERROR_CANCELLED
#define ERROR_DBG_TIMEOUT 0xC00005B4 // 0xC0000000 + ERROR_TIMEOUT
//----------------------------------------------------------------------------
//
// GUIDs and interface forward declarations. // GUIDs and interface forward declarations.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
/* f2df5f53-071f-47bd-9de6-5734c3fed689 */ /* f2df5f53-071f-47bd-9de6-5734c3fed689 */
DEFINE_GUID(IID_IDebugAdvanced, 0xf2df5f53, 0x071f, 0x47bd, DEFINE_GUID(IID_IDebugAdvanced, 0xf2df5f53, 0x071f, 0x47bd,
0x9d, 0xe6, 0x57, 0x34, 0xc3, 0xfe, 0xd6, 0x89); 0x9d, 0xe6, 0x57, 0x34, 0xc3, 0xfe, 0xd6, 0x89);
/* 716d14c9-119b-4ba5-af1f-0890e672416a */ /* 716d14c9-119b-4ba5-af1f-0890e672416a */
DEFINE_GUID(IID_IDebugAdvanced2, 0x716d14c9, 0x119b, 0x4ba5, DEFINE_GUID(IID_IDebugAdvanced2, 0x716d14c9, 0x119b, 0x4ba5,
0xaf, 0x1f, 0x08, 0x90, 0xe6, 0x72, 0x41, 0x6a); 0xaf, 0x1f, 0x08, 0x90, 0xe6, 0x72, 0x41, 0x6a);
/* cba4abb4-84c4-444d-87ca-a04e13286739 */ /* cba4abb4-84c4-444d-87ca-a04e13286739 */
DEFINE_GUID(IID_IDebugAdvanced3, 0xcba4abb4, 0x84c4, 0x444d, DEFINE_GUID(IID_IDebugAdvanced3, 0xcba4abb4, 0x84c4, 0x444d,
0x87, 0xca, 0xa0, 0x4e, 0x13, 0x28, 0x67, 0x39); 0x87, 0xca, 0xa0, 0x4e, 0x13, 0x28, 0x67, 0x39);
/* 5bd9d474-5975-423a-b88b-65a8e7110e65 */ /* 5bd9d474-5975-423a-b88b-65a8e7110e65 */
DEFINE_GUID(IID_IDebugBreakpoint, 0x5bd9d474, 0x5975, 0x423a, DEFINE_GUID(IID_IDebugBreakpoint, 0x5bd9d474, 0x5975, 0x423a,
0xb8, 0x8b, 0x65, 0xa8, 0xe7, 0x11, 0x0e, 0x65); 0xb8, 0x8b, 0x65, 0xa8, 0xe7, 0x11, 0x0e, 0x65);
/* 1b278d20-79f2-426e-a3f9-c1ddf375d48e */ /* 1b278d20-79f2-426e-a3f9-c1ddf375d48e */
DEFINE_GUID(IID_IDebugBreakpoint2, 0x1b278d20, 0x79f2, 0x426e, DEFINE_GUID(IID_IDebugBreakpoint2, 0x1b278d20, 0x79f2, 0x426e,
0xa3, 0xf9, 0xc1, 0xdd, 0xf3, 0x75, 0xd4, 0x8e); 0xa3, 0xf9, 0xc1, 0xdd, 0xf3, 0x75, 0xd4, 0x8e);
/* 38f5c249-b448-43bb-9835-579d4ec02249 */
DEFINE_GUID(IID_IDebugBreakpoint3, 0x38f5c249, 0xb448, 0x43bb,
0x98, 0x35, 0x57, 0x9d, 0x4e, 0xc0, 0x22, 0x49);
/* 27fe5639-8407-4f47-8364-ee118fb08ac8 */ /* 27fe5639-8407-4f47-8364-ee118fb08ac8 */
DEFINE_GUID(IID_IDebugClient, 0x27fe5639, 0x8407, 0x4f47, DEFINE_GUID(IID_IDebugClient, 0x27fe5639, 0x8407, 0x4f47,
0x83, 0x64, 0xee, 0x11, 0x8f, 0xb0, 0x8a, 0xc8); 0x83, 0x64, 0xee, 0x11, 0x8f, 0xb0, 0x8a, 0xc8);
/* edbed635-372e-4dab-bbfe-ed0d2f63be81 */ /* edbed635-372e-4dab-bbfe-ed0d2f63be81 */
DEFINE_GUID(IID_IDebugClient2, 0xedbed635, 0x372e, 0x4dab, DEFINE_GUID(IID_IDebugClient2, 0xedbed635, 0x372e, 0x4dab,
0xbb, 0xfe, 0xed, 0x0d, 0x2f, 0x63, 0xbe, 0x81); 0xbb, 0xfe, 0xed, 0x0d, 0x2f, 0x63, 0xbe, 0x81);
/* dd492d7f-71b8-4ad6-a8dc-1c887479ff91 */ /* dd492d7f-71b8-4ad6-a8dc-1c887479ff91 */
DEFINE_GUID(IID_IDebugClient3, 0xdd492d7f, 0x71b8, 0x4ad6, DEFINE_GUID(IID_IDebugClient3, 0xdd492d7f, 0x71b8, 0x4ad6,
0xa8, 0xdc, 0x1c, 0x88, 0x74, 0x79, 0xff, 0x91); 0xa8, 0xdc, 0x1c, 0x88, 0x74, 0x79, 0xff, 0x91);
/* ca83c3de-5089-4cf8-93c8-d892387f2a5e */ /* ca83c3de-5089-4cf8-93c8-d892387f2a5e */
DEFINE_GUID(IID_IDebugClient4, 0xca83c3de, 0x5089, 0x4cf8, DEFINE_GUID(IID_IDebugClient4, 0xca83c3de, 0x5089, 0x4cf8,
0x93, 0xc8, 0xd8, 0x92, 0x38, 0x7f, 0x2a, 0x5e); 0x93, 0xc8, 0xd8, 0x92, 0x38, 0x7f, 0x2a, 0x5e);
/* e3acb9d7-7ec2-4f0c-a0da-e81e0cbbe628 */ /* e3acb9d7-7ec2-4f0c-a0da-e81e0cbbe628 */
DEFINE_GUID(IID_IDebugClient5, 0xe3acb9d7, 0x7ec2, 0x4f0c, DEFINE_GUID(IID_IDebugClient5, 0xe3acb9d7, 0x7ec2, 0x4f0c,
0xa0, 0xda, 0xe8, 0x1e, 0x0c, 0xbb, 0xe6, 0x28); 0xa0, 0xda, 0xe8, 0x1e, 0x0c, 0xbb, 0xe6, 0x28);
/* fd28b4c5-c498-4686-a28e-62cad2154eb3 */
DEFINE_GUID(IID_IDebugClient6, 0xfd28b4c5, 0xc498, 0x4686,
0xa2, 0x8e, 0x62, 0xca, 0xd2, 0x15, 0x4e, 0xb3);
/* 13586be3-542e-481e-b1f2-8497ba74f9a9 */
DEFINE_GUID(IID_IDebugClient7, 0x13586be3, 0x542e, 0x481e,
0xb1, 0xf2, 0x84, 0x97, 0xba, 0x74, 0xf9, 0xa9);
/* 5182e668-105e-416e-ad92-24ef800424ba */ /* 5182e668-105e-416e-ad92-24ef800424ba */
DEFINE_GUID(IID_IDebugControl, 0x5182e668, 0x105e, 0x416e, DEFINE_GUID(IID_IDebugControl, 0x5182e668, 0x105e, 0x416e,
0xad, 0x92, 0x24, 0xef, 0x80, 0x04, 0x24, 0xba); 0xad, 0x92, 0x24, 0xef, 0x80, 0x04, 0x24, 0xba);
/* d4366723-44df-4bed-8c7e-4c05424f4588 */ /* d4366723-44df-4bed-8c7e-4c05424f4588 */
DEFINE_GUID(IID_IDebugControl2, 0xd4366723, 0x44df, 0x4bed, DEFINE_GUID(IID_IDebugControl2, 0xd4366723, 0x44df, 0x4bed,
0x8c, 0x7e, 0x4c, 0x05, 0x42, 0x4f, 0x45, 0x88); 0x8c, 0x7e, 0x4c, 0x05, 0x42, 0x4f, 0x45, 0x88);
/* 7df74a86-b03f-407f-90ab-a20dadcead08 */ /* 7df74a86-b03f-407f-90ab-a20dadcead08 */
DEFINE_GUID(IID_IDebugControl3, 0x7df74a86, 0xb03f, 0x407f, DEFINE_GUID(IID_IDebugControl3, 0x7df74a86, 0xb03f, 0x407f,
0x90, 0xab, 0xa2, 0x0d, 0xad, 0xce, 0xad, 0x08); 0x90, 0xab, 0xa2, 0x0d, 0xad, 0xce, 0xad, 0x08);
/* 94e60ce9-9b41-4b19-9fc0-6d9eb35272b3 */ /* 94e60ce9-9b41-4b19-9fc0-6d9eb35272b3 */
DEFINE_GUID(IID_IDebugControl4, 0x94e60ce9, 0x9b41, 0x4b19, DEFINE_GUID(IID_IDebugControl4, 0x94e60ce9, 0x9b41, 0x4b19,
0x9f, 0xc0, 0x6d, 0x9e, 0xb3, 0x52, 0x72, 0xb3); 0x9f, 0xc0, 0x6d, 0x9e, 0xb3, 0x52, 0x72, 0xb3);
/* b2ffe162-2412-429f-8d1d-5bf6dd824696 */
DEFINE_GUID(IID_IDebugControl5, 0xb2ffe162, 0x2412, 0x429f,
0x8d, 0x1d, 0x5b, 0xf6, 0xdd, 0x82, 0x46, 0x96);
/* bc0d583f-126d-43a1-9cc4-a860ab1d537b */
DEFINE_GUID(IID_IDebugControl6, 0xbc0d583f, 0x126d, 0x43a1,
0x9c, 0xc4, 0xa8, 0x60, 0xab, 0x1d, 0x53, 0x7b);
/* b86fb3b1-80d4-475b-aea3-cf06539cf63a */
DEFINE_GUID(IID_IDebugControl7, 0xb86fb3b1, 0x80d4, 0x475b,
0xae, 0xa3, 0xcf, 0x06, 0x53, 0x9c, 0xf6, 0x3a);
/* 88f7dfab-3ea7-4c3a-aefb-c4e8106173aa */ /* 88f7dfab-3ea7-4c3a-aefb-c4e8106173aa */
DEFINE_GUID(IID_IDebugDataSpaces, 0x88f7dfab, 0x3ea7, 0x4c3a, DEFINE_GUID(IID_IDebugDataSpaces, 0x88f7dfab, 0x3ea7, 0x4c3a,
0xae, 0xfb, 0xc4, 0xe8, 0x10, 0x61, 0x73, 0xaa); 0xae, 0xfb, 0xc4, 0xe8, 0x10, 0x61, 0x73, 0xaa);
/* 7a5e852f-96e9-468f-ac1b-0b3addc4a049 */ /* 7a5e852f-96e9-468f-ac1b-0b3addc4a049 */
DEFINE_GUID(IID_IDebugDataSpaces2, 0x7a5e852f, 0x96e9, 0x468f, DEFINE_GUID(IID_IDebugDataSpaces2, 0x7a5e852f, 0x96e9, 0x468f,
0xac, 0x1b, 0x0b, 0x3a, 0xdd, 0xc4, 0xa0, 0x49); 0xac, 0x1b, 0x0b, 0x3a, 0xdd, 0xc4, 0xa0, 0x49);
/* 23f79d6c-8aaf-4f7c-a607-9995f5407e63 */ /* 23f79d6c-8aaf-4f7c-a607-9995f5407e63 */
DEFINE_GUID(IID_IDebugDataSpaces3, 0x23f79d6c, 0x8aaf, 0x4f7c, DEFINE_GUID(IID_IDebugDataSpaces3, 0x23f79d6c, 0x8aaf, 0x4f7c,
0xa6, 0x07, 0x99, 0x95, 0xf5, 0x40, 0x7e, 0x63); 0xa6, 0x07, 0x99, 0x95, 0xf5, 0x40, 0x7e, 0x63);
/* d98ada1f-29e9-4ef5-a6c0-e53349883212 */ /* d98ada1f-29e9-4ef5-a6c0-e53349883212 */
DEFINE_GUID(IID_IDebugDataSpaces4, 0xd98ada1f, 0x29e9, 0x4ef5, DEFINE_GUID(IID_IDebugDataSpaces4, 0xd98ada1f, 0x29e9, 0x4ef5,
0xa6, 0xc0, 0xe5, 0x33, 0x49, 0x88, 0x32, 0x12); 0xa6, 0xc0, 0xe5, 0x33, 0x49, 0x88, 0x32, 0x12);
/* 337be28b-5036-4d72-b6bf-c45fbb9f2eaa */ /* 337be28b-5036-4d72-b6bf-c45fbb9f2eaa */
DEFINE_GUID(IID_IDebugEventCallbacks, 0x337be28b, 0x5036, 0x4d72, DEFINE_GUID(IID_IDebugEventCallbacks, 0x337be28b, 0x5036, 0x4d72,
0xb6, 0xbf, 0xc4, 0x5f, 0xbb, 0x9f, 0x2e, 0xaa); 0xb6, 0xbf, 0xc4, 0x5f, 0xbb, 0x9f, 0x2e, 0xaa);
/* 0690e046-9c23-45ac-a04f-987ac29ad0d3 */ /* 0690e046-9c23-45ac-a04f-987ac29ad0d3 */
DEFINE_GUID(IID_IDebugEventCallbacksWide, 0x0690e046, 0x9c23, 0x45ac, DEFINE_GUID(IID_IDebugEventCallbacksWide, 0x0690e046, 0x9c23, 0x45ac,
0xa0, 0x4f, 0x98, 0x7a, 0xc2, 0x9a, 0xd0, 0xd3); 0xa0, 0x4f, 0x98, 0x7a, 0xc2, 0x9a, 0xd0, 0xd3);
/* 61a4905b-23f9-4247-b3c5-53d087529ab7 */
DEFINE_GUID(IID_IDebugEventContextCallbacks, 0x61a4905b, 0x23f9, 0x4247,
0xb3, 0xc5, 0x53, 0xd0, 0x87, 0x52, 0x9a, 0xb7);
/* 9f50e42c-f136-499e-9a97-73036c94ed2d */ /* 9f50e42c-f136-499e-9a97-73036c94ed2d */
DEFINE_GUID(IID_IDebugInputCallbacks, 0x9f50e42c, 0xf136, 0x499e, DEFINE_GUID(IID_IDebugInputCallbacks, 0x9f50e42c, 0xf136, 0x499e,
0x9a, 0x97, 0x73, 0x03, 0x6c, 0x94, 0xed, 0x2d); 0x9a, 0x97, 0x73, 0x03, 0x6c, 0x94, 0xed, 0x2d);
/* 4bf58045-d654-4c40-b0af-683090f356dc */ /* 4bf58045-d654-4c40-b0af-683090f356dc */
DEFINE_GUID(IID_IDebugOutputCallbacks, 0x4bf58045, 0xd654, 0x4c40, DEFINE_GUID(IID_IDebugOutputCallbacks, 0x4bf58045, 0xd654, 0x4c40,
0xb0, 0xaf, 0x68, 0x30, 0x90, 0xf3, 0x56, 0xdc); 0xb0, 0xaf, 0x68, 0x30, 0x90, 0xf3, 0x56, 0xdc);
/* 4c7fd663-c394-4e26-8ef1-34ad5ed3764c */ /* 4c7fd663-c394-4e26-8ef1-34ad5ed3764c */
DEFINE_GUID(IID_IDebugOutputCallbacksWide, 0x4c7fd663, 0xc394, 0x4e26, DEFINE_GUID(IID_IDebugOutputCallbacksWide, 0x4c7fd663, 0xc394, 0x4e26,
0x8e, 0xf1, 0x34, 0xad, 0x5e, 0xd3, 0x76, 0x4c); 0x8e, 0xf1, 0x34, 0xad, 0x5e, 0xd3, 0x76, 0x4c);
/* 67721fe9-56d2-4a44-a325-2b65513ce6eb */ /* 67721fe9-56d2-4a44-a325-2b65513ce6eb */
skipping to change at line 147 skipping to change at line 161
0xb4, 0x1c, 0x6c, 0x20, 0x30, 0x7b, 0xcc, 0xc7); 0xb4, 0x1c, 0x6c, 0x20, 0x30, 0x7b, 0xcc, 0xc7);
/* 8c31e98c-983a-48a5-9016-6fe5d667a950 */ /* 8c31e98c-983a-48a5-9016-6fe5d667a950 */
DEFINE_GUID(IID_IDebugSymbols, 0x8c31e98c, 0x983a, 0x48a5, DEFINE_GUID(IID_IDebugSymbols, 0x8c31e98c, 0x983a, 0x48a5,
0x90, 0x16, 0x6f, 0xe5, 0xd6, 0x67, 0xa9, 0x50); 0x90, 0x16, 0x6f, 0xe5, 0xd6, 0x67, 0xa9, 0x50);
/* 3a707211-afdd-4495-ad4f-56fecdf8163f */ /* 3a707211-afdd-4495-ad4f-56fecdf8163f */
DEFINE_GUID(IID_IDebugSymbols2, 0x3a707211, 0xafdd, 0x4495, DEFINE_GUID(IID_IDebugSymbols2, 0x3a707211, 0xafdd, 0x4495,
0xad, 0x4f, 0x56, 0xfe, 0xcd, 0xf8, 0x16, 0x3f); 0xad, 0x4f, 0x56, 0xfe, 0xcd, 0xf8, 0x16, 0x3f);
/* f02fbecc-50ac-4f36-9ad9-c975e8f32ff8 */ /* f02fbecc-50ac-4f36-9ad9-c975e8f32ff8 */
DEFINE_GUID(IID_IDebugSymbols3, 0xf02fbecc, 0x50ac, 0x4f36, DEFINE_GUID(IID_IDebugSymbols3, 0xf02fbecc, 0x50ac, 0x4f36,
0x9a, 0xd9, 0xc9, 0x75, 0xe8, 0xf3, 0x2f, 0xf8); 0x9a, 0xd9, 0xc9, 0x75, 0xe8, 0xf3, 0x2f, 0xf8);
/* e391bbd8-9d8c-4418-840b-c006592a1752 */
DEFINE_GUID(IID_IDebugSymbols4, 0xe391bbd8, 0x9d8c, 0x4418,
0x84, 0x0b, 0xc0, 0x06, 0x59, 0x2a, 0x17, 0x52);
/* c65fa83e-1e69-475e-8e0e-b5d79e9cc17e */
DEFINE_GUID(IID_IDebugSymbols5, 0xc65fa83e, 0x1e69, 0x475e,
0x8e, 0x0e, 0xb5, 0xd7, 0x9e, 0x9c, 0xc1, 0x7e);
/* 6b86fe2c-2c4f-4f0c-9da2-174311acc327 */ /* 6b86fe2c-2c4f-4f0c-9da2-174311acc327 */
DEFINE_GUID(IID_IDebugSystemObjects, 0x6b86fe2c, 0x2c4f, 0x4f0c, DEFINE_GUID(IID_IDebugSystemObjects, 0x6b86fe2c, 0x2c4f, 0x4f0c,
0x9d, 0xa2, 0x17, 0x43, 0x11, 0xac, 0xc3, 0x27); 0x9d, 0xa2, 0x17, 0x43, 0x11, 0xac, 0xc3, 0x27);
/* 0ae9f5ff-1852-4679-b055-494bee6407ee */ /* 0ae9f5ff-1852-4679-b055-494bee6407ee */
DEFINE_GUID(IID_IDebugSystemObjects2, 0x0ae9f5ff, 0x1852, 0x4679, DEFINE_GUID(IID_IDebugSystemObjects2, 0x0ae9f5ff, 0x1852, 0x4679,
0xb0, 0x55, 0x49, 0x4b, 0xee, 0x64, 0x07, 0xee); 0xb0, 0x55, 0x49, 0x4b, 0xee, 0x64, 0x07, 0xee);
/* e9676e2f-e286-4ea3-b0f9-dfe5d9fc330e */ /* e9676e2f-e286-4ea3-b0f9-dfe5d9fc330e */
DEFINE_GUID(IID_IDebugSystemObjects3, 0xe9676e2f, 0xe286, 0x4ea3, DEFINE_GUID(IID_IDebugSystemObjects3, 0xe9676e2f, 0xe286, 0x4ea3,
0xb0, 0xf9, 0xdf, 0xe5, 0xd9, 0xfc, 0x33, 0x0e); 0xb0, 0xf9, 0xdf, 0xe5, 0xd9, 0xfc, 0x33, 0x0e);
/* 489468e6-7d0f-4af5-87ab-25207454d553 */ /* 489468e6-7d0f-4af5-87ab-25207454d553 */
skipping to change at line 170 skipping to change at line 190
typedef interface DECLSPEC_UUID("f2df5f53-071f-47bd-9de6-5734c3fed689") typedef interface DECLSPEC_UUID("f2df5f53-071f-47bd-9de6-5734c3fed689")
IDebugAdvanced* PDEBUG_ADVANCED; IDebugAdvanced* PDEBUG_ADVANCED;
typedef interface DECLSPEC_UUID("716d14c9-119b-4ba5-af1f-0890e672416a") typedef interface DECLSPEC_UUID("716d14c9-119b-4ba5-af1f-0890e672416a")
IDebugAdvanced2* PDEBUG_ADVANCED2; IDebugAdvanced2* PDEBUG_ADVANCED2;
typedef interface DECLSPEC_UUID("cba4abb4-84c4-444d-87ca-a04e13286739") typedef interface DECLSPEC_UUID("cba4abb4-84c4-444d-87ca-a04e13286739")
IDebugAdvanced3* PDEBUG_ADVANCED3; IDebugAdvanced3* PDEBUG_ADVANCED3;
typedef interface DECLSPEC_UUID("5bd9d474-5975-423a-b88b-65a8e7110e65") typedef interface DECLSPEC_UUID("5bd9d474-5975-423a-b88b-65a8e7110e65")
IDebugBreakpoint* PDEBUG_BREAKPOINT; IDebugBreakpoint* PDEBUG_BREAKPOINT;
typedef interface DECLSPEC_UUID("1b278d20-79f2-426e-a3f9-c1ddf375d48e") typedef interface DECLSPEC_UUID("1b278d20-79f2-426e-a3f9-c1ddf375d48e")
IDebugBreakpoint2* PDEBUG_BREAKPOINT2; IDebugBreakpoint2* PDEBUG_BREAKPOINT2;
typedef interface DECLSPEC_UUID("38f5c249-b448-43bb-9835-579d4ec02249")
IDebugBreakpoint3* PDEBUG_BREAKPOINT3;
typedef interface DECLSPEC_UUID("27fe5639-8407-4f47-8364-ee118fb08ac8") typedef interface DECLSPEC_UUID("27fe5639-8407-4f47-8364-ee118fb08ac8")
IDebugClient* PDEBUG_CLIENT; IDebugClient* PDEBUG_CLIENT;
typedef interface DECLSPEC_UUID("edbed635-372e-4dab-bbfe-ed0d2f63be81") typedef interface DECLSPEC_UUID("edbed635-372e-4dab-bbfe-ed0d2f63be81")
IDebugClient2* PDEBUG_CLIENT2; IDebugClient2* PDEBUG_CLIENT2;
typedef interface DECLSPEC_UUID("dd492d7f-71b8-4ad6-a8dc-1c887479ff91") typedef interface DECLSPEC_UUID("dd492d7f-71b8-4ad6-a8dc-1c887479ff91")
IDebugClient3* PDEBUG_CLIENT3; IDebugClient3* PDEBUG_CLIENT3;
typedef interface DECLSPEC_UUID("ca83c3de-5089-4cf8-93c8-d892387f2a5e") typedef interface DECLSPEC_UUID("ca83c3de-5089-4cf8-93c8-d892387f2a5e")
IDebugClient4* PDEBUG_CLIENT4; IDebugClient4* PDEBUG_CLIENT4;
typedef interface DECLSPEC_UUID("e3acb9d7-7ec2-4f0c-a0da-e81e0cbbe628") typedef interface DECLSPEC_UUID("e3acb9d7-7ec2-4f0c-a0da-e81e0cbbe628")
IDebugClient5* PDEBUG_CLIENT5; IDebugClient5* PDEBUG_CLIENT5;
typedef interface DECLSPEC_UUID("fd28b4c5-c498-4686-a28e-62cad2154eb3")
IDebugClient6* PDEBUG_CLIENT6;
typedef interface DECLSPEC_UUID("13586be3-542e-481e-b1f2-8497ba74f9a9")
IDebugClient7* PDEBUG_CLIENT7;
typedef interface DECLSPEC_UUID("5182e668-105e-416e-ad92-24ef800424ba") typedef interface DECLSPEC_UUID("5182e668-105e-416e-ad92-24ef800424ba")
IDebugControl* PDEBUG_CONTROL; IDebugControl* PDEBUG_CONTROL;
typedef interface DECLSPEC_UUID("d4366723-44df-4bed-8c7e-4c05424f4588") typedef interface DECLSPEC_UUID("d4366723-44df-4bed-8c7e-4c05424f4588")
IDebugControl2* PDEBUG_CONTROL2; IDebugControl2* PDEBUG_CONTROL2;
typedef interface DECLSPEC_UUID("7df74a86-b03f-407f-90ab-a20dadcead08") typedef interface DECLSPEC_UUID("7df74a86-b03f-407f-90ab-a20dadcead08")
IDebugControl3* PDEBUG_CONTROL3; IDebugControl3* PDEBUG_CONTROL3;
typedef interface DECLSPEC_UUID("94e60ce9-9b41-4b19-9fc0-6d9eb35272b3") typedef interface DECLSPEC_UUID("94e60ce9-9b41-4b19-9fc0-6d9eb35272b3")
IDebugControl4* PDEBUG_CONTROL4; IDebugControl4* PDEBUG_CONTROL4;
typedef interface DECLSPEC_UUID("b2ffe162-2412-429f-8d1d-5bf6dd824696")
IDebugControl5* PDEBUG_CONTROL5;
typedef interface DECLSPEC_UUID("bc0d583f-126d-43a1-9cc4-a860ab1d537b")
IDebugControl6* PDEBUG_CONTROL6;
typedef interface DECLSPEC_UUID("b86fb3b1-80d4-475b-aea3-cf06539cf63a")
IDebugControl7* PDEBUG_CONTROL7;
typedef interface DECLSPEC_UUID("88f7dfab-3ea7-4c3a-aefb-c4e8106173aa") typedef interface DECLSPEC_UUID("88f7dfab-3ea7-4c3a-aefb-c4e8106173aa")
IDebugDataSpaces* PDEBUG_DATA_SPACES; IDebugDataSpaces* PDEBUG_DATA_SPACES;
typedef interface DECLSPEC_UUID("7a5e852f-96e9-468f-ac1b-0b3addc4a049") typedef interface DECLSPEC_UUID("7a5e852f-96e9-468f-ac1b-0b3addc4a049")
IDebugDataSpaces2* PDEBUG_DATA_SPACES2; IDebugDataSpaces2* PDEBUG_DATA_SPACES2;
typedef interface DECLSPEC_UUID("23f79d6c-8aaf-4f7c-a607-9995f5407e63") typedef interface DECLSPEC_UUID("23f79d6c-8aaf-4f7c-a607-9995f5407e63")
IDebugDataSpaces3* PDEBUG_DATA_SPACES3; IDebugDataSpaces3* PDEBUG_DATA_SPACES3;
typedef interface DECLSPEC_UUID("d98ada1f-29e9-4ef5-a6c0-e53349883212") typedef interface DECLSPEC_UUID("d98ada1f-29e9-4ef5-a6c0-e53349883212")
IDebugDataSpaces4* PDEBUG_DATA_SPACES4; IDebugDataSpaces4* PDEBUG_DATA_SPACES4;
typedef interface DECLSPEC_UUID("337be28b-5036-4d72-b6bf-c45fbb9f2eaa") typedef interface DECLSPEC_UUID("337be28b-5036-4d72-b6bf-c45fbb9f2eaa")
IDebugEventCallbacks* PDEBUG_EVENT_CALLBACKS; IDebugEventCallbacks* PDEBUG_EVENT_CALLBACKS;
typedef interface DECLSPEC_UUID("0690e046-9c23-45ac-a04f-987ac29ad0d3") typedef interface DECLSPEC_UUID("0690e046-9c23-45ac-a04f-987ac29ad0d3")
IDebugEventCallbacksWide* PDEBUG_EVENT_CALLBACKS_WIDE; IDebugEventCallbacksWide* PDEBUG_EVENT_CALLBACKS_WIDE;
typedef interface DECLSPEC_UUID("61a4905b-23f9-4247-b3c5-53d087529ab7")
IDebugEventContextCallbacks* PDEBUG_EVENT_CONTEXT_CALLBACKS;
typedef interface DECLSPEC_UUID("9f50e42c-f136-499e-9a97-73036c94ed2d") typedef interface DECLSPEC_UUID("9f50e42c-f136-499e-9a97-73036c94ed2d")
IDebugInputCallbacks* PDEBUG_INPUT_CALLBACKS; IDebugInputCallbacks* PDEBUG_INPUT_CALLBACKS;
typedef interface DECLSPEC_UUID("4bf58045-d654-4c40-b0af-683090f356dc") typedef interface DECLSPEC_UUID("4bf58045-d654-4c40-b0af-683090f356dc")
IDebugOutputCallbacks* PDEBUG_OUTPUT_CALLBACKS; IDebugOutputCallbacks* PDEBUG_OUTPUT_CALLBACKS;
typedef interface DECLSPEC_UUID("4c7fd663-c394-4e26-8ef1-34ad5ed3764c") typedef interface DECLSPEC_UUID("4c7fd663-c394-4e26-8ef1-34ad5ed3764c")
IDebugOutputCallbacksWide* PDEBUG_OUTPUT_CALLBACKS_WIDE; IDebugOutputCallbacksWide* PDEBUG_OUTPUT_CALLBACKS_WIDE;
typedef interface DECLSPEC_UUID("67721fe9-56d2-4a44-a325-2b65513ce6eb") typedef interface DECLSPEC_UUID("67721fe9-56d2-4a44-a325-2b65513ce6eb")
IDebugOutputCallbacks2* PDEBUG_OUTPUT_CALLBACKS2; IDebugOutputCallbacks2* PDEBUG_OUTPUT_CALLBACKS2;
typedef interface DECLSPEC_UUID("ce289126-9e84-45a7-937e-67bb18691493") typedef interface DECLSPEC_UUID("ce289126-9e84-45a7-937e-67bb18691493")
IDebugRegisters* PDEBUG_REGISTERS; IDebugRegisters* PDEBUG_REGISTERS;
skipping to change at line 222 skipping to change at line 256
typedef interface DECLSPEC_UUID("f2528316-0f1a-4431-aeed-11d096e1e2ab") typedef interface DECLSPEC_UUID("f2528316-0f1a-4431-aeed-11d096e1e2ab")
IDebugSymbolGroup* PDEBUG_SYMBOL_GROUP; IDebugSymbolGroup* PDEBUG_SYMBOL_GROUP;
typedef interface DECLSPEC_UUID("6a7ccc5f-fb5e-4dcc-b41c-6c20307bccc7") typedef interface DECLSPEC_UUID("6a7ccc5f-fb5e-4dcc-b41c-6c20307bccc7")
IDebugSymbolGroup2* PDEBUG_SYMBOL_GROUP2; IDebugSymbolGroup2* PDEBUG_SYMBOL_GROUP2;
typedef interface DECLSPEC_UUID("8c31e98c-983a-48a5-9016-6fe5d667a950") typedef interface DECLSPEC_UUID("8c31e98c-983a-48a5-9016-6fe5d667a950")
IDebugSymbols* PDEBUG_SYMBOLS; IDebugSymbols* PDEBUG_SYMBOLS;
typedef interface DECLSPEC_UUID("3a707211-afdd-4495-ad4f-56fecdf8163f") typedef interface DECLSPEC_UUID("3a707211-afdd-4495-ad4f-56fecdf8163f")
IDebugSymbols2* PDEBUG_SYMBOLS2; IDebugSymbols2* PDEBUG_SYMBOLS2;
typedef interface DECLSPEC_UUID("f02fbecc-50ac-4f36-9ad9-c975e8f32ff8") typedef interface DECLSPEC_UUID("f02fbecc-50ac-4f36-9ad9-c975e8f32ff8")
IDebugSymbols3* PDEBUG_SYMBOLS3; IDebugSymbols3* PDEBUG_SYMBOLS3;
typedef interface DECLSPEC_UUID("e391bbd8-9d8c-4418-840b-c006592a1752")
IDebugSymbols4* PDEBUG_SYMBOLS4;
typedef interface DECLSPEC_UUID("c65fa83e-1e69-475e-8e0e-b5d79e9cc17e")
IDebugSymbols5* PDEBUG_SYMBOLS5;
typedef interface DECLSPEC_UUID("6b86fe2c-2c4f-4f0c-9da2-174311acc327") typedef interface DECLSPEC_UUID("6b86fe2c-2c4f-4f0c-9da2-174311acc327")
IDebugSystemObjects* PDEBUG_SYSTEM_OBJECTS; IDebugSystemObjects* PDEBUG_SYSTEM_OBJECTS;
typedef interface DECLSPEC_UUID("0ae9f5ff-1852-4679-b055-494bee6407ee") typedef interface DECLSPEC_UUID("0ae9f5ff-1852-4679-b055-494bee6407ee")
IDebugSystemObjects2* PDEBUG_SYSTEM_OBJECTS2; IDebugSystemObjects2* PDEBUG_SYSTEM_OBJECTS2;
typedef interface DECLSPEC_UUID("e9676e2f-e286-4ea3-b0f9-dfe5d9fc330e") typedef interface DECLSPEC_UUID("e9676e2f-e286-4ea3-b0f9-dfe5d9fc330e")
IDebugSystemObjects3* PDEBUG_SYSTEM_OBJECTS3; IDebugSystemObjects3* PDEBUG_SYSTEM_OBJECTS3;
typedef interface DECLSPEC_UUID("489468e6-7d0f-4af5-87ab-25207454d553") typedef interface DECLSPEC_UUID("489468e6-7d0f-4af5-87ab-25207454d553")
IDebugSystemObjects4* PDEBUG_SYSTEM_OBJECTS4; IDebugSystemObjects4* PDEBUG_SYSTEM_OBJECTS4;
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
skipping to change at line 252 skipping to change at line 290
// Client creation functions. // Client creation functions.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// RemoteOptions specifies connection types and // RemoteOptions specifies connection types and
// their parameters. Supported strings are: // their parameters. Supported strings are:
// npipe:Server=<Machine>,Pipe=<Pipe name> // npipe:Server=<Machine>,Pipe=<Pipe name>
// tcp:Server=<Machine>,Port=<IP port> // tcp:Server=<Machine>,Port=<IP port>
STDAPI STDAPI
DebugConnect( DebugConnect(
__in PCSTR RemoteOptions, _In_ PCSTR RemoteOptions,
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
); );
STDAPI STDAPI
DebugConnectWide( DebugConnectWide(
__in PCWSTR RemoteOptions, _In_ PCWSTR RemoteOptions,
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
); );
STDAPI STDAPI
DebugCreate( DebugCreate(
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
);
STDAPI
DebugCreateEx(
_In_ REFIID InterfaceId,
_In_ DWORD DbgEngOptions,
_Out_ PVOID* Interface
); );
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// IDebugAdvanced. // IDebugAdvanced.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
typedef struct _DEBUG_OFFSET_REGION typedef struct _DEBUG_OFFSET_REGION
{ {
skipping to change at line 289 skipping to change at line 334
ULONG64 Size; ULONG64 Size;
} DEBUG_OFFSET_REGION, *PDEBUG_OFFSET_REGION; } DEBUG_OFFSET_REGION, *PDEBUG_OFFSET_REGION;
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugAdvanced #define INTERFACE IDebugAdvanced
DECLARE_INTERFACE_(IDebugAdvanced, IUnknown) DECLARE_INTERFACE_(IDebugAdvanced, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugAdvanced. // IDebugAdvanced.
skipping to change at line 312 skipping to change at line 357
// the full processor context for a thread. // the full processor context for a thread.
// Higher-level functions, such as the // Higher-level functions, such as the
// IDebugRegisters interface, allow similar // IDebugRegisters interface, allow similar
// access in simpler and more generic ways. // access in simpler and more generic ways.
// Get/SetThreadContext are useful when // Get/SetThreadContext are useful when
// large amounts of thread context must // large amounts of thread context must
// be changed and processor-specific code // be changed and processor-specific code
// is not a problem. // is not a problem.
STDMETHOD(GetThreadContext)( STDMETHOD(GetThreadContext)(
THIS_ THIS_
__out_bcount(ContextSize) /* align_is(16) */ PVOID Context, _Out_writes_bytes_(ContextSize) /* align_is(16) */ PVOID Context,
__in ULONG ContextSize _In_ ULONG ContextSize
) PURE; ) PURE;
STDMETHOD(SetThreadContext)( STDMETHOD(SetThreadContext)(
THIS_ THIS_
__in_bcount(ContextSize) /* align_is(16) */ PVOID Context, _In_reads_bytes_(ContextSize) /* align_is(16) */ PVOID Context,
__in ULONG ContextSize _In_ ULONG ContextSize
) PURE; ) PURE;
}; };
typedef struct _DEBUG_READ_USER_MINIDUMP_STREAM typedef struct _DEBUG_READ_USER_MINIDUMP_STREAM
{ {
IN ULONG StreamType; IN ULONG StreamType;
IN ULONG Flags; IN ULONG Flags;
IN ULONG64 Offset; IN ULONG64 Offset;
OUT PVOID Buffer; OUT PVOID Buffer;
IN ULONG BufferSize; IN ULONG BufferSize;
skipping to change at line 498 skipping to change at line 543
#define DEBUG_REQUEST_DUPLICATE_TOKEN 28 #define DEBUG_REQUEST_DUPLICATE_TOKEN 28
// InBuffer - a ULONG64 as TokenHandle and a ULONG as NtQueryInformationToken() request code // InBuffer - a ULONG64 as TokenHandle and a ULONG as NtQueryInformationToken() request code
// OutBuffer - NtQueryInformationToken() return // OutBuffer - NtQueryInformationToken() return
#define DEBUG_REQUEST_QUERY_INFO_TOKEN 29 #define DEBUG_REQUEST_QUERY_INFO_TOKEN 29
// InBuffer - ULONG64 as TokenHandle // InBuffer - ULONG64 as TokenHandle
// OutBuffer - Unused // OutBuffer - Unused
#define DEBUG_REQUEST_CLOSE_TOKEN 30 #define DEBUG_REQUEST_CLOSE_TOKEN 30
// InBuffer - ULONG64 for process server identification and ULONG as PID
// OutBuffer - Unused
#define DEBUG_REQUEST_WOW_PROCESS 31
// InBuffer - ULONG64 for process server identification and PWSTR as module path
// OutBuffer - Unused
#define DEBUG_REQUEST_WOW_MODULE 32
// InBuffer - Unused
// OutBuffer - Unused
// return - S_OK if non-invasive user-mode attach, S_FALSE if not (but still liv
e user-mode), E_FAIL otherwise.
#define DEBUG_LIVE_USER_NON_INVASIVE 33
// InBuffer - TID
// OutBuffer - Unused
// return - ResumeThreads() return.
#define DEBUG_REQUEST_RESUME_THREAD 34
// InBuffer - LONG32 - 0:query current state; >0:enable inline queries; <0: disa
ble inline queries
// OutBuffer - Unused
// return - S_OK: inline queries are enabled; S_FALSE: inline queries are disabl
ed; others: errors.
#define DEBUG_REQUEST_INLINE_QUERY 35
// //
// GetSourceFileInformation requests. // GetSourceFileInformation requests.
// //
// Arg64 - Module base. // Arg64 - Module base.
// Arg32 - Unused. // Arg32 - Unused.
#define DEBUG_SRCFILE_SYMBOL_TOKEN 0 #define DEBUG_SRCFILE_SYMBOL_TOKEN 0
// Arg64 - Module base. // Arg64 - Module base.
// Arg32 - Unused. // Arg32 - Unused.
skipping to change at line 590 skipping to change at line 658
ULONG64 Affinity; ULONG64 Affinity;
} DEBUG_THREAD_BASIC_INFORMATION, *PDEBUG_THREAD_BASIC_INFORMATION; } DEBUG_THREAD_BASIC_INFORMATION, *PDEBUG_THREAD_BASIC_INFORMATION;
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugAdvanced2 #define INTERFACE IDebugAdvanced2
DECLARE_INTERFACE_(IDebugAdvanced2, IUnknown) DECLARE_INTERFACE_(IDebugAdvanced2, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugAdvanced. // IDebugAdvanced.
skipping to change at line 613 skipping to change at line 681
// the full processor context for a thread. // the full processor context for a thread.
// Higher-level functions, such as the // Higher-level functions, such as the
// IDebugRegisters interface, allow similar // IDebugRegisters interface, allow similar
// access in simpler and more generic ways. // access in simpler and more generic ways.
// Get/SetThreadContext are useful when // Get/SetThreadContext are useful when
// large amounts of thread context must // large amounts of thread context must
// be changed and processor-specific code // be changed and processor-specific code
// is not a problem. // is not a problem.
STDMETHOD(GetThreadContext)( STDMETHOD(GetThreadContext)(
THIS_ THIS_
__out_bcount(ContextSize) /* align_is(16) */ PVOID Context, _Out_writes_bytes_(ContextSize) /* align_is(16) */ PVOID Context,
__in ULONG ContextSize _In_ ULONG ContextSize
) PURE; ) PURE;
STDMETHOD(SetThreadContext)( STDMETHOD(SetThreadContext)(
THIS_ THIS_
__in_bcount(ContextSize) /* align_is(16) */ PVOID Context, _In_reads_bytes_(ContextSize) /* align_is(16) */ PVOID Context,
__in ULONG ContextSize _In_ ULONG ContextSize
) PURE; ) PURE;
// IDebugAdvanced2. // IDebugAdvanced2.
// //
// Generalized open-ended methods for querying // Generalized open-ended methods for querying
// and manipulation. The open-ended nature of // and manipulation. The open-ended nature of
// these methods makes it easy to add new requests, // these methods makes it easy to add new requests,
// although at a cost in convenience of calling. // although at a cost in convenience of calling.
// Sufficiently common requests may have more specific, // Sufficiently common requests may have more specific,
// simpler methods elsewhere. // simpler methods elsewhere.
// //
STDMETHOD(Request)( STDMETHOD(Request)(
THIS_ THIS_
__in ULONG Request, _In_ ULONG Request,
__in_bcount_opt(InBufferSize) PVOID InBuffer, _In_reads_bytes_opt_(InBufferSize) PVOID InBuffer,
__in ULONG InBufferSize, _In_ ULONG InBufferSize,
__out_bcount_opt(OutBufferSize) PVOID OutBuffer, _Out_writes_bytes_opt_(OutBufferSize) PVOID OutBuffer,
__in ULONG OutBufferSize, _In_ ULONG OutBufferSize,
__out_opt PULONG OutSize _Out_opt_ PULONG OutSize
) PURE; ) PURE;
STDMETHOD(GetSourceFileInformation)( STDMETHOD(GetSourceFileInformation)(
THIS_ THIS_
__in ULONG Which, _In_ ULONG Which,
__in PSTR SourceFile, _In_ PSTR SourceFile,
__in ULONG64 Arg64, _In_ ULONG64 Arg64,
__in ULONG Arg32, _In_ ULONG Arg32,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG InfoSize _Out_opt_ PULONG InfoSize
) PURE; ) PURE;
STDMETHOD(FindSourceFileAndToken)( STDMETHOD(FindSourceFileAndToken)(
THIS_ THIS_
__in ULONG StartElement, _In_ ULONG StartElement,
__in ULONG64 ModAddr, _In_ ULONG64 ModAddr,
__in PCSTR File, _In_ PCSTR File,
__in ULONG Flags, _In_ ULONG Flags,
__in_bcount_opt(FileTokenSize) PVOID FileToken, _In_reads_bytes_opt_(FileTokenSize) PVOID FileToken,
__in ULONG FileTokenSize, _In_ ULONG FileTokenSize,
__out_opt PULONG FoundElement, _Out_opt_ PULONG FoundElement,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG FoundSize _Out_opt_ PULONG FoundSize
) PURE; ) PURE;
STDMETHOD(GetSymbolInformation)( STDMETHOD(GetSymbolInformation)(
THIS_ THIS_
__in ULONG Which, _In_ ULONG Which,
__in ULONG64 Arg64, _In_ ULONG64 Arg64,
__in ULONG Arg32, _In_ ULONG Arg32,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG InfoSize, _Out_opt_ PULONG InfoSize,
__out_ecount_opt(StringBufferSize) PSTR StringBuffer, _Out_writes_opt_(StringBufferSize) PSTR StringBuffer,
__in ULONG StringBufferSize, _In_ ULONG StringBufferSize,
__out_opt PULONG StringSize _Out_opt_ PULONG StringSize
) PURE; ) PURE;
STDMETHOD(GetSystemObjectInformation)( STDMETHOD(GetSystemObjectInformation)(
THIS_ THIS_
__in ULONG Which, _In_ ULONG Which,
__in ULONG64 Arg64, _In_ ULONG64 Arg64,
__in ULONG Arg32, _In_ ULONG Arg32,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG InfoSize _Out_opt_ PULONG InfoSize
) PURE; ) PURE;
}; };
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugAdvanced3 #define INTERFACE IDebugAdvanced3
DECLARE_INTERFACE_(IDebugAdvanced3, IUnknown) DECLARE_INTERFACE_(IDebugAdvanced3, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugAdvanced. // IDebugAdvanced.
skipping to change at line 721 skipping to change at line 789
// the full processor context for a thread. // the full processor context for a thread.
// Higher-level functions, such as the // Higher-level functions, such as the
// IDebugRegisters interface, allow similar // IDebugRegisters interface, allow similar
// access in simpler and more generic ways. // access in simpler and more generic ways.
// Get/SetThreadContext are useful when // Get/SetThreadContext are useful when
// large amounts of thread context must // large amounts of thread context must
// be changed and processor-specific code // be changed and processor-specific code
// is not a problem. // is not a problem.
STDMETHOD(GetThreadContext)( STDMETHOD(GetThreadContext)(
THIS_ THIS_
__out_bcount(ContextSize) /* align_is(16) */ PVOID Context, _Out_writes_bytes_(ContextSize) /* align_is(16) */ PVOID Context,
__in ULONG ContextSize _In_ ULONG ContextSize
) PURE; ) PURE;
STDMETHOD(SetThreadContext)( STDMETHOD(SetThreadContext)(
THIS_ THIS_
__in_bcount(ContextSize) /* align_is(16) */ PVOID Context, _In_reads_bytes_(ContextSize) /* align_is(16) */ PVOID Context,
__in ULONG ContextSize _In_ ULONG ContextSize
) PURE; ) PURE;
// IDebugAdvanced2. // IDebugAdvanced2.
// //
// Generalized open-ended methods for querying // Generalized open-ended methods for querying
// and manipulation. The open-ended nature of // and manipulation. The open-ended nature of
// these methods makes it easy to add new requests, // these methods makes it easy to add new requests,
// although at a cost in convenience of calling. // although at a cost in convenience of calling.
// Sufficiently common requests may have more specific, // Sufficiently common requests may have more specific,
// simpler methods elsewhere. // simpler methods elsewhere.
// //
STDMETHOD(Request)( STDMETHOD(Request)(
THIS_ THIS_
__in ULONG Request, _In_ ULONG Request,
__in_bcount_opt(InBufferSize) PVOID InBuffer, _In_reads_bytes_opt_(InBufferSize) PVOID InBuffer,
__in ULONG InBufferSize, _In_ ULONG InBufferSize,
__out_bcount_opt(OutBufferSize) PVOID OutBuffer, _Out_writes_bytes_opt_(OutBufferSize) PVOID OutBuffer,
__in ULONG OutBufferSize, _In_ ULONG OutBufferSize,
__out_opt PULONG OutSize _Out_opt_ PULONG OutSize
) PURE; ) PURE;
STDMETHOD(GetSourceFileInformation)( STDMETHOD(GetSourceFileInformation)(
THIS_ THIS_
__in ULONG Which, _In_ ULONG Which,
__in PSTR SourceFile, _In_ PSTR SourceFile,
__in ULONG64 Arg64, _In_ ULONG64 Arg64,
__in ULONG Arg32, _In_ ULONG Arg32,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG InfoSize _Out_opt_ PULONG InfoSize
) PURE; ) PURE;
STDMETHOD(FindSourceFileAndToken)( STDMETHOD(FindSourceFileAndToken)(
THIS_ THIS_
__in ULONG StartElement, _In_ ULONG StartElement,
__in ULONG64 ModAddr, _In_ ULONG64 ModAddr,
__in PCSTR File, _In_ PCSTR File,
__in ULONG Flags, _In_ ULONG Flags,
__in_bcount_opt(FileTokenSize) PVOID FileToken, _In_reads_bytes_opt_(FileTokenSize) PVOID FileToken,
__in ULONG FileTokenSize, _In_ ULONG FileTokenSize,
__out_opt PULONG FoundElement, _Out_opt_ PULONG FoundElement,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG FoundSize _Out_opt_ PULONG FoundSize
) PURE; ) PURE;
STDMETHOD(GetSymbolInformation)( STDMETHOD(GetSymbolInformation)(
THIS_ THIS_
__in ULONG Which, _In_ ULONG Which,
__in ULONG64 Arg64, _In_ ULONG64 Arg64,
__in ULONG Arg32, _In_ ULONG Arg32,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG InfoSize, _Out_opt_ PULONG InfoSize,
__out_ecount_opt(StringBufferSize) PSTR StringBuffer, _Out_writes_opt_(StringBufferSize) PSTR StringBuffer,
__in ULONG StringBufferSize, _In_ ULONG StringBufferSize,
__out_opt PULONG StringSize _Out_opt_ PULONG StringSize
) PURE; ) PURE;
STDMETHOD(GetSystemObjectInformation)( STDMETHOD(GetSystemObjectInformation)(
THIS_ THIS_
__in ULONG Which, _In_ ULONG Which,
__in ULONG64 Arg64, _In_ ULONG64 Arg64,
__in ULONG Arg32, _In_ ULONG Arg32,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG InfoSize _Out_opt_ PULONG InfoSize
) PURE; ) PURE;
// IDebugAdvanced3. // IDebugAdvanced3.
STDMETHOD(GetSourceFileInformationWide)( STDMETHOD(GetSourceFileInformationWide)(
THIS_ THIS_
__in ULONG Which, _In_ ULONG Which,
__in PWSTR SourceFile, _In_ PWSTR SourceFile,
__in ULONG64 Arg64, _In_ ULONG64 Arg64,
__in ULONG Arg32, _In_ ULONG Arg32,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG InfoSize _Out_opt_ PULONG InfoSize
) PURE; ) PURE;
STDMETHOD(FindSourceFileAndTokenWide)( STDMETHOD(FindSourceFileAndTokenWide)(
THIS_ THIS_
__in ULONG StartElement, _In_ ULONG StartElement,
__in ULONG64 ModAddr, _In_ ULONG64 ModAddr,
__in PCWSTR File, _In_ PCWSTR File,
__in ULONG Flags, _In_ ULONG Flags,
__in_bcount_opt(FileTokenSize) PVOID FileToken, _In_reads_bytes_opt_(FileTokenSize) PVOID FileToken,
__in ULONG FileTokenSize, _In_ ULONG FileTokenSize,
__out_opt PULONG FoundElement, _Out_opt_ PULONG FoundElement,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG FoundSize _Out_opt_ PULONG FoundSize
) PURE; ) PURE;
STDMETHOD(GetSymbolInformationWide)( STDMETHOD(GetSymbolInformationWide)(
THIS_ THIS_
__in ULONG Which, _In_ ULONG Which,
__in ULONG64 Arg64, _In_ ULONG64 Arg64,
__in ULONG Arg32, _In_ ULONG Arg32,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG InfoSize, _Out_opt_ PULONG InfoSize,
__out_ecount_opt(StringBufferSize) PWSTR StringBuffer, _Out_writes_opt_(StringBufferSize) PWSTR StringBuffer,
__in ULONG StringBufferSize, _In_ ULONG StringBufferSize,
__out_opt PULONG StringSize _Out_opt_ PULONG StringSize
) PURE; ) PURE;
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// IDebugBreakpoint. // IDebugBreakpoint.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// Types of breakpoints. // Types of breakpoints.
#define DEBUG_BREAKPOINT_CODE 0 #define DEBUG_BREAKPOINT_CODE 0
#define DEBUG_BREAKPOINT_DATA 1 #define DEBUG_BREAKPOINT_DATA 1
#define DEBUG_BREAKPOINT_TIME 2 #define DEBUG_BREAKPOINT_TIME 2
#define DEBUG_BREAKPOINT_INLINE 3
// Breakpoint flags. // Breakpoint flags.
// Go-only breakpoints are only active when // Go-only breakpoints are only active when
// the engine is in unrestricted execution // the engine is in unrestricted execution
// mode. They do not fire when the engine // mode. They do not fire when the engine
// is stepping. // is stepping.
#define DEBUG_BREAKPOINT_GO_ONLY 0x00000001 #define DEBUG_BREAKPOINT_GO_ONLY 0x00000001
// A breakpoint is flagged as deferred as long as // A breakpoint is flagged as deferred as long as
// its offset expression cannot be evaluated. // its offset expression cannot be evaluated.
// A deferred breakpoint is not active. // A deferred breakpoint is not active.
skipping to change at line 905 skipping to change at line 974
ULONG OffsetExpressionSize; ULONG OffsetExpressionSize;
} DEBUG_BREAKPOINT_PARAMETERS, *PDEBUG_BREAKPOINT_PARAMETERS; } DEBUG_BREAKPOINT_PARAMETERS, *PDEBUG_BREAKPOINT_PARAMETERS;
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugBreakpoint #define INTERFACE IDebugBreakpoint
DECLARE_INTERFACE_(IDebugBreakpoint, IUnknown) DECLARE_INTERFACE_(IDebugBreakpoint, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugBreakpoint. // IDebugBreakpoint.
// Retrieves debugger engine unique ID // Retrieves debugger engine unique ID
// for the breakpoint. This ID is // for the breakpoint. This ID is
// fixed as long as the breakpoint exists // fixed as long as the breakpoint exists
// but after that may be reused. // but after that may be reused.
STDMETHOD(GetId)( STDMETHOD(GetId)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Retrieves the type of break and // Retrieves the type of break and
// processor type for the breakpoint. // processor type for the breakpoint.
STDMETHOD(GetType)( STDMETHOD(GetType)(
THIS_ THIS_
__out PULONG BreakType, _Out_ PULONG BreakType,
__out PULONG ProcType _Out_ PULONG ProcType
) PURE; ) PURE;
// Returns the client that called AddBreakpoint. // Returns the client that called AddBreakpoint.
STDMETHOD(GetAdder)( STDMETHOD(GetAdder)(
THIS_ THIS_
__out PDEBUG_CLIENT* Adder _Out_ PDEBUG_CLIENT* Adder
) PURE; ) PURE;
STDMETHOD(GetFlags)( STDMETHOD(GetFlags)(
THIS_ THIS_
__out PULONG Flags _Out_ PULONG Flags
) PURE; ) PURE;
// Only certain flags can be changed. Flags // Only certain flags can be changed. Flags
// are: GO_ONLY, ENABLE. // are: GO_ONLY, ENABLE.
// Sets the given flags. // Sets the given flags.
STDMETHOD(AddFlags)( STDMETHOD(AddFlags)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Clears the given flags. // Clears the given flags.
STDMETHOD(RemoveFlags)( STDMETHOD(RemoveFlags)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Sets the flags. // Sets the flags.
STDMETHOD(SetFlags)( STDMETHOD(SetFlags)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Controls the offset of the breakpoint. The // Controls the offset of the breakpoint. The
// interpretation of the offset value depends on // interpretation of the offset value depends on
// the type of breakpoint and its settings. It // the type of breakpoint and its settings. It
// may be a code address, a data address, an // may be a code address, a data address, an
// I/O port, etc. // I/O port, etc.
STDMETHOD(GetOffset)( STDMETHOD(GetOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(SetOffset)( STDMETHOD(SetOffset)(
THIS_ THIS_
__in ULONG64 Offset _In_ ULONG64 Offset
) PURE; ) PURE;
// Data breakpoint methods will fail if the // Data breakpoint methods will fail if the
// target platform does not support the // target platform does not support the
// parameters used. // parameters used.
// These methods only function for breakpoints // These methods only function for breakpoints
// created as data breakpoints. // created as data breakpoints.
STDMETHOD(GetDataParameters)( STDMETHOD(GetDataParameters)(
THIS_ THIS_
__out PULONG Size, _Out_ PULONG Size,
__out PULONG AccessType _Out_ PULONG AccessType
) PURE; ) PURE;
STDMETHOD(SetDataParameters)( STDMETHOD(SetDataParameters)(
THIS_ THIS_
__in ULONG Size, _In_ ULONG Size,
__in ULONG AccessType _In_ ULONG AccessType
) PURE; ) PURE;
// Pass count defaults to one. // Pass count defaults to one.
STDMETHOD(GetPassCount)( STDMETHOD(GetPassCount)(
THIS_ THIS_
__out PULONG Count _Out_ PULONG Count
) PURE; ) PURE;
STDMETHOD(SetPassCount)( STDMETHOD(SetPassCount)(
THIS_ THIS_
__in ULONG Count _In_ ULONG Count
) PURE; ) PURE;
// Gets the current number of times // Gets the current number of times
// the breakpoint has been hit since // the breakpoint has been hit since
// it was last triggered. // it was last triggered.
STDMETHOD(GetCurrentPassCount)( STDMETHOD(GetCurrentPassCount)(
THIS_ THIS_
__out PULONG Count _Out_ PULONG Count
) PURE; ) PURE;
// If a match thread is set this breakpoint will // If a match thread is set this breakpoint will
// only trigger if it occurs on the match thread. // only trigger if it occurs on the match thread.
// Otherwise it triggers for all threads. // Otherwise it triggers for all threads.
// Thread restrictions are not currently supported // Thread restrictions are not currently supported
// in kernel mode. // in kernel mode.
STDMETHOD(GetMatchThreadId)( STDMETHOD(GetMatchThreadId)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(SetMatchThreadId)( STDMETHOD(SetMatchThreadId)(
THIS_ THIS_
__in ULONG Thread _In_ ULONG Thread
) PURE; ) PURE;
// The command for a breakpoint is automatically // The command for a breakpoint is automatically
// executed by the engine before the event // executed by the engine before the event
// is propagated. If the breakpoint continues // is propagated. If the breakpoint continues
// execution the event will begin with a continue // execution the event will begin with a continue
// status. If the breakpoint does not continue // status. If the breakpoint does not continue
// the event will begin with a break status. // the event will begin with a break status.
// This allows breakpoint commands to participate // This allows breakpoint commands to participate
// in the normal event status voting. // in the normal event status voting.
// Breakpoint commands are only executed until // Breakpoint commands are only executed until
// the first command that alters the execution // the first command that alters the execution
// status, such as g, p and t. // status, such as g, p and t.
STDMETHOD(GetCommand)( STDMETHOD(GetCommand)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG CommandSize _Out_opt_ PULONG CommandSize
) PURE; ) PURE;
STDMETHOD(SetCommand)( STDMETHOD(SetCommand)(
THIS_ THIS_
__in PCSTR Command _In_ PCSTR Command
) PURE; ) PURE;
// Offset expressions are evaluated immediately // Offset expressions are evaluated immediately
// and at module load and unload events. If the // and at module load and unload events. If the
// evaluation is successful the breakpoints // evaluation is successful the breakpoints
// offset is updated and the breakpoint is // offset is updated and the breakpoint is
// handled normally. If the expression cannot // handled normally. If the expression cannot
// be evaluated the breakpoint is deferred. // be evaluated the breakpoint is deferred.
// Currently the only offset expression // Currently the only offset expression
// supported is a module-relative symbol // supported is a module-relative symbol
// of the form <Module>!<Symbol>. // of the form <Module>!<Symbol>.
STDMETHOD(GetOffsetExpression)( STDMETHOD(GetOffsetExpression)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ExpressionSize _Out_opt_ PULONG ExpressionSize
) PURE; ) PURE;
STDMETHOD(SetOffsetExpression)( STDMETHOD(SetOffsetExpression)(
THIS_ THIS_
__in PCSTR Expression _In_ PCSTR Expression
) PURE; ) PURE;
STDMETHOD(GetParameters)( STDMETHOD(GetParameters)(
THIS_ THIS_
__out PDEBUG_BREAKPOINT_PARAMETERS Params _Out_ PDEBUG_BREAKPOINT_PARAMETERS Params
) PURE; ) PURE;
}; };
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugBreakpoint2 #define INTERFACE IDebugBreakpoint2
DECLARE_INTERFACE_(IDebugBreakpoint2, IUnknown) DECLARE_INTERFACE_(IDebugBreakpoint2, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugBreakpoint. // IDebugBreakpoint.
// Retrieves debugger engine unique ID // Retrieves debugger engine unique ID
// for the breakpoint. This ID is // for the breakpoint. This ID is
// fixed as long as the breakpoint exists // fixed as long as the breakpoint exists
// but after that may be reused. // but after that may be reused.
STDMETHOD(GetId)( STDMETHOD(GetId)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Retrieves the type of break and // Retrieves the type of break and
// processor type for the breakpoint. // processor type for the breakpoint.
STDMETHOD(GetType)( STDMETHOD(GetType)(
THIS_ THIS_
__out PULONG BreakType, _Out_ PULONG BreakType,
__out PULONG ProcType _Out_ PULONG ProcType
) PURE; ) PURE;
// Returns the client that called AddBreakpoint. // Returns the client that called AddBreakpoint.
STDMETHOD(GetAdder)( STDMETHOD(GetAdder)(
THIS_ THIS_
__out PDEBUG_CLIENT* Adder _Out_ PDEBUG_CLIENT* Adder
) PURE; ) PURE;
STDMETHOD(GetFlags)( STDMETHOD(GetFlags)(
THIS_ THIS_
__out PULONG Flags _Out_ PULONG Flags
) PURE; ) PURE;
// Only certain flags can be changed. Flags // Only certain flags can be changed. Flags
// are: GO_ONLY, ENABLE. // are: GO_ONLY, ENABLE.
// Sets the given flags. // Sets the given flags.
STDMETHOD(AddFlags)( STDMETHOD(AddFlags)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Clears the given flags. // Clears the given flags.
STDMETHOD(RemoveFlags)( STDMETHOD(RemoveFlags)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Sets the flags. // Sets the flags.
STDMETHOD(SetFlags)( STDMETHOD(SetFlags)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Controls the offset of the breakpoint. The // Controls the offset of the breakpoint. The
// interpretation of the offset value depends on // interpretation of the offset value depends on
// the type of breakpoint and its settings. It // the type of breakpoint and its settings. It
// may be a code address, a data address, an // may be a code address, a data address, an
// I/O port, etc. // I/O port, etc.
STDMETHOD(GetOffset)( STDMETHOD(GetOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(SetOffset)( STDMETHOD(SetOffset)(
THIS_ THIS_
__in ULONG64 Offset _In_ ULONG64 Offset
) PURE; ) PURE;
// Data breakpoint methods will fail if the // Data breakpoint methods will fail if the
// target platform does not support the // target platform does not support the
// parameters used. // parameters used.
// These methods only function for breakpoints // These methods only function for breakpoints
// created as data breakpoints. // created as data breakpoints.
STDMETHOD(GetDataParameters)( STDMETHOD(GetDataParameters)(
THIS_ THIS_
__out PULONG Size, _Out_ PULONG Size,
__out PULONG AccessType _Out_ PULONG AccessType
) PURE; ) PURE;
STDMETHOD(SetDataParameters)( STDMETHOD(SetDataParameters)(
THIS_ THIS_
__in ULONG Size, _In_ ULONG Size,
__in ULONG AccessType _In_ ULONG AccessType
) PURE; ) PURE;
// Pass count defaults to one. // Pass count defaults to one.
STDMETHOD(GetPassCount)( STDMETHOD(GetPassCount)(
THIS_ THIS_
__out PULONG Count _Out_ PULONG Count
) PURE; ) PURE;
STDMETHOD(SetPassCount)( STDMETHOD(SetPassCount)(
THIS_ THIS_
__in ULONG Count _In_ ULONG Count
) PURE; ) PURE;
// Gets the current number of times // Gets the current number of times
// the breakpoint has been hit since // the breakpoint has been hit since
// it was last triggered. // it was last triggered.
STDMETHOD(GetCurrentPassCount)( STDMETHOD(GetCurrentPassCount)(
THIS_ THIS_
__out PULONG Count _Out_ PULONG Count
) PURE; ) PURE;
// If a match thread is set this breakpoint will // If a match thread is set this breakpoint will
// only trigger if it occurs on the match thread. // only trigger if it occurs on the match thread.
// Otherwise it triggers for all threads. // Otherwise it triggers for all threads.
// Thread restrictions are not currently supported // Thread restrictions are not currently supported
// in kernel mode. // in kernel mode.
STDMETHOD(GetMatchThreadId)( STDMETHOD(GetMatchThreadId)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(SetMatchThreadId)( STDMETHOD(SetMatchThreadId)(
THIS_ THIS_
__in ULONG Thread _In_ ULONG Thread
) PURE; ) PURE;
// The command for a breakpoint is automatically // The command for a breakpoint is automatically
// executed by the engine before the event // executed by the engine before the event
// is propagated. If the breakpoint continues // is propagated. If the breakpoint continues
// execution the event will begin with a continue // execution the event will begin with a continue
// status. If the breakpoint does not continue // status. If the breakpoint does not continue
// the event will begin with a break status. // the event will begin with a break status.
// This allows breakpoint commands to participate // This allows breakpoint commands to participate
// in the normal event status voting. // in the normal event status voting.
// Breakpoint commands are only executed until // Breakpoint commands are only executed until
// the first command that alters the execution // the first command that alters the execution
// status, such as g, p and t. // status, such as g, p and t.
STDMETHOD(GetCommand)( STDMETHOD(GetCommand)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG CommandSize _Out_opt_ PULONG CommandSize
) PURE; ) PURE;
STDMETHOD(SetCommand)( STDMETHOD(SetCommand)(
THIS_ THIS_
__in PCSTR Command _In_ PCSTR Command
) PURE; ) PURE;
// Offset expressions are evaluated immediately // Offset expressions are evaluated immediately
// and at module load and unload events. If the // and at module load and unload events. If the
// evaluation is successful the breakpoints // evaluation is successful the breakpoints
// offset is updated and the breakpoint is // offset is updated and the breakpoint is
// handled normally. If the expression cannot // handled normally. If the expression cannot
// be evaluated the breakpoint is deferred. // be evaluated the breakpoint is deferred.
// Currently the only offset expression // Currently the only offset expression
// supported is a module-relative symbol // supported is a module-relative symbol
// of the form <Module>!<Symbol>. // of the form <Module>!<Symbol>.
STDMETHOD(GetOffsetExpression)( STDMETHOD(GetOffsetExpression)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ExpressionSize _Out_opt_ PULONG ExpressionSize
) PURE; ) PURE;
STDMETHOD(SetOffsetExpression)( STDMETHOD(SetOffsetExpression)(
THIS_ THIS_
__in PCSTR Expression _In_ PCSTR Expression
) PURE; ) PURE;
STDMETHOD(GetParameters)( STDMETHOD(GetParameters)(
THIS_ THIS_
__out PDEBUG_BREAKPOINT_PARAMETERS Params _Out_ PDEBUG_BREAKPOINT_PARAMETERS Params
) PURE; ) PURE;
// IDebugBreakpoint2. // IDebugBreakpoint2.
STDMETHOD(GetCommandWide)( STDMETHOD(GetCommandWide)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG CommandSize _Out_opt_ PULONG CommandSize
) PURE; ) PURE;
STDMETHOD(SetCommandWide)( STDMETHOD(SetCommandWide)(
THIS_ THIS_
__in PCWSTR Command _In_ PCWSTR Command
) PURE; ) PURE;
STDMETHOD(GetOffsetExpressionWide)( STDMETHOD(GetOffsetExpressionWide)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ExpressionSize _Out_opt_ PULONG ExpressionSize
) PURE; ) PURE;
STDMETHOD(SetOffsetExpressionWide)( STDMETHOD(SetOffsetExpressionWide)(
THIS_ THIS_
__in PCWSTR Expression _In_ PCWSTR Expression
) PURE;
};
#undef INTERFACE
#define INTERFACE IDebugBreakpoint3
DECLARE_INTERFACE_(IDebugBreakpoint3, IUnknown)
{
// IUnknown.
STDMETHOD(QueryInterface)(
THIS_
_In_ REFIID InterfaceId,
_Out_ PVOID* Interface
) PURE;
STDMETHOD_(ULONG, AddRef)(
THIS
) PURE;
STDMETHOD_(ULONG, Release)(
THIS
) PURE;
// IDebugBreakpoint.
// Retrieves debugger engine unique ID
// for the breakpoint. This ID is
// fixed as long as the breakpoint exists
// but after that may be reused.
STDMETHOD(GetId)(
THIS_
_Out_ PULONG Id
) PURE;
// Retrieves the type of break and
// processor type for the breakpoint.
STDMETHOD(GetType)(
THIS_
_Out_ PULONG BreakType,
_Out_ PULONG ProcType
) PURE;
// Returns the client that called AddBreakpoint.
STDMETHOD(GetAdder)(
THIS_
_Out_ PDEBUG_CLIENT* Adder
) PURE;
STDMETHOD(GetFlags)(
THIS_
_Out_ PULONG Flags
) PURE;
// Only certain flags can be changed. Flags
// are: GO_ONLY, ENABLE.
// Sets the given flags.
STDMETHOD(AddFlags)(
THIS_
_In_ ULONG Flags
) PURE;
// Clears the given flags.
STDMETHOD(RemoveFlags)(
THIS_
_In_ ULONG Flags
) PURE;
// Sets the flags.
STDMETHOD(SetFlags)(
THIS_
_In_ ULONG Flags
) PURE;
// Controls the offset of the breakpoint. The
// interpretation of the offset value depends on
// the type of breakpoint and its settings. It
// may be a code address, a data address, an
// I/O port, etc.
STDMETHOD(GetOffset)(
THIS_
_Out_ PULONG64 Offset
) PURE;
STDMETHOD(SetOffset)(
THIS_
_In_ ULONG64 Offset
) PURE;
// Data breakpoint methods will fail if the
// target platform does not support the
// parameters used.
// These methods only function for breakpoints
// created as data breakpoints.
STDMETHOD(GetDataParameters)(
THIS_
_Out_ PULONG Size,
_Out_ PULONG AccessType
) PURE;
STDMETHOD(SetDataParameters)(
THIS_
_In_ ULONG Size,
_In_ ULONG AccessType
) PURE;
// Pass count defaults to one.
STDMETHOD(GetPassCount)(
THIS_
_Out_ PULONG Count
) PURE;
STDMETHOD(SetPassCount)(
THIS_
_In_ ULONG Count
) PURE;
// Gets the current number of times
// the breakpoint has been hit since
// it was last triggered.
STDMETHOD(GetCurrentPassCount)(
THIS_
_Out_ PULONG Count
) PURE;
// If a match thread is set this breakpoint will
// only trigger if it occurs on the match thread.
// Otherwise it triggers for all threads.
// Thread restrictions are not currently supported
// in kernel mode.
STDMETHOD(GetMatchThreadId)(
THIS_
_Out_ PULONG Id
) PURE;
STDMETHOD(SetMatchThreadId)(
THIS_
_In_ ULONG Thread
) PURE;
// The command for a breakpoint is automatically
// executed by the engine before the event
// is propagated. If the breakpoint continues
// execution the event will begin with a continue
// status. If the breakpoint does not continue
// the event will begin with a break status.
// This allows breakpoint commands to participate
// in the normal event status voting.
// Breakpoint commands are only executed until
// the first command that alters the execution
// status, such as g, p and t.
STDMETHOD(GetCommand)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG CommandSize
) PURE;
STDMETHOD(SetCommand)(
THIS_
_In_ PCSTR Command
) PURE;
// Offset expressions are evaluated immediately
// and at module load and unload events. If the
// evaluation is successful the breakpoints
// offset is updated and the breakpoint is
// handled normally. If the expression cannot
// be evaluated the breakpoint is deferred.
// Currently the only offset expression
// supported is a module-relative symbol
// of the form <Module>!<Symbol>.
STDMETHOD(GetOffsetExpression)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG ExpressionSize
) PURE;
STDMETHOD(SetOffsetExpression)(
THIS_
_In_ PCSTR Expression
) PURE;
STDMETHOD(GetParameters)(
THIS_
_Out_ PDEBUG_BREAKPOINT_PARAMETERS Params
) PURE;
// IDebugBreakpoint2.
STDMETHOD(GetCommandWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG CommandSize
) PURE;
STDMETHOD(SetCommandWide)(
THIS_
_In_ PCWSTR Command
) PURE;
STDMETHOD(GetOffsetExpressionWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG ExpressionSize
) PURE;
STDMETHOD(SetOffsetExpressionWide)(
THIS_
_In_ PCWSTR Expression
) PURE;
// IDebugBreakpoint3.
STDMETHOD(GetGuid)(
THIS_
_Out_ LPGUID Guid
) PURE; ) PURE;
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// IDebugClient. // IDebugClient.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// Kernel attach flags. // Kernel attach flags.
#define DEBUG_ATTACH_KERNEL_CONNECTION 0x00000000 #define DEBUG_ATTACH_KERNEL_CONNECTION 0x00000000
// Attach to the local machine. If this flag is not set // Attach to the local machine. If this flag is not set
// a connection is made to a separate target machine using // a connection is made to a separate target machine using
// the given connection options. // the given connection options.
#define DEBUG_ATTACH_LOCAL_KERNEL 0x00000001 #define DEBUG_ATTACH_LOCAL_KERNEL 0x00000001
// Attach to an eXDI driver. // Attach to an eXDI driver.
#define DEBUG_ATTACH_EXDI_DRIVER 0x00000002 #define DEBUG_ATTACH_EXDI_DRIVER 0x00000002
// Just install client-side transpotr drivers
#define DEBUG_ATTACH_INSTALL_DRIVER 0x00000004
// GetRunningProcessSystemIdByExecutableName flags. // GetRunningProcessSystemIdByExecutableName flags.
// By default the match allows a tail match on // By default the match allows a tail match on
// just the filename. The match returns the first hit // just the filename. The match returns the first hit
// even if multiple matches exist. // even if multiple matches exist.
#define DEBUG_GET_PROC_DEFAULT 0x00000000 #define DEBUG_GET_PROC_DEFAULT 0x00000000
// The name must match fully. // The name must match fully.
#define DEBUG_GET_PROC_FULL_MATCH 0x00000001 #define DEBUG_GET_PROC_FULL_MATCH 0x00000001
// The match must be the only match. // The match must be the only match.
#define DEBUG_GET_PROC_ONLY_MATCH 0x00000002 #define DEBUG_GET_PROC_ONLY_MATCH 0x00000002
skipping to change at line 1467 skipping to change at line 1740
// Register dump before prompt. // Register dump before prompt.
#define DEBUG_OUTPUT_PROMPT_REGISTERS 0x00000020 #define DEBUG_OUTPUT_PROMPT_REGISTERS 0x00000020
// Warnings specific to extension operation. // Warnings specific to extension operation.
#define DEBUG_OUTPUT_EXTENSION_WARNING 0x00000040 #define DEBUG_OUTPUT_EXTENSION_WARNING 0x00000040
// Debuggee debug output, such as from OutputDebugString. // Debuggee debug output, such as from OutputDebugString.
#define DEBUG_OUTPUT_DEBUGGEE 0x00000080 #define DEBUG_OUTPUT_DEBUGGEE 0x00000080
// Debuggee-generated prompt, such as from DbgPrompt. // Debuggee-generated prompt, such as from DbgPrompt.
#define DEBUG_OUTPUT_DEBUGGEE_PROMPT 0x00000100 #define DEBUG_OUTPUT_DEBUGGEE_PROMPT 0x00000100
// Symbol messages, such as for !sym noisy. // Symbol messages, such as for !sym noisy.
#define DEBUG_OUTPUT_SYMBOLS 0x00000200 #define DEBUG_OUTPUT_SYMBOLS 0x00000200
// Output which modifies the status bar
#define DEBUG_OUTPUT_STATUS 0x00000400
// Internal debugger output, used mainly // Internal debugger output, used mainly
// for debugging the debugger. Output // for debugging the debugger. Output
// may only occur in debug builds. // may only occur in debug builds.
// KD protocol output. // KD protocol output.
#define DEBUG_IOUTPUT_KD_PROTOCOL 0x80000000 #define DEBUG_IOUTPUT_KD_PROTOCOL 0x80000000
// Remoting output. // Remoting output.
#define DEBUG_IOUTPUT_REMOTING 0x40000000 #define DEBUG_IOUTPUT_REMOTING 0x40000000
// Breakpoint output. // Breakpoint output.
#define DEBUG_IOUTPUT_BREAKPOINT 0x20000000 #define DEBUG_IOUTPUT_BREAKPOINT 0x20000000
// Event output. // Event output.
#define DEBUG_IOUTPUT_EVENT 0x10000000 #define DEBUG_IOUTPUT_EVENT 0x10000000
// Virtual/Physical address translation // Virtual/Physical address translation
#define DEBUG_IOUTPUT_ADDR_TRANSLATE 0x08000000 #define DEBUG_IOUTPUT_ADDR_TRANSLATE 0x08000000
// OutputIdentity flags. // OutputIdentity flags.
#define DEBUG_OUTPUT_IDENTITY_DEFAULT 0x00000000 #define DEBUG_OUTPUT_IDENTITY_DEFAULT 0x00000000
// Client identification constants
#define DEBUG_CLIENT_UNKNOWN 0x0
#define DEBUG_CLIENT_VSINT 0x1
#define DEBUG_CLIENT_NTSD 0x2
#define DEBUG_CLIENT_NTKD 0x3
#define DEBUG_CLIENT_CDB 0x4
#define DEBUG_CLIENT_KD 0x5
#define DEBUG_CLIENT_WINDBG 0x6
#define DEBUG_CLIENT_WINIDE 0x7
typedef struct _DEBUG_CLIENT_CONTEXT
{
UINT cbSize;
UINT eClient;
} DEBUG_CLIENT_CONTEXT, *PDEBUG_CLIENT_CONTEXT;
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugClient #define INTERFACE IDebugClient
DECLARE_INTERFACE_(IDebugClient, IUnknown) DECLARE_INTERFACE_(IDebugClient, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugClient. // IDebugClient.
// The following set of methods start // The following set of methods start
// the different kinds of debuggees. // the different kinds of debuggees.
// Begins a debug session using the kernel // Begins a debug session using the kernel
// debugging protocol. This method selects // debugging protocol. This method selects
// the protocol as the debuggee communication // the protocol as the debuggee communication
// mechanism but does not initiate the communication // mechanism but does not initiate the communication
// itself. // itself.
STDMETHOD(AttachKernel)( STDMETHOD(AttachKernel)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in_opt PCSTR ConnectOptions _In_opt_ PCSTR ConnectOptions
) PURE; ) PURE;
STDMETHOD(GetKernelConnectionOptions)( STDMETHOD(GetKernelConnectionOptions)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG OptionsSize _Out_opt_ PULONG OptionsSize
) PURE; ) PURE;
// Updates the connection options for a live // Updates the connection options for a live
// kernel connection. This can only be used // kernel connection. This can only be used
// to modify parameters for the connection, not // to modify parameters for the connection, not
// to switch to a completely different kind of // to switch to a completely different kind of
// connection. // connection.
// This method is reentrant. // This method is reentrant.
STDMETHOD(SetKernelConnectionOptions)( STDMETHOD(SetKernelConnectionOptions)(
THIS_ THIS_
__in PCSTR Options _In_ PCSTR Options
) PURE; ) PURE;
// Starts a process server for remote // Starts a process server for remote
// user-mode process control. // user-mode process control.
// The local process server is server zero. // The local process server is server zero.
STDMETHOD(StartProcessServer)( STDMETHOD(StartProcessServer)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in PCSTR Options, _In_ PCSTR Options,
__in_opt __reserved PVOID Reserved _In_opt_ _Reserved_ PVOID Reserved
) PURE; ) PURE;
STDMETHOD(ConnectProcessServer)( STDMETHOD(ConnectProcessServer)(
THIS_ THIS_
__in PCSTR RemoteOptions, _In_ PCSTR RemoteOptions,
__out PULONG64 Server _Out_ PULONG64 Server
) PURE; ) PURE;
STDMETHOD(DisconnectProcessServer)( STDMETHOD(DisconnectProcessServer)(
THIS_ THIS_
__in ULONG64 Server _In_ ULONG64 Server
) PURE; ) PURE;
// Enumerates and describes processes // Enumerates and describes processes
// accessible through the given process server. // accessible through the given process server.
STDMETHOD(GetRunningProcessSystemIds)( STDMETHOD(GetRunningProcessSystemIds)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__out_ecount_opt(Count) PULONG Ids, _Out_writes_opt_(Count) PULONG Ids,
__in ULONG Count, _In_ ULONG Count,
__out_opt PULONG ActualCount _Out_opt_ PULONG ActualCount
) PURE; ) PURE;
STDMETHOD(GetRunningProcessSystemIdByExecutableName)( STDMETHOD(GetRunningProcessSystemIdByExecutableName)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PCSTR ExeName, _In_ PCSTR ExeName,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetRunningProcessDescription)( STDMETHOD(GetRunningProcessDescription)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in ULONG SystemId, _In_ ULONG SystemId,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(ExeNameSize) PSTR ExeName, _Out_writes_opt_(ExeNameSize) PSTR ExeName,
__in ULONG ExeNameSize, _In_ ULONG ExeNameSize,
__out_opt PULONG ActualExeNameSize, _Out_opt_ PULONG ActualExeNameSize,
__out_ecount_opt(DescriptionSize) PSTR Description, _Out_writes_opt_(DescriptionSize) PSTR Description,
__in ULONG DescriptionSize, _In_ ULONG DescriptionSize,
__out_opt PULONG ActualDescriptionSize _Out_opt_ PULONG ActualDescriptionSize
) PURE; ) PURE;
// Attaches to a running user-mode process. // Attaches to a running user-mode process.
STDMETHOD(AttachProcess)( STDMETHOD(AttachProcess)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in ULONG ProcessId, _In_ ULONG ProcessId,
__in ULONG AttachFlags _In_ ULONG AttachFlags
) PURE; ) PURE;
// Creates a new user-mode process for debugging. // Creates a new user-mode process for debugging.
// CreateFlags are as given to Win32s CreateProcess. // CreateFlags are as given to Win32s CreateProcess.
// One of DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS // One of DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS
// must be specified. // must be specified.
STDMETHOD(CreateProcess)( STDMETHOD(CreateProcess)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PSTR CommandLine, _In_ PSTR CommandLine,
__in ULONG CreateFlags _In_ ULONG CreateFlags
) PURE; ) PURE;
// Creates or attaches to a user-mode process, or both. // Creates or attaches to a user-mode process, or both.
// If CommandLine is NULL this method operates as // If CommandLine is NULL this method operates as
// AttachProcess does. If ProcessId is zero it // AttachProcess does. If ProcessId is zero it
// operates as CreateProcess does. If CommandLine is // operates as CreateProcess does. If CommandLine is
// non-NULL and ProcessId is non-zero the method first // non-NULL and ProcessId is non-zero the method first
// starts a process with the given information but // starts a process with the given information but
// in a suspended state. The engine then attaches to // in a suspended state. The engine then attaches to
// the indicated process. Once the attach is successful // the indicated process. Once the attach is successful
// the suspended process is resumed. This provides // the suspended process is resumed. This provides
// synchronization between the new process and the // synchronization between the new process and the
// attachment. // attachment.
STDMETHOD(CreateProcessAndAttach)( STDMETHOD(CreateProcessAndAttach)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in_opt PSTR CommandLine, _In_opt_ PSTR CommandLine,
__in ULONG CreateFlags, _In_ ULONG CreateFlags,
__in ULONG ProcessId, _In_ ULONG ProcessId,
__in ULONG AttachFlags _In_ ULONG AttachFlags
) PURE; ) PURE;
// Gets and sets process control flags. // Gets and sets process control flags.
STDMETHOD(GetProcessOptions)( STDMETHOD(GetProcessOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddProcessOptions)( STDMETHOD(AddProcessOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveProcessOptions)( STDMETHOD(RemoveProcessOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetProcessOptions)( STDMETHOD(SetProcessOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
// Opens any kind of user- or kernel-mode dump file // Opens any kind of user- or kernel-mode dump file
// and begins a debug session with the information // and begins a debug session with the information
// contained within it. // contained within it.
STDMETHOD(OpenDumpFile)( STDMETHOD(OpenDumpFile)(
THIS_ THIS_
__in PCSTR DumpFile _In_ PCSTR DumpFile
) PURE; ) PURE;
// Writes a dump file from the current session information. // Writes a dump file from the current session information.
// The kind of dump file written is determined by the // The kind of dump file written is determined by the
// kind of session and the type qualifier given. // kind of session and the type qualifier given.
// For example, if the current session is a kernel // For example, if the current session is a kernel
// debug session (DEBUG_CLASS_KERNEL) and the qualifier // debug session (DEBUG_CLASS_KERNEL) and the qualifier
// is DEBUG_DUMP_SMALL a small kernel dump will be written. // is DEBUG_DUMP_SMALL a small kernel dump will be written.
STDMETHOD(WriteDumpFile)( STDMETHOD(WriteDumpFile)(
THIS_ THIS_
__in PCSTR DumpFile, _In_ PCSTR DumpFile,
__in ULONG Qualifier _In_ ULONG Qualifier
) PURE; ) PURE;
// Indicates that a remote client is ready to // Indicates that a remote client is ready to
// begin participating in the current session. // begin participating in the current session.
// HistoryLimit gives a character limit on // HistoryLimit gives a character limit on
// the amount of output history to be sent. // the amount of output history to be sent.
STDMETHOD(ConnectSession)( STDMETHOD(ConnectSession)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG HistoryLimit _In_ ULONG HistoryLimit
) PURE; ) PURE;
// Indicates that the engine should start accepting // Indicates that the engine should start accepting
// remote connections. Options specifies connection types // remote connections. Options specifies connection types
// and their parameters. Supported strings are: // and their parameters. Supported strings are:
// npipe:Pipe=<Pipe name> // npipe:Pipe=<Pipe name>
// tcp:Port=<IP port> // tcp:Port=<IP port>
STDMETHOD(StartServer)( STDMETHOD(StartServer)(
THIS_ THIS_
__in PCSTR Options _In_ PCSTR Options
) PURE; ) PURE;
// List the servers running on the given machine. // List the servers running on the given machine.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputServers)( STDMETHOD(OutputServers)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCSTR Machine, _In_ PCSTR Machine,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Attempts to terminate all processes in the debuggers list. // Attempts to terminate all processes in the debuggers list.
STDMETHOD(TerminateProcesses)( STDMETHOD(TerminateProcesses)(
THIS THIS
) PURE; ) PURE;
// Attempts to detach from all processes in the debuggers list. // Attempts to detach from all processes in the debuggers list.
// This requires OS support for debugger detach. // This requires OS support for debugger detach.
STDMETHOD(DetachProcesses)( STDMETHOD(DetachProcesses)(
THIS THIS
) PURE; ) PURE;
// Stops the current debug session. If a process // Stops the current debug session. If a process
// was created or attached an active EndSession can // was created or attached an active EndSession can
// terminate or detach from it. // terminate or detach from it.
// If a kernel connection was opened it will be closed but the // If a kernel connection was opened it will be closed but the
// target machine is otherwise unaffected. // target machine is otherwise unaffected.
STDMETHOD(EndSession)( STDMETHOD(EndSession)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// If a process was started and ran to completion // If a process was started and ran to completion
// this method can be used to retrieve its exit code. // this method can be used to retrieve its exit code.
STDMETHOD(GetExitCode)( STDMETHOD(GetExitCode)(
THIS_ THIS_
__out PULONG Code _Out_ PULONG Code
) PURE; ) PURE;
// Client event callbacks are called on the thread // Client event callbacks are called on the thread
// of the client. In order to give thread // of the client. In order to give thread
// execution to the engine for callbacks all // execution to the engine for callbacks all
// client threads should call DispatchCallbacks // client threads should call DispatchCallbacks
// when they are idle. Callbacks are only // when they are idle. Callbacks are only
// received when a thread calls DispatchCallbacks // received when a thread calls DispatchCallbacks
// or WaitForEvent. WaitForEvent can only be // or WaitForEvent. WaitForEvent can only be
// called by the thread that started the debug // called by the thread that started the debug
skipping to change at line 1726 skipping to change at line 2017
// call DispatchCallbacks when possible. // call DispatchCallbacks when possible.
// DispatchCallbacks returns when ExitDispatch is used // DispatchCallbacks returns when ExitDispatch is used
// to interrupt dispatch or when the timeout expires. // to interrupt dispatch or when the timeout expires.
// DispatchCallbacks dispatches callbacks for all // DispatchCallbacks dispatches callbacks for all
// clients associated with the thread calling // clients associated with the thread calling
// DispatchCallbacks. // DispatchCallbacks.
// DispatchCallbacks returns S_FALSE when the // DispatchCallbacks returns S_FALSE when the
// timeout expires. // timeout expires.
STDMETHOD(DispatchCallbacks)( STDMETHOD(DispatchCallbacks)(
THIS_ THIS_
__in ULONG Timeout _In_ ULONG Timeout
) PURE; ) PURE;
// ExitDispatch can be used to interrupt callback // ExitDispatch can be used to interrupt callback
// dispatch when a client thread is needed by the // dispatch when a client thread is needed by the
// client. This method is reentrant and can // client. This method is reentrant and can
// be called from any thread. // be called from any thread.
STDMETHOD(ExitDispatch)( STDMETHOD(ExitDispatch)(
THIS_ THIS_
__in PDEBUG_CLIENT Client _In_ PDEBUG_CLIENT Client
) PURE; ) PURE;
// Clients are specific to the thread that // Clients are specific to the thread that
// created them. Calls from other threads // created them. Calls from other threads
// fail immediately. The CreateClient method // fail immediately. The CreateClient method
// is a notable exception; it allows creation // is a notable exception; it allows creation
// of a new client for a new thread. // of a new client for a new thread.
STDMETHOD(CreateClient)( STDMETHOD(CreateClient)(
THIS_ THIS_
__out PDEBUG_CLIENT* Client _Out_ PDEBUG_CLIENT* Client
) PURE; ) PURE;
STDMETHOD(GetInputCallbacks)( STDMETHOD(GetInputCallbacks)(
THIS_ THIS_
__out PDEBUG_INPUT_CALLBACKS* Callbacks _Out_ PDEBUG_INPUT_CALLBACKS* Callbacks
) PURE; ) PURE;
STDMETHOD(SetInputCallbacks)( STDMETHOD(SetInputCallbacks)(
THIS_ THIS_
__in_opt PDEBUG_INPUT_CALLBACKS Callbacks _In_opt_ PDEBUG_INPUT_CALLBACKS Callbacks
) PURE; ) PURE;
// Output callback interfaces are described separately. // Output callback interfaces are described separately.
STDMETHOD(GetOutputCallbacks)( STDMETHOD(GetOutputCallbacks)(
THIS_ THIS_
__out PDEBUG_OUTPUT_CALLBACKS* Callbacks _Out_ PDEBUG_OUTPUT_CALLBACKS* Callbacks
) PURE; ) PURE;
STDMETHOD(SetOutputCallbacks)( STDMETHOD(SetOutputCallbacks)(
THIS_ THIS_
__in_opt PDEBUG_OUTPUT_CALLBACKS Callbacks _In_opt_ PDEBUG_OUTPUT_CALLBACKS Callbacks
) PURE; ) PURE;
// Output flags provide control over // Output flags provide control over
// the distribution of output among clients. // the distribution of output among clients.
// Output masks select which output streams // Output masks select which output streams
// should be sent to the output callbacks. // should be sent to the output callbacks.
// Only Output calls with a mask that // Only Output calls with a mask that
// contains one of the output mask bits // contains one of the output mask bits
// will be sent to the output callbacks. // will be sent to the output callbacks.
// These methods are reentrant. // These methods are reentrant.
// If such access is not synchronized // If such access is not synchronized
// disruptions in output may occur. // disruptions in output may occur.
STDMETHOD(GetOutputMask)( STDMETHOD(GetOutputMask)(
THIS_ THIS_
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
STDMETHOD(SetOutputMask)( STDMETHOD(SetOutputMask)(
THIS_ THIS_
__in ULONG Mask _In_ ULONG Mask
) PURE; ) PURE;
// These methods allow access to another clients // These methods allow access to another clients
// output mask. They are necessary for changing // output mask. They are necessary for changing
// a clients output mask when it is // a clients output mask when it is
// waiting for events. These methods are reentrant // waiting for events. These methods are reentrant
// and can be called from any thread. // and can be called from any thread.
STDMETHOD(GetOtherOutputMask)( STDMETHOD(GetOtherOutputMask)(
THIS_ THIS_
__in PDEBUG_CLIENT Client, _In_ PDEBUG_CLIENT Client,
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
STDMETHOD(SetOtherOutputMask)( STDMETHOD(SetOtherOutputMask)(
THIS_ THIS_
__in PDEBUG_CLIENT Client, _In_ PDEBUG_CLIENT Client,
__in ULONG Mask _In_ ULONG Mask
) PURE; ) PURE;
// Control the width of an output line for // Control the width of an output line for
// commands which produce formatted output. // commands which produce formatted output.
// This setting is just a suggestion. // This setting is just a suggestion.
STDMETHOD(GetOutputWidth)( STDMETHOD(GetOutputWidth)(
THIS_ THIS_
__out PULONG Columns _Out_ PULONG Columns
) PURE; ) PURE;
STDMETHOD(SetOutputWidth)( STDMETHOD(SetOutputWidth)(
THIS_ THIS_
__in ULONG Columns _In_ ULONG Columns
) PURE; ) PURE;
// Some of the engines output commands produce // Some of the engines output commands produce
// multiple lines of output. A prefix can be // multiple lines of output. A prefix can be
// set that the engine will automatically output // set that the engine will automatically output
// for each line in that case, allowing a caller // for each line in that case, allowing a caller
// to control indentation or identifying marks. // to control indentation or identifying marks.
// This is not a general setting for any output // This is not a general setting for any output
// with a newline in it. Methods which use // with a newline in it. Methods which use
// the line prefix are marked in their documentation. // the line prefix are marked in their documentation.
STDMETHOD(GetOutputLinePrefix)( STDMETHOD(GetOutputLinePrefix)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PrefixSize _Out_opt_ PULONG PrefixSize
) PURE; ) PURE;
STDMETHOD(SetOutputLinePrefix)( STDMETHOD(SetOutputLinePrefix)(
THIS_ THIS_
__in_opt PCSTR Prefix _In_opt_ PCSTR Prefix
) PURE; ) PURE;
// Returns a string describing the machine // Returns a string describing the machine
// and user this client represents. The // and user this client represents. The
// specific content of the string varies // specific content of the string varies
// with operating system. If the client is // with operating system. If the client is
// remotely connected some network information // remotely connected some network information
// may also be present. // may also be present.
STDMETHOD(GetIdentity)( STDMETHOD(GetIdentity)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG IdentitySize _Out_opt_ PULONG IdentitySize
) PURE; ) PURE;
// Format is a printf-like format string // Format is a printf-like format string
// with one %s where the identity string should go. // with one %s where the identity string should go.
STDMETHOD(OutputIdentity)( STDMETHOD(OutputIdentity)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags, _In_ ULONG Flags,
__in PCSTR Format _In_ PCSTR Format
) PURE; ) PURE;
// Event callbacks allow a client to // Event callbacks allow a client to
// receive notification about changes // receive notification about changes
// during the debug session. // during the debug session.
STDMETHOD(GetEventCallbacks)( STDMETHOD(GetEventCallbacks)(
THIS_ THIS_
__out PDEBUG_EVENT_CALLBACKS* Callbacks _Out_ PDEBUG_EVENT_CALLBACKS* Callbacks
) PURE; ) PURE;
STDMETHOD(SetEventCallbacks)( STDMETHOD(SetEventCallbacks)(
THIS_ THIS_
__in_opt PDEBUG_EVENT_CALLBACKS Callbacks _In_opt_ PDEBUG_EVENT_CALLBACKS Callbacks
) PURE; ) PURE;
// The engine sometimes merges compatible callback // The engine sometimes merges compatible callback
// requests to reduce callback overhead. This is // requests to reduce callback overhead. This is
// most noticeable with output as small pieces of // most noticeable with output as small pieces of
// output are collected into larger groups to // output are collected into larger groups to
// reduce the overall number of output callback calls. // reduce the overall number of output callback calls.
// A client can use this method to force all pending // A client can use this method to force all pending
// callbacks to be delivered. This is rarely necessary. // callbacks to be delivered. This is rarely necessary.
STDMETHOD(FlushCallbacks)( STDMETHOD(FlushCallbacks)(
skipping to change at line 1903 skipping to change at line 2194
#define DEBUG_FORMAT_USER_SMALL_FILTER_MEMORY 0x00000020 #define DEBUG_FORMAT_USER_SMALL_FILTER_MEMORY 0x00000020
#define DEBUG_FORMAT_USER_SMALL_FILTER_PATHS 0x00000040 #define DEBUG_FORMAT_USER_SMALL_FILTER_PATHS 0x00000040
#define DEBUG_FORMAT_USER_SMALL_PROCESS_THREAD_DATA 0x00000080 #define DEBUG_FORMAT_USER_SMALL_PROCESS_THREAD_DATA 0x00000080
#define DEBUG_FORMAT_USER_SMALL_PRIVATE_READ_WRITE_MEMORY 0x00000100 #define DEBUG_FORMAT_USER_SMALL_PRIVATE_READ_WRITE_MEMORY 0x00000100
#define DEBUG_FORMAT_USER_SMALL_NO_OPTIONAL_DATA 0x00000200 #define DEBUG_FORMAT_USER_SMALL_NO_OPTIONAL_DATA 0x00000200
#define DEBUG_FORMAT_USER_SMALL_FULL_MEMORY_INFO 0x00000400 #define DEBUG_FORMAT_USER_SMALL_FULL_MEMORY_INFO 0x00000400
#define DEBUG_FORMAT_USER_SMALL_THREAD_INFO 0x00000800 #define DEBUG_FORMAT_USER_SMALL_THREAD_INFO 0x00000800
#define DEBUG_FORMAT_USER_SMALL_CODE_SEGMENTS 0x00001000 #define DEBUG_FORMAT_USER_SMALL_CODE_SEGMENTS 0x00001000
#define DEBUG_FORMAT_USER_SMALL_NO_AUXILIARY_STATE 0x00002000 #define DEBUG_FORMAT_USER_SMALL_NO_AUXILIARY_STATE 0x00002000
#define DEBUG_FORMAT_USER_SMALL_FULL_AUXILIARY_STATE 0x00004000 #define DEBUG_FORMAT_USER_SMALL_FULL_AUXILIARY_STATE 0x00004000
#define DEBUG_FORMAT_USER_SMALL_MODULE_HEADERS 0x00008000
#define DEBUG_FORMAT_USER_SMALL_FILTER_TRIAGE 0x00010000
#define DEBUG_FORMAT_USER_SMALL_IGNORE_INACCESSIBLE_MEM 0x08000000 #define DEBUG_FORMAT_USER_SMALL_IGNORE_INACCESSIBLE_MEM 0x08000000
// //
// Dump information file types. // Dump information file types.
// //
// Base dump file, returned when querying for dump files. // Base dump file, returned when querying for dump files.
#define DEBUG_DUMP_FILE_BASE 0xffffffff #define DEBUG_DUMP_FILE_BASE 0xffffffff
// Single file containing packed page file information. // Single file containing packed page file information.
#define DEBUG_DUMP_FILE_PAGE_FILE_DUMP 0x00000000 #define DEBUG_DUMP_FILE_PAGE_FILE_DUMP 0x00000000
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugClient2 #define INTERFACE IDebugClient2
DECLARE_INTERFACE_(IDebugClient2, IUnknown) DECLARE_INTERFACE_(IDebugClient2, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugClient. // IDebugClient.
// The following set of methods start // The following set of methods start
// the different kinds of debuggees. // the different kinds of debuggees.
// Begins a debug session using the kernel // Begins a debug session using the kernel
// debugging protocol. This method selects // debugging protocol. This method selects
// the protocol as the debuggee communication // the protocol as the debuggee communication
// mechanism but does not initiate the communication // mechanism but does not initiate the communication
// itself. // itself.
STDMETHOD(AttachKernel)( STDMETHOD(AttachKernel)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in_opt PCSTR ConnectOptions _In_opt_ PCSTR ConnectOptions
) PURE; ) PURE;
STDMETHOD(GetKernelConnectionOptions)( STDMETHOD(GetKernelConnectionOptions)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG OptionsSize _Out_opt_ PULONG OptionsSize
) PURE; ) PURE;
// Updates the connection options for a live // Updates the connection options for a live
// kernel connection. This can only be used // kernel connection. This can only be used
// to modify parameters for the connection, not // to modify parameters for the connection, not
// to switch to a completely different kind of // to switch to a completely different kind of
// connection. // connection.
// This method is reentrant. // This method is reentrant.
STDMETHOD(SetKernelConnectionOptions)( STDMETHOD(SetKernelConnectionOptions)(
THIS_ THIS_
__in PCSTR Options _In_ PCSTR Options
) PURE; ) PURE;
// Starts a process server for remote // Starts a process server for remote
// user-mode process control. // user-mode process control.
// The local process server is server zero. // The local process server is server zero.
STDMETHOD(StartProcessServer)( STDMETHOD(StartProcessServer)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in PCSTR Options, _In_ PCSTR Options,
__in_opt __reserved PVOID Reserved _In_opt_ _Reserved_ PVOID Reserved
) PURE; ) PURE;
STDMETHOD(ConnectProcessServer)( STDMETHOD(ConnectProcessServer)(
THIS_ THIS_
__in PCSTR RemoteOptions, _In_ PCSTR RemoteOptions,
__out PULONG64 Server _Out_ PULONG64 Server
) PURE; ) PURE;
STDMETHOD(DisconnectProcessServer)( STDMETHOD(DisconnectProcessServer)(
THIS_ THIS_
__in ULONG64 Server _In_ ULONG64 Server
) PURE; ) PURE;
// Enumerates and describes processes // Enumerates and describes processes
// accessible through the given process server. // accessible through the given process server.
STDMETHOD(GetRunningProcessSystemIds)( STDMETHOD(GetRunningProcessSystemIds)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__out_ecount_opt(Count) PULONG Ids, _Out_writes_opt_(Count) PULONG Ids,
__in ULONG Count, _In_ ULONG Count,
__out_opt PULONG ActualCount _Out_opt_ PULONG ActualCount
) PURE; ) PURE;
STDMETHOD(GetRunningProcessSystemIdByExecutableName)( STDMETHOD(GetRunningProcessSystemIdByExecutableName)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PCSTR ExeName, _In_ PCSTR ExeName,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetRunningProcessDescription)( STDMETHOD(GetRunningProcessDescription)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in ULONG SystemId, _In_ ULONG SystemId,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(ExeNameSize) PSTR ExeName, _Out_writes_opt_(ExeNameSize) PSTR ExeName,
__in ULONG ExeNameSize, _In_ ULONG ExeNameSize,
__out_opt PULONG ActualExeNameSize, _Out_opt_ PULONG ActualExeNameSize,
__out_ecount_opt(DescriptionSize) PSTR Description, _Out_writes_opt_(DescriptionSize) PSTR Description,
__in ULONG DescriptionSize, _In_ ULONG DescriptionSize,
__out_opt PULONG ActualDescriptionSize _Out_opt_ PULONG ActualDescriptionSize
) PURE; ) PURE;
// Attaches to a running user-mode process. // Attaches to a running user-mode process.
STDMETHOD(AttachProcess)( STDMETHOD(AttachProcess)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in ULONG ProcessId, _In_ ULONG ProcessId,
__in ULONG AttachFlags _In_ ULONG AttachFlags
) PURE; ) PURE;
// Creates a new user-mode process for debugging. // Creates a new user-mode process for debugging.
// CreateFlags are as given to Win32s CreateProcess. // CreateFlags are as given to Win32s CreateProcess.
// One of DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS // One of DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS
// must be specified. // must be specified.
STDMETHOD(CreateProcess)( STDMETHOD(CreateProcess)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PSTR CommandLine, _In_ PSTR CommandLine,
__in ULONG CreateFlags _In_ ULONG CreateFlags
) PURE; ) PURE;
// Creates or attaches to a user-mode process, or both. // Creates or attaches to a user-mode process, or both.
// If CommandLine is NULL this method operates as // If CommandLine is NULL this method operates as
// AttachProcess does. If ProcessId is zero it // AttachProcess does. If ProcessId is zero it
// operates as CreateProcess does. If CommandLine is // operates as CreateProcess does. If CommandLine is
// non-NULL and ProcessId is non-zero the method first // non-NULL and ProcessId is non-zero the method first
// starts a process with the given information but // starts a process with the given information but
// in a suspended state. The engine then attaches to // in a suspended state. The engine then attaches to
// the indicated process. Once the attach is successful // the indicated process. Once the attach is successful
// the suspended process is resumed. This provides // the suspended process is resumed. This provides
// synchronization between the new process and the // synchronization between the new process and the
// attachment. // attachment.
STDMETHOD(CreateProcessAndAttach)( STDMETHOD(CreateProcessAndAttach)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in_opt PSTR CommandLine, _In_opt_ PSTR CommandLine,
__in ULONG CreateFlags, _In_ ULONG CreateFlags,
__in ULONG ProcessId, _In_ ULONG ProcessId,
__in ULONG AttachFlags _In_ ULONG AttachFlags
) PURE; ) PURE;
// Gets and sets process control flags. // Gets and sets process control flags.
STDMETHOD(GetProcessOptions)( STDMETHOD(GetProcessOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddProcessOptions)( STDMETHOD(AddProcessOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveProcessOptions)( STDMETHOD(RemoveProcessOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetProcessOptions)( STDMETHOD(SetProcessOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
// Opens any kind of user- or kernel-mode dump file // Opens any kind of user- or kernel-mode dump file
// and begins a debug session with the information // and begins a debug session with the information
// contained within it. // contained within it.
STDMETHOD(OpenDumpFile)( STDMETHOD(OpenDumpFile)(
THIS_ THIS_
__in PCSTR DumpFile _In_ PCSTR DumpFile
) PURE; ) PURE;
// Writes a dump file from the current session information. // Writes a dump file from the current session information.
// The kind of dump file written is determined by the // The kind of dump file written is determined by the
// kind of session and the type qualifier given. // kind of session and the type qualifier given.
// For example, if the current session is a kernel // For example, if the current session is a kernel
// debug session (DEBUG_CLASS_KERNEL) and the qualifier // debug session (DEBUG_CLASS_KERNEL) and the qualifier
// is DEBUG_DUMP_SMALL a small kernel dump will be written. // is DEBUG_DUMP_SMALL a small kernel dump will be written.
STDMETHOD(WriteDumpFile)( STDMETHOD(WriteDumpFile)(
THIS_ THIS_
__in PCSTR DumpFile, _In_ PCSTR DumpFile,
__in ULONG Qualifier _In_ ULONG Qualifier
) PURE; ) PURE;
// Indicates that a remote client is ready to // Indicates that a remote client is ready to
// begin participating in the current session. // begin participating in the current session.
// HistoryLimit gives a character limit on // HistoryLimit gives a character limit on
// the amount of output history to be sent. // the amount of output history to be sent.
STDMETHOD(ConnectSession)( STDMETHOD(ConnectSession)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG HistoryLimit _In_ ULONG HistoryLimit
) PURE; ) PURE;
// Indicates that the engine should start accepting // Indicates that the engine should start accepting
// remote connections. Options specifies connection types // remote connections. Options specifies connection types
// and their parameters. Supported strings are: // and their parameters. Supported strings are:
// npipe:Pipe=<Pipe name> // npipe:Pipe=<Pipe name>
// tcp:Port=<IP port> // tcp:Port=<IP port>
STDMETHOD(StartServer)( STDMETHOD(StartServer)(
THIS_ THIS_
__in PCSTR Options _In_ PCSTR Options
) PURE; ) PURE;
// List the servers running on the given machine. // List the servers running on the given machine.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputServers)( STDMETHOD(OutputServers)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCSTR Machine, _In_ PCSTR Machine,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Attempts to terminate all processes in the debuggers list. // Attempts to terminate all processes in the debuggers list.
STDMETHOD(TerminateProcesses)( STDMETHOD(TerminateProcesses)(
THIS THIS
) PURE; ) PURE;
// Attempts to detach from all processes in the debuggers list. // Attempts to detach from all processes in the debuggers list.
// This requires OS support for debugger detach. // This requires OS support for debugger detach.
STDMETHOD(DetachProcesses)( STDMETHOD(DetachProcesses)(
THIS THIS
) PURE; ) PURE;
// Stops the current debug session. If a process // Stops the current debug session. If a process
// was created or attached an active EndSession can // was created or attached an active EndSession can
// terminate or detach from it. // terminate or detach from it.
// If a kernel connection was opened it will be closed but the // If a kernel connection was opened it will be closed but the
// target machine is otherwise unaffected. // target machine is otherwise unaffected.
STDMETHOD(EndSession)( STDMETHOD(EndSession)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// If a process was started and ran to completion // If a process was started and ran to completion
// this method can be used to retrieve its exit code. // this method can be used to retrieve its exit code.
STDMETHOD(GetExitCode)( STDMETHOD(GetExitCode)(
THIS_ THIS_
__out PULONG Code _Out_ PULONG Code
) PURE; ) PURE;
// Client event callbacks are called on the thread // Client event callbacks are called on the thread
// of the client. In order to give thread // of the client. In order to give thread
// execution to the engine for callbacks all // execution to the engine for callbacks all
// client threads should call DispatchCallbacks // client threads should call DispatchCallbacks
// when they are idle. Callbacks are only // when they are idle. Callbacks are only
// received when a thread calls DispatchCallbacks // received when a thread calls DispatchCallbacks
// or WaitForEvent. WaitForEvent can only be // or WaitForEvent. WaitForEvent can only be
// called by the thread that started the debug // called by the thread that started the debug
skipping to change at line 2155 skipping to change at line 2448
// call DispatchCallbacks when possible. // call DispatchCallbacks when possible.
// DispatchCallbacks returns when ExitDispatch is used // DispatchCallbacks returns when ExitDispatch is used
// to interrupt dispatch or when the timeout expires. // to interrupt dispatch or when the timeout expires.
// DispatchCallbacks dispatches callbacks for all // DispatchCallbacks dispatches callbacks for all
// clients associated with the thread calling // clients associated with the thread calling
// DispatchCallbacks. // DispatchCallbacks.
// DispatchCallbacks returns S_FALSE when the // DispatchCallbacks returns S_FALSE when the
// timeout expires. // timeout expires.
STDMETHOD(DispatchCallbacks)( STDMETHOD(DispatchCallbacks)(
THIS_ THIS_
__in ULONG Timeout _In_ ULONG Timeout
) PURE; ) PURE;
// ExitDispatch can be used to interrupt callback // ExitDispatch can be used to interrupt callback
// dispatch when a client thread is needed by the // dispatch when a client thread is needed by the
// client. This method is reentrant and can // client. This method is reentrant and can
// be called from any thread. // be called from any thread.
STDMETHOD(ExitDispatch)( STDMETHOD(ExitDispatch)(
THIS_ THIS_
__in PDEBUG_CLIENT Client _In_ PDEBUG_CLIENT Client
) PURE; ) PURE;
// Clients are specific to the thread that // Clients are specific to the thread that
// created them. Calls from other threads // created them. Calls from other threads
// fail immediately. The CreateClient method // fail immediately. The CreateClient method
// is a notable exception; it allows creation // is a notable exception; it allows creation
// of a new client for a new thread. // of a new client for a new thread.
STDMETHOD(CreateClient)( STDMETHOD(CreateClient)(
THIS_ THIS_
__out PDEBUG_CLIENT* Client _Out_ PDEBUG_CLIENT* Client
) PURE; ) PURE;
STDMETHOD(GetInputCallbacks)( STDMETHOD(GetInputCallbacks)(
THIS_ THIS_
__out PDEBUG_INPUT_CALLBACKS* Callbacks _Out_ PDEBUG_INPUT_CALLBACKS* Callbacks
) PURE; ) PURE;
STDMETHOD(SetInputCallbacks)( STDMETHOD(SetInputCallbacks)(
THIS_ THIS_
__in_opt PDEBUG_INPUT_CALLBACKS Callbacks _In_opt_ PDEBUG_INPUT_CALLBACKS Callbacks
) PURE; ) PURE;
// Output callback interfaces are described separately. // Output callback interfaces are described separately.
STDMETHOD(GetOutputCallbacks)( STDMETHOD(GetOutputCallbacks)(
THIS_ THIS_
__out PDEBUG_OUTPUT_CALLBACKS* Callbacks _Out_ PDEBUG_OUTPUT_CALLBACKS* Callbacks
) PURE; ) PURE;
STDMETHOD(SetOutputCallbacks)( STDMETHOD(SetOutputCallbacks)(
THIS_ THIS_
__in_opt PDEBUG_OUTPUT_CALLBACKS Callbacks _In_opt_ PDEBUG_OUTPUT_CALLBACKS Callbacks
) PURE; ) PURE;
// Output flags provide control over // Output flags provide control over
// the distribution of output among clients. // the distribution of output among clients.
// Output masks select which output streams // Output masks select which output streams
// should be sent to the output callbacks. // should be sent to the output callbacks.
// Only Output calls with a mask that // Only Output calls with a mask that
// contains one of the output mask bits // contains one of the output mask bits
// will be sent to the output callbacks. // will be sent to the output callbacks.
// These methods are reentrant. // These methods are reentrant.
// If such access is not synchronized // If such access is not synchronized
// disruptions in output may occur. // disruptions in output may occur.
STDMETHOD(GetOutputMask)( STDMETHOD(GetOutputMask)(
THIS_ THIS_
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
STDMETHOD(SetOutputMask)( STDMETHOD(SetOutputMask)(
THIS_ THIS_
__in ULONG Mask _In_ ULONG Mask
) PURE; ) PURE;
// These methods allow access to another clients // These methods allow access to another clients
// output mask. They are necessary for changing // output mask. They are necessary for changing
// a clients output mask when it is // a clients output mask when it is
// waiting for events. These methods are reentrant // waiting for events. These methods are reentrant
// and can be called from any thread. // and can be called from any thread.
STDMETHOD(GetOtherOutputMask)( STDMETHOD(GetOtherOutputMask)(
THIS_ THIS_
__in PDEBUG_CLIENT Client, _In_ PDEBUG_CLIENT Client,
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
STDMETHOD(SetOtherOutputMask)( STDMETHOD(SetOtherOutputMask)(
THIS_ THIS_
__in PDEBUG_CLIENT Client, _In_ PDEBUG_CLIENT Client,
__in ULONG Mask _In_ ULONG Mask
) PURE; ) PURE;
// Control the width of an output line for // Control the width of an output line for
// commands which produce formatted output. // commands which produce formatted output.
// This setting is just a suggestion. // This setting is just a suggestion.
STDMETHOD(GetOutputWidth)( STDMETHOD(GetOutputWidth)(
THIS_ THIS_
__out PULONG Columns _Out_ PULONG Columns
) PURE; ) PURE;
STDMETHOD(SetOutputWidth)( STDMETHOD(SetOutputWidth)(
THIS_ THIS_
__in ULONG Columns _In_ ULONG Columns
) PURE; ) PURE;
// Some of the engines output commands produce // Some of the engines output commands produce
// multiple lines of output. A prefix can be // multiple lines of output. A prefix can be
// set that the engine will automatically output // set that the engine will automatically output
// for each line in that case, allowing a caller // for each line in that case, allowing a caller
// to control indentation or identifying marks. // to control indentation or identifying marks.
// This is not a general setting for any output // This is not a general setting for any output
// with a newline in it. Methods which use // with a newline in it. Methods which use
// the line prefix are marked in their documentation. // the line prefix are marked in their documentation.
STDMETHOD(GetOutputLinePrefix)( STDMETHOD(GetOutputLinePrefix)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PrefixSize _Out_opt_ PULONG PrefixSize
) PURE; ) PURE;
STDMETHOD(SetOutputLinePrefix)( STDMETHOD(SetOutputLinePrefix)(
THIS_ THIS_
__in_opt PCSTR Prefix _In_opt_ PCSTR Prefix
) PURE; ) PURE;
// Returns a string describing the machine // Returns a string describing the machine
// and user this client represents. The // and user this client represents. The
// specific content of the string varies // specific content of the string varies
// with operating system. If the client is // with operating system. If the client is
// remotely connected some network information // remotely connected some network information
// may also be present. // may also be present.
STDMETHOD(GetIdentity)( STDMETHOD(GetIdentity)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG IdentitySize _Out_opt_ PULONG IdentitySize
) PURE; ) PURE;
// Format is a printf-like format string // Format is a printf-like format string
// with one %s where the identity string should go. // with one %s where the identity string should go.
STDMETHOD(OutputIdentity)( STDMETHOD(OutputIdentity)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags, _In_ ULONG Flags,
__in PCSTR Format _In_ PCSTR Format
) PURE; ) PURE;
// Event callbacks allow a client to // Event callbacks allow a client to
// receive notification about changes // receive notification about changes
// during the debug session. // during the debug session.
STDMETHOD(GetEventCallbacks)( STDMETHOD(GetEventCallbacks)(
THIS_ THIS_
__out PDEBUG_EVENT_CALLBACKS* Callbacks _Out_ PDEBUG_EVENT_CALLBACKS* Callbacks
) PURE; ) PURE;
STDMETHOD(SetEventCallbacks)( STDMETHOD(SetEventCallbacks)(
THIS_ THIS_
__in_opt PDEBUG_EVENT_CALLBACKS Callbacks _In_opt_ PDEBUG_EVENT_CALLBACKS Callbacks
) PURE; ) PURE;
// The engine sometimes merges compatible callback // The engine sometimes merges compatible callback
// requests to reduce callback overhead. This is // requests to reduce callback overhead. This is
// most noticeable with output as small pieces of // most noticeable with output as small pieces of
// output are collected into larger groups to // output are collected into larger groups to
// reduce the overall number of output callback calls. // reduce the overall number of output callback calls.
// A client can use this method to force all pending // A client can use this method to force all pending
// callbacks to be delivered. This is rarely necessary. // callbacks to be delivered. This is rarely necessary.
STDMETHOD(FlushCallbacks)( STDMETHOD(FlushCallbacks)(
skipping to change at line 2309 skipping to change at line 2602
) PURE; ) PURE;
// IDebugClient2. // IDebugClient2.
// Functions similarly to WriteDumpFile with // Functions similarly to WriteDumpFile with
// the addition of the ability to specify // the addition of the ability to specify
// per-dump-format write control flags. // per-dump-format write control flags.
// Comment is not supported in all formats. // Comment is not supported in all formats.
STDMETHOD(WriteDumpFile2)( STDMETHOD(WriteDumpFile2)(
THIS_ THIS_
__in PCSTR DumpFile, _In_ PCSTR DumpFile,
__in ULONG Qualifier, _In_ ULONG Qualifier,
__in ULONG FormatFlags, _In_ ULONG FormatFlags,
__in_opt PCSTR Comment _In_opt_ PCSTR Comment
) PURE; ) PURE;
// Registers additional files of supporting information // Registers additional files of supporting information
// for a dump file open. This method must be called // for a dump file open. This method must be called
// before OpenDumpFile is called. // before OpenDumpFile is called.
// The files registered may be opened at the time // The files registered may be opened at the time
// this method is called but generally will not // this method is called but generally will not
// be used until OpenDumpFile is called. // be used until OpenDumpFile is called.
STDMETHOD(AddDumpInformationFile)( STDMETHOD(AddDumpInformationFile)(
THIS_ THIS_
__in PCSTR InfoFile, _In_ PCSTR InfoFile,
__in ULONG Type _In_ ULONG Type
) PURE; ) PURE;
// Requests that the remote process server shut down. // Requests that the remote process server shut down.
STDMETHOD(EndProcessServer)( STDMETHOD(EndProcessServer)(
THIS_ THIS_
__in ULONG64 Server _In_ ULONG64 Server
) PURE; ) PURE;
// Waits for a started process server to // Waits for a started process server to
// exit. Allows an application running a // exit. Allows an application running a
// process server to monitor the process // process server to monitor the process
// server so that it can tell when a remote // server so that it can tell when a remote
// client has asked for it to exit. // client has asked for it to exit.
// Returns S_OK if the process server has // Returns S_OK if the process server has
// shut down and S_FALSE for a timeout. // shut down and S_FALSE for a timeout.
STDMETHOD(WaitForProcessServerEnd)( STDMETHOD(WaitForProcessServerEnd)(
THIS_ THIS_
__in ULONG Timeout _In_ ULONG Timeout
) PURE; ) PURE;
// Returns S_OK if the system is configured // Returns S_OK if the system is configured
// to allow kernel debugging. // to allow kernel debugging.
STDMETHOD(IsKernelDebuggerEnabled)( STDMETHOD(IsKernelDebuggerEnabled)(
THIS THIS
) PURE; ) PURE;
// Attempts to terminate the current process. // Attempts to terminate the current process.
// Exit process events for the process may be generated. // Exit process events for the process may be generated.
skipping to change at line 2378 skipping to change at line 2671
) PURE; ) PURE;
}; };
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugClient3 #define INTERFACE IDebugClient3
DECLARE_INTERFACE_(IDebugClient3, IUnknown) DECLARE_INTERFACE_(IDebugClient3, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugClient. // IDebugClient.
// The following set of methods start // The following set of methods start
// the different kinds of debuggees. // the different kinds of debuggees.
// Begins a debug session using the kernel // Begins a debug session using the kernel
// debugging protocol. This method selects // debugging protocol. This method selects
// the protocol as the debuggee communication // the protocol as the debuggee communication
// mechanism but does not initiate the communication // mechanism but does not initiate the communication
// itself. // itself.
STDMETHOD(AttachKernel)( STDMETHOD(AttachKernel)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in_opt PCSTR ConnectOptions _In_opt_ PCSTR ConnectOptions
) PURE; ) PURE;
STDMETHOD(GetKernelConnectionOptions)( STDMETHOD(GetKernelConnectionOptions)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG OptionsSize _Out_opt_ PULONG OptionsSize
) PURE; ) PURE;
// Updates the connection options for a live // Updates the connection options for a live
// kernel connection. This can only be used // kernel connection. This can only be used
// to modify parameters for the connection, not // to modify parameters for the connection, not
// to switch to a completely different kind of // to switch to a completely different kind of
// connection. // connection.
// This method is reentrant. // This method is reentrant.
STDMETHOD(SetKernelConnectionOptions)( STDMETHOD(SetKernelConnectionOptions)(
THIS_ THIS_
__in PCSTR Options _In_ PCSTR Options
) PURE; ) PURE;
// Starts a process server for remote // Starts a process server for remote
// user-mode process control. // user-mode process control.
// The local process server is server zero. // The local process server is server zero.
STDMETHOD(StartProcessServer)( STDMETHOD(StartProcessServer)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in PCSTR Options, _In_ PCSTR Options,
__in_opt __reserved PVOID Reserved _In_opt_ _Reserved_ PVOID Reserved
) PURE; ) PURE;
STDMETHOD(ConnectProcessServer)( STDMETHOD(ConnectProcessServer)(
THIS_ THIS_
__in PCSTR RemoteOptions, _In_ PCSTR RemoteOptions,
__out PULONG64 Server _Out_ PULONG64 Server
) PURE; ) PURE;
STDMETHOD(DisconnectProcessServer)( STDMETHOD(DisconnectProcessServer)(
THIS_ THIS_
__in ULONG64 Server _In_ ULONG64 Server
) PURE; ) PURE;
// Enumerates and describes processes // Enumerates and describes processes
// accessible through the given process server. // accessible through the given process server.
STDMETHOD(GetRunningProcessSystemIds)( STDMETHOD(GetRunningProcessSystemIds)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__out_ecount_opt(Count) PULONG Ids, _Out_writes_opt_(Count) PULONG Ids,
__in ULONG Count, _In_ ULONG Count,
__out_opt PULONG ActualCount _Out_opt_ PULONG ActualCount
) PURE; ) PURE;
STDMETHOD(GetRunningProcessSystemIdByExecutableName)( STDMETHOD(GetRunningProcessSystemIdByExecutableName)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PCSTR ExeName, _In_ PCSTR ExeName,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetRunningProcessDescription)( STDMETHOD(GetRunningProcessDescription)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in ULONG SystemId, _In_ ULONG SystemId,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(ExeNameSize) PSTR ExeName, _Out_writes_opt_(ExeNameSize) PSTR ExeName,
__in ULONG ExeNameSize, _In_ ULONG ExeNameSize,
__out_opt PULONG ActualExeNameSize, _Out_opt_ PULONG ActualExeNameSize,
__out_ecount_opt(DescriptionSize) PSTR Description, _Out_writes_opt_(DescriptionSize) PSTR Description,
__in ULONG DescriptionSize, _In_ ULONG DescriptionSize,
__out_opt PULONG ActualDescriptionSize _Out_opt_ PULONG ActualDescriptionSize
) PURE; ) PURE;
// Attaches to a running user-mode process. // Attaches to a running user-mode process.
STDMETHOD(AttachProcess)( STDMETHOD(AttachProcess)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in ULONG ProcessId, _In_ ULONG ProcessId,
__in ULONG AttachFlags _In_ ULONG AttachFlags
) PURE; ) PURE;
// Creates a new user-mode process for debugging. // Creates a new user-mode process for debugging.
// CreateFlags are as given to Win32s CreateProcess. // CreateFlags are as given to Win32s CreateProcess.
// One of DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS // One of DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS
// must be specified. // must be specified.
STDMETHOD(CreateProcess)( STDMETHOD(CreateProcess)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PSTR CommandLine, _In_ PSTR CommandLine,
__in ULONG CreateFlags _In_ ULONG CreateFlags
) PURE; ) PURE;
// Creates or attaches to a user-mode process, or both. // Creates or attaches to a user-mode process, or both.
// If CommandLine is NULL this method operates as // If CommandLine is NULL this method operates as
// AttachProcess does. If ProcessId is zero it // AttachProcess does. If ProcessId is zero it
// operates as CreateProcess does. If CommandLine is // operates as CreateProcess does. If CommandLine is
// non-NULL and ProcessId is non-zero the method first // non-NULL and ProcessId is non-zero the method first
// starts a process with the given information but // starts a process with the given information but
// in a suspended state. The engine then attaches to // in a suspended state. The engine then attaches to
// the indicated process. Once the attach is successful // the indicated process. Once the attach is successful
// the suspended process is resumed. This provides // the suspended process is resumed. This provides
// synchronization between the new process and the // synchronization between the new process and the
// attachment. // attachment.
STDMETHOD(CreateProcessAndAttach)( STDMETHOD(CreateProcessAndAttach)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in_opt PSTR CommandLine, _In_opt_ PSTR CommandLine,
__in ULONG CreateFlags, _In_ ULONG CreateFlags,
__in ULONG ProcessId, _In_ ULONG ProcessId,
__in ULONG AttachFlags _In_ ULONG AttachFlags
) PURE; ) PURE;
// Gets and sets process control flags. // Gets and sets process control flags.
STDMETHOD(GetProcessOptions)( STDMETHOD(GetProcessOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddProcessOptions)( STDMETHOD(AddProcessOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveProcessOptions)( STDMETHOD(RemoveProcessOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetProcessOptions)( STDMETHOD(SetProcessOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
// Opens any kind of user- or kernel-mode dump file // Opens any kind of user- or kernel-mode dump file
// and begins a debug session with the information // and begins a debug session with the information
// contained within it. // contained within it.
STDMETHOD(OpenDumpFile)( STDMETHOD(OpenDumpFile)(
THIS_ THIS_
__in PCSTR DumpFile _In_ PCSTR DumpFile
) PURE; ) PURE;
// Writes a dump file from the current session information. // Writes a dump file from the current session information.
// The kind of dump file written is determined by the // The kind of dump file written is determined by the
// kind of session and the type qualifier given. // kind of session and the type qualifier given.
// For example, if the current session is a kernel // For example, if the current session is a kernel
// debug session (DEBUG_CLASS_KERNEL) and the qualifier // debug session (DEBUG_CLASS_KERNEL) and the qualifier
// is DEBUG_DUMP_SMALL a small kernel dump will be written. // is DEBUG_DUMP_SMALL a small kernel dump will be written.
STDMETHOD(WriteDumpFile)( STDMETHOD(WriteDumpFile)(
THIS_ THIS_
__in PCSTR DumpFile, _In_ PCSTR DumpFile,
__in ULONG Qualifier _In_ ULONG Qualifier
) PURE; ) PURE;
// Indicates that a remote client is ready to // Indicates that a remote client is ready to
// begin participating in the current session. // begin participating in the current session.
// HistoryLimit gives a character limit on // HistoryLimit gives a character limit on
// the amount of output history to be sent. // the amount of output history to be sent.
STDMETHOD(ConnectSession)( STDMETHOD(ConnectSession)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG HistoryLimit _In_ ULONG HistoryLimit
) PURE; ) PURE;
// Indicates that the engine should start accepting // Indicates that the engine should start accepting
// remote connections. Options specifies connection types // remote connections. Options specifies connection types
// and their parameters. Supported strings are: // and their parameters. Supported strings are:
// npipe:Pipe=<Pipe name> // npipe:Pipe=<Pipe name>
// tcp:Port=<IP port> // tcp:Port=<IP port>
STDMETHOD(StartServer)( STDMETHOD(StartServer)(
THIS_ THIS_
__in PCSTR Options _In_ PCSTR Options
) PURE; ) PURE;
// List the servers running on the given machine. // List the servers running on the given machine.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputServers)( STDMETHOD(OutputServers)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCSTR Machine, _In_ PCSTR Machine,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Attempts to terminate all processes in the debuggers list. // Attempts to terminate all processes in the debuggers list.
STDMETHOD(TerminateProcesses)( STDMETHOD(TerminateProcesses)(
THIS THIS
) PURE; ) PURE;
// Attempts to detach from all processes in the debuggers list. // Attempts to detach from all processes in the debuggers list.
// This requires OS support for debugger detach. // This requires OS support for debugger detach.
STDMETHOD(DetachProcesses)( STDMETHOD(DetachProcesses)(
THIS THIS
) PURE; ) PURE;
// Stops the current debug session. If a process // Stops the current debug session. If a process
// was created or attached an active EndSession can // was created or attached an active EndSession can
// terminate or detach from it. // terminate or detach from it.
// If a kernel connection was opened it will be closed but the // If a kernel connection was opened it will be closed but the
// target machine is otherwise unaffected. // target machine is otherwise unaffected.
STDMETHOD(EndSession)( STDMETHOD(EndSession)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// If a process was started and ran to completion // If a process was started and ran to completion
// this method can be used to retrieve its exit code. // this method can be used to retrieve its exit code.
STDMETHOD(GetExitCode)( STDMETHOD(GetExitCode)(
THIS_ THIS_
__out PULONG Code _Out_ PULONG Code
) PURE; ) PURE;
// Client event callbacks are called on the thread // Client event callbacks are called on the thread
// of the client. In order to give thread // of the client. In order to give thread
// execution to the engine for callbacks all // execution to the engine for callbacks all
// client threads should call DispatchCallbacks // client threads should call DispatchCallbacks
// when they are idle. Callbacks are only // when they are idle. Callbacks are only
// received when a thread calls DispatchCallbacks // received when a thread calls DispatchCallbacks
// or WaitForEvent. WaitForEvent can only be // or WaitForEvent. WaitForEvent can only be
// called by the thread that started the debug // called by the thread that started the debug
skipping to change at line 2612 skipping to change at line 2905
// call DispatchCallbacks when possible. // call DispatchCallbacks when possible.
// DispatchCallbacks returns when ExitDispatch is used // DispatchCallbacks returns when ExitDispatch is used
// to interrupt dispatch or when the timeout expires. // to interrupt dispatch or when the timeout expires.
// DispatchCallbacks dispatches callbacks for all // DispatchCallbacks dispatches callbacks for all
// clients associated with the thread calling // clients associated with the thread calling
// DispatchCallbacks. // DispatchCallbacks.
// DispatchCallbacks returns S_FALSE when the // DispatchCallbacks returns S_FALSE when the
// timeout expires. // timeout expires.
STDMETHOD(DispatchCallbacks)( STDMETHOD(DispatchCallbacks)(
THIS_ THIS_
__in ULONG Timeout _In_ ULONG Timeout
) PURE; ) PURE;
// ExitDispatch can be used to interrupt callback // ExitDispatch can be used to interrupt callback
// dispatch when a client thread is needed by the // dispatch when a client thread is needed by the
// client. This method is reentrant and can // client. This method is reentrant and can
// be called from any thread. // be called from any thread.
STDMETHOD(ExitDispatch)( STDMETHOD(ExitDispatch)(
THIS_ THIS_
__in PDEBUG_CLIENT Client _In_ PDEBUG_CLIENT Client
) PURE; ) PURE;
// Clients are specific to the thread that // Clients are specific to the thread that
// created them. Calls from other threads // created them. Calls from other threads
// fail immediately. The CreateClient method // fail immediately. The CreateClient method
// is a notable exception; it allows creation // is a notable exception; it allows creation
// of a new client for a new thread. // of a new client for a new thread.
STDMETHOD(CreateClient)( STDMETHOD(CreateClient)(
THIS_ THIS_
__out PDEBUG_CLIENT* Client _Out_ PDEBUG_CLIENT* Client
) PURE; ) PURE;
STDMETHOD(GetInputCallbacks)( STDMETHOD(GetInputCallbacks)(
THIS_ THIS_
__out PDEBUG_INPUT_CALLBACKS* Callbacks _Out_ PDEBUG_INPUT_CALLBACKS* Callbacks
) PURE; ) PURE;
STDMETHOD(SetInputCallbacks)( STDMETHOD(SetInputCallbacks)(
THIS_ THIS_
__in_opt PDEBUG_INPUT_CALLBACKS Callbacks _In_opt_ PDEBUG_INPUT_CALLBACKS Callbacks
) PURE; ) PURE;
// Output callback interfaces are described separately. // Output callback interfaces are described separately.
STDMETHOD(GetOutputCallbacks)( STDMETHOD(GetOutputCallbacks)(
THIS_ THIS_
__out PDEBUG_OUTPUT_CALLBACKS* Callbacks _Out_ PDEBUG_OUTPUT_CALLBACKS* Callbacks
) PURE; ) PURE;
STDMETHOD(SetOutputCallbacks)( STDMETHOD(SetOutputCallbacks)(
THIS_ THIS_
__in_opt PDEBUG_OUTPUT_CALLBACKS Callbacks _In_opt_ PDEBUG_OUTPUT_CALLBACKS Callbacks
) PURE; ) PURE;
// Output flags provide control over // Output flags provide control over
// the distribution of output among clients. // the distribution of output among clients.
// Output masks select which output streams // Output masks select which output streams
// should be sent to the output callbacks. // should be sent to the output callbacks.
// Only Output calls with a mask that // Only Output calls with a mask that
// contains one of the output mask bits // contains one of the output mask bits
// will be sent to the output callbacks. // will be sent to the output callbacks.
// These methods are reentrant. // These methods are reentrant.
// If such access is not synchronized // If such access is not synchronized
// disruptions in output may occur. // disruptions in output may occur.
STDMETHOD(GetOutputMask)( STDMETHOD(GetOutputMask)(
THIS_ THIS_
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
STDMETHOD(SetOutputMask)( STDMETHOD(SetOutputMask)(
THIS_ THIS_
__in ULONG Mask _In_ ULONG Mask
) PURE; ) PURE;
// These methods allow access to another clients // These methods allow access to another clients
// output mask. They are necessary for changing // output mask. They are necessary for changing
// a clients output mask when it is // a clients output mask when it is
// waiting for events. These methods are reentrant // waiting for events. These methods are reentrant
// and can be called from any thread. // and can be called from any thread.
STDMETHOD(GetOtherOutputMask)( STDMETHOD(GetOtherOutputMask)(
THIS_ THIS_
__in PDEBUG_CLIENT Client, _In_ PDEBUG_CLIENT Client,
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
STDMETHOD(SetOtherOutputMask)( STDMETHOD(SetOtherOutputMask)(
THIS_ THIS_
__in PDEBUG_CLIENT Client, _In_ PDEBUG_CLIENT Client,
__in ULONG Mask _In_ ULONG Mask
) PURE; ) PURE;
// Control the width of an output line for // Control the width of an output line for
// commands which produce formatted output. // commands which produce formatted output.
// This setting is just a suggestion. // This setting is just a suggestion.
STDMETHOD(GetOutputWidth)( STDMETHOD(GetOutputWidth)(
THIS_ THIS_
__out PULONG Columns _Out_ PULONG Columns
) PURE; ) PURE;
STDMETHOD(SetOutputWidth)( STDMETHOD(SetOutputWidth)(
THIS_ THIS_
__in ULONG Columns _In_ ULONG Columns
) PURE; ) PURE;
// Some of the engines output commands produce // Some of the engines output commands produce
// multiple lines of output. A prefix can be // multiple lines of output. A prefix can be
// set that the engine will automatically output // set that the engine will automatically output
// for each line in that case, allowing a caller // for each line in that case, allowing a caller
// to control indentation or identifying marks. // to control indentation or identifying marks.
// This is not a general setting for any output // This is not a general setting for any output
// with a newline in it. Methods which use // with a newline in it. Methods which use
// the line prefix are marked in their documentation. // the line prefix are marked in their documentation.
STDMETHOD(GetOutputLinePrefix)( STDMETHOD(GetOutputLinePrefix)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PrefixSize _Out_opt_ PULONG PrefixSize
) PURE; ) PURE;
STDMETHOD(SetOutputLinePrefix)( STDMETHOD(SetOutputLinePrefix)(
THIS_ THIS_
__in_opt PCSTR Prefix _In_opt_ PCSTR Prefix
) PURE; ) PURE;
// Returns a string describing the machine // Returns a string describing the machine
// and user this client represents. The // and user this client represents. The
// specific content of the string varies // specific content of the string varies
// with operating system. If the client is // with operating system. If the client is
// remotely connected some network information // remotely connected some network information
// may also be present. // may also be present.
STDMETHOD(GetIdentity)( STDMETHOD(GetIdentity)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG IdentitySize _Out_opt_ PULONG IdentitySize
) PURE; ) PURE;
// Format is a printf-like format string // Format is a printf-like format string
// with one %s where the identity string should go. // with one %s where the identity string should go.
STDMETHOD(OutputIdentity)( STDMETHOD(OutputIdentity)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags, _In_ ULONG Flags,
__in PCSTR Format _In_ PCSTR Format
) PURE; ) PURE;
// Event callbacks allow a client to // Event callbacks allow a client to
// receive notification about changes // receive notification about changes
// during the debug session. // during the debug session.
STDMETHOD(GetEventCallbacks)( STDMETHOD(GetEventCallbacks)(
THIS_ THIS_
__out PDEBUG_EVENT_CALLBACKS* Callbacks _Out_ PDEBUG_EVENT_CALLBACKS* Callbacks
) PURE; ) PURE;
STDMETHOD(SetEventCallbacks)( STDMETHOD(SetEventCallbacks)(
THIS_ THIS_
__in_opt PDEBUG_EVENT_CALLBACKS Callbacks _In_opt_ PDEBUG_EVENT_CALLBACKS Callbacks
) PURE; ) PURE;
// The engine sometimes merges compatible callback // The engine sometimes merges compatible callback
// requests to reduce callback overhead. This is // requests to reduce callback overhead. This is
// most noticeable with output as small pieces of // most noticeable with output as small pieces of
// output are collected into larger groups to // output are collected into larger groups to
// reduce the overall number of output callback calls. // reduce the overall number of output callback calls.
// A client can use this method to force all pending // A client can use this method to force all pending
// callbacks to be delivered. This is rarely necessary. // callbacks to be delivered. This is rarely necessary.
STDMETHOD(FlushCallbacks)( STDMETHOD(FlushCallbacks)(
skipping to change at line 2766 skipping to change at line 3059
) PURE; ) PURE;
// IDebugClient2. // IDebugClient2.
// Functions similarly to WriteDumpFile with // Functions similarly to WriteDumpFile with
// the addition of the ability to specify // the addition of the ability to specify
// per-dump-format write control flags. // per-dump-format write control flags.
// Comment is not supported in all formats. // Comment is not supported in all formats.
STDMETHOD(WriteDumpFile2)( STDMETHOD(WriteDumpFile2)(
THIS_ THIS_
__in PCSTR DumpFile, _In_ PCSTR DumpFile,
__in ULONG Qualifier, _In_ ULONG Qualifier,
__in ULONG FormatFlags, _In_ ULONG FormatFlags,
__in_opt PCSTR Comment _In_opt_ PCSTR Comment
) PURE; ) PURE;
// Registers additional files of supporting information // Registers additional files of supporting information
// for a dump file open. This method must be called // for a dump file open. This method must be called
// before OpenDumpFile is called. // before OpenDumpFile is called.
// The files registered may be opened at the time // The files registered may be opened at the time
// this method is called but generally will not // this method is called but generally will not
// be used until OpenDumpFile is called. // be used until OpenDumpFile is called.
STDMETHOD(AddDumpInformationFile)( STDMETHOD(AddDumpInformationFile)(
THIS_ THIS_
__in PCSTR InfoFile, _In_ PCSTR InfoFile,
__in ULONG Type _In_ ULONG Type
) PURE; ) PURE;
// Requests that the remote process server shut down. // Requests that the remote process server shut down.
STDMETHOD(EndProcessServer)( STDMETHOD(EndProcessServer)(
THIS_ THIS_
__in ULONG64 Server _In_ ULONG64 Server
) PURE; ) PURE;
// Waits for a started process server to // Waits for a started process server to
// exit. Allows an application running a // exit. Allows an application running a
// process server to monitor the process // process server to monitor the process
// server so that it can tell when a remote // server so that it can tell when a remote
// client has asked for it to exit. // client has asked for it to exit.
// Returns S_OK if the process server has // Returns S_OK if the process server has
// shut down and S_FALSE for a timeout. // shut down and S_FALSE for a timeout.
STDMETHOD(WaitForProcessServerEnd)( STDMETHOD(WaitForProcessServerEnd)(
THIS_ THIS_
__in ULONG Timeout _In_ ULONG Timeout
) PURE; ) PURE;
// Returns S_OK if the system is configured // Returns S_OK if the system is configured
// to allow kernel debugging. // to allow kernel debugging.
STDMETHOD(IsKernelDebuggerEnabled)( STDMETHOD(IsKernelDebuggerEnabled)(
THIS THIS
) PURE; ) PURE;
// Attempts to terminate the current process. // Attempts to terminate the current process.
// Exit process events for the process may be generated. // Exit process events for the process may be generated.
skipping to change at line 2831 skipping to change at line 3124
// process out of the debugged state. // process out of the debugged state.
// This is only supported on some system versions. // This is only supported on some system versions.
STDMETHOD(AbandonCurrentProcess)( STDMETHOD(AbandonCurrentProcess)(
THIS THIS
) PURE; ) PURE;
// IDebugClient3. // IDebugClient3.
STDMETHOD(GetRunningProcessSystemIdByExecutableNameWide)( STDMETHOD(GetRunningProcessSystemIdByExecutableNameWide)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PCWSTR ExeName, _In_ PCWSTR ExeName,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetRunningProcessDescriptionWide)( STDMETHOD(GetRunningProcessDescriptionWide)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in ULONG SystemId, _In_ ULONG SystemId,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(ExeNameSize) PWSTR ExeName, _Out_writes_opt_(ExeNameSize) PWSTR ExeName,
__in ULONG ExeNameSize, _In_ ULONG ExeNameSize,
__out_opt PULONG ActualExeNameSize, _Out_opt_ PULONG ActualExeNameSize,
__out_ecount_opt(DescriptionSize) PWSTR Description, _Out_writes_opt_(DescriptionSize) PWSTR Description,
__in ULONG DescriptionSize, _In_ ULONG DescriptionSize,
__out_opt PULONG ActualDescriptionSize _Out_opt_ PULONG ActualDescriptionSize
) PURE; ) PURE;
STDMETHOD(CreateProcessWide)( STDMETHOD(CreateProcessWide)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PWSTR CommandLine, _In_ PWSTR CommandLine,
__in ULONG CreateFlags _In_ ULONG CreateFlags
) PURE; ) PURE;
STDMETHOD(CreateProcessAndAttachWide)( STDMETHOD(CreateProcessAndAttachWide)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in_opt PWSTR CommandLine, _In_opt_ PWSTR CommandLine,
__in ULONG CreateFlags, _In_ ULONG CreateFlags,
__in ULONG ProcessId, _In_ ULONG ProcessId,
__in ULONG AttachFlags _In_ ULONG AttachFlags
) PURE; ) PURE;
}; };
// //
// Special indices for GetDumpFile to return // Special indices for GetDumpFile to return
// alternate filenames. // alternate filenames.
// //
// Special index that returns the name of the last .dmp file // Special index that returns the name of the last .dmp file
// that failed to load (whether directly or from inside a // that failed to load (whether directly or from inside a
skipping to change at line 2886 skipping to change at line 3179
// extracted dump file in the GetDumpFile method. // extracted dump file in the GetDumpFile method.
#define DEBUG_DUMP_FILE_ORIGINAL_CAB_INDEX 0xfffffffe #define DEBUG_DUMP_FILE_ORIGINAL_CAB_INDEX 0xfffffffe
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugClient4 #define INTERFACE IDebugClient4
DECLARE_INTERFACE_(IDebugClient4, IUnknown) DECLARE_INTERFACE_(IDebugClient4, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugClient. // IDebugClient.
// The following set of methods start // The following set of methods start
// the different kinds of debuggees. // the different kinds of debuggees.
// Begins a debug session using the kernel // Begins a debug session using the kernel
// debugging protocol. This method selects // debugging protocol. This method selects
// the protocol as the debuggee communication // the protocol as the debuggee communication
// mechanism but does not initiate the communication // mechanism but does not initiate the communication
// itself. // itself.
STDMETHOD(AttachKernel)( STDMETHOD(AttachKernel)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in_opt PCSTR ConnectOptions _In_opt_ PCSTR ConnectOptions
) PURE; ) PURE;
STDMETHOD(GetKernelConnectionOptions)( STDMETHOD(GetKernelConnectionOptions)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG OptionsSize _Out_opt_ PULONG OptionsSize
) PURE; ) PURE;
// Updates the connection options for a live // Updates the connection options for a live
// kernel connection. This can only be used // kernel connection. This can only be used
// to modify parameters for the connection, not // to modify parameters for the connection, not
// to switch to a completely different kind of // to switch to a completely different kind of
// connection. // connection.
// This method is reentrant. // This method is reentrant.
STDMETHOD(SetKernelConnectionOptions)( STDMETHOD(SetKernelConnectionOptions)(
THIS_ THIS_
__in PCSTR Options _In_ PCSTR Options
) PURE; ) PURE;
// Starts a process server for remote // Starts a process server for remote
// user-mode process control. // user-mode process control.
// The local process server is server zero. // The local process server is server zero.
STDMETHOD(StartProcessServer)( STDMETHOD(StartProcessServer)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in PCSTR Options, _In_ PCSTR Options,
__in_opt __reserved PVOID Reserved _In_opt_ _Reserved_ PVOID Reserved
) PURE; ) PURE;
STDMETHOD(ConnectProcessServer)( STDMETHOD(ConnectProcessServer)(
THIS_ THIS_
__in PCSTR RemoteOptions, _In_ PCSTR RemoteOptions,
__out PULONG64 Server _Out_ PULONG64 Server
) PURE; ) PURE;
STDMETHOD(DisconnectProcessServer)( STDMETHOD(DisconnectProcessServer)(
THIS_ THIS_
__in ULONG64 Server _In_ ULONG64 Server
) PURE; ) PURE;
// Enumerates and describes processes // Enumerates and describes processes
// accessible through the given process server. // accessible through the given process server.
STDMETHOD(GetRunningProcessSystemIds)( STDMETHOD(GetRunningProcessSystemIds)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__out_ecount_opt(Count) PULONG Ids, _Out_writes_opt_(Count) PULONG Ids,
__in ULONG Count, _In_ ULONG Count,
__out_opt PULONG ActualCount _Out_opt_ PULONG ActualCount
) PURE; ) PURE;
STDMETHOD(GetRunningProcessSystemIdByExecutableName)( STDMETHOD(GetRunningProcessSystemIdByExecutableName)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PCSTR ExeName, _In_ PCSTR ExeName,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetRunningProcessDescription)( STDMETHOD(GetRunningProcessDescription)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in ULONG SystemId, _In_ ULONG SystemId,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(ExeNameSize) PSTR ExeName, _Out_writes_opt_(ExeNameSize) PSTR ExeName,
__in ULONG ExeNameSize, _In_ ULONG ExeNameSize,
__out_opt PULONG ActualExeNameSize, _Out_opt_ PULONG ActualExeNameSize,
__out_ecount_opt(DescriptionSize) PSTR Description, _Out_writes_opt_(DescriptionSize) PSTR Description,
__in ULONG DescriptionSize, _In_ ULONG DescriptionSize,
__out_opt PULONG ActualDescriptionSize _Out_opt_ PULONG ActualDescriptionSize
) PURE; ) PURE;
// Attaches to a running user-mode process. // Attaches to a running user-mode process.
STDMETHOD(AttachProcess)( STDMETHOD(AttachProcess)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in ULONG ProcessId, _In_ ULONG ProcessId,
__in ULONG AttachFlags _In_ ULONG AttachFlags
) PURE; ) PURE;
// Creates a new user-mode process for debugging. // Creates a new user-mode process for debugging.
// CreateFlags are as given to Win32s CreateProcess. // CreateFlags are as given to Win32s CreateProcess.
// One of DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS // One of DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS
// must be specified. // must be specified.
STDMETHOD(CreateProcess)( STDMETHOD(CreateProcess)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PSTR CommandLine, _In_ PSTR CommandLine,
__in ULONG CreateFlags _In_ ULONG CreateFlags
) PURE; ) PURE;
// Creates or attaches to a user-mode process, or both. // Creates or attaches to a user-mode process, or both.
// If CommandLine is NULL this method operates as // If CommandLine is NULL this method operates as
// AttachProcess does. If ProcessId is zero it // AttachProcess does. If ProcessId is zero it
// operates as CreateProcess does. If CommandLine is // operates as CreateProcess does. If CommandLine is
// non-NULL and ProcessId is non-zero the method first // non-NULL and ProcessId is non-zero the method first
// starts a process with the given information but // starts a process with the given information but
// in a suspended state. The engine then attaches to // in a suspended state. The engine then attaches to
// the indicated process. Once the attach is successful // the indicated process. Once the attach is successful
// the suspended process is resumed. This provides // the suspended process is resumed. This provides
// synchronization between the new process and the // synchronization between the new process and the
// attachment. // attachment.
STDMETHOD(CreateProcessAndAttach)( STDMETHOD(CreateProcessAndAttach)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in_opt PSTR CommandLine, _In_opt_ PSTR CommandLine,
__in ULONG CreateFlags, _In_ ULONG CreateFlags,
__in ULONG ProcessId, _In_ ULONG ProcessId,
__in ULONG AttachFlags _In_ ULONG AttachFlags
) PURE; ) PURE;
// Gets and sets process control flags. // Gets and sets process control flags.
STDMETHOD(GetProcessOptions)( STDMETHOD(GetProcessOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddProcessOptions)( STDMETHOD(AddProcessOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveProcessOptions)( STDMETHOD(RemoveProcessOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetProcessOptions)( STDMETHOD(SetProcessOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
// Opens any kind of user- or kernel-mode dump file // Opens any kind of user- or kernel-mode dump file
// and begins a debug session with the information // and begins a debug session with the information
// contained within it. // contained within it.
STDMETHOD(OpenDumpFile)( STDMETHOD(OpenDumpFile)(
THIS_ THIS_
__in PCSTR DumpFile _In_ PCSTR DumpFile
) PURE; ) PURE;
// Writes a dump file from the current session information. // Writes a dump file from the current session information.
// The kind of dump file written is determined by the // The kind of dump file written is determined by the
// kind of session and the type qualifier given. // kind of session and the type qualifier given.
// For example, if the current session is a kernel // For example, if the current session is a kernel
// debug session (DEBUG_CLASS_KERNEL) and the qualifier // debug session (DEBUG_CLASS_KERNEL) and the qualifier
// is DEBUG_DUMP_SMALL a small kernel dump will be written. // is DEBUG_DUMP_SMALL a small kernel dump will be written.
STDMETHOD(WriteDumpFile)( STDMETHOD(WriteDumpFile)(
THIS_ THIS_
__in PCSTR DumpFile, _In_ PCSTR DumpFile,
__in ULONG Qualifier _In_ ULONG Qualifier
) PURE; ) PURE;
// Indicates that a remote client is ready to // Indicates that a remote client is ready to
// begin participating in the current session. // begin participating in the current session.
// HistoryLimit gives a character limit on // HistoryLimit gives a character limit on
// the amount of output history to be sent. // the amount of output history to be sent.
STDMETHOD(ConnectSession)( STDMETHOD(ConnectSession)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG HistoryLimit _In_ ULONG HistoryLimit
) PURE; ) PURE;
// Indicates that the engine should start accepting // Indicates that the engine should start accepting
// remote connections. Options specifies connection types // remote connections. Options specifies connection types
// and their parameters. Supported strings are: // and their parameters. Supported strings are:
// npipe:Pipe=<Pipe name> // npipe:Pipe=<Pipe name>
// tcp:Port=<IP port> // tcp:Port=<IP port>
STDMETHOD(StartServer)( STDMETHOD(StartServer)(
THIS_ THIS_
__in PCSTR Options _In_ PCSTR Options
) PURE; ) PURE;
// List the servers running on the given machine. // List the servers running on the given machine.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputServers)( STDMETHOD(OutputServers)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCSTR Machine, _In_ PCSTR Machine,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Attempts to terminate all processes in the debuggers list. // Attempts to terminate all processes in the debuggers list.
STDMETHOD(TerminateProcesses)( STDMETHOD(TerminateProcesses)(
THIS THIS
) PURE; ) PURE;
// Attempts to detach from all processes in the debuggers list. // Attempts to detach from all processes in the debuggers list.
// This requires OS support for debugger detach. // This requires OS support for debugger detach.
STDMETHOD(DetachProcesses)( STDMETHOD(DetachProcesses)(
THIS THIS
) PURE; ) PURE;
// Stops the current debug session. If a process // Stops the current debug session. If a process
// was created or attached an active EndSession can // was created or attached an active EndSession can
// terminate or detach from it. // terminate or detach from it.
// If a kernel connection was opened it will be closed but the // If a kernel connection was opened it will be closed but the
// target machine is otherwise unaffected. // target machine is otherwise unaffected.
STDMETHOD(EndSession)( STDMETHOD(EndSession)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// If a process was started and ran to completion // If a process was started and ran to completion
// this method can be used to retrieve its exit code. // this method can be used to retrieve its exit code.
STDMETHOD(GetExitCode)( STDMETHOD(GetExitCode)(
THIS_ THIS_
__out PULONG Code _Out_ PULONG Code
) PURE; ) PURE;
// Client event callbacks are called on the thread // Client event callbacks are called on the thread
// of the client. In order to give thread // of the client. In order to give thread
// execution to the engine for callbacks all // execution to the engine for callbacks all
// client threads should call DispatchCallbacks // client threads should call DispatchCallbacks
// when they are idle. Callbacks are only // when they are idle. Callbacks are only
// received when a thread calls DispatchCallbacks // received when a thread calls DispatchCallbacks
// or WaitForEvent. WaitForEvent can only be // or WaitForEvent. WaitForEvent can only be
// called by the thread that started the debug // called by the thread that started the debug
skipping to change at line 3120 skipping to change at line 3413
// call DispatchCallbacks when possible. // call DispatchCallbacks when possible.
// DispatchCallbacks returns when ExitDispatch is used // DispatchCallbacks returns when ExitDispatch is used
// to interrupt dispatch or when the timeout expires. // to interrupt dispatch or when the timeout expires.
// DispatchCallbacks dispatches callbacks for all // DispatchCallbacks dispatches callbacks for all
// clients associated with the thread calling // clients associated with the thread calling
// DispatchCallbacks. // DispatchCallbacks.
// DispatchCallbacks returns S_FALSE when the // DispatchCallbacks returns S_FALSE when the
// timeout expires. // timeout expires.
STDMETHOD(DispatchCallbacks)( STDMETHOD(DispatchCallbacks)(
THIS_ THIS_
__in ULONG Timeout _In_ ULONG Timeout
) PURE; ) PURE;
// ExitDispatch can be used to interrupt callback // ExitDispatch can be used to interrupt callback
// dispatch when a client thread is needed by the // dispatch when a client thread is needed by the
// client. This method is reentrant and can // client. This method is reentrant and can
// be called from any thread. // be called from any thread.
STDMETHOD(ExitDispatch)( STDMETHOD(ExitDispatch)(
THIS_ THIS_
__in PDEBUG_CLIENT Client _In_ PDEBUG_CLIENT Client
) PURE; ) PURE;
// Clients are specific to the thread that // Clients are specific to the thread that
// created them. Calls from other threads // created them. Calls from other threads
// fail immediately. The CreateClient method // fail immediately. The CreateClient method
// is a notable exception; it allows creation // is a notable exception; it allows creation
// of a new client for a new thread. // of a new client for a new thread.
STDMETHOD(CreateClient)( STDMETHOD(CreateClient)(
THIS_ THIS_
__out PDEBUG_CLIENT* Client _Out_ PDEBUG_CLIENT* Client
) PURE; ) PURE;
STDMETHOD(GetInputCallbacks)( STDMETHOD(GetInputCallbacks)(
THIS_ THIS_
__out PDEBUG_INPUT_CALLBACKS* Callbacks _Out_ PDEBUG_INPUT_CALLBACKS* Callbacks
) PURE; ) PURE;
STDMETHOD(SetInputCallbacks)( STDMETHOD(SetInputCallbacks)(
THIS_ THIS_
__in_opt PDEBUG_INPUT_CALLBACKS Callbacks _In_opt_ PDEBUG_INPUT_CALLBACKS Callbacks
) PURE; ) PURE;
// Output callback interfaces are described separately. // Output callback interfaces are described separately.
STDMETHOD(GetOutputCallbacks)( STDMETHOD(GetOutputCallbacks)(
THIS_ THIS_
__out PDEBUG_OUTPUT_CALLBACKS* Callbacks _Out_ PDEBUG_OUTPUT_CALLBACKS* Callbacks
) PURE; ) PURE;
STDMETHOD(SetOutputCallbacks)( STDMETHOD(SetOutputCallbacks)(
THIS_ THIS_
__in_opt PDEBUG_OUTPUT_CALLBACKS Callbacks _In_opt_ PDEBUG_OUTPUT_CALLBACKS Callbacks
) PURE; ) PURE;
// Output flags provide control over // Output flags provide control over
// the distribution of output among clients. // the distribution of output among clients.
// Output masks select which output streams // Output masks select which output streams
// should be sent to the output callbacks. // should be sent to the output callbacks.
// Only Output calls with a mask that // Only Output calls with a mask that
// contains one of the output mask bits // contains one of the output mask bits
// will be sent to the output callbacks. // will be sent to the output callbacks.
// These methods are reentrant. // These methods are reentrant.
// If such access is not synchronized // If such access is not synchronized
// disruptions in output may occur. // disruptions in output may occur.
STDMETHOD(GetOutputMask)( STDMETHOD(GetOutputMask)(
THIS_ THIS_
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
STDMETHOD(SetOutputMask)( STDMETHOD(SetOutputMask)(
THIS_ THIS_
__in ULONG Mask _In_ ULONG Mask
) PURE; ) PURE;
// These methods allow access to another clients // These methods allow access to another clients
// output mask. They are necessary for changing // output mask. They are necessary for changing
// a clients output mask when it is // a clients output mask when it is
// waiting for events. These methods are reentrant // waiting for events. These methods are reentrant
// and can be called from any thread. // and can be called from any thread.
STDMETHOD(GetOtherOutputMask)( STDMETHOD(GetOtherOutputMask)(
THIS_ THIS_
__in PDEBUG_CLIENT Client, _In_ PDEBUG_CLIENT Client,
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
STDMETHOD(SetOtherOutputMask)( STDMETHOD(SetOtherOutputMask)(
THIS_ THIS_
__in PDEBUG_CLIENT Client, _In_ PDEBUG_CLIENT Client,
__in ULONG Mask _In_ ULONG Mask
) PURE; ) PURE;
// Control the width of an output line for // Control the width of an output line for
// commands which produce formatted output. // commands which produce formatted output.
// This setting is just a suggestion. // This setting is just a suggestion.
STDMETHOD(GetOutputWidth)( STDMETHOD(GetOutputWidth)(
THIS_ THIS_
__out PULONG Columns _Out_ PULONG Columns
) PURE; ) PURE;
STDMETHOD(SetOutputWidth)( STDMETHOD(SetOutputWidth)(
THIS_ THIS_
__in ULONG Columns _In_ ULONG Columns
) PURE; ) PURE;
// Some of the engines output commands produce // Some of the engines output commands produce
// multiple lines of output. A prefix can be // multiple lines of output. A prefix can be
// set that the engine will automatically output // set that the engine will automatically output
// for each line in that case, allowing a caller // for each line in that case, allowing a caller
// to control indentation or identifying marks. // to control indentation or identifying marks.
// This is not a general setting for any output // This is not a general setting for any output
// with a newline in it. Methods which use // with a newline in it. Methods which use
// the line prefix are marked in their documentation. // the line prefix are marked in their documentation.
STDMETHOD(GetOutputLinePrefix)( STDMETHOD(GetOutputLinePrefix)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PrefixSize _Out_opt_ PULONG PrefixSize
) PURE; ) PURE;
STDMETHOD(SetOutputLinePrefix)( STDMETHOD(SetOutputLinePrefix)(
THIS_ THIS_
__in_opt PCSTR Prefix _In_opt_ PCSTR Prefix
) PURE; ) PURE;
// Returns a string describing the machine // Returns a string describing the machine
// and user this client represents. The // and user this client represents. The
// specific content of the string varies // specific content of the string varies
// with operating system. If the client is // with operating system. If the client is
// remotely connected some network information // remotely connected some network information
// may also be present. // may also be present.
STDMETHOD(GetIdentity)( STDMETHOD(GetIdentity)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG IdentitySize _Out_opt_ PULONG IdentitySize
) PURE; ) PURE;
// Format is a printf-like format string // Format is a printf-like format string
// with one %s where the identity string should go. // with one %s where the identity string should go.
STDMETHOD(OutputIdentity)( STDMETHOD(OutputIdentity)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags, _In_ ULONG Flags,
__in PCSTR Format _In_ PCSTR Format
) PURE; ) PURE;
// Event callbacks allow a client to // Event callbacks allow a client to
// receive notification about changes // receive notification about changes
// during the debug session. // during the debug session.
STDMETHOD(GetEventCallbacks)( STDMETHOD(GetEventCallbacks)(
THIS_ THIS_
__out PDEBUG_EVENT_CALLBACKS* Callbacks _Out_ PDEBUG_EVENT_CALLBACKS* Callbacks
) PURE; ) PURE;
STDMETHOD(SetEventCallbacks)( STDMETHOD(SetEventCallbacks)(
THIS_ THIS_
__in_opt PDEBUG_EVENT_CALLBACKS Callbacks _In_opt_ PDEBUG_EVENT_CALLBACKS Callbacks
) PURE; ) PURE;
// The engine sometimes merges compatible callback // The engine sometimes merges compatible callback
// requests to reduce callback overhead. This is // requests to reduce callback overhead. This is
// most noticeable with output as small pieces of // most noticeable with output as small pieces of
// output are collected into larger groups to // output are collected into larger groups to
// reduce the overall number of output callback calls. // reduce the overall number of output callback calls.
// A client can use this method to force all pending // A client can use this method to force all pending
// callbacks to be delivered. This is rarely necessary. // callbacks to be delivered. This is rarely necessary.
STDMETHOD(FlushCallbacks)( STDMETHOD(FlushCallbacks)(
skipping to change at line 3274 skipping to change at line 3567
) PURE; ) PURE;
// IDebugClient2. // IDebugClient2.
// Functions similarly to WriteDumpFile with // Functions similarly to WriteDumpFile with
// the addition of the ability to specify // the addition of the ability to specify
// per-dump-format write control flags. // per-dump-format write control flags.
// Comment is not supported in all formats. // Comment is not supported in all formats.
STDMETHOD(WriteDumpFile2)( STDMETHOD(WriteDumpFile2)(
THIS_ THIS_
__in PCSTR DumpFile, _In_ PCSTR DumpFile,
__in ULONG Qualifier, _In_ ULONG Qualifier,
__in ULONG FormatFlags, _In_ ULONG FormatFlags,
__in_opt PCSTR Comment _In_opt_ PCSTR Comment
) PURE; ) PURE;
// Registers additional files of supporting information // Registers additional files of supporting information
// for a dump file open. This method must be called // for a dump file open. This method must be called
// before OpenDumpFile is called. // before OpenDumpFile is called.
// The files registered may be opened at the time // The files registered may be opened at the time
// this method is called but generally will not // this method is called but generally will not
// be used until OpenDumpFile is called. // be used until OpenDumpFile is called.
STDMETHOD(AddDumpInformationFile)( STDMETHOD(AddDumpInformationFile)(
THIS_ THIS_
__in PCSTR InfoFile, _In_ PCSTR InfoFile,
__in ULONG Type _In_ ULONG Type
) PURE; ) PURE;
// Requests that the remote process server shut down. // Requests that the remote process server shut down.
STDMETHOD(EndProcessServer)( STDMETHOD(EndProcessServer)(
THIS_ THIS_
__in ULONG64 Server _In_ ULONG64 Server
) PURE; ) PURE;
// Waits for a started process server to // Waits for a started process server to
// exit. Allows an application running a // exit. Allows an application running a
// process server to monitor the process // process server to monitor the process
// server so that it can tell when a remote // server so that it can tell when a remote
// client has asked for it to exit. // client has asked for it to exit.
// Returns S_OK if the process server has // Returns S_OK if the process server has
// shut down and S_FALSE for a timeout. // shut down and S_FALSE for a timeout.
STDMETHOD(WaitForProcessServerEnd)( STDMETHOD(WaitForProcessServerEnd)(
THIS_ THIS_
__in ULONG Timeout _In_ ULONG Timeout
) PURE; ) PURE;
// Returns S_OK if the system is configured // Returns S_OK if the system is configured
// to allow kernel debugging. // to allow kernel debugging.
STDMETHOD(IsKernelDebuggerEnabled)( STDMETHOD(IsKernelDebuggerEnabled)(
THIS THIS
) PURE; ) PURE;
// Attempts to terminate the current process. // Attempts to terminate the current process.
// Exit process events for the process may be generated. // Exit process events for the process may be generated.
skipping to change at line 3339 skipping to change at line 3632
// process out of the debugged state. // process out of the debugged state.
// This is only supported on some system versions. // This is only supported on some system versions.
STDMETHOD(AbandonCurrentProcess)( STDMETHOD(AbandonCurrentProcess)(
THIS THIS
) PURE; ) PURE;
// IDebugClient3. // IDebugClient3.
STDMETHOD(GetRunningProcessSystemIdByExecutableNameWide)( STDMETHOD(GetRunningProcessSystemIdByExecutableNameWide)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PCWSTR ExeName, _In_ PCWSTR ExeName,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetRunningProcessDescriptionWide)( STDMETHOD(GetRunningProcessDescriptionWide)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in ULONG SystemId, _In_ ULONG SystemId,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(ExeNameSize) PWSTR ExeName, _Out_writes_opt_(ExeNameSize) PWSTR ExeName,
__in ULONG ExeNameSize, _In_ ULONG ExeNameSize,
__out_opt PULONG ActualExeNameSize, _Out_opt_ PULONG ActualExeNameSize,
__out_ecount_opt(DescriptionSize) PWSTR Description, _Out_writes_opt_(DescriptionSize) PWSTR Description,
__in ULONG DescriptionSize, _In_ ULONG DescriptionSize,
__out_opt PULONG ActualDescriptionSize _Out_opt_ PULONG ActualDescriptionSize
) PURE; ) PURE;
STDMETHOD(CreateProcessWide)( STDMETHOD(CreateProcessWide)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PWSTR CommandLine, _In_ PWSTR CommandLine,
__in ULONG CreateFlags _In_ ULONG CreateFlags
) PURE; ) PURE;
STDMETHOD(CreateProcessAndAttachWide)( STDMETHOD(CreateProcessAndAttachWide)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in_opt PWSTR CommandLine, _In_opt_ PWSTR CommandLine,
__in ULONG CreateFlags, _In_ ULONG CreateFlags,
__in ULONG ProcessId, _In_ ULONG ProcessId,
__in ULONG AttachFlags _In_ ULONG AttachFlags
) PURE; ) PURE;
// IDebugClient4. // IDebugClient4.
// In the following methods both a filename and a file // In the following methods both a filename and a file
// handle can be passed in. If a file handle is given // handle can be passed in. If a file handle is given
// the filename may be omitted, although providing it // the filename may be omitted, although providing it
// allows the debugger to properly report the name when // allows the debugger to properly report the name when
// queried. // queried.
// File handles cannot be used in remote calls. // File handles cannot be used in remote calls.
STDMETHOD(OpenDumpFileWide)( STDMETHOD(OpenDumpFileWide)(
THIS_ THIS_
__in_opt PCWSTR FileName, _In_opt_ PCWSTR FileName,
__in ULONG64 FileHandle _In_ ULONG64 FileHandle
) PURE; ) PURE;
STDMETHOD(WriteDumpFileWide)( STDMETHOD(WriteDumpFileWide)(
THIS_ THIS_
__in_opt PCWSTR FileName, _In_opt_ PCWSTR FileName,
__in ULONG64 FileHandle, _In_ ULONG64 FileHandle,
__in ULONG Qualifier, _In_ ULONG Qualifier,
__in ULONG FormatFlags, _In_ ULONG FormatFlags,
__in_opt PCWSTR Comment _In_opt_ PCWSTR Comment
) PURE; ) PURE;
STDMETHOD(AddDumpInformationFileWide)( STDMETHOD(AddDumpInformationFileWide)(
THIS_ THIS_
__in_opt PCWSTR FileName, _In_opt_ PCWSTR FileName,
__in ULONG64 FileHandle, _In_ ULONG64 FileHandle,
__in ULONG Type _In_ ULONG Type
) PURE; ) PURE;
// These methods can be used to retrieve // These methods can be used to retrieve
// file information for all targets that // file information for all targets that
// involve files. // involve files.
STDMETHOD(GetNumberDumpFiles)( STDMETHOD(GetNumberDumpFiles)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetDumpFile)( STDMETHOD(GetDumpFile)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PULONG64 Handle, _Out_opt_ PULONG64 Handle,
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
STDMETHOD(GetDumpFileWide)( STDMETHOD(GetDumpFileWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PULONG64 Handle, _Out_opt_ PULONG64 Handle,
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
}; };
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugClient5 #define INTERFACE IDebugClient5
DECLARE_INTERFACE_(IDebugClient5, IUnknown) DECLARE_INTERFACE_(IDebugClient5, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugClient. // IDebugClient.
// The following set of methods start // The following set of methods start
// the different kinds of debuggees. // the different kinds of debuggees.
// Begins a debug session using the kernel // Begins a debug session using the kernel
// debugging protocol. This method selects // debugging protocol. This method selects
// the protocol as the debuggee communication // the protocol as the debuggee communication
// mechanism but does not initiate the communication // mechanism but does not initiate the communication
// itself. // itself.
STDMETHOD(AttachKernel)( STDMETHOD(AttachKernel)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in_opt PCSTR ConnectOptions _In_opt_ PCSTR ConnectOptions
) PURE; ) PURE;
STDMETHOD(GetKernelConnectionOptions)( STDMETHOD(GetKernelConnectionOptions)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG OptionsSize _Out_opt_ PULONG OptionsSize
) PURE; ) PURE;
// Updates the connection options for a live // Updates the connection options for a live
// kernel connection. This can only be used // kernel connection. This can only be used
// to modify parameters for the connection, not // to modify parameters for the connection, not
// to switch to a completely different kind of // to switch to a completely different kind of
// connection. // connection.
// This method is reentrant. // This method is reentrant.
STDMETHOD(SetKernelConnectionOptions)( STDMETHOD(SetKernelConnectionOptions)(
THIS_ THIS_
__in PCSTR Options _In_ PCSTR Options
) PURE; ) PURE;
// Starts a process server for remote // Starts a process server for remote
// user-mode process control. // user-mode process control.
// The local process server is server zero. // The local process server is server zero.
STDMETHOD(StartProcessServer)( STDMETHOD(StartProcessServer)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in PCSTR Options, _In_ PCSTR Options,
__in_opt __reserved PVOID Reserved _In_opt_ _Reserved_ PVOID Reserved
) PURE; ) PURE;
STDMETHOD(ConnectProcessServer)( STDMETHOD(ConnectProcessServer)(
THIS_ THIS_
__in PCSTR RemoteOptions, _In_ PCSTR RemoteOptions,
__out PULONG64 Server _Out_ PULONG64 Server
) PURE; ) PURE;
STDMETHOD(DisconnectProcessServer)( STDMETHOD(DisconnectProcessServer)(
THIS_ THIS_
__in ULONG64 Server _In_ ULONG64 Server
) PURE; ) PURE;
// Enumerates and describes processes // Enumerates and describes processes
// accessible through the given process server. // accessible through the given process server.
STDMETHOD(GetRunningProcessSystemIds)( STDMETHOD(GetRunningProcessSystemIds)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__out_ecount_opt(Count) PULONG Ids, _Out_writes_opt_(Count) PULONG Ids,
__in ULONG Count, _In_ ULONG Count,
__out_opt PULONG ActualCount _Out_opt_ PULONG ActualCount
) PURE; ) PURE;
STDMETHOD(GetRunningProcessSystemIdByExecutableName)( STDMETHOD(GetRunningProcessSystemIdByExecutableName)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PCSTR ExeName, _In_ PCSTR ExeName,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetRunningProcessDescription)( STDMETHOD(GetRunningProcessDescription)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in ULONG SystemId, _In_ ULONG SystemId,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(ExeNameSize) PSTR ExeName, _Out_writes_opt_(ExeNameSize) PSTR ExeName,
__in ULONG ExeNameSize, _In_ ULONG ExeNameSize,
__out_opt PULONG ActualExeNameSize, _Out_opt_ PULONG ActualExeNameSize,
__out_ecount_opt(DescriptionSize) PSTR Description, _Out_writes_opt_(DescriptionSize) PSTR Description,
__in ULONG DescriptionSize, _In_ ULONG DescriptionSize,
__out_opt PULONG ActualDescriptionSize _Out_opt_ PULONG ActualDescriptionSize
) PURE; ) PURE;
// Attaches to a running user-mode process. // Attaches to a running user-mode process.
STDMETHOD(AttachProcess)( STDMETHOD(AttachProcess)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in ULONG ProcessId, _In_ ULONG ProcessId,
__in ULONG AttachFlags _In_ ULONG AttachFlags
) PURE; ) PURE;
// Creates a new user-mode process for debugging. // Creates a new user-mode process for debugging.
// CreateFlags are as given to Win32s CreateProcess. // CreateFlags are as given to Win32s CreateProcess.
// One of DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS // One of DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS
// must be specified. // must be specified.
STDMETHOD(CreateProcess)( STDMETHOD(CreateProcess)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PSTR CommandLine, _In_ PSTR CommandLine,
__in ULONG CreateFlags _In_ ULONG CreateFlags
) PURE; ) PURE;
// Creates or attaches to a user-mode process, or both. // Creates or attaches to a user-mode process, or both.
// If CommandLine is NULL this method operates as // If CommandLine is NULL this method operates as
// AttachProcess does. If ProcessId is zero it // AttachProcess does. If ProcessId is zero it
// operates as CreateProcess does. If CommandLine is // operates as CreateProcess does. If CommandLine is
// non-NULL and ProcessId is non-zero the method first // non-NULL and ProcessId is non-zero the method first
// starts a process with the given information but // starts a process with the given information but
// in a suspended state. The engine then attaches to // in a suspended state. The engine then attaches to
// the indicated process. Once the attach is successful // the indicated process. Once the attach is successful
// the suspended process is resumed. This provides // the suspended process is resumed. This provides
// synchronization between the new process and the // synchronization between the new process and the
// attachment. // attachment.
STDMETHOD(CreateProcessAndAttach)( STDMETHOD(CreateProcessAndAttach)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in_opt PSTR CommandLine, _In_opt_ PSTR CommandLine,
__in ULONG CreateFlags, _In_ ULONG CreateFlags,
__in ULONG ProcessId, _In_ ULONG ProcessId,
__in ULONG AttachFlags _In_ ULONG AttachFlags
) PURE; ) PURE;
// Gets and sets process control flags. // Gets and sets process control flags.
STDMETHOD(GetProcessOptions)( STDMETHOD(GetProcessOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddProcessOptions)( STDMETHOD(AddProcessOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveProcessOptions)( STDMETHOD(RemoveProcessOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetProcessOptions)( STDMETHOD(SetProcessOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
// Opens any kind of user- or kernel-mode dump file // Opens any kind of user- or kernel-mode dump file
// and begins a debug session with the information // and begins a debug session with the information
// contained within it. // contained within it.
STDMETHOD(OpenDumpFile)( STDMETHOD(OpenDumpFile)(
THIS_ THIS_
__in PCSTR DumpFile _In_ PCSTR DumpFile
) PURE; ) PURE;
// Writes a dump file from the current session information. // Writes a dump file from the current session information.
// The kind of dump file written is determined by the // The kind of dump file written is determined by the
// kind of session and the type qualifier given. // kind of session and the type qualifier given.
// For example, if the current session is a kernel // For example, if the current session is a kernel
// debug session (DEBUG_CLASS_KERNEL) and the qualifier // debug session (DEBUG_CLASS_KERNEL) and the qualifier
// is DEBUG_DUMP_SMALL a small kernel dump will be written. // is DEBUG_DUMP_SMALL a small kernel dump will be written.
STDMETHOD(WriteDumpFile)( STDMETHOD(WriteDumpFile)(
THIS_ THIS_
__in PCSTR DumpFile, _In_ PCSTR DumpFile,
__in ULONG Qualifier _In_ ULONG Qualifier
) PURE; ) PURE;
// Indicates that a remote client is ready to // Indicates that a remote client is ready to
// begin participating in the current session. // begin participating in the current session.
// HistoryLimit gives a character limit on // HistoryLimit gives a character limit on
// the amount of output history to be sent. // the amount of output history to be sent.
STDMETHOD(ConnectSession)( STDMETHOD(ConnectSession)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG HistoryLimit _In_ ULONG HistoryLimit
) PURE; ) PURE;
// Indicates that the engine should start accepting // Indicates that the engine should start accepting
// remote connections. Options specifies connection types // remote connections. Options specifies connection types
// and their parameters. Supported strings are: // and their parameters. Supported strings are:
// npipe:Pipe=<Pipe name> // npipe:Pipe=<Pipe name>
// tcp:Port=<IP port> // tcp:Port=<IP port>
STDMETHOD(StartServer)( STDMETHOD(StartServer)(
THIS_ THIS_
__in PCSTR Options _In_ PCSTR Options
) PURE; ) PURE;
// List the servers running on the given machine. // List the servers running on the given machine.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputServers)( STDMETHOD(OutputServers)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCSTR Machine, _In_ PCSTR Machine,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Attempts to terminate all processes in the debuggers list. // Attempts to terminate all processes in the debuggers list.
STDMETHOD(TerminateProcesses)( STDMETHOD(TerminateProcesses)(
THIS THIS
) PURE; ) PURE;
// Attempts to detach from all processes in the debuggers list. // Attempts to detach from all processes in the debuggers list.
// This requires OS support for debugger detach. // This requires OS support for debugger detach.
STDMETHOD(DetachProcesses)( STDMETHOD(DetachProcesses)(
THIS THIS
) PURE; ) PURE;
// Stops the current debug session. If a process // Stops the current debug session. If a process
// was created or attached an active EndSession can // was created or attached an active EndSession can
// terminate or detach from it. // terminate or detach from it.
// If a kernel connection was opened it will be closed but the // If a kernel connection was opened it will be closed but the
// target machine is otherwise unaffected. // target machine is otherwise unaffected.
STDMETHOD(EndSession)( STDMETHOD(EndSession)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// If a process was started and ran to completion // If a process was started and ran to completion
// this method can be used to retrieve its exit code. // this method can be used to retrieve its exit code.
STDMETHOD(GetExitCode)( STDMETHOD(GetExitCode)(
THIS_ THIS_
__out PULONG Code _Out_ PULONG Code
) PURE; ) PURE;
// Client event callbacks are called on the thread // Client event callbacks are called on the thread
// of the client. In order to give thread // of the client. In order to give thread
// execution to the engine for callbacks all // execution to the engine for callbacks all
// client threads should call DispatchCallbacks // client threads should call DispatchCallbacks
// when they are idle. Callbacks are only // when they are idle. Callbacks are only
// received when a thread calls DispatchCallbacks // received when a thread calls DispatchCallbacks
// or WaitForEvent. WaitForEvent can only be // or WaitForEvent. WaitForEvent can only be
// called by the thread that started the debug // called by the thread that started the debug
skipping to change at line 3667 skipping to change at line 3960
// call DispatchCallbacks when possible. // call DispatchCallbacks when possible.
// DispatchCallbacks returns when ExitDispatch is used // DispatchCallbacks returns when ExitDispatch is used
// to interrupt dispatch or when the timeout expires. // to interrupt dispatch or when the timeout expires.
// DispatchCallbacks dispatches callbacks for all // DispatchCallbacks dispatches callbacks for all
// clients associated with the thread calling // clients associated with the thread calling
// DispatchCallbacks. // DispatchCallbacks.
// DispatchCallbacks returns S_FALSE when the // DispatchCallbacks returns S_FALSE when the
// timeout expires. // timeout expires.
STDMETHOD(DispatchCallbacks)( STDMETHOD(DispatchCallbacks)(
THIS_ THIS_
__in ULONG Timeout _In_ ULONG Timeout
) PURE; ) PURE;
// ExitDispatch can be used to interrupt callback // ExitDispatch can be used to interrupt callback
// dispatch when a client thread is needed by the // dispatch when a client thread is needed by the
// client. This method is reentrant and can // client. This method is reentrant and can
// be called from any thread. // be called from any thread.
STDMETHOD(ExitDispatch)( STDMETHOD(ExitDispatch)(
THIS_ THIS_
__in PDEBUG_CLIENT Client _In_ PDEBUG_CLIENT Client
) PURE; ) PURE;
// Clients are specific to the thread that // Clients are specific to the thread that
// created them. Calls from other threads // created them. Calls from other threads
// fail immediately. The CreateClient method // fail immediately. The CreateClient method
// is a notable exception; it allows creation // is a notable exception; it allows creation
// of a new client for a new thread. // of a new client for a new thread.
STDMETHOD(CreateClient)( STDMETHOD(CreateClient)(
THIS_ THIS_
__out PDEBUG_CLIENT* Client _Out_ PDEBUG_CLIENT* Client
) PURE; ) PURE;
STDMETHOD(GetInputCallbacks)( STDMETHOD(GetInputCallbacks)(
THIS_ THIS_
__out PDEBUG_INPUT_CALLBACKS* Callbacks _Out_ PDEBUG_INPUT_CALLBACKS* Callbacks
) PURE; ) PURE;
STDMETHOD(SetInputCallbacks)( STDMETHOD(SetInputCallbacks)(
THIS_ THIS_
__in_opt PDEBUG_INPUT_CALLBACKS Callbacks _In_opt_ PDEBUG_INPUT_CALLBACKS Callbacks
) PURE; ) PURE;
// Output callback interfaces are described separately. // Output callback interfaces are described separately.
STDMETHOD(GetOutputCallbacks)( STDMETHOD(GetOutputCallbacks)(
THIS_ THIS_
__out PDEBUG_OUTPUT_CALLBACKS* Callbacks _Out_ PDEBUG_OUTPUT_CALLBACKS* Callbacks
) PURE; ) PURE;
STDMETHOD(SetOutputCallbacks)( STDMETHOD(SetOutputCallbacks)(
THIS_ THIS_
__in_opt PDEBUG_OUTPUT_CALLBACKS Callbacks _In_opt_ PDEBUG_OUTPUT_CALLBACKS Callbacks
) PURE; ) PURE;
// Output flags provide control over // Output flags provide control over
// the distribution of output among clients. // the distribution of output among clients.
// Output masks select which output streams // Output masks select which output streams
// should be sent to the output callbacks. // should be sent to the output callbacks.
// Only Output calls with a mask that // Only Output calls with a mask that
// contains one of the output mask bits // contains one of the output mask bits
// will be sent to the output callbacks. // will be sent to the output callbacks.
// These methods are reentrant. // These methods are reentrant.
// If such access is not synchronized // If such access is not synchronized
// disruptions in output may occur. // disruptions in output may occur.
STDMETHOD(GetOutputMask)( STDMETHOD(GetOutputMask)(
THIS_ THIS_
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
STDMETHOD(SetOutputMask)( STDMETHOD(SetOutputMask)(
THIS_ THIS_
__in ULONG Mask _In_ ULONG Mask
) PURE; ) PURE;
// These methods allow access to another clients // These methods allow access to another clients
// output mask. They are necessary for changing // output mask. They are necessary for changing
// a clients output mask when it is // a clients output mask when it is
// waiting for events. These methods are reentrant // waiting for events. These methods are reentrant
// and can be called from any thread. // and can be called from any thread.
STDMETHOD(GetOtherOutputMask)( STDMETHOD(GetOtherOutputMask)(
THIS_ THIS_
__in PDEBUG_CLIENT Client, _In_ PDEBUG_CLIENT Client,
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
STDMETHOD(SetOtherOutputMask)( STDMETHOD(SetOtherOutputMask)(
THIS_ THIS_
__in PDEBUG_CLIENT Client, _In_ PDEBUG_CLIENT Client,
__in ULONG Mask _In_ ULONG Mask
) PURE; ) PURE;
// Control the width of an output line for // Control the width of an output line for
// commands which produce formatted output. // commands which produce formatted output.
// This setting is just a suggestion. // This setting is just a suggestion.
STDMETHOD(GetOutputWidth)( STDMETHOD(GetOutputWidth)(
THIS_ THIS_
__out PULONG Columns _Out_ PULONG Columns
) PURE; ) PURE;
STDMETHOD(SetOutputWidth)( STDMETHOD(SetOutputWidth)(
THIS_ THIS_
__in ULONG Columns _In_ ULONG Columns
) PURE; ) PURE;
// Some of the engines output commands produce // Some of the engines output commands produce
// multiple lines of output. A prefix can be // multiple lines of output. A prefix can be
// set that the engine will automatically output // set that the engine will automatically output
// for each line in that case, allowing a caller // for each line in that case, allowing a caller
// to control indentation or identifying marks. // to control indentation or identifying marks.
// This is not a general setting for any output // This is not a general setting for any output
// with a newline in it. Methods which use // with a newline in it. Methods which use
// the line prefix are marked in their documentation. // the line prefix are marked in their documentation.
STDMETHOD(GetOutputLinePrefix)( STDMETHOD(GetOutputLinePrefix)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PrefixSize _Out_opt_ PULONG PrefixSize
) PURE; ) PURE;
STDMETHOD(SetOutputLinePrefix)( STDMETHOD(SetOutputLinePrefix)(
THIS_ THIS_
__in_opt PCSTR Prefix _In_opt_ PCSTR Prefix
) PURE; ) PURE;
// Returns a string describing the machine // Returns a string describing the machine
// and user this client represents. The // and user this client represents. The
// specific content of the string varies // specific content of the string varies
// with operating system. If the client is // with operating system. If the client is
// remotely connected some network information // remotely connected some network information
// may also be present. // may also be present.
STDMETHOD(GetIdentity)( STDMETHOD(GetIdentity)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG IdentitySize _Out_opt_ PULONG IdentitySize
) PURE; ) PURE;
// Format is a printf-like format string // Format is a printf-like format string
// with one %s where the identity string should go. // with one %s where the identity string should go.
STDMETHOD(OutputIdentity)( STDMETHOD(OutputIdentity)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags, _In_ ULONG Flags,
__in PCSTR Format _In_ PCSTR Format
) PURE; ) PURE;
// Event callbacks allow a client to // Event callbacks allow a client to
// receive notification about changes // receive notification about changes
// during the debug session. // during the debug session.
STDMETHOD(GetEventCallbacks)( STDMETHOD(GetEventCallbacks)(
THIS_ THIS_
__out PDEBUG_EVENT_CALLBACKS* Callbacks _Out_ PDEBUG_EVENT_CALLBACKS* Callbacks
) PURE; ) PURE;
STDMETHOD(SetEventCallbacks)( STDMETHOD(SetEventCallbacks)(
THIS_ THIS_
__in_opt PDEBUG_EVENT_CALLBACKS Callbacks _In_opt_ PDEBUG_EVENT_CALLBACKS Callbacks
) PURE; ) PURE;
// The engine sometimes merges compatible callback // The engine sometimes merges compatible callback
// requests to reduce callback overhead. This is // requests to reduce callback overhead. This is
// most noticeable with output as small pieces of // most noticeable with output as small pieces of
// output are collected into larger groups to // output are collected into larger groups to
// reduce the overall number of output callback calls. // reduce the overall number of output callback calls.
// A client can use this method to force all pending // A client can use this method to force all pending
// callbacks to be delivered. This is rarely necessary. // callbacks to be delivered. This is rarely necessary.
STDMETHOD(FlushCallbacks)( STDMETHOD(FlushCallbacks)(
skipping to change at line 3821 skipping to change at line 4114
) PURE; ) PURE;
// IDebugClient2. // IDebugClient2.
// Functions similarly to WriteDumpFile with // Functions similarly to WriteDumpFile with
// the addition of the ability to specify // the addition of the ability to specify
// per-dump-format write control flags. // per-dump-format write control flags.
// Comment is not supported in all formats. // Comment is not supported in all formats.
STDMETHOD(WriteDumpFile2)( STDMETHOD(WriteDumpFile2)(
THIS_ THIS_
__in PCSTR DumpFile, _In_ PCSTR DumpFile,
__in ULONG Qualifier, _In_ ULONG Qualifier,
__in ULONG FormatFlags, _In_ ULONG FormatFlags,
__in_opt PCSTR Comment _In_opt_ PCSTR Comment
) PURE; ) PURE;
// Registers additional files of supporting information // Registers additional files of supporting information
// for a dump file open. This method must be called // for a dump file open. This method must be called
// before OpenDumpFile is called. // before OpenDumpFile is called.
// The files registered may be opened at the time // The files registered may be opened at the time
// this method is called but generally will not // this method is called but generally will not
// be used until OpenDumpFile is called. // be used until OpenDumpFile is called.
STDMETHOD(AddDumpInformationFile)( STDMETHOD(AddDumpInformationFile)(
THIS_ THIS_
__in PCSTR InfoFile, _In_ PCSTR InfoFile,
__in ULONG Type _In_ ULONG Type
) PURE; ) PURE;
// Requests that the remote process server shut down. // Requests that the remote process server shut down.
STDMETHOD(EndProcessServer)( STDMETHOD(EndProcessServer)(
THIS_ THIS_
__in ULONG64 Server _In_ ULONG64 Server
) PURE; ) PURE;
// Waits for a started process server to // Waits for a started process server to
// exit. Allows an application running a // exit. Allows an application running a
// process server to monitor the process // process server to monitor the process
// server so that it can tell when a remote // server so that it can tell when a remote
// client has asked for it to exit. // client has asked for it to exit.
// Returns S_OK if the process server has // Returns S_OK if the process server has
// shut down and S_FALSE for a timeout. // shut down and S_FALSE for a timeout.
STDMETHOD(WaitForProcessServerEnd)( STDMETHOD(WaitForProcessServerEnd)(
THIS_ THIS_
__in ULONG Timeout _In_ ULONG Timeout
) PURE; ) PURE;
// Returns S_OK if the system is configured // Returns S_OK if the system is configured
// to allow kernel debugging. // to allow kernel debugging.
STDMETHOD(IsKernelDebuggerEnabled)( STDMETHOD(IsKernelDebuggerEnabled)(
THIS THIS
) PURE; ) PURE;
// Attempts to terminate the current process. // Attempts to terminate the current process.
// Exit process events for the process may be generated. // Exit process events for the process may be generated.
skipping to change at line 3886 skipping to change at line 4179
// process out of the debugged state. // process out of the debugged state.
// This is only supported on some system versions. // This is only supported on some system versions.
STDMETHOD(AbandonCurrentProcess)( STDMETHOD(AbandonCurrentProcess)(
THIS THIS
) PURE; ) PURE;
// IDebugClient3. // IDebugClient3.
STDMETHOD(GetRunningProcessSystemIdByExecutableNameWide)( STDMETHOD(GetRunningProcessSystemIdByExecutableNameWide)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PCWSTR ExeName, _In_ PCWSTR ExeName,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetRunningProcessDescriptionWide)( STDMETHOD(GetRunningProcessDescriptionWide)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in ULONG SystemId, _In_ ULONG SystemId,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(ExeNameSize) PWSTR ExeName, _Out_writes_opt_(ExeNameSize) PWSTR ExeName,
__in ULONG ExeNameSize, _In_ ULONG ExeNameSize,
__out_opt PULONG ActualExeNameSize, _Out_opt_ PULONG ActualExeNameSize,
__out_ecount_opt(DescriptionSize) PWSTR Description, _Out_writes_opt_(DescriptionSize) PWSTR Description,
__in ULONG DescriptionSize, _In_ ULONG DescriptionSize,
__out_opt PULONG ActualDescriptionSize _Out_opt_ PULONG ActualDescriptionSize
) PURE; ) PURE;
STDMETHOD(CreateProcessWide)( STDMETHOD(CreateProcessWide)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PWSTR CommandLine, _In_ PWSTR CommandLine,
__in ULONG CreateFlags _In_ ULONG CreateFlags
) PURE; ) PURE;
STDMETHOD(CreateProcessAndAttachWide)( STDMETHOD(CreateProcessAndAttachWide)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in_opt PWSTR CommandLine, _In_opt_ PWSTR CommandLine,
__in ULONG CreateFlags, _In_ ULONG CreateFlags,
__in ULONG ProcessId, _In_ ULONG ProcessId,
__in ULONG AttachFlags _In_ ULONG AttachFlags
) PURE; ) PURE;
// IDebugClient4. // IDebugClient4.
// In the following methods both a filename and a file // In the following methods both a filename and a file
// handle can be passed in. If a file handle is given // handle can be passed in. If a file handle is given
// the filename may be omitted, although providing it // the filename may be omitted, although providing it
// allows the debugger to properly report the name when // allows the debugger to properly report the name when
// queried. // queried.
// File handles cannot be used in remote calls. // File handles cannot be used in remote calls.
STDMETHOD(OpenDumpFileWide)( STDMETHOD(OpenDumpFileWide)(
THIS_ THIS_
__in_opt PCWSTR FileName, _In_opt_ PCWSTR FileName,
__in ULONG64 FileHandle _In_ ULONG64 FileHandle
) PURE; ) PURE;
STDMETHOD(WriteDumpFileWide)( STDMETHOD(WriteDumpFileWide)(
THIS_ THIS_
__in_opt PCWSTR FileName, _In_opt_ PCWSTR FileName,
__in ULONG64 FileHandle, _In_ ULONG64 FileHandle,
__in ULONG Qualifier, _In_ ULONG Qualifier,
__in ULONG FormatFlags, _In_ ULONG FormatFlags,
__in_opt PCWSTR Comment _In_opt_ PCWSTR Comment
) PURE; ) PURE;
STDMETHOD(AddDumpInformationFileWide)( STDMETHOD(AddDumpInformationFileWide)(
THIS_ THIS_
__in_opt PCWSTR FileName, _In_opt_ PCWSTR FileName,
__in ULONG64 FileHandle, _In_ ULONG64 FileHandle,
__in ULONG Type _In_ ULONG Type
) PURE; ) PURE;
// These methods can be used to retrieve // These methods can be used to retrieve
// file information for all targets that // file information for all targets that
// involve files. // involve files.
STDMETHOD(GetNumberDumpFiles)( STDMETHOD(GetNumberDumpFiles)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetDumpFile)( STDMETHOD(GetDumpFile)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PULONG64 Handle, _Out_opt_ PULONG64 Handle,
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
STDMETHOD(GetDumpFileWide)( STDMETHOD(GetDumpFileWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PULONG64 Handle, _Out_opt_ PULONG64 Handle,
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
// IDebugClient5. // IDebugClient5.
STDMETHOD(AttachKernelWide)( STDMETHOD(AttachKernelWide)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in_opt PCWSTR ConnectOptions _In_opt_ PCWSTR ConnectOptions
) PURE; ) PURE;
STDMETHOD(GetKernelConnectionOptionsWide)( STDMETHOD(GetKernelConnectionOptionsWide)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG OptionsSize _Out_opt_ PULONG OptionsSize
) PURE; ) PURE;
STDMETHOD(SetKernelConnectionOptionsWide)( STDMETHOD(SetKernelConnectionOptionsWide)(
THIS_ THIS_
__in PCWSTR Options _In_ PCWSTR Options
) PURE; ) PURE;
STDMETHOD(StartProcessServerWide)( STDMETHOD(StartProcessServerWide)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in PCWSTR Options, _In_ PCWSTR Options,
__in_opt __reserved PVOID Reserved _In_opt_ _Reserved_ PVOID Reserved
) PURE; ) PURE;
STDMETHOD(ConnectProcessServerWide)( STDMETHOD(ConnectProcessServerWide)(
THIS_ THIS_
__in PCWSTR RemoteOptions, _In_ PCWSTR RemoteOptions,
__out PULONG64 Server _Out_ PULONG64 Server
) PURE; ) PURE;
STDMETHOD(StartServerWide)( STDMETHOD(StartServerWide)(
THIS_ THIS_
__in PCWSTR Options _In_ PCWSTR Options
) PURE; ) PURE;
STDMETHOD(OutputServersWide)( STDMETHOD(OutputServersWide)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCWSTR Machine, _In_ PCWSTR Machine,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
STDMETHOD(GetOutputCallbacksWide)( STDMETHOD(GetOutputCallbacksWide)(
THIS_ THIS_
__out PDEBUG_OUTPUT_CALLBACKS_WIDE* Callbacks _Out_ PDEBUG_OUTPUT_CALLBACKS_WIDE* Callbacks
) PURE; ) PURE;
STDMETHOD(SetOutputCallbacksWide)( STDMETHOD(SetOutputCallbacksWide)(
THIS_ THIS_
__in PDEBUG_OUTPUT_CALLBACKS_WIDE Callbacks _In_ PDEBUG_OUTPUT_CALLBACKS_WIDE Callbacks
) PURE; ) PURE;
STDMETHOD(GetOutputLinePrefixWide)( STDMETHOD(GetOutputLinePrefixWide)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PrefixSize _Out_opt_ PULONG PrefixSize
) PURE; ) PURE;
STDMETHOD(SetOutputLinePrefixWide)( STDMETHOD(SetOutputLinePrefixWide)(
THIS_ THIS_
__in_opt PCWSTR Prefix _In_opt_ PCWSTR Prefix
) PURE; ) PURE;
STDMETHOD(GetIdentityWide)( STDMETHOD(GetIdentityWide)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG IdentitySize _Out_opt_ PULONG IdentitySize
) PURE; ) PURE;
STDMETHOD(OutputIdentityWide)( STDMETHOD(OutputIdentityWide)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags, _In_ ULONG Flags,
__in PCWSTR Format _In_ PCWSTR Format
) PURE; ) PURE;
STDMETHOD(GetEventCallbacksWide)( STDMETHOD(GetEventCallbacksWide)(
THIS_ THIS_
__out PDEBUG_EVENT_CALLBACKS_WIDE* Callbacks _Out_ PDEBUG_EVENT_CALLBACKS_WIDE* Callbacks
) PURE; ) PURE;
STDMETHOD(SetEventCallbacksWide)( STDMETHOD(SetEventCallbacksWide)(
THIS_ THIS_
__in PDEBUG_EVENT_CALLBACKS_WIDE Callbacks _In_ PDEBUG_EVENT_CALLBACKS_WIDE Callbacks
) PURE; ) PURE;
STDMETHOD(CreateProcess2)( STDMETHOD(CreateProcess2)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PSTR CommandLine, _In_ PSTR CommandLine,
__in_bcount(OptionsBufferSize) PVOID OptionsBuffer, _In_reads_bytes_(OptionsBufferSize) PVOID OptionsBuffer,
__in ULONG OptionsBufferSize, _In_ ULONG OptionsBufferSize,
__in_opt PCSTR InitialDirectory, _In_opt_ PCSTR InitialDirectory,
__in_opt PCSTR Environment _In_opt_ PCSTR Environment
) PURE; ) PURE;
STDMETHOD(CreateProcess2Wide)( STDMETHOD(CreateProcess2Wide)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in PWSTR CommandLine, _In_ PWSTR CommandLine,
__in_bcount(OptionsBufferSize) PVOID OptionsBuffer, _In_reads_bytes_(OptionsBufferSize) PVOID OptionsBuffer,
__in ULONG OptionsBufferSize, _In_ ULONG OptionsBufferSize,
__in_opt PCWSTR InitialDirectory, _In_opt_ PCWSTR InitialDirectory,
__in_opt PCWSTR Environment _In_opt_ PCWSTR Environment
) PURE; ) PURE;
STDMETHOD(CreateProcessAndAttach2)( STDMETHOD(CreateProcessAndAttach2)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in_opt PSTR CommandLine, _In_opt_ PSTR CommandLine,
__in_bcount(OptionsBufferSize) PVOID OptionsBuffer, _In_reads_bytes_(OptionsBufferSize) PVOID OptionsBuffer,
__in ULONG OptionsBufferSize, _In_ ULONG OptionsBufferSize,
__in_opt PCSTR InitialDirectory, _In_opt_ PCSTR InitialDirectory,
__in_opt PCSTR Environment, _In_opt_ PCSTR Environment,
__in ULONG ProcessId, _In_ ULONG ProcessId,
__in ULONG AttachFlags _In_ ULONG AttachFlags
) PURE; ) PURE;
STDMETHOD(CreateProcessAndAttach2Wide)( STDMETHOD(CreateProcessAndAttach2Wide)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__in_opt PWSTR CommandLine, _In_opt_ PWSTR CommandLine,
__in_bcount(OptionsBufferSize) PVOID OptionsBuffer, _In_reads_bytes_(OptionsBufferSize) PVOID OptionsBuffer,
__in ULONG OptionsBufferSize, _In_ ULONG OptionsBufferSize,
__in_opt PCWSTR InitialDirectory, _In_opt_ PCWSTR InitialDirectory,
__in_opt PCWSTR Environment, _In_opt_ PCWSTR Environment,
__in ULONG ProcessId, _In_ ULONG ProcessId,
__in ULONG AttachFlags _In_ ULONG AttachFlags
) PURE; ) PURE;
// Helpers for saving and restoring the // Helpers for saving and restoring the
// current output line prefix. // current output line prefix.
STDMETHOD(PushOutputLinePrefix)( STDMETHOD(PushOutputLinePrefix)(
THIS_ THIS_
__in_opt PCSTR NewPrefix, _In_opt_ PCSTR NewPrefix,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
STDMETHOD(PushOutputLinePrefixWide)( STDMETHOD(PushOutputLinePrefixWide)(
THIS_ THIS_
__in_opt PCWSTR NewPrefix, _In_opt_ PCWSTR NewPrefix,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
STDMETHOD(PopOutputLinePrefix)( STDMETHOD(PopOutputLinePrefix)(
THIS_ THIS_
__in ULONG64 Handle _In_ ULONG64 Handle
) PURE; ) PURE;
// Queries to determine if any clients // Queries to determine if any clients
// could potentially respond to the given callback. // could potentially respond to the given callback.
STDMETHOD(GetNumberInputCallbacks)( STDMETHOD(GetNumberInputCallbacks)(
THIS_ THIS_
__out PULONG Count _Out_ PULONG Count
) PURE; ) PURE;
STDMETHOD(GetNumberOutputCallbacks)( STDMETHOD(GetNumberOutputCallbacks)(
THIS_ THIS_
__out PULONG Count _Out_ PULONG Count
) PURE; ) PURE;
STDMETHOD(GetNumberEventCallbacks)( STDMETHOD(GetNumberEventCallbacks)(
THIS_ THIS_
__in ULONG EventFlags, _In_ ULONG EventFlags,
__out PULONG Count _Out_ PULONG Count
) PURE; ) PURE;
// Control over locking the session against // Control over locking the session against
// undesired quits. The quit lock string // undesired quits. The quit lock string
// cannot be retrieved from a secure session. // cannot be retrieved from a secure session.
STDMETHOD(GetQuitLockString)( STDMETHOD(GetQuitLockString)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG StringSize _Out_opt_ PULONG StringSize
) PURE; ) PURE;
STDMETHOD(SetQuitLockString)( STDMETHOD(SetQuitLockString)(
THIS_ THIS_
__in PCSTR String _In_ PCSTR String
) PURE; ) PURE;
STDMETHOD(GetQuitLockStringWide)( STDMETHOD(GetQuitLockStringWide)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG StringSize _Out_opt_ PULONG StringSize
) PURE; ) PURE;
STDMETHOD(SetQuitLockStringWide)( STDMETHOD(SetQuitLockStringWide)(
THIS_ THIS_
__in PCWSTR String _In_ PCWSTR String
) PURE;
};
#undef INTERFACE
#define INTERFACE IDebugClient6
DECLARE_INTERFACE_(IDebugClient6, IUnknown)
{
// IUnknown.
STDMETHOD(QueryInterface)(
THIS_
_In_ REFIID InterfaceId,
_Out_ PVOID* Interface
) PURE;
STDMETHOD_(ULONG, AddRef)(
THIS
) PURE;
STDMETHOD_(ULONG, Release)(
THIS
) PURE;
// IDebugClient.
// The following set of methods start
// the different kinds of debuggees.
// Begins a debug session using the kernel
// debugging protocol. This method selects
// the protocol as the debuggee communication
// mechanism but does not initiate the communication
// itself.
STDMETHOD(AttachKernel)(
THIS_
_In_ ULONG Flags,
_In_opt_ PCSTR ConnectOptions
) PURE;
STDMETHOD(GetKernelConnectionOptions)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG OptionsSize
) PURE;
// Updates the connection options for a live
// kernel connection. This can only be used
// to modify parameters for the connection, not
// to switch to a completely different kind of
// connection.
// This method is reentrant.
STDMETHOD(SetKernelConnectionOptions)(
THIS_
_In_ PCSTR Options
) PURE;
// Starts a process server for remote
// user-mode process control.
// The local process server is server zero.
STDMETHOD(StartProcessServer)(
THIS_
_In_ ULONG Flags,
_In_ PCSTR Options,
_In_opt_ _Reserved_ PVOID Reserved
) PURE;
STDMETHOD(ConnectProcessServer)(
THIS_
_In_ PCSTR RemoteOptions,
_Out_ PULONG64 Server
) PURE;
STDMETHOD(DisconnectProcessServer)(
THIS_
_In_ ULONG64 Server
) PURE;
// Enumerates and describes processes
// accessible through the given process server.
STDMETHOD(GetRunningProcessSystemIds)(
THIS_
_In_ ULONG64 Server,
_Out_writes_opt_(Count) PULONG Ids,
_In_ ULONG Count,
_Out_opt_ PULONG ActualCount
) PURE;
STDMETHOD(GetRunningProcessSystemIdByExecutableName)(
THIS_
_In_ ULONG64 Server,
_In_ PCSTR ExeName,
_In_ ULONG Flags,
_Out_ PULONG Id
) PURE;
STDMETHOD(GetRunningProcessDescription)(
THIS_
_In_ ULONG64 Server,
_In_ ULONG SystemId,
_In_ ULONG Flags,
_Out_writes_opt_(ExeNameSize) PSTR ExeName,
_In_ ULONG ExeNameSize,
_Out_opt_ PULONG ActualExeNameSize,
_Out_writes_opt_(DescriptionSize) PSTR Description,
_In_ ULONG DescriptionSize,
_Out_opt_ PULONG ActualDescriptionSize
) PURE;
// Attaches to a running user-mode process.
STDMETHOD(AttachProcess)(
THIS_
_In_ ULONG64 Server,
_In_ ULONG ProcessId,
_In_ ULONG AttachFlags
) PURE;
// Creates a new user-mode process for debugging.
// CreateFlags are as given to Win32s CreateProcess.
// One of DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS
// must be specified.
STDMETHOD(CreateProcess)(
THIS_
_In_ ULONG64 Server,
_In_ PSTR CommandLine,
_In_ ULONG CreateFlags
) PURE;
// Creates or attaches to a user-mode process, or both.
// If CommandLine is NULL this method operates as
// AttachProcess does. If ProcessId is zero it
// operates as CreateProcess does. If CommandLine is
// non-NULL and ProcessId is non-zero the method first
// starts a process with the given information but
// in a suspended state. The engine then attaches to
// the indicated process. Once the attach is successful
// the suspended process is resumed. This provides
// synchronization between the new process and the
// attachment.
STDMETHOD(CreateProcessAndAttach)(
THIS_
_In_ ULONG64 Server,
_In_opt_ PSTR CommandLine,
_In_ ULONG CreateFlags,
_In_ ULONG ProcessId,
_In_ ULONG AttachFlags
) PURE;
// Gets and sets process control flags.
STDMETHOD(GetProcessOptions)(
THIS_
_Out_ PULONG Options
) PURE;
STDMETHOD(AddProcessOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(RemoveProcessOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(SetProcessOptions)(
THIS_
_In_ ULONG Options
) PURE;
// Opens any kind of user- or kernel-mode dump file
// and begins a debug session with the information
// contained within it.
STDMETHOD(OpenDumpFile)(
THIS_
_In_ PCSTR DumpFile
) PURE;
// Writes a dump file from the current session information.
// The kind of dump file written is determined by the
// kind of session and the type qualifier given.
// For example, if the current session is a kernel
// debug session (DEBUG_CLASS_KERNEL) and the qualifier
// is DEBUG_DUMP_SMALL a small kernel dump will be written.
STDMETHOD(WriteDumpFile)(
THIS_
_In_ PCSTR DumpFile,
_In_ ULONG Qualifier
) PURE;
// Indicates that a remote client is ready to
// begin participating in the current session.
// HistoryLimit gives a character limit on
// the amount of output history to be sent.
STDMETHOD(ConnectSession)(
THIS_
_In_ ULONG Flags,
_In_ ULONG HistoryLimit
) PURE;
// Indicates that the engine should start accepting
// remote connections. Options specifies connection types
// and their parameters. Supported strings are:
// npipe:Pipe=<Pipe name>
// tcp:Port=<IP port>
STDMETHOD(StartServer)(
THIS_
_In_ PCSTR Options
) PURE;
// List the servers running on the given machine.
// Uses the line prefix.
STDMETHOD(OutputServers)(
THIS_
_In_ ULONG OutputControl,
_In_ PCSTR Machine,
_In_ ULONG Flags
) PURE;
// Attempts to terminate all processes in the debuggers list.
STDMETHOD(TerminateProcesses)(
THIS
) PURE;
// Attempts to detach from all processes in the debuggers list.
// This requires OS support for debugger detach.
STDMETHOD(DetachProcesses)(
THIS
) PURE;
// Stops the current debug session. If a process
// was created or attached an active EndSession can
// terminate or detach from it.
// If a kernel connection was opened it will be closed but the
// target machine is otherwise unaffected.
STDMETHOD(EndSession)(
THIS_
_In_ ULONG Flags
) PURE;
// If a process was started and ran to completion
// this method can be used to retrieve its exit code.
STDMETHOD(GetExitCode)(
THIS_
_Out_ PULONG Code
) PURE;
// Client event callbacks are called on the thread
// of the client. In order to give thread
// execution to the engine for callbacks all
// client threads should call DispatchCallbacks
// when they are idle. Callbacks are only
// received when a thread calls DispatchCallbacks
// or WaitForEvent. WaitForEvent can only be
// called by the thread that started the debug
// session so all other client threads should
// call DispatchCallbacks when possible.
// DispatchCallbacks returns when ExitDispatch is used
// to interrupt dispatch or when the timeout expires.
// DispatchCallbacks dispatches callbacks for all
// clients associated with the thread calling
// DispatchCallbacks.
// DispatchCallbacks returns S_FALSE when the
// timeout expires.
STDMETHOD(DispatchCallbacks)(
THIS_
_In_ ULONG Timeout
) PURE;
// ExitDispatch can be used to interrupt callback
// dispatch when a client thread is needed by the
// client. This method is reentrant and can
// be called from any thread.
STDMETHOD(ExitDispatch)(
THIS_
_In_ PDEBUG_CLIENT Client
) PURE;
// Clients are specific to the thread that
// created them. Calls from other threads
// fail immediately. The CreateClient method
// is a notable exception; it allows creation
// of a new client for a new thread.
STDMETHOD(CreateClient)(
THIS_
_Out_ PDEBUG_CLIENT* Client
) PURE;
STDMETHOD(GetInputCallbacks)(
THIS_
_Out_ PDEBUG_INPUT_CALLBACKS* Callbacks
) PURE;
STDMETHOD(SetInputCallbacks)(
THIS_
_In_opt_ PDEBUG_INPUT_CALLBACKS Callbacks
) PURE;
// Output callback interfaces are described separately.
STDMETHOD(GetOutputCallbacks)(
THIS_
_Out_ PDEBUG_OUTPUT_CALLBACKS* Callbacks
) PURE;
STDMETHOD(SetOutputCallbacks)(
THIS_
_In_opt_ PDEBUG_OUTPUT_CALLBACKS Callbacks
) PURE;
// Output flags provide control over
// the distribution of output among clients.
// Output masks select which output streams
// should be sent to the output callbacks.
// Only Output calls with a mask that
// contains one of the output mask bits
// will be sent to the output callbacks.
// These methods are reentrant.
// If such access is not synchronized
// disruptions in output may occur.
STDMETHOD(GetOutputMask)(
THIS_
_Out_ PULONG Mask
) PURE;
STDMETHOD(SetOutputMask)(
THIS_
_In_ ULONG Mask
) PURE;
// These methods allow access to another clients
// output mask. They are necessary for changing
// a clients output mask when it is
// waiting for events. These methods are reentrant
// and can be called from any thread.
STDMETHOD(GetOtherOutputMask)(
THIS_
_In_ PDEBUG_CLIENT Client,
_Out_ PULONG Mask
) PURE;
STDMETHOD(SetOtherOutputMask)(
THIS_
_In_ PDEBUG_CLIENT Client,
_In_ ULONG Mask
) PURE;
// Control the width of an output line for
// commands which produce formatted output.
// This setting is just a suggestion.
STDMETHOD(GetOutputWidth)(
THIS_
_Out_ PULONG Columns
) PURE;
STDMETHOD(SetOutputWidth)(
THIS_
_In_ ULONG Columns
) PURE;
// Some of the engines output commands produce
// multiple lines of output. A prefix can be
// set that the engine will automatically output
// for each line in that case, allowing a caller
// to control indentation or identifying marks.
// This is not a general setting for any output
// with a newline in it. Methods which use
// the line prefix are marked in their documentation.
STDMETHOD(GetOutputLinePrefix)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PrefixSize
) PURE;
STDMETHOD(SetOutputLinePrefix)(
THIS_
_In_opt_ PCSTR Prefix
) PURE;
// Returns a string describing the machine
// and user this client represents. The
// specific content of the string varies
// with operating system. If the client is
// remotely connected some network information
// may also be present.
STDMETHOD(GetIdentity)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG IdentitySize
) PURE;
// Format is a printf-like format string
// with one %s where the identity string should go.
STDMETHOD(OutputIdentity)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Flags,
_In_ PCSTR Format
) PURE;
// Event callbacks allow a client to
// receive notification about changes
// during the debug session.
STDMETHOD(GetEventCallbacks)(
THIS_
_Out_ PDEBUG_EVENT_CALLBACKS* Callbacks
) PURE;
STDMETHOD(SetEventCallbacks)(
THIS_
_In_opt_ PDEBUG_EVENT_CALLBACKS Callbacks
) PURE;
// The engine sometimes merges compatible callback
// requests to reduce callback overhead. This is
// most noticeable with output as small pieces of
// output are collected into larger groups to
// reduce the overall number of output callback calls.
// A client can use this method to force all pending
// callbacks to be delivered. This is rarely necessary.
STDMETHOD(FlushCallbacks)(
THIS
) PURE;
// IDebugClient2.
// Functions similarly to WriteDumpFile with
// the addition of the ability to specify
// per-dump-format write control flags.
// Comment is not supported in all formats.
STDMETHOD(WriteDumpFile2)(
THIS_
_In_ PCSTR DumpFile,
_In_ ULONG Qualifier,
_In_ ULONG FormatFlags,
_In_opt_ PCSTR Comment
) PURE;
// Registers additional files of supporting information
// for a dump file open. This method must be called
// before OpenDumpFile is called.
// The files registered may be opened at the time
// this method is called but generally will not
// be used until OpenDumpFile is called.
STDMETHOD(AddDumpInformationFile)(
THIS_
_In_ PCSTR InfoFile,
_In_ ULONG Type
) PURE;
// Requests that the remote process server shut down.
STDMETHOD(EndProcessServer)(
THIS_
_In_ ULONG64 Server
) PURE;
// Waits for a started process server to
// exit. Allows an application running a
// process server to monitor the process
// server so that it can tell when a remote
// client has asked for it to exit.
// Returns S_OK if the process server has
// shut down and S_FALSE for a timeout.
STDMETHOD(WaitForProcessServerEnd)(
THIS_
_In_ ULONG Timeout
) PURE;
// Returns S_OK if the system is configured
// to allow kernel debugging.
STDMETHOD(IsKernelDebuggerEnabled)(
THIS
) PURE;
// Attempts to terminate the current process.
// Exit process events for the process may be generated.
STDMETHOD(TerminateCurrentProcess)(
THIS
) PURE;
// Attempts to detach from the current process.
// This requires OS support for debugger detach.
STDMETHOD(DetachCurrentProcess)(
THIS
) PURE;
// Removes the process from the debuggers process
// list without making any other changes. The process
// will still be marked as being debugged and will
// not run. This allows a debugger to be shut down
// and a new debugger attached without taking the
// process out of the debugged state.
// This is only supported on some system versions.
STDMETHOD(AbandonCurrentProcess)(
THIS
) PURE;
// IDebugClient3.
STDMETHOD(GetRunningProcessSystemIdByExecutableNameWide)(
THIS_
_In_ ULONG64 Server,
_In_ PCWSTR ExeName,
_In_ ULONG Flags,
_Out_ PULONG Id
) PURE;
STDMETHOD(GetRunningProcessDescriptionWide)(
THIS_
_In_ ULONG64 Server,
_In_ ULONG SystemId,
_In_ ULONG Flags,
_Out_writes_opt_(ExeNameSize) PWSTR ExeName,
_In_ ULONG ExeNameSize,
_Out_opt_ PULONG ActualExeNameSize,
_Out_writes_opt_(DescriptionSize) PWSTR Description,
_In_ ULONG DescriptionSize,
_Out_opt_ PULONG ActualDescriptionSize
) PURE;
STDMETHOD(CreateProcessWide)(
THIS_
_In_ ULONG64 Server,
_In_ PWSTR CommandLine,
_In_ ULONG CreateFlags
) PURE;
STDMETHOD(CreateProcessAndAttachWide)(
THIS_
_In_ ULONG64 Server,
_In_opt_ PWSTR CommandLine,
_In_ ULONG CreateFlags,
_In_ ULONG ProcessId,
_In_ ULONG AttachFlags
) PURE;
// IDebugClient4.
// In the following methods both a filename and a file
// handle can be passed in. If a file handle is given
// the filename may be omitted, although providing it
// allows the debugger to properly report the name when
// queried.
// File handles cannot be used in remote calls.
STDMETHOD(OpenDumpFileWide)(
THIS_
_In_opt_ PCWSTR FileName,
_In_ ULONG64 FileHandle
) PURE;
STDMETHOD(WriteDumpFileWide)(
THIS_
_In_opt_ PCWSTR FileName,
_In_ ULONG64 FileHandle,
_In_ ULONG Qualifier,
_In_ ULONG FormatFlags,
_In_opt_ PCWSTR Comment
) PURE;
STDMETHOD(AddDumpInformationFileWide)(
THIS_
_In_opt_ PCWSTR FileName,
_In_ ULONG64 FileHandle,
_In_ ULONG Type
) PURE;
// These methods can be used to retrieve
// file information for all targets that
// involve files.
STDMETHOD(GetNumberDumpFiles)(
THIS_
_Out_ PULONG Number
) PURE;
STDMETHOD(GetDumpFile)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Handle,
_Out_ PULONG Type
) PURE;
STDMETHOD(GetDumpFileWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Handle,
_Out_ PULONG Type
) PURE;
// IDebugClient5.
STDMETHOD(AttachKernelWide)(
THIS_
_In_ ULONG Flags,
_In_opt_ PCWSTR ConnectOptions
) PURE;
STDMETHOD(GetKernelConnectionOptionsWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG OptionsSize
) PURE;
STDMETHOD(SetKernelConnectionOptionsWide)(
THIS_
_In_ PCWSTR Options
) PURE;
STDMETHOD(StartProcessServerWide)(
THIS_
_In_ ULONG Flags,
_In_ PCWSTR Options,
_In_opt_ _Reserved_ PVOID Reserved
) PURE;
STDMETHOD(ConnectProcessServerWide)(
THIS_
_In_ PCWSTR RemoteOptions,
_Out_ PULONG64 Server
) PURE;
STDMETHOD(StartServerWide)(
THIS_
_In_ PCWSTR Options
) PURE;
STDMETHOD(OutputServersWide)(
THIS_
_In_ ULONG OutputControl,
_In_ PCWSTR Machine,
_In_ ULONG Flags
) PURE;
STDMETHOD(GetOutputCallbacksWide)(
THIS_
_Out_ PDEBUG_OUTPUT_CALLBACKS_WIDE* Callbacks
) PURE;
STDMETHOD(SetOutputCallbacksWide)(
THIS_
_In_ PDEBUG_OUTPUT_CALLBACKS_WIDE Callbacks
) PURE;
STDMETHOD(GetOutputLinePrefixWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PrefixSize
) PURE;
STDMETHOD(SetOutputLinePrefixWide)(
THIS_
_In_opt_ PCWSTR Prefix
) PURE;
STDMETHOD(GetIdentityWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG IdentitySize
) PURE;
STDMETHOD(OutputIdentityWide)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Flags,
_In_ PCWSTR Format
) PURE;
STDMETHOD(GetEventCallbacksWide)(
THIS_
_Out_ PDEBUG_EVENT_CALLBACKS_WIDE* Callbacks
) PURE;
STDMETHOD(SetEventCallbacksWide)(
THIS_
_In_ PDEBUG_EVENT_CALLBACKS_WIDE Callbacks
) PURE;
STDMETHOD(CreateProcess2)(
THIS_
_In_ ULONG64 Server,
_In_ PSTR CommandLine,
_In_reads_bytes_(OptionsBufferSize) PVOID OptionsBuffer,
_In_ ULONG OptionsBufferSize,
_In_opt_ PCSTR InitialDirectory,
_In_opt_ PCSTR Environment
) PURE;
STDMETHOD(CreateProcess2Wide)(
THIS_
_In_ ULONG64 Server,
_In_ PWSTR CommandLine,
_In_reads_bytes_(OptionsBufferSize) PVOID OptionsBuffer,
_In_ ULONG OptionsBufferSize,
_In_opt_ PCWSTR InitialDirectory,
_In_opt_ PCWSTR Environment
) PURE;
STDMETHOD(CreateProcessAndAttach2)(
THIS_
_In_ ULONG64 Server,
_In_opt_ PSTR CommandLine,
_In_reads_bytes_(OptionsBufferSize) PVOID OptionsBuffer,
_In_ ULONG OptionsBufferSize,
_In_opt_ PCSTR InitialDirectory,
_In_opt_ PCSTR Environment,
_In_ ULONG ProcessId,
_In_ ULONG AttachFlags
) PURE;
STDMETHOD(CreateProcessAndAttach2Wide)(
THIS_
_In_ ULONG64 Server,
_In_opt_ PWSTR CommandLine,
_In_reads_bytes_(OptionsBufferSize) PVOID OptionsBuffer,
_In_ ULONG OptionsBufferSize,
_In_opt_ PCWSTR InitialDirectory,
_In_opt_ PCWSTR Environment,
_In_ ULONG ProcessId,
_In_ ULONG AttachFlags
) PURE;
// Helpers for saving and restoring the
// current output line prefix.
STDMETHOD(PushOutputLinePrefix)(
THIS_
_In_opt_ PCSTR NewPrefix,
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(PushOutputLinePrefixWide)(
THIS_
_In_opt_ PCWSTR NewPrefix,
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(PopOutputLinePrefix)(
THIS_
_In_ ULONG64 Handle
) PURE;
// Queries to determine if any clients
// could potentially respond to the given callback.
STDMETHOD(GetNumberInputCallbacks)(
THIS_
_Out_ PULONG Count
) PURE;
STDMETHOD(GetNumberOutputCallbacks)(
THIS_
_Out_ PULONG Count
) PURE;
STDMETHOD(GetNumberEventCallbacks)(
THIS_
_In_ ULONG EventFlags,
_Out_ PULONG Count
) PURE;
// Control over locking the session against
// undesired quits. The quit lock string
// cannot be retrieved from a secure session.
STDMETHOD(GetQuitLockString)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
STDMETHOD(SetQuitLockString)(
THIS_
_In_ PCSTR String
) PURE;
STDMETHOD(GetQuitLockStringWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
STDMETHOD(SetQuitLockStringWide)(
THIS_
_In_ PCWSTR String
) PURE;
// IDebugClient6
STDMETHOD(SetEventContextCallbacks)(
THIS_
_In_opt_ PDEBUG_EVENT_CONTEXT_CALLBACKS Callbacks
) PURE;
};
#undef INTERFACE
#define INTERFACE IDebugClient7
DECLARE_INTERFACE_(IDebugClient7, IUnknown)
{
// IUnknown.
STDMETHOD(QueryInterface)(
THIS_
_In_ REFIID InterfaceId,
_Out_ PVOID* Interface
) PURE;
STDMETHOD_(ULONG, AddRef)(
THIS
) PURE;
STDMETHOD_(ULONG, Release)(
THIS
) PURE;
// IDebugClient.
// The following set of methods start
// the different kinds of debuggees.
// Begins a debug session using the kernel
// debugging protocol. This method selects
// the protocol as the debuggee communication
// mechanism but does not initiate the communication
// itself.
STDMETHOD(AttachKernel)(
THIS_
_In_ ULONG Flags,
_In_opt_ PCSTR ConnectOptions
) PURE;
STDMETHOD(GetKernelConnectionOptions)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG OptionsSize
) PURE;
// Updates the connection options for a live
// kernel connection. This can only be used
// to modify parameters for the connection, not
// to switch to a completely different kind of
// connection.
// This method is reentrant.
STDMETHOD(SetKernelConnectionOptions)(
THIS_
_In_ PCSTR Options
) PURE;
// Starts a process server for remote
// user-mode process control.
// The local process server is server zero.
STDMETHOD(StartProcessServer)(
THIS_
_In_ ULONG Flags,
_In_ PCSTR Options,
_In_opt_ _Reserved_ PVOID Reserved
) PURE;
STDMETHOD(ConnectProcessServer)(
THIS_
_In_ PCSTR RemoteOptions,
_Out_ PULONG64 Server
) PURE;
STDMETHOD(DisconnectProcessServer)(
THIS_
_In_ ULONG64 Server
) PURE;
// Enumerates and describes processes
// accessible through the given process server.
STDMETHOD(GetRunningProcessSystemIds)(
THIS_
_In_ ULONG64 Server,
_Out_writes_opt_(Count) PULONG Ids,
_In_ ULONG Count,
_Out_opt_ PULONG ActualCount
) PURE;
STDMETHOD(GetRunningProcessSystemIdByExecutableName)(
THIS_
_In_ ULONG64 Server,
_In_ PCSTR ExeName,
_In_ ULONG Flags,
_Out_ PULONG Id
) PURE;
STDMETHOD(GetRunningProcessDescription)(
THIS_
_In_ ULONG64 Server,
_In_ ULONG SystemId,
_In_ ULONG Flags,
_Out_writes_opt_(ExeNameSize) PSTR ExeName,
_In_ ULONG ExeNameSize,
_Out_opt_ PULONG ActualExeNameSize,
_Out_writes_opt_(DescriptionSize) PSTR Description,
_In_ ULONG DescriptionSize,
_Out_opt_ PULONG ActualDescriptionSize
) PURE;
// Attaches to a running user-mode process.
STDMETHOD(AttachProcess)(
THIS_
_In_ ULONG64 Server,
_In_ ULONG ProcessId,
_In_ ULONG AttachFlags
) PURE;
// Creates a new user-mode process for debugging.
// CreateFlags are as given to Win32s CreateProcess.
// One of DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS
// must be specified.
STDMETHOD(CreateProcess)(
THIS_
_In_ ULONG64 Server,
_In_ PSTR CommandLine,
_In_ ULONG CreateFlags
) PURE;
// Creates or attaches to a user-mode process, or both.
// If CommandLine is NULL this method operates as
// AttachProcess does. If ProcessId is zero it
// operates as CreateProcess does. If CommandLine is
// non-NULL and ProcessId is non-zero the method first
// starts a process with the given information but
// in a suspended state. The engine then attaches to
// the indicated process. Once the attach is successful
// the suspended process is resumed. This provides
// synchronization between the new process and the
// attachment.
STDMETHOD(CreateProcessAndAttach)(
THIS_
_In_ ULONG64 Server,
_In_opt_ PSTR CommandLine,
_In_ ULONG CreateFlags,
_In_ ULONG ProcessId,
_In_ ULONG AttachFlags
) PURE;
// Gets and sets process control flags.
STDMETHOD(GetProcessOptions)(
THIS_
_Out_ PULONG Options
) PURE;
STDMETHOD(AddProcessOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(RemoveProcessOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(SetProcessOptions)(
THIS_
_In_ ULONG Options
) PURE;
// Opens any kind of user- or kernel-mode dump file
// and begins a debug session with the information
// contained within it.
STDMETHOD(OpenDumpFile)(
THIS_
_In_ PCSTR DumpFile
) PURE;
// Writes a dump file from the current session information.
// The kind of dump file written is determined by the
// kind of session and the type qualifier given.
// For example, if the current session is a kernel
// debug session (DEBUG_CLASS_KERNEL) and the qualifier
// is DEBUG_DUMP_SMALL a small kernel dump will be written.
STDMETHOD(WriteDumpFile)(
THIS_
_In_ PCSTR DumpFile,
_In_ ULONG Qualifier
) PURE;
// Indicates that a remote client is ready to
// begin participating in the current session.
// HistoryLimit gives a character limit on
// the amount of output history to be sent.
STDMETHOD(ConnectSession)(
THIS_
_In_ ULONG Flags,
_In_ ULONG HistoryLimit
) PURE;
// Indicates that the engine should start accepting
// remote connections. Options specifies connection types
// and their parameters. Supported strings are:
// npipe:Pipe=<Pipe name>
// tcp:Port=<IP port>
STDMETHOD(StartServer)(
THIS_
_In_ PCSTR Options
) PURE;
// List the servers running on the given machine.
// Uses the line prefix.
STDMETHOD(OutputServers)(
THIS_
_In_ ULONG OutputControl,
_In_ PCSTR Machine,
_In_ ULONG Flags
) PURE;
// Attempts to terminate all processes in the debuggers list.
STDMETHOD(TerminateProcesses)(
THIS
) PURE;
// Attempts to detach from all processes in the debuggers list.
// This requires OS support for debugger detach.
STDMETHOD(DetachProcesses)(
THIS
) PURE;
// Stops the current debug session. If a process
// was created or attached an active EndSession can
// terminate or detach from it.
// If a kernel connection was opened it will be closed but the
// target machine is otherwise unaffected.
STDMETHOD(EndSession)(
THIS_
_In_ ULONG Flags
) PURE;
// If a process was started and ran to completion
// this method can be used to retrieve its exit code.
STDMETHOD(GetExitCode)(
THIS_
_Out_ PULONG Code
) PURE;
// Client event callbacks are called on the thread
// of the client. In order to give thread
// execution to the engine for callbacks all
// client threads should call DispatchCallbacks
// when they are idle. Callbacks are only
// received when a thread calls DispatchCallbacks
// or WaitForEvent. WaitForEvent can only be
// called by the thread that started the debug
// session so all other client threads should
// call DispatchCallbacks when possible.
// DispatchCallbacks returns when ExitDispatch is used
// to interrupt dispatch or when the timeout expires.
// DispatchCallbacks dispatches callbacks for all
// clients associated with the thread calling
// DispatchCallbacks.
// DispatchCallbacks returns S_FALSE when the
// timeout expires.
STDMETHOD(DispatchCallbacks)(
THIS_
_In_ ULONG Timeout
) PURE;
// ExitDispatch can be used to interrupt callback
// dispatch when a client thread is needed by the
// client. This method is reentrant and can
// be called from any thread.
STDMETHOD(ExitDispatch)(
THIS_
_In_ PDEBUG_CLIENT Client
) PURE;
// Clients are specific to the thread that
// created them. Calls from other threads
// fail immediately. The CreateClient method
// is a notable exception; it allows creation
// of a new client for a new thread.
STDMETHOD(CreateClient)(
THIS_
_Out_ PDEBUG_CLIENT* Client
) PURE;
STDMETHOD(GetInputCallbacks)(
THIS_
_Out_ PDEBUG_INPUT_CALLBACKS* Callbacks
) PURE;
STDMETHOD(SetInputCallbacks)(
THIS_
_In_opt_ PDEBUG_INPUT_CALLBACKS Callbacks
) PURE;
// Output callback interfaces are described separately.
STDMETHOD(GetOutputCallbacks)(
THIS_
_Out_ PDEBUG_OUTPUT_CALLBACKS* Callbacks
) PURE;
STDMETHOD(SetOutputCallbacks)(
THIS_
_In_opt_ PDEBUG_OUTPUT_CALLBACKS Callbacks
) PURE;
// Output flags provide control over
// the distribution of output among clients.
// Output masks select which output streams
// should be sent to the output callbacks.
// Only Output calls with a mask that
// contains one of the output mask bits
// will be sent to the output callbacks.
// These methods are reentrant.
// If such access is not synchronized
// disruptions in output may occur.
STDMETHOD(GetOutputMask)(
THIS_
_Out_ PULONG Mask
) PURE;
STDMETHOD(SetOutputMask)(
THIS_
_In_ ULONG Mask
) PURE;
// These methods allow access to another clients
// output mask. They are necessary for changing
// a clients output mask when it is
// waiting for events. These methods are reentrant
// and can be called from any thread.
STDMETHOD(GetOtherOutputMask)(
THIS_
_In_ PDEBUG_CLIENT Client,
_Out_ PULONG Mask
) PURE;
STDMETHOD(SetOtherOutputMask)(
THIS_
_In_ PDEBUG_CLIENT Client,
_In_ ULONG Mask
) PURE;
// Control the width of an output line for
// commands which produce formatted output.
// This setting is just a suggestion.
STDMETHOD(GetOutputWidth)(
THIS_
_Out_ PULONG Columns
) PURE;
STDMETHOD(SetOutputWidth)(
THIS_
_In_ ULONG Columns
) PURE;
// Some of the engines output commands produce
// multiple lines of output. A prefix can be
// set that the engine will automatically output
// for each line in that case, allowing a caller
// to control indentation or identifying marks.
// This is not a general setting for any output
// with a newline in it. Methods which use
// the line prefix are marked in their documentation.
STDMETHOD(GetOutputLinePrefix)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PrefixSize
) PURE;
STDMETHOD(SetOutputLinePrefix)(
THIS_
_In_opt_ PCSTR Prefix
) PURE;
// Returns a string describing the machine
// and user this client represents. The
// specific content of the string varies
// with operating system. If the client is
// remotely connected some network information
// may also be present.
STDMETHOD(GetIdentity)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG IdentitySize
) PURE;
// Format is a printf-like format string
// with one %s where the identity string should go.
STDMETHOD(OutputIdentity)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Flags,
_In_ PCSTR Format
) PURE;
// Event callbacks allow a client to
// receive notification about changes
// during the debug session.
STDMETHOD(GetEventCallbacks)(
THIS_
_Out_ PDEBUG_EVENT_CALLBACKS* Callbacks
) PURE;
STDMETHOD(SetEventCallbacks)(
THIS_
_In_opt_ PDEBUG_EVENT_CALLBACKS Callbacks
) PURE;
// The engine sometimes merges compatible callback
// requests to reduce callback overhead. This is
// most noticeable with output as small pieces of
// output are collected into larger groups to
// reduce the overall number of output callback calls.
// A client can use this method to force all pending
// callbacks to be delivered. This is rarely necessary.
STDMETHOD(FlushCallbacks)(
THIS
) PURE;
// IDebugClient2.
// Functions similarly to WriteDumpFile with
// the addition of the ability to specify
// per-dump-format write control flags.
// Comment is not supported in all formats.
STDMETHOD(WriteDumpFile2)(
THIS_
_In_ PCSTR DumpFile,
_In_ ULONG Qualifier,
_In_ ULONG FormatFlags,
_In_opt_ PCSTR Comment
) PURE;
// Registers additional files of supporting information
// for a dump file open. This method must be called
// before OpenDumpFile is called.
// The files registered may be opened at the time
// this method is called but generally will not
// be used until OpenDumpFile is called.
STDMETHOD(AddDumpInformationFile)(
THIS_
_In_ PCSTR InfoFile,
_In_ ULONG Type
) PURE;
// Requests that the remote process server shut down.
STDMETHOD(EndProcessServer)(
THIS_
_In_ ULONG64 Server
) PURE;
// Waits for a started process server to
// exit. Allows an application running a
// process server to monitor the process
// server so that it can tell when a remote
// client has asked for it to exit.
// Returns S_OK if the process server has
// shut down and S_FALSE for a timeout.
STDMETHOD(WaitForProcessServerEnd)(
THIS_
_In_ ULONG Timeout
) PURE;
// Returns S_OK if the system is configured
// to allow kernel debugging.
STDMETHOD(IsKernelDebuggerEnabled)(
THIS
) PURE;
// Attempts to terminate the current process.
// Exit process events for the process may be generated.
STDMETHOD(TerminateCurrentProcess)(
THIS
) PURE;
// Attempts to detach from the current process.
// This requires OS support for debugger detach.
STDMETHOD(DetachCurrentProcess)(
THIS
) PURE;
// Removes the process from the debuggers process
// list without making any other changes. The process
// will still be marked as being debugged and will
// not run. This allows a debugger to be shut down
// and a new debugger attached without taking the
// process out of the debugged state.
// This is only supported on some system versions.
STDMETHOD(AbandonCurrentProcess)(
THIS
) PURE;
// IDebugClient3.
STDMETHOD(GetRunningProcessSystemIdByExecutableNameWide)(
THIS_
_In_ ULONG64 Server,
_In_ PCWSTR ExeName,
_In_ ULONG Flags,
_Out_ PULONG Id
) PURE;
STDMETHOD(GetRunningProcessDescriptionWide)(
THIS_
_In_ ULONG64 Server,
_In_ ULONG SystemId,
_In_ ULONG Flags,
_Out_writes_opt_(ExeNameSize) PWSTR ExeName,
_In_ ULONG ExeNameSize,
_Out_opt_ PULONG ActualExeNameSize,
_Out_writes_opt_(DescriptionSize) PWSTR Description,
_In_ ULONG DescriptionSize,
_Out_opt_ PULONG ActualDescriptionSize
) PURE;
STDMETHOD(CreateProcessWide)(
THIS_
_In_ ULONG64 Server,
_In_ PWSTR CommandLine,
_In_ ULONG CreateFlags
) PURE;
STDMETHOD(CreateProcessAndAttachWide)(
THIS_
_In_ ULONG64 Server,
_In_opt_ PWSTR CommandLine,
_In_ ULONG CreateFlags,
_In_ ULONG ProcessId,
_In_ ULONG AttachFlags
) PURE;
// IDebugClient4.
// In the following methods both a filename and a file
// handle can be passed in. If a file handle is given
// the filename may be omitted, although providing it
// allows the debugger to properly report the name when
// queried.
// File handles cannot be used in remote calls.
STDMETHOD(OpenDumpFileWide)(
THIS_
_In_opt_ PCWSTR FileName,
_In_ ULONG64 FileHandle
) PURE;
STDMETHOD(WriteDumpFileWide)(
THIS_
_In_opt_ PCWSTR FileName,
_In_ ULONG64 FileHandle,
_In_ ULONG Qualifier,
_In_ ULONG FormatFlags,
_In_opt_ PCWSTR Comment
) PURE;
STDMETHOD(AddDumpInformationFileWide)(
THIS_
_In_opt_ PCWSTR FileName,
_In_ ULONG64 FileHandle,
_In_ ULONG Type
) PURE;
// These methods can be used to retrieve
// file information for all targets that
// involve files.
STDMETHOD(GetNumberDumpFiles)(
THIS_
_Out_ PULONG Number
) PURE;
STDMETHOD(GetDumpFile)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Handle,
_Out_ PULONG Type
) PURE;
STDMETHOD(GetDumpFileWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Handle,
_Out_ PULONG Type
) PURE;
// IDebugClient5.
STDMETHOD(AttachKernelWide)(
THIS_
_In_ ULONG Flags,
_In_opt_ PCWSTR ConnectOptions
) PURE;
STDMETHOD(GetKernelConnectionOptionsWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG OptionsSize
) PURE;
STDMETHOD(SetKernelConnectionOptionsWide)(
THIS_
_In_ PCWSTR Options
) PURE;
STDMETHOD(StartProcessServerWide)(
THIS_
_In_ ULONG Flags,
_In_ PCWSTR Options,
_In_opt_ _Reserved_ PVOID Reserved
) PURE;
STDMETHOD(ConnectProcessServerWide)(
THIS_
_In_ PCWSTR RemoteOptions,
_Out_ PULONG64 Server
) PURE;
STDMETHOD(StartServerWide)(
THIS_
_In_ PCWSTR Options
) PURE;
STDMETHOD(OutputServersWide)(
THIS_
_In_ ULONG OutputControl,
_In_ PCWSTR Machine,
_In_ ULONG Flags
) PURE;
STDMETHOD(GetOutputCallbacksWide)(
THIS_
_Out_ PDEBUG_OUTPUT_CALLBACKS_WIDE* Callbacks
) PURE;
STDMETHOD(SetOutputCallbacksWide)(
THIS_
_In_ PDEBUG_OUTPUT_CALLBACKS_WIDE Callbacks
) PURE;
STDMETHOD(GetOutputLinePrefixWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PrefixSize
) PURE;
STDMETHOD(SetOutputLinePrefixWide)(
THIS_
_In_opt_ PCWSTR Prefix
) PURE;
STDMETHOD(GetIdentityWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG IdentitySize
) PURE;
STDMETHOD(OutputIdentityWide)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Flags,
_In_ PCWSTR Format
) PURE;
STDMETHOD(GetEventCallbacksWide)(
THIS_
_Out_ PDEBUG_EVENT_CALLBACKS_WIDE* Callbacks
) PURE;
STDMETHOD(SetEventCallbacksWide)(
THIS_
_In_ PDEBUG_EVENT_CALLBACKS_WIDE Callbacks
) PURE;
STDMETHOD(CreateProcess2)(
THIS_
_In_ ULONG64 Server,
_In_ PSTR CommandLine,
_In_reads_bytes_(OptionsBufferSize) PVOID OptionsBuffer,
_In_ ULONG OptionsBufferSize,
_In_opt_ PCSTR InitialDirectory,
_In_opt_ PCSTR Environment
) PURE;
STDMETHOD(CreateProcess2Wide)(
THIS_
_In_ ULONG64 Server,
_In_ PWSTR CommandLine,
_In_reads_bytes_(OptionsBufferSize) PVOID OptionsBuffer,
_In_ ULONG OptionsBufferSize,
_In_opt_ PCWSTR InitialDirectory,
_In_opt_ PCWSTR Environment
) PURE;
STDMETHOD(CreateProcessAndAttach2)(
THIS_
_In_ ULONG64 Server,
_In_opt_ PSTR CommandLine,
_In_reads_bytes_(OptionsBufferSize) PVOID OptionsBuffer,
_In_ ULONG OptionsBufferSize,
_In_opt_ PCSTR InitialDirectory,
_In_opt_ PCSTR Environment,
_In_ ULONG ProcessId,
_In_ ULONG AttachFlags
) PURE;
STDMETHOD(CreateProcessAndAttach2Wide)(
THIS_
_In_ ULONG64 Server,
_In_opt_ PWSTR CommandLine,
_In_reads_bytes_(OptionsBufferSize) PVOID OptionsBuffer,
_In_ ULONG OptionsBufferSize,
_In_opt_ PCWSTR InitialDirectory,
_In_opt_ PCWSTR Environment,
_In_ ULONG ProcessId,
_In_ ULONG AttachFlags
) PURE;
// Helpers for saving and restoring the
// current output line prefix.
STDMETHOD(PushOutputLinePrefix)(
THIS_
_In_opt_ PCSTR NewPrefix,
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(PushOutputLinePrefixWide)(
THIS_
_In_opt_ PCWSTR NewPrefix,
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(PopOutputLinePrefix)(
THIS_
_In_ ULONG64 Handle
) PURE;
// Queries to determine if any clients
// could potentially respond to the given callback.
STDMETHOD(GetNumberInputCallbacks)(
THIS_
_Out_ PULONG Count
) PURE;
STDMETHOD(GetNumberOutputCallbacks)(
THIS_
_Out_ PULONG Count
) PURE;
STDMETHOD(GetNumberEventCallbacks)(
THIS_
_In_ ULONG EventFlags,
_Out_ PULONG Count
) PURE;
// Control over locking the session against
// undesired quits. The quit lock string
// cannot be retrieved from a secure session.
STDMETHOD(GetQuitLockString)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
STDMETHOD(SetQuitLockString)(
THIS_
_In_ PCSTR String
) PURE;
STDMETHOD(GetQuitLockStringWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
STDMETHOD(SetQuitLockStringWide)(
THIS_
_In_ PCWSTR String
) PURE;
// IDebugClient6
STDMETHOD(SetEventContextCallbacks)(
THIS_
_In_opt_ PDEBUG_EVENT_CONTEXT_CALLBACKS Callbacks
) PURE;
// IDebugClient7
STDMETHOD(SetClientContext)(
THIS_
_In_reads_bytes_(ContextSize) PVOID Context,
_In_ ULONG ContextSize
) PURE; ) PURE;
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// IDebugControl. // IDebugControl.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// Execution status codes used for waiting, // Execution status codes used for waiting,
skipping to change at line 4177 skipping to change at line 5947
#define DEBUG_STATUS_STEP_INTO 5 #define DEBUG_STATUS_STEP_INTO 5
#define DEBUG_STATUS_BREAK 6 #define DEBUG_STATUS_BREAK 6
#define DEBUG_STATUS_NO_DEBUGGEE 7 #define DEBUG_STATUS_NO_DEBUGGEE 7
#define DEBUG_STATUS_STEP_BRANCH 8 #define DEBUG_STATUS_STEP_BRANCH 8
#define DEBUG_STATUS_IGNORE_EVENT 9 #define DEBUG_STATUS_IGNORE_EVENT 9
#define DEBUG_STATUS_RESTART_REQUESTED 10 #define DEBUG_STATUS_RESTART_REQUESTED 10
#define DEBUG_STATUS_REVERSE_GO 11 #define DEBUG_STATUS_REVERSE_GO 11
#define DEBUG_STATUS_REVERSE_STEP_BRANCH 12 #define DEBUG_STATUS_REVERSE_STEP_BRANCH 12
#define DEBUG_STATUS_REVERSE_STEP_OVER 13 #define DEBUG_STATUS_REVERSE_STEP_OVER 13
#define DEBUG_STATUS_REVERSE_STEP_INTO 14 #define DEBUG_STATUS_REVERSE_STEP_INTO 14
#define DEBUG_STATUS_OUT_OF_SYNC 15
#define DEBUG_STATUS_WAIT_INPUT 16
#define DEBUG_STATUS_TIMEOUT 17
#define DEBUG_STATUS_MASK 0xf #define DEBUG_STATUS_MASK 0x1f
// This bit is added in DEBUG_CES_EXECUTION_STATUS // This bit is added in DEBUG_CES_EXECUTION_STATUS
// notifications when the engines execution status // notifications when the engines execution status
// is changing due to operations performed during // is changing due to operations performed during
// a wait, such as making synchronous callbacks. If // a wait, such as making synchronous callbacks. If
// the bit is not set the execution status is changing // the bit is not set the execution status is changing
// due to a wait being satisfied. // due to a wait being satisfied.
#define DEBUG_STATUS_INSIDE_WAIT 0x100000000 #define DEBUG_STATUS_INSIDE_WAIT 0x100000000
// This bit is added in DEBUG_CES_EXECUTION_STATUS // This bit is added in DEBUG_CES_EXECUTION_STATUS
// notifications when the engines execution status // notifications when the engines execution status
skipping to change at line 4363 skipping to change at line 6136
// Disables execution commands. // Disables execution commands.
#define DEBUG_ENGOPT_DISABLE_EXECUTION_COMMANDS 0x00010000 #define DEBUG_ENGOPT_DISABLE_EXECUTION_COMMANDS 0x00010000
// Disallows mapping of image files from disk for any use. // Disallows mapping of image files from disk for any use.
// For example, this disallows image mapping for memory // For example, this disallows image mapping for memory
// content when debugging minidumps. // content when debugging minidumps.
// Does not affect existing mappings, only future attempts. // Does not affect existing mappings, only future attempts.
#define DEBUG_ENGOPT_DISALLOW_IMAGE_FILE_MAPPING 0x00020000 #define DEBUG_ENGOPT_DISALLOW_IMAGE_FILE_MAPPING 0x00020000
// Requests that dbgeng run DML-enhanced versions of commands // Requests that dbgeng run DML-enhanced versions of commands
// and operations by default. // and operations by default.
#define DEBUG_ENGOPT_PREFER_DML 0x00040000 #define DEBUG_ENGOPT_PREFER_DML 0x00040000
#define DEBUG_ENGOPT_ALL 0x0007FFFF // Explicitly disable SQM upload.
#define DEBUG_ENGOPT_DISABLESQM 0x00080000
// This is used to disable the source stepping (step over/step in) into CFG code
.
#define DEBUG_ENGOPT_DISABLE_STEPLINES_OPTIONS 0x00200000
#define DEBUG_ENGOPT_ALL 0x002FFFFF
// General unspecified ID constant. // General unspecified ID constant.
#define DEBUG_ANY_ID 0xffffffff #define DEBUG_ANY_ID 0xffffffff
typedef struct _DEBUG_STACK_FRAME typedef struct _DEBUG_STACK_FRAME
{ {
ULONG64 InstructionOffset; ULONG64 InstructionOffset;
ULONG64 ReturnOffset; ULONG64 ReturnOffset;
ULONG64 FrameOffset; ULONG64 FrameOffset;
ULONG64 StackOffset; ULONG64 StackOffset;
ULONG64 FuncTableEntry; ULONG64 FuncTableEntry;
ULONG64 Params[4]; ULONG64 Params[4];
ULONG64 Reserved[6]; ULONG64 Reserved[6];
BOOL Virtual; BOOL Virtual;
ULONG FrameNumber; ULONG FrameNumber;
} DEBUG_STACK_FRAME, *PDEBUG_STACK_FRAME; } DEBUG_STACK_FRAME, *PDEBUG_STACK_FRAME;
#define DBG_FRAME_DEFAULT 0 // the same as INLINE_FRAME_CONTEXT_I
NIT in dbghelp.h
#define DBG_FRAME_IGNORE_INLINE 0xFFFFFFFF // the same as INLINE_FRAME_CONTEXT_I
GNORE in dbghelp.h
typedef struct _DEBUG_STACK_FRAME_EX
{
// First DEBUG_STACK_FRAME structure
ULONG64 InstructionOffset;
ULONG64 ReturnOffset;
ULONG64 FrameOffset;
ULONG64 StackOffset;
ULONG64 FuncTableEntry;
ULONG64 Params[4];
ULONG64 Reserved[6];
BOOL Virtual;
ULONG FrameNumber;
// Extended DEBUG_STACK_FRAME fields.
ULONG InlineFrameContext;
ULONG Reserved1; // For alignment purpose.
} DEBUG_STACK_FRAME_EX, *PDEBUG_STACK_FRAME_EX;
// The types of inline frame context.
#define STACK_FRAME_TYPE_INIT 0x00
#define STACK_FRAME_TYPE_STACK 0x01
#define STACK_FRAME_TYPE_INLINE 0x02
#define STACK_FRAME_TYPE_RA 0x80 // Whether the instruction pointer is the c
urrent IP or a RA from callee frame.
#define STACK_FRAME_TYPE_IGNORE 0xFF
#pragma warning(push)
#pragma warning(disable:4201) // nonstandard extension used : nameless struct
typedef union _INLINE_FRAME_CONTEXT {
DWORD ContextValue;
struct {
BYTE FrameId;
BYTE FrameType;
WORD FrameSignature;
};
} INLINE_FRAME_CONTEXT;
#pragma warning(pop)
typedef struct _STACK_SRC_INFO
{
PCWSTR ImagePath;
PCWSTR ModuleName;
PCWSTR Function;
ULONG Displacement;
ULONG Row;
ULONG Column;
} STACK_SRC_INFO, *PSTACK_SRC_INFO;
typedef struct _STACK_SYM_FRAME_INFO
{
DEBUG_STACK_FRAME_EX StackFrameEx;
STACK_SRC_INFO SrcInfo;
} STACK_SYM_FRAME_INFO, *PSTACK_SYM_FRAME_INFO;
// OutputStackTrace flags. // OutputStackTrace flags.
// Display a small number of arguments for each call. // Display a small number of arguments for each call.
// These may or may not be the actual arguments depending // These may or may not be the actual arguments depending
// on the architecture, particular function and // on the architecture, particular function and
// point during the execution of the function. // point during the execution of the function.
// If the current code level is assembly arguments // If the current code level is assembly arguments
// are dumped as hex values. If the code level is // are dumped as hex values. If the code level is
// source the engine attempts to provide symbolic // source the engine attempts to provide symbolic
// argument information. // argument information.
#define DEBUG_STACK_ARGUMENTS 0x00000001 #define DEBUG_STACK_ARGUMENTS 0x00000001
skipping to change at line 4420 skipping to change at line 6255
// Show just return address in stack frame addresses. // Show just return address in stack frame addresses.
#define DEBUG_STACK_FRAME_ADDRESSES_RA_ONLY 0x00000100 #define DEBUG_STACK_FRAME_ADDRESSES_RA_ONLY 0x00000100
// Show frame-to-frame memory usage. // Show frame-to-frame memory usage.
#define DEBUG_STACK_FRAME_MEMORY_USAGE 0x00000200 #define DEBUG_STACK_FRAME_MEMORY_USAGE 0x00000200
// Show typed source parameters one to a line. // Show typed source parameters one to a line.
#define DEBUG_STACK_PARAMETERS_NEWLINE 0x00000400 #define DEBUG_STACK_PARAMETERS_NEWLINE 0x00000400
// Produce stack output enhanced with DML content. // Produce stack output enhanced with DML content.
#define DEBUG_STACK_DML 0x00000800 #define DEBUG_STACK_DML 0x00000800
// Show offset from stack frame // Show offset from stack frame
#define DEBUG_STACK_FRAME_OFFSETS 0x00001000 #define DEBUG_STACK_FRAME_OFFSETS 0x00001000
// The stack trace information is from a stack provider
#define DEBUG_STACK_PROVIDER 0x00002000
// Classes of debuggee. Each class // Classes of debuggee. Each class
// has different qualifiers for specific // has different qualifiers for specific
// kinds of debuggees. // kinds of debuggees.
#define DEBUG_CLASS_UNINITIALIZED 0 #define DEBUG_CLASS_UNINITIALIZED 0
#define DEBUG_CLASS_KERNEL 1 #define DEBUG_CLASS_KERNEL 1
#define DEBUG_CLASS_USER_WINDOWS 2 #define DEBUG_CLASS_USER_WINDOWS 2
#define DEBUG_CLASS_IMAGE_FILE 3 #define DEBUG_CLASS_IMAGE_FILE 3
// Generic dump types. These can be used // Generic dump types. These can be used
skipping to change at line 4441 skipping to change at line 6278
// Session-type-specific aliases are also // Session-type-specific aliases are also
// provided. // provided.
#define DEBUG_DUMP_SMALL 1024 #define DEBUG_DUMP_SMALL 1024
#define DEBUG_DUMP_DEFAULT 1025 #define DEBUG_DUMP_DEFAULT 1025
#define DEBUG_DUMP_FULL 1026 #define DEBUG_DUMP_FULL 1026
#define DEBUG_DUMP_IMAGE_FILE 1027 #define DEBUG_DUMP_IMAGE_FILE 1027
#define DEBUG_DUMP_TRACE_LOG 1028 #define DEBUG_DUMP_TRACE_LOG 1028
#define DEBUG_DUMP_WINDOWS_CE 1029 #define DEBUG_DUMP_WINDOWS_CE 1029
// Specific types of kernel debuggees. // Specific types of kernel debuggees.
#define DEBUG_KERNEL_CONNECTION 0 #define DEBUG_KERNEL_CONNECTION 0
#define DEBUG_KERNEL_LOCAL 1 #define DEBUG_KERNEL_LOCAL 1
#define DEBUG_KERNEL_EXDI_DRIVER 2 #define DEBUG_KERNEL_EXDI_DRIVER 2
#define DEBUG_KERNEL_IDNA 3 #define DEBUG_KERNEL_IDNA 3
#define DEBUG_KERNEL_INSTALL_DRIVER 4
#define DEBUG_KERNEL_SMALL_DUMP DEBUG_DUMP_SMALL #define DEBUG_KERNEL_SMALL_DUMP DEBUG_DUMP_SMALL
#define DEBUG_KERNEL_DUMP DEBUG_DUMP_DEFAULT #define DEBUG_KERNEL_DUMP DEBUG_DUMP_DEFAULT
#define DEBUG_KERNEL_FULL_DUMP DEBUG_DUMP_FULL #define DEBUG_KERNEL_FULL_DUMP DEBUG_DUMP_FULL
#define DEBUG_KERNEL_TRACE_LOG DEBUG_DUMP_TRACE_LOG #define DEBUG_KERNEL_TRACE_LOG DEBUG_DUMP_TRACE_LOG
// Specific types of Windows user debuggees. // Specific types of Windows user debuggees.
#define DEBUG_USER_WINDOWS_PROCESS 0 #define DEBUG_USER_WINDOWS_PROCESS 0
#define DEBUG_USER_WINDOWS_PROCESS_SERVER 1 #define DEBUG_USER_WINDOWS_PROCESS_SERVER 1
skipping to change at line 4696 skipping to change at line 6534
#endif #endif
#endif #endif
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugControl #define INTERFACE IDebugControl
DECLARE_INTERFACE_(IDebugControl, IUnknown) DECLARE_INTERFACE_(IDebugControl, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugControl. // IDebugControl.
// Checks for a user interrupt, such a Ctrl-C // Checks for a user interrupt, such a Ctrl-C
// or stop button. // or stop button.
// This method is reentrant. // This method is reentrant.
STDMETHOD(GetInterrupt)( STDMETHOD(GetInterrupt)(
THIS THIS
) PURE; ) PURE;
// Registers a user interrupt. // Registers a user interrupt.
// This method is reentrant. // This method is reentrant.
STDMETHOD(SetInterrupt)( STDMETHOD(SetInterrupt)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Interrupting a user-mode process requires // Interrupting a user-mode process requires
// access to some system resources that the // access to some system resources that the
// process may hold itself, preventing the // process may hold itself, preventing the
// interrupt from occurring. The engine // interrupt from occurring. The engine
// will time-out pending interrupt requests // will time-out pending interrupt requests
// and simulate an interrupt if necessary. // and simulate an interrupt if necessary.
// These methods control the interrupt timeout. // These methods control the interrupt timeout.
STDMETHOD(GetInterruptTimeout)( STDMETHOD(GetInterruptTimeout)(
THIS_ THIS_
__out PULONG Seconds _Out_ PULONG Seconds
) PURE; ) PURE;
STDMETHOD(SetInterruptTimeout)( STDMETHOD(SetInterruptTimeout)(
THIS_ THIS_
__in ULONG Seconds _In_ ULONG Seconds
) PURE; ) PURE;
STDMETHOD(GetLogFile)( STDMETHOD(GetLogFile)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG FileSize, _Out_opt_ PULONG FileSize,
__out PBOOL Append _Out_ PBOOL Append
) PURE; ) PURE;
// Opens a log file which collects all // Opens a log file which collects all
// output. Output from every client except // output. Output from every client except
// those that explicitly disable logging // those that explicitly disable logging
// goes into the log. // goes into the log.
// Opening a log file closes any log file // Opening a log file closes any log file
// already open. // already open.
STDMETHOD(OpenLogFile)( STDMETHOD(OpenLogFile)(
THIS_ THIS_
__in PCSTR File, _In_ PCSTR File,
__in BOOL Append _In_ BOOL Append
) PURE; ) PURE;
STDMETHOD(CloseLogFile)( STDMETHOD(CloseLogFile)(
THIS THIS
) PURE; ) PURE;
// Controls what output is logged. // Controls what output is logged.
STDMETHOD(GetLogMask)( STDMETHOD(GetLogMask)(
THIS_ THIS_
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
STDMETHOD(SetLogMask)( STDMETHOD(SetLogMask)(
THIS_ THIS_
__in ULONG Mask _In_ ULONG Mask
) PURE; ) PURE;
// Input requests input from all clients. // Input requests input from all clients.
// The first input that is returned is used // The first input that is returned is used
// to satisfy the call. Other returned // to satisfy the call. Other returned
// input is discarded. // input is discarded.
STDMETHOD(Input)( STDMETHOD(Input)(
THIS_ THIS_
__out_ecount(BufferSize) PSTR Buffer, _Out_writes_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG InputSize _Out_opt_ PULONG InputSize
) PURE; ) PURE;
// This method is used by clients to return // This method is used by clients to return
// input when it is available. It will // input when it is available. It will
// return S_OK if the input is used to // return S_OK if the input is used to
// satisfy an Input call and S_FALSE if // satisfy an Input call and S_FALSE if
// the input is ignored. // the input is ignored.
// This method is reentrant. // This method is reentrant.
STDMETHOD(ReturnInput)( STDMETHOD(ReturnInput)(
THIS_ THIS_
__in PCSTR Buffer _In_ PCSTR Buffer
) PURE; ) PURE;
// Sends output through clients // Sends output through clients
// output callbacks if the mask is allowed // output callbacks if the mask is allowed
// by the current output control mask and // by the current output control mask and
// according to the output distribution // according to the output distribution
// settings. // settings.
STDMETHODV(Output)( STDMETHODV(Output)(
THIS_ THIS_
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
... ...
) PURE; ) PURE;
STDMETHOD(OutputVaList)( STDMETHOD(OutputVaList)(
THIS_ THIS_
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
__in va_list Args _In_ va_list Args
) PURE; ) PURE;
// The following methods allow direct control // The following methods allow direct control
// over the distribution of the given output // over the distribution of the given output
// for situations where something other than // for situations where something other than
// the default is desired. These methods require // the default is desired. These methods require
// extra work in the engine so they should // extra work in the engine so they should
// only be used when necessary. // only be used when necessary.
STDMETHODV(ControlledOutput)( STDMETHODV(ControlledOutput)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
... ...
) PURE; ) PURE;
STDMETHOD(ControlledOutputVaList)( STDMETHOD(ControlledOutputVaList)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
__in va_list Args _In_ va_list Args
) PURE; ) PURE;
// Displays the standard command-line prompt // Displays the standard command-line prompt
// followed by the given output. If Format // followed by the given output. If Format
// is NULL no additional output is produced. // is NULL no additional output is produced.
// Output is produced under the // Output is produced under the
// DEBUG_OUTPUT_PROMPT mask. // DEBUG_OUTPUT_PROMPT mask.
// This method only outputs the prompt; it // This method only outputs the prompt; it
// does not get input. // does not get input.
STDMETHODV(OutputPrompt)( STDMETHODV(OutputPrompt)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in_opt PCSTR Format, _In_opt_ PCSTR Format,
... ...
) PURE; ) PURE;
STDMETHOD(OutputPromptVaList)( STDMETHOD(OutputPromptVaList)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in_opt PCSTR Format, _In_opt_ PCSTR Format,
__in va_list Args _In_ va_list Args
) PURE; ) PURE;
// Gets the text that would be displayed by OutputPrompt. // Gets the text that would be displayed by OutputPrompt.
STDMETHOD(GetPromptText)( STDMETHOD(GetPromptText)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG TextSize _Out_opt_ PULONG TextSize
) PURE; ) PURE;
// Outputs information about the current // Outputs information about the current
// debuggee state such as a register // debuggee state such as a register
// summary, disassembly at the current PC, // summary, disassembly at the current PC,
// closest symbol and others. // closest symbol and others.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputCurrentState)( STDMETHOD(OutputCurrentState)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Outputs the debugger and extension version // Outputs the debugger and extension version
// information. This method is reentrant. // information. This method is reentrant.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputVersionInformation)( STDMETHOD(OutputVersionInformation)(
THIS_ THIS_
__in ULONG OutputControl _In_ ULONG OutputControl
) PURE; ) PURE;
// In user-mode debugging sessions the // In user-mode debugging sessions the
// engine will set an event when // engine will set an event when
// exceptions are continued. This can // exceptions are continued. This can
// be used to synchronize other processes // be used to synchronize other processes
// with the debuggers handling of events. // with the debuggers handling of events.
// For example, this is used to support // For example, this is used to support
// the e argument to ntsd. // the e argument to ntsd.
STDMETHOD(GetNotifyEventHandle)( STDMETHOD(GetNotifyEventHandle)(
THIS_ THIS_
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
STDMETHOD(SetNotifyEventHandle)( STDMETHOD(SetNotifyEventHandle)(
THIS_ THIS_
__in ULONG64 Handle _In_ ULONG64 Handle
) PURE; ) PURE;
STDMETHOD(Assemble)( STDMETHOD(Assemble)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in PCSTR Instr, _In_ PCSTR Instr,
__out PULONG64 EndOffset _Out_ PULONG64 EndOffset
) PURE; ) PURE;
STDMETHOD(Disassemble)( STDMETHOD(Disassemble)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DisassemblySize, _Out_opt_ PULONG DisassemblySize,
__out PULONG64 EndOffset _Out_ PULONG64 EndOffset
) PURE; ) PURE;
// Returns the value of the effective address // Returns the value of the effective address
// computed for the last Disassemble, if there // computed for the last Disassemble, if there
// was one. // was one.
STDMETHOD(GetDisassembleEffectiveOffset)( STDMETHOD(GetDisassembleEffectiveOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Uses the line prefix if necessary. // Uses the line prefix if necessary.
STDMETHOD(OutputDisassembly)( STDMETHOD(OutputDisassembly)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG64 EndOffset _Out_ PULONG64 EndOffset
) PURE; ) PURE;
// Produces multiple lines of disassembly output. // Produces multiple lines of disassembly output.
// There will be PreviousLines of disassembly before // There will be PreviousLines of disassembly before
// the given offset if a valid disassembly exists. // the given offset if a valid disassembly exists.
// In all, there will be TotalLines of output produced. // In all, there will be TotalLines of output produced.
// The first and last line offsets are returned // The first and last line offsets are returned
// specially and all lines offsets can be retrieved // specially and all lines offsets can be retrieved
// through LineOffsets. LineOffsets will contain // through LineOffsets. LineOffsets will contain
// offsets for each line where disassembly started. // offsets for each line where disassembly started.
// When disassembly of a single instruction takes // When disassembly of a single instruction takes
// multiple lines the initial offset will be followed // multiple lines the initial offset will be followed
// by DEBUG_INVALID_OFFSET. // by DEBUG_INVALID_OFFSET.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputDisassemblyLines)( STDMETHOD(OutputDisassemblyLines)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG PreviousLines, _In_ ULONG PreviousLines,
__in ULONG TotalLines, _In_ ULONG TotalLines,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out_opt PULONG OffsetLine, _Out_opt_ PULONG OffsetLine,
__out_opt PULONG64 StartOffset, _Out_opt_ PULONG64 StartOffset,
__out_opt PULONG64 EndOffset, _Out_opt_ PULONG64 EndOffset,
__out_ecount_opt(TotalLines) PULONG64 LineOffsets _Out_writes_opt_(TotalLines) PULONG64 LineOffsets
) PURE; ) PURE;
// Returns the offset of the start of // Returns the offset of the start of
// the instruction thats the given // the instruction thats the given
// delta away from the instruction // delta away from the instruction
// at the initial offset. // at the initial offset.
// This routine does not check for // This routine does not check for
// validity of the instruction or // validity of the instruction or
// the memory containing it. // the memory containing it.
STDMETHOD(GetNearInstruction)( STDMETHOD(GetNearInstruction)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in LONG Delta, _In_ LONG Delta,
__out PULONG64 NearOffset _Out_ PULONG64 NearOffset
) PURE; ) PURE;
// Offsets can be passed in as zero to use the current // Offsets can be passed in as zero to use the current
// thread state. // thread state.
STDMETHOD(GetStackTrace)( STDMETHOD(GetStackTrace)(
THIS_ THIS_
__in ULONG64 FrameOffset, _In_ ULONG64 FrameOffset,
__in ULONG64 StackOffset, _In_ ULONG64 StackOffset,
__in ULONG64 InstructionOffset, _In_ ULONG64 InstructionOffset,
__out_ecount(FramesSize) PDEBUG_STACK_FRAME Frames, _Out_writes_(FramesSize) PDEBUG_STACK_FRAME Frames,
__in ULONG FramesSize, _In_ ULONG FramesSize,
__out_opt PULONG FramesFilled _Out_opt_ PULONG FramesFilled
) PURE; ) PURE;
// Does a simple stack trace to determine // Does a simple stack trace to determine
// what the current return address is. // what the current return address is.
STDMETHOD(GetReturnOffset)( STDMETHOD(GetReturnOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// If Frames is NULL OutputStackTrace will // If Frames is NULL OutputStackTrace will
// use GetStackTrace to get FramesSize frames // use GetStackTrace to get FramesSize frames
// and then output them. The current register // and then output them. The current register
// values for frame, stack and instruction offsets // values for frame, stack and instruction offsets
// are used. // are used.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputStackTrace)( STDMETHOD(OutputStackTrace)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in_ecount_opt(FramesSize) PDEBUG_STACK_FRAME Frames, _In_reads_opt_(FramesSize) PDEBUG_STACK_FRAME Frames,
__in ULONG FramesSize, _In_ ULONG FramesSize,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Returns information about the debuggee such // Returns information about the debuggee such
// as user vs. kernel, dump vs. live, etc. // as user vs. kernel, dump vs. live, etc.
STDMETHOD(GetDebuggeeType)( STDMETHOD(GetDebuggeeType)(
THIS_ THIS_
__out PULONG Class, _Out_ PULONG Class,
__out PULONG Qualifier _Out_ PULONG Qualifier
) PURE; ) PURE;
// Returns the type of physical processors in // Returns the type of physical processors in
// the machine. // the machine.
// Returns one of the IMAGE_FILE_MACHINE values. // Returns one of the IMAGE_FILE_MACHINE values.
STDMETHOD(GetActualProcessorType)( STDMETHOD(GetActualProcessorType)(
THIS_ THIS_
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
// Returns the type of processor used in the // Returns the type of processor used in the
// current processor context. // current processor context.
STDMETHOD(GetExecutingProcessorType)( STDMETHOD(GetExecutingProcessorType)(
THIS_ THIS_
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
// Query all the possible processor types that // Query all the possible processor types that
// may be encountered during this debug session. // may be encountered during this debug session.
STDMETHOD(GetNumberPossibleExecutingProcessorTypes)( STDMETHOD(GetNumberPossibleExecutingProcessorTypes)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetPossibleExecutingProcessorTypes)( STDMETHOD(GetPossibleExecutingProcessorTypes)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PULONG Types _Out_writes_(Count) PULONG Types
) PURE; ) PURE;
// Get the number of actual processors in // Get the number of actual processors in
// the machine. // the machine.
STDMETHOD(GetNumberProcessors)( STDMETHOD(GetNumberProcessors)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
// PlatformId is one of the VER_PLATFORM values. // PlatformId is one of the VER_PLATFORM values.
// Major and minor are as given in the NT // Major and minor are as given in the NT
// kernel debugger protocol. // kernel debugger protocol.
// ServicePackString and ServicePackNumber indicate the // ServicePackString and ServicePackNumber indicate the
// system service pack level. ServicePackNumber is not // system service pack level. ServicePackNumber is not
// available in some sessions where the service pack level // available in some sessions where the service pack level
// is only expressed as a string. The service pack information // is only expressed as a string. The service pack information
// will be empty if the system does not have a service pack // will be empty if the system does not have a service pack
// applied. // applied.
// The build string is string information identifying the // The build string is string information identifying the
// particular build of the system. The build string is // particular build of the system. The build string is
// empty if the system has no particular identifying // empty if the system has no particular identifying
// information. // information.
STDMETHOD(GetSystemVersion)( STDMETHOD(GetSystemVersion)(
THIS_ THIS_
__out PULONG PlatformId, _Out_ PULONG PlatformId,
__out PULONG Major, _Out_ PULONG Major,
__out PULONG Minor, _Out_ PULONG Minor,
__out_ecount_opt(ServicePackStringSize) PSTR ServicePackString, _Out_writes_opt_(ServicePackStringSize) PSTR ServicePackString,
__in ULONG ServicePackStringSize, _In_ ULONG ServicePackStringSize,
__out_opt PULONG ServicePackStringUsed, _Out_opt_ PULONG ServicePackStringUsed,
__out PULONG ServicePackNumber, _Out_ PULONG ServicePackNumber,
__out_ecount_opt(BuildStringSize) PSTR BuildString, _Out_writes_opt_(BuildStringSize) PSTR BuildString,
__in ULONG BuildStringSize, _In_ ULONG BuildStringSize,
__out_opt PULONG BuildStringUsed _Out_opt_ PULONG BuildStringUsed
) PURE; ) PURE;
// Returns the page size for the currently executing // Returns the page size for the currently executing
// processor context. The page size may vary between // processor context. The page size may vary between
// processor types. // processor types.
STDMETHOD(GetPageSize)( STDMETHOD(GetPageSize)(
THIS_ THIS_
__out PULONG Size _Out_ PULONG Size
) PURE; ) PURE;
// Returns S_OK if the current processor context uses // Returns S_OK if the current processor context uses
// 64-bit addresses, otherwise S_FALSE. // 64-bit addresses, otherwise S_FALSE.
STDMETHOD(IsPointer64Bit)( STDMETHOD(IsPointer64Bit)(
THIS THIS
) PURE; ) PURE;
// Reads the bugcheck data area and returns the // Reads the bugcheck data area and returns the
// current contents. This method only works // current contents. This method only works
// in kernel debugging sessions. // in kernel debugging sessions.
STDMETHOD(ReadBugCheckData)( STDMETHOD(ReadBugCheckData)(
THIS_ THIS_
__out PULONG Code, _Out_ PULONG Code,
__out PULONG64 Arg1, _Out_ PULONG64 Arg1,
__out PULONG64 Arg2, _Out_ PULONG64 Arg2,
__out PULONG64 Arg3, _Out_ PULONG64 Arg3,
__out PULONG64 Arg4 _Out_ PULONG64 Arg4
) PURE; ) PURE;
// Query all the processor types supported by // Query all the processor types supported by
// the engine. This is a complete list and is // the engine. This is a complete list and is
// not related to the machine running the engine // not related to the machine running the engine
// or the debuggee. // or the debuggee.
STDMETHOD(GetNumberSupportedProcessorTypes)( STDMETHOD(GetNumberSupportedProcessorTypes)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetSupportedProcessorTypes)( STDMETHOD(GetSupportedProcessorTypes)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PULONG Types _Out_writes_(Count) PULONG Types
) PURE; ) PURE;
// Returns a full, descriptive name and an // Returns a full, descriptive name and an
// abbreviated name for a processor type. // abbreviated name for a processor type.
STDMETHOD(GetProcessorTypeNames)( STDMETHOD(GetProcessorTypeNames)(
THIS_ THIS_
__in ULONG Type, _In_ ULONG Type,
__out_ecount_opt(FullNameBufferSize) PSTR FullNameBuffer, _Out_writes_opt_(FullNameBufferSize) PSTR FullNameBuffer,
__in ULONG FullNameBufferSize, _In_ ULONG FullNameBufferSize,
__out_opt PULONG FullNameSize, _Out_opt_ PULONG FullNameSize,
__out_ecount_opt(AbbrevNameBufferSize) PSTR AbbrevNameBuffer, _Out_writes_opt_(AbbrevNameBufferSize) PSTR AbbrevNameBuffer,
__in ULONG AbbrevNameBufferSize, _In_ ULONG AbbrevNameBufferSize,
__out_opt PULONG AbbrevNameSize _Out_opt_ PULONG AbbrevNameSize
) PURE; ) PURE;
// Gets and sets the type of processor to // Gets and sets the type of processor to
// use when doing things like setting // use when doing things like setting
// breakpoints, accessing registers, // breakpoints, accessing registers,
// getting stack traces and so on. // getting stack traces and so on.
STDMETHOD(GetEffectiveProcessorType)( STDMETHOD(GetEffectiveProcessorType)(
THIS_ THIS_
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
STDMETHOD(SetEffectiveProcessorType)( STDMETHOD(SetEffectiveProcessorType)(
THIS_ THIS_
__in ULONG Type _In_ ULONG Type
) PURE; ) PURE;
// Returns information about whether and how // Returns information about whether and how
// the debuggee is running. Status will // the debuggee is running. Status will
// be GO if the debuggee is running and // be GO if the debuggee is running and
// BREAK if it isnt. // BREAK if it isnt.
// If no debuggee exists the status is // If no debuggee exists the status is
// NO_DEBUGGEE. // NO_DEBUGGEE.
// This method is reentrant. // This method is reentrant.
STDMETHOD(GetExecutionStatus)( STDMETHOD(GetExecutionStatus)(
THIS_ THIS_
__out PULONG Status _Out_ PULONG Status
) PURE; ) PURE;
// Changes the execution status of the // Changes the execution status of the
// engine from stopped to running. // engine from stopped to running.
// Status must be one of the go or step // Status must be one of the go or step
// status values. // status values.
STDMETHOD(SetExecutionStatus)( STDMETHOD(SetExecutionStatus)(
THIS_ THIS_
__in ULONG Status _In_ ULONG Status
) PURE; ) PURE;
// Controls what code interpretation level the debugger // Controls what code interpretation level the debugger
// runs at. The debugger checks the code level when // runs at. The debugger checks the code level when
// deciding whether to step by a source line or // deciding whether to step by a source line or
// assembly instruction along with other related operations. // assembly instruction along with other related operations.
STDMETHOD(GetCodeLevel)( STDMETHOD(GetCodeLevel)(
THIS_ THIS_
__out PULONG Level _Out_ PULONG Level
) PURE; ) PURE;
STDMETHOD(SetCodeLevel)( STDMETHOD(SetCodeLevel)(
THIS_ THIS_
__in ULONG Level _In_ ULONG Level
) PURE; ) PURE;
// Gets and sets engine control flags. // Gets and sets engine control flags.
// These methods are reentrant. // These methods are reentrant.
STDMETHOD(GetEngineOptions)( STDMETHOD(GetEngineOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddEngineOptions)( STDMETHOD(AddEngineOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveEngineOptions)( STDMETHOD(RemoveEngineOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetEngineOptions)( STDMETHOD(SetEngineOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
// Gets and sets control values for // Gets and sets control values for
// handling system error events. // handling system error events.
// If the system error level is less // If the system error level is less
// than or equal to the given levels // than or equal to the given levels
// the error may be displayed and // the error may be displayed and
// the default break for the event // the default break for the event
// may be set. // may be set.
STDMETHOD(GetSystemErrorControl)( STDMETHOD(GetSystemErrorControl)(
THIS_ THIS_
__out PULONG OutputLevel, _Out_ PULONG OutputLevel,
__out PULONG BreakLevel _Out_ PULONG BreakLevel
) PURE; ) PURE;
STDMETHOD(SetSystemErrorControl)( STDMETHOD(SetSystemErrorControl)(
THIS_ THIS_
__in ULONG OutputLevel, _In_ ULONG OutputLevel,
__in ULONG BreakLevel _In_ ULONG BreakLevel
) PURE; ) PURE;
// The command processor supports simple // The command processor supports simple
// string replacement macros in Evaluate and // string replacement macros in Evaluate and
// Execute. There are currently ten macro // Execute. There are currently ten macro
// slots available. Slots 0-9 map to // slots available. Slots 0-9 map to
// the command invocations $u0-$u9. // the command invocations $u0-$u9.
STDMETHOD(GetTextMacro)( STDMETHOD(GetTextMacro)(
THIS_ THIS_
__in ULONG Slot, _In_ ULONG Slot,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG MacroSize _Out_opt_ PULONG MacroSize
) PURE; ) PURE;
STDMETHOD(SetTextMacro)( STDMETHOD(SetTextMacro)(
THIS_ THIS_
__in ULONG Slot, _In_ ULONG Slot,
__in PCSTR Macro _In_ PCSTR Macro
) PURE; ) PURE;
// Controls the default number radix used // Controls the default number radix used
// in expressions and commands. // in expressions and commands.
STDMETHOD(GetRadix)( STDMETHOD(GetRadix)(
THIS_ THIS_
__out PULONG Radix _Out_ PULONG Radix
) PURE; ) PURE;
STDMETHOD(SetRadix)( STDMETHOD(SetRadix)(
THIS_ THIS_
__in ULONG Radix _In_ ULONG Radix
) PURE; ) PURE;
// Evaluates the given expression string and // Evaluates the given expression string and
// returns the resulting value. // returns the resulting value.
// If DesiredType is DEBUG_VALUE_INVALID then // If DesiredType is DEBUG_VALUE_INVALID then
// the natural type is used. // the natural type is used.
// RemainderIndex, if provided, is set to the index // RemainderIndex, if provided, is set to the index
// of the first character in the input string that was // of the first character in the input string that was
// not used when evaluating the expression. // not used when evaluating the expression.
STDMETHOD(Evaluate)( STDMETHOD(Evaluate)(
THIS_ THIS_
__in PCSTR Expression, _In_ PCSTR Expression,
__in ULONG DesiredType, _In_ ULONG DesiredType,
__out PDEBUG_VALUE Value, _Out_ PDEBUG_VALUE Value,
__out_opt PULONG RemainderIndex _Out_opt_ PULONG RemainderIndex
) PURE; ) PURE;
// Attempts to convert the input value to a value // Attempts to convert the input value to a value
// of the requested type in the output value. // of the requested type in the output value.
// Conversions can fail if no conversion exists. // Conversions can fail if no conversion exists.
// Successful conversions may be lossy. // Successful conversions may be lossy.
STDMETHOD(CoerceValue)( STDMETHOD(CoerceValue)(
THIS_ THIS_
__in PDEBUG_VALUE In, _In_ PDEBUG_VALUE In,
__in ULONG OutType, _In_ ULONG OutType,
__out PDEBUG_VALUE Out _Out_ PDEBUG_VALUE Out
) PURE; ) PURE;
STDMETHOD(CoerceValues)( STDMETHOD(CoerceValues)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount(Count) PDEBUG_VALUE In, _In_reads_(Count) PDEBUG_VALUE In,
__in_ecount(Count) PULONG OutTypes, _In_reads_(Count) PULONG OutTypes,
__out_ecount(Count) PDEBUG_VALUE Out _Out_writes_(Count) PDEBUG_VALUE Out
) PURE; ) PURE;
// Executes the given command string. // Executes the given command string.
// If the string has multiple commands // If the string has multiple commands
// Execute will not return until all // Execute will not return until all
// of them have been executed. If this // of them have been executed. If this
// requires waiting for the debuggee to // requires waiting for the debuggee to
// execute an internal wait will be done // execute an internal wait will be done
// so Execute can take an arbitrary amount // so Execute can take an arbitrary amount
// of time. // of time.
STDMETHOD(Execute)( STDMETHOD(Execute)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCSTR Command, _In_ PCSTR Command,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Executes the given command file by // Executes the given command file by
// reading a line at a time and processing // reading a line at a time and processing
// it with Execute. // it with Execute.
STDMETHOD(ExecuteCommandFile)( STDMETHOD(ExecuteCommandFile)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCSTR CommandFile, _In_ PCSTR CommandFile,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Breakpoint interfaces are described // Breakpoint interfaces are described
// elsewhere in this section. // elsewhere in this section.
STDMETHOD(GetNumberBreakpoints)( STDMETHOD(GetNumberBreakpoints)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
// It is possible for this retrieval function to // It is possible for this retrieval function to
// fail even with an index within the number of // fail even with an index within the number of
// existing breakpoints if the breakpoint is // existing breakpoints if the breakpoint is
// a private breakpoint. // a private breakpoint.
STDMETHOD(GetBreakpointByIndex)( STDMETHOD(GetBreakpointByIndex)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out PDEBUG_BREAKPOINT* Bp _Out_ PDEBUG_BREAKPOINT* Bp
) PURE; ) PURE;
STDMETHOD(GetBreakpointById)( STDMETHOD(GetBreakpointById)(
THIS_ THIS_
__in ULONG Id, _In_ ULONG Id,
__out PDEBUG_BREAKPOINT* Bp _Out_ PDEBUG_BREAKPOINT* Bp
) PURE; ) PURE;
// If Ids is non-NULL the Count breakpoints // If Ids is non-NULL the Count breakpoints
// referred to in the Ids array are returned, // referred to in the Ids array are returned,
// otherwise breakpoints from index Start to // otherwise breakpoints from index Start to
// Start + Count 1 are returned. // Start + Count 1 are returned.
STDMETHOD(GetBreakpointParameters)( STDMETHOD(GetBreakpointParameters)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Ids, _In_reads_opt_(Count) PULONG Ids,
__in ULONG Start, _In_ ULONG Start,
__out_ecount(Count) PDEBUG_BREAKPOINT_PARAMETERS Params _Out_writes_(Count) PDEBUG_BREAKPOINT_PARAMETERS Params
) PURE; ) PURE;
// Breakpoints are created empty and disabled. // Breakpoints are created empty and disabled.
// When their parameters have been set they // When their parameters have been set they
// should be enabled by setting the ENABLE flag. // should be enabled by setting the ENABLE flag.
// If DesiredId is DEBUG_ANY_ID then the // If DesiredId is DEBUG_ANY_ID then the
// engine picks an unused ID. If DesiredId // engine picks an unused ID. If DesiredId
// is any other number the engine attempts // is any other number the engine attempts
// to use the given ID for the breakpoint. // to use the given ID for the breakpoint.
// If another breakpoint exists with that ID // If another breakpoint exists with that ID
// the call will fail. // the call will fail.
STDMETHOD(AddBreakpoint)( STDMETHOD(AddBreakpoint)(
THIS_ THIS_
__in ULONG Type, _In_ ULONG Type,
__in ULONG DesiredId, _In_ ULONG DesiredId,
__out PDEBUG_BREAKPOINT* Bp _Out_ PDEBUG_BREAKPOINT* Bp
) PURE; ) PURE;
// Breakpoint interface is invalid after this call. // Breakpoint interface is invalid after this call.
STDMETHOD(RemoveBreakpoint)( STDMETHOD(RemoveBreakpoint)(
THIS_ THIS_
__in PDEBUG_BREAKPOINT Bp _In_ PDEBUG_BREAKPOINT Bp
) PURE; ) PURE;
// Control and use extension DLLs. // Control and use extension DLLs.
STDMETHOD(AddExtension)( STDMETHOD(AddExtension)(
THIS_ THIS_
__in PCSTR Path, _In_ PCSTR Path,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
STDMETHOD(RemoveExtension)( STDMETHOD(RemoveExtension)(
THIS_ THIS_
__in ULONG64 Handle _In_ ULONG64 Handle
) PURE; ) PURE;
STDMETHOD(GetExtensionByPath)( STDMETHOD(GetExtensionByPath)(
THIS_ THIS_
__in PCSTR Path, _In_ PCSTR Path,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
// If Handle is zero the extension // If Handle is zero the extension
// chain is walked searching for the // chain is walked searching for the
// function. // function.
STDMETHOD(CallExtension)( STDMETHOD(CallExtension)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in PCSTR Function, _In_ PCSTR Function,
__in_opt PCSTR Arguments _In_opt_ PCSTR Arguments
) PURE; ) PURE;
// GetExtensionFunction works like // GetExtensionFunction works like
// GetProcAddress on extension DLLs // GetProcAddress on extension DLLs
// to allow raw function-call-level // to allow raw function-call-level
// interaction with extension DLLs. // interaction with extension DLLs.
// Such functions do not need to // Such functions do not need to
// follow the standard extension prototype // follow the standard extension prototype
// if they are not going to be called // if they are not going to be called
// through the text extension interface. // through the text extension interface.
// _EFN_ is automatically prepended to // _EFN_ is automatically prepended to
// the name string given. // the name string given.
// This function cannot be called remotely. // This function cannot be called remotely.
STDMETHOD(GetExtensionFunction)( STDMETHOD(GetExtensionFunction)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in PCSTR FuncName, _In_ PCSTR FuncName,
__out FARPROC* Function _Out_ FARPROC* Function
) PURE; ) PURE;
// These methods return alternate // These methods return alternate
// extension interfaces in order to allow // extension interfaces in order to allow
// interface-style extension DLLs to mix in // interface-style extension DLLs to mix in
// older extension calls. // older extension calls.
// Structure sizes must be initialized before // Structure sizes must be initialized before
// the call. // the call.
// These methods cannot be called remotely. // These methods cannot be called remotely.
STDMETHOD(GetWindbgExtensionApis32)( STDMETHOD(GetWindbgExtensionApis32)(
THIS_ THIS_
__inout PWINDBG_EXTENSION_APIS32 Api _Inout_ PWINDBG_EXTENSION_APIS32 Api
) PURE; ) PURE;
STDMETHOD(GetWindbgExtensionApis64)( STDMETHOD(GetWindbgExtensionApis64)(
THIS_ THIS_
__inout PWINDBG_EXTENSION_APIS64 Api _Inout_ PWINDBG_EXTENSION_APIS64 Api
) PURE; ) PURE;
// The engine provides a simple mechanism // The engine provides a simple mechanism
// to filter common events. Arbitrarily complicated // to filter common events. Arbitrarily complicated
// filtering can be done by registering event callbacks // filtering can be done by registering event callbacks
// but simple event filtering only requires // but simple event filtering only requires
// setting the options of one of the predefined // setting the options of one of the predefined
// event filters. // event filters.
// Simple event filters are either for specific // Simple event filters are either for specific
// events and therefore have an enumerant or // events and therefore have an enumerant or
skipping to change at line 5402 skipping to change at line 7240
// All three groups of filters are indexed together // All three groups of filters are indexed together
// with the specific filters first, then the specific // with the specific filters first, then the specific
// exception filters and finally the arbitrary // exception filters and finally the arbitrary
// exception filters. // exception filters.
// The first specific exception is the default // The first specific exception is the default
// exception. If an exception event occurs for // exception. If an exception event occurs for
// an exception without settings the default // an exception without settings the default
// exception settings are used. // exception settings are used.
STDMETHOD(GetNumberEventFilters)( STDMETHOD(GetNumberEventFilters)(
THIS_ THIS_
__out PULONG SpecificEvents, _Out_ PULONG SpecificEvents,
__out PULONG SpecificExceptions, _Out_ PULONG SpecificExceptions,
__out PULONG ArbitraryExceptions _Out_ PULONG ArbitraryExceptions
) PURE; ) PURE;
// Some filters have descriptive text associated with them. // Some filters have descriptive text associated with them.
STDMETHOD(GetEventFilterText)( STDMETHOD(GetEventFilterText)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG TextSize _Out_opt_ PULONG TextSize
) PURE; ) PURE;
// All filters support executing a command when the // All filters support executing a command when the
// event occurs. // event occurs.
STDMETHOD(GetEventFilterCommand)( STDMETHOD(GetEventFilterCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG CommandSize _Out_opt_ PULONG CommandSize
) PURE; ) PURE;
STDMETHOD(SetEventFilterCommand)( STDMETHOD(SetEventFilterCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Command _In_ PCSTR Command
) PURE; ) PURE;
STDMETHOD(GetSpecificFilterParameters)( STDMETHOD(GetSpecificFilterParameters)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params _Out_writes_(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
) PURE; ) PURE;
STDMETHOD(SetSpecificFilterParameters)( STDMETHOD(SetSpecificFilterParameters)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__in_ecount(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params _In_reads_(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
) PURE; ) PURE;
// Some specific filters have arguments to further // Some specific filters have arguments to further
// qualify their operation. // qualify their operation.
STDMETHOD(GetSpecificFilterArgument)( STDMETHOD(GetSpecificFilterArgument)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ArgumentSize _Out_opt_ PULONG ArgumentSize
) PURE; ) PURE;
STDMETHOD(SetSpecificFilterArgument)( STDMETHOD(SetSpecificFilterArgument)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Argument _In_ PCSTR Argument
) PURE; ) PURE;
// If Codes is non-NULL Start is ignored. // If Codes is non-NULL Start is ignored.
STDMETHOD(GetExceptionFilterParameters)( STDMETHOD(GetExceptionFilterParameters)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Codes, _In_reads_opt_(Count) PULONG Codes,
__in ULONG Start, _In_ ULONG Start,
__out_ecount(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params _Out_writes_(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
) PURE; ) PURE;
// The codes in the parameter data control the application // The codes in the parameter data control the application
// of the parameter data. If a code is not already in // of the parameter data. If a code is not already in
// the set of filters it is added. If the ExecutionOption // the set of filters it is added. If the ExecutionOption
// for a code is REMOVE then the filter is removed. // for a code is REMOVE then the filter is removed.
// Specific exception filters cannot be removed. // Specific exception filters cannot be removed.
STDMETHOD(SetExceptionFilterParameters)( STDMETHOD(SetExceptionFilterParameters)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params _In_reads_(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
) PURE; ) PURE;
// Exception filters support an additional command for // Exception filters support an additional command for
// second-chance events. // second-chance events.
STDMETHOD(GetExceptionFilterSecondCommand)( STDMETHOD(GetExceptionFilterSecondCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG CommandSize _Out_opt_ PULONG CommandSize
) PURE; ) PURE;
STDMETHOD(SetExceptionFilterSecondCommand)( STDMETHOD(SetExceptionFilterSecondCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Command _In_ PCSTR Command
) PURE; ) PURE;
// Yields processing to the engine until // Yields processing to the engine until
// an event occurs. This method may // an event occurs. This method may
// only be called by the thread that started // only be called by the thread that started
// the debug session. // the debug session.
// When an event occurs the engine carries // When an event occurs the engine carries
// out all event processing such as calling // out all event processing such as calling
// callbacks. // callbacks.
// If the callbacks indicate that execution should // If the callbacks indicate that execution should
// break the wait will return, otherwise it // break the wait will return, otherwise it
// goes back to waiting for a new event. // goes back to waiting for a new event.
// If the timeout expires, S_FALSE is returned. // If the timeout expires, S_FALSE is returned.
// The timeout is not currently supported for // The timeout is not currently supported for
// kernel debugging. // kernel debugging.
STDMETHOD(WaitForEvent)( STDMETHOD(WaitForEvent)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG Timeout _In_ ULONG Timeout
) PURE; ) PURE;
// Retrieves information about the last event that occurred. // Retrieves information about the last event that occurred.
// EventType is one of the event callback mask bits. // EventType is one of the event callback mask bits.
// ExtraInformation contains additional event-specific // ExtraInformation contains additional event-specific
// information. Not all events have additional information. // information. Not all events have additional information.
STDMETHOD(GetLastEventInformation)( STDMETHOD(GetLastEventInformation)(
THIS_ THIS_
__out PULONG Type, _Out_ PULONG Type,
__out PULONG ProcessId, _Out_ PULONG ProcessId,
__out PULONG ThreadId, _Out_ PULONG ThreadId,
__out_bcount_opt(ExtraInformationSize) PVOID ExtraInformation, _Out_writes_bytes_opt_(ExtraInformationSize) PVOID ExtraInformation,
__in ULONG ExtraInformationSize, _In_ ULONG ExtraInformationSize,
__out_opt PULONG ExtraInformationUsed, _Out_opt_ PULONG ExtraInformationUsed,
__out_ecount_opt(DescriptionSize) PSTR Description, _Out_writes_opt_(DescriptionSize) PSTR Description,
__in ULONG DescriptionSize, _In_ ULONG DescriptionSize,
__out_opt PULONG DescriptionUsed _Out_opt_ PULONG DescriptionUsed
) PURE; ) PURE;
}; };
// OutputTextReplacements flags. // OutputTextReplacements flags.
#define DEBUG_OUT_TEXT_REPL_DEFAULT 0x00000000 #define DEBUG_OUT_TEXT_REPL_DEFAULT 0x00000000
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugControl2 #define INTERFACE IDebugControl2
DECLARE_INTERFACE_(IDebugControl2, IUnknown) DECLARE_INTERFACE_(IDebugControl2, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugControl. // IDebugControl.
// Checks for a user interrupt, such a Ctrl-C // Checks for a user interrupt, such a Ctrl-C
// or stop button. // or stop button.
// This method is reentrant. // This method is reentrant.
STDMETHOD(GetInterrupt)( STDMETHOD(GetInterrupt)(
THIS THIS
) PURE; ) PURE;
// Registers a user interrupt. // Registers a user interrupt.
// This method is reentrant. // This method is reentrant.
STDMETHOD(SetInterrupt)( STDMETHOD(SetInterrupt)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Interrupting a user-mode process requires // Interrupting a user-mode process requires
// access to some system resources that the // access to some system resources that the
// process may hold itself, preventing the // process may hold itself, preventing the
// interrupt from occurring. The engine // interrupt from occurring. The engine
// will time-out pending interrupt requests // will time-out pending interrupt requests
// and simulate an interrupt if necessary. // and simulate an interrupt if necessary.
// These methods control the interrupt timeout. // These methods control the interrupt timeout.
STDMETHOD(GetInterruptTimeout)( STDMETHOD(GetInterruptTimeout)(
THIS_ THIS_
__out PULONG Seconds _Out_ PULONG Seconds
) PURE; ) PURE;
STDMETHOD(SetInterruptTimeout)( STDMETHOD(SetInterruptTimeout)(
THIS_ THIS_
__in ULONG Seconds _In_ ULONG Seconds
) PURE; ) PURE;
STDMETHOD(GetLogFile)( STDMETHOD(GetLogFile)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG FileSize, _Out_opt_ PULONG FileSize,
__out PBOOL Append _Out_ PBOOL Append
) PURE; ) PURE;
// Opens a log file which collects all // Opens a log file which collects all
// output. Output from every client except // output. Output from every client except
// those that explicitly disable logging // those that explicitly disable logging
// goes into the log. // goes into the log.
// Opening a log file closes any log file // Opening a log file closes any log file
// already open. // already open.
STDMETHOD(OpenLogFile)( STDMETHOD(OpenLogFile)(
THIS_ THIS_
__in PCSTR File, _In_ PCSTR File,
__in BOOL Append _In_ BOOL Append
) PURE; ) PURE;
STDMETHOD(CloseLogFile)( STDMETHOD(CloseLogFile)(
THIS THIS
) PURE; ) PURE;
// Controls what output is logged. // Controls what output is logged.
STDMETHOD(GetLogMask)( STDMETHOD(GetLogMask)(
THIS_ THIS_
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
STDMETHOD(SetLogMask)( STDMETHOD(SetLogMask)(
THIS_ THIS_
__in ULONG Mask _In_ ULONG Mask
) PURE; ) PURE;
// Input requests input from all clients. // Input requests input from all clients.
// The first input that is returned is used // The first input that is returned is used
// to satisfy the call. Other returned // to satisfy the call. Other returned
// input is discarded. // input is discarded.
STDMETHOD(Input)( STDMETHOD(Input)(
THIS_ THIS_
__out_ecount(BufferSize) PSTR Buffer, _Out_writes_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG InputSize _Out_opt_ PULONG InputSize
) PURE; ) PURE;
// This method is used by clients to return // This method is used by clients to return
// input when it is available. It will // input when it is available. It will
// return S_OK if the input is used to // return S_OK if the input is used to
// satisfy an Input call and S_FALSE if // satisfy an Input call and S_FALSE if
// the input is ignored. // the input is ignored.
// This method is reentrant. // This method is reentrant.
STDMETHOD(ReturnInput)( STDMETHOD(ReturnInput)(
THIS_ THIS_
__in PCSTR Buffer _In_ PCSTR Buffer
) PURE; ) PURE;
// Sends output through clients // Sends output through clients
// output callbacks if the mask is allowed // output callbacks if the mask is allowed
// by the current output control mask and // by the current output control mask and
// according to the output distribution // according to the output distribution
// settings. // settings.
STDMETHODV(Output)( STDMETHODV(Output)(
THIS_ THIS_
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
... ...
) PURE; ) PURE;
STDMETHOD(OutputVaList)( STDMETHOD(OutputVaList)(
THIS_ THIS_
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
__in va_list Args _In_ va_list Args
) PURE; ) PURE;
// The following methods allow direct control // The following methods allow direct control
// over the distribution of the given output // over the distribution of the given output
// for situations where something other than // for situations where something other than
// the default is desired. These methods require // the default is desired. These methods require
// extra work in the engine so they should // extra work in the engine so they should
// only be used when necessary. // only be used when necessary.
STDMETHODV(ControlledOutput)( STDMETHODV(ControlledOutput)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
... ...
) PURE; ) PURE;
STDMETHOD(ControlledOutputVaList)( STDMETHOD(ControlledOutputVaList)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
__in va_list Args _In_ va_list Args
) PURE; ) PURE;
// Displays the standard command-line prompt // Displays the standard command-line prompt
// followed by the given output. If Format // followed by the given output. If Format
// is NULL no additional output is produced. // is NULL no additional output is produced.
// Output is produced under the // Output is produced under the
// DEBUG_OUTPUT_PROMPT mask. // DEBUG_OUTPUT_PROMPT mask.
// This method only outputs the prompt; it // This method only outputs the prompt; it
// does not get input. // does not get input.
STDMETHODV(OutputPrompt)( STDMETHODV(OutputPrompt)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in_opt PCSTR Format, _In_opt_ PCSTR Format,
... ...
) PURE; ) PURE;
STDMETHOD(OutputPromptVaList)( STDMETHOD(OutputPromptVaList)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in_opt PCSTR Format, _In_opt_ PCSTR Format,
__in va_list Args _In_ va_list Args
) PURE; ) PURE;
// Gets the text that would be displayed by OutputPrompt. // Gets the text that would be displayed by OutputPrompt.
STDMETHOD(GetPromptText)( STDMETHOD(GetPromptText)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG TextSize _Out_opt_ PULONG TextSize
) PURE; ) PURE;
// Outputs information about the current // Outputs information about the current
// debuggee state such as a register // debuggee state such as a register
// summary, disassembly at the current PC, // summary, disassembly at the current PC,
// closest symbol and others. // closest symbol and others.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputCurrentState)( STDMETHOD(OutputCurrentState)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Outputs the debugger and extension version // Outputs the debugger and extension version
// information. This method is reentrant. // information. This method is reentrant.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputVersionInformation)( STDMETHOD(OutputVersionInformation)(
THIS_ THIS_
__in ULONG OutputControl _In_ ULONG OutputControl
) PURE; ) PURE;
// In user-mode debugging sessions the // In user-mode debugging sessions the
// engine will set an event when // engine will set an event when
// exceptions are continued. This can // exceptions are continued. This can
// be used to synchronize other processes // be used to synchronize other processes
// with the debuggers handling of events. // with the debuggers handling of events.
// For example, this is used to support // For example, this is used to support
// the e argument to ntsd. // the e argument to ntsd.
STDMETHOD(GetNotifyEventHandle)( STDMETHOD(GetNotifyEventHandle)(
THIS_ THIS_
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
STDMETHOD(SetNotifyEventHandle)( STDMETHOD(SetNotifyEventHandle)(
THIS_ THIS_
__in ULONG64 Handle _In_ ULONG64 Handle
) PURE; ) PURE;
STDMETHOD(Assemble)( STDMETHOD(Assemble)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in PCSTR Instr, _In_ PCSTR Instr,
__out PULONG64 EndOffset _Out_ PULONG64 EndOffset
) PURE; ) PURE;
STDMETHOD(Disassemble)( STDMETHOD(Disassemble)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DisassemblySize, _Out_opt_ PULONG DisassemblySize,
__out PULONG64 EndOffset _Out_ PULONG64 EndOffset
) PURE; ) PURE;
// Returns the value of the effective address // Returns the value of the effective address
// computed for the last Disassemble, if there // computed for the last Disassemble, if there
// was one. // was one.
STDMETHOD(GetDisassembleEffectiveOffset)( STDMETHOD(GetDisassembleEffectiveOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Uses the line prefix if necessary. // Uses the line prefix if necessary.
STDMETHOD(OutputDisassembly)( STDMETHOD(OutputDisassembly)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG64 EndOffset _Out_ PULONG64 EndOffset
) PURE; ) PURE;
// Produces multiple lines of disassembly output. // Produces multiple lines of disassembly output.
// There will be PreviousLines of disassembly before // There will be PreviousLines of disassembly before
// the given offset if a valid disassembly exists. // the given offset if a valid disassembly exists.
// In all, there will be TotalLines of output produced. // In all, there will be TotalLines of output produced.
// The first and last line offsets are returned // The first and last line offsets are returned
// specially and all lines offsets can be retrieved // specially and all lines offsets can be retrieved
// through LineOffsets. LineOffsets will contain // through LineOffsets. LineOffsets will contain
// offsets for each line where disassembly started. // offsets for each line where disassembly started.
// When disassembly of a single instruction takes // When disassembly of a single instruction takes
// multiple lines the initial offset will be followed // multiple lines the initial offset will be followed
// by DEBUG_INVALID_OFFSET. // by DEBUG_INVALID_OFFSET.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputDisassemblyLines)( STDMETHOD(OutputDisassemblyLines)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG PreviousLines, _In_ ULONG PreviousLines,
__in ULONG TotalLines, _In_ ULONG TotalLines,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out_opt PULONG OffsetLine, _Out_opt_ PULONG OffsetLine,
__out_opt PULONG64 StartOffset, _Out_opt_ PULONG64 StartOffset,
__out_opt PULONG64 EndOffset, _Out_opt_ PULONG64 EndOffset,
__out_ecount_opt(TotalLines) PULONG64 LineOffsets _Out_writes_opt_(TotalLines) PULONG64 LineOffsets
) PURE; ) PURE;
// Returns the offset of the start of // Returns the offset of the start of
// the instruction thats the given // the instruction thats the given
// delta away from the instruction // delta away from the instruction
// at the initial offset. // at the initial offset.
// This routine does not check for // This routine does not check for
// validity of the instruction or // validity of the instruction or
// the memory containing it. // the memory containing it.
STDMETHOD(GetNearInstruction)( STDMETHOD(GetNearInstruction)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in LONG Delta, _In_ LONG Delta,
__out PULONG64 NearOffset _Out_ PULONG64 NearOffset
) PURE; ) PURE;
// Offsets can be passed in as zero to use the current // Offsets can be passed in as zero to use the current
// thread state. // thread state.
STDMETHOD(GetStackTrace)( STDMETHOD(GetStackTrace)(
THIS_ THIS_
__in ULONG64 FrameOffset, _In_ ULONG64 FrameOffset,
__in ULONG64 StackOffset, _In_ ULONG64 StackOffset,
__in ULONG64 InstructionOffset, _In_ ULONG64 InstructionOffset,
__out_ecount(FramesSize) PDEBUG_STACK_FRAME Frames, _Out_writes_(FramesSize) PDEBUG_STACK_FRAME Frames,
__in ULONG FramesSize, _In_ ULONG FramesSize,
__out_opt PULONG FramesFilled _Out_opt_ PULONG FramesFilled
) PURE; ) PURE;
// Does a simple stack trace to determine // Does a simple stack trace to determine
// what the current return address is. // what the current return address is.
STDMETHOD(GetReturnOffset)( STDMETHOD(GetReturnOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// If Frames is NULL OutputStackTrace will // If Frames is NULL OutputStackTrace will
// use GetStackTrace to get FramesSize frames // use GetStackTrace to get FramesSize frames
// and then output them. The current register // and then output them. The current register
// values for frame, stack and instruction offsets // values for frame, stack and instruction offsets
// are used. // are used.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputStackTrace)( STDMETHOD(OutputStackTrace)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in_ecount_opt(FramesSize) PDEBUG_STACK_FRAME Frames, _In_reads_opt_(FramesSize) PDEBUG_STACK_FRAME Frames,
__in ULONG FramesSize, _In_ ULONG FramesSize,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Returns information about the debuggee such // Returns information about the debuggee such
// as user vs. kernel, dump vs. live, etc. // as user vs. kernel, dump vs. live, etc.
STDMETHOD(GetDebuggeeType)( STDMETHOD(GetDebuggeeType)(
THIS_ THIS_
__out PULONG Class, _Out_ PULONG Class,
__out PULONG Qualifier _Out_ PULONG Qualifier
) PURE; ) PURE;
// Returns the type of physical processors in // Returns the type of physical processors in
// the machine. // the machine.
// Returns one of the IMAGE_FILE_MACHINE values. // Returns one of the IMAGE_FILE_MACHINE values.
STDMETHOD(GetActualProcessorType)( STDMETHOD(GetActualProcessorType)(
THIS_ THIS_
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
// Returns the type of processor used in the // Returns the type of processor used in the
// current processor context. // current processor context.
STDMETHOD(GetExecutingProcessorType)( STDMETHOD(GetExecutingProcessorType)(
THIS_ THIS_
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
// Query all the possible processor types that // Query all the possible processor types that
// may be encountered during this debug session. // may be encountered during this debug session.
STDMETHOD(GetNumberPossibleExecutingProcessorTypes)( STDMETHOD(GetNumberPossibleExecutingProcessorTypes)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetPossibleExecutingProcessorTypes)( STDMETHOD(GetPossibleExecutingProcessorTypes)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PULONG Types _Out_writes_(Count) PULONG Types
) PURE; ) PURE;
// Get the number of actual processors in // Get the number of actual processors in
// the machine. // the machine.
STDMETHOD(GetNumberProcessors)( STDMETHOD(GetNumberProcessors)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
// PlatformId is one of the VER_PLATFORM values. // PlatformId is one of the VER_PLATFORM values.
// Major and minor are as given in the NT // Major and minor are as given in the NT
// kernel debugger protocol. // kernel debugger protocol.
// ServicePackString and ServicePackNumber indicate the // ServicePackString and ServicePackNumber indicate the
// system service pack level. ServicePackNumber is not // system service pack level. ServicePackNumber is not
// available in some sessions where the service pack level // available in some sessions where the service pack level
// is only expressed as a string. The service pack information // is only expressed as a string. The service pack information
// will be empty if the system does not have a service pack // will be empty if the system does not have a service pack
// applied. // applied.
// The build string is string information identifying the // The build string is string information identifying the
// particular build of the system. The build string is // particular build of the system. The build string is
// empty if the system has no particular identifying // empty if the system has no particular identifying
// information. // information.
STDMETHOD(GetSystemVersion)( STDMETHOD(GetSystemVersion)(
THIS_ THIS_
__out PULONG PlatformId, _Out_ PULONG PlatformId,
__out PULONG Major, _Out_ PULONG Major,
__out PULONG Minor, _Out_ PULONG Minor,
__out_ecount_opt(ServicePackStringSize) PSTR ServicePackString, _Out_writes_opt_(ServicePackStringSize) PSTR ServicePackString,
__in ULONG ServicePackStringSize, _In_ ULONG ServicePackStringSize,
__out_opt PULONG ServicePackStringUsed, _Out_opt_ PULONG ServicePackStringUsed,
__out PULONG ServicePackNumber, _Out_ PULONG ServicePackNumber,
__out_ecount_opt(BuildStringSize) PSTR BuildString, _Out_writes_opt_(BuildStringSize) PSTR BuildString,
__in ULONG BuildStringSize, _In_ ULONG BuildStringSize,
__out_opt PULONG BuildStringUsed _Out_opt_ PULONG BuildStringUsed
) PURE; ) PURE;
// Returns the page size for the currently executing // Returns the page size for the currently executing
// processor context. The page size may vary between // processor context. The page size may vary between
// processor types. // processor types.
STDMETHOD(GetPageSize)( STDMETHOD(GetPageSize)(
THIS_ THIS_
__out PULONG Size _Out_ PULONG Size
) PURE; ) PURE;
// Returns S_OK if the current processor context uses // Returns S_OK if the current processor context uses
// 64-bit addresses, otherwise S_FALSE. // 64-bit addresses, otherwise S_FALSE.
STDMETHOD(IsPointer64Bit)( STDMETHOD(IsPointer64Bit)(
THIS THIS
) PURE; ) PURE;
// Reads the bugcheck data area and returns the // Reads the bugcheck data area and returns the
// current contents. This method only works // current contents. This method only works
// in kernel debugging sessions. // in kernel debugging sessions.
STDMETHOD(ReadBugCheckData)( STDMETHOD(ReadBugCheckData)(
THIS_ THIS_
__out PULONG Code, _Out_ PULONG Code,
__out PULONG64 Arg1, _Out_ PULONG64 Arg1,
__out PULONG64 Arg2, _Out_ PULONG64 Arg2,
__out PULONG64 Arg3, _Out_ PULONG64 Arg3,
__out PULONG64 Arg4 _Out_ PULONG64 Arg4
) PURE; ) PURE;
// Query all the processor types supported by // Query all the processor types supported by
// the engine. This is a complete list and is // the engine. This is a complete list and is
// not related to the machine running the engine // not related to the machine running the engine
// or the debuggee. // or the debuggee.
STDMETHOD(GetNumberSupportedProcessorTypes)( STDMETHOD(GetNumberSupportedProcessorTypes)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetSupportedProcessorTypes)( STDMETHOD(GetSupportedProcessorTypes)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PULONG Types _Out_writes_(Count) PULONG Types
) PURE; ) PURE;
// Returns a full, descriptive name and an // Returns a full, descriptive name and an
// abbreviated name for a processor type. // abbreviated name for a processor type.
STDMETHOD(GetProcessorTypeNames)( STDMETHOD(GetProcessorTypeNames)(
THIS_ THIS_
__in ULONG Type, _In_ ULONG Type,
__out_ecount_opt(FullNameBufferSize) PSTR FullNameBuffer, _Out_writes_opt_(FullNameBufferSize) PSTR FullNameBuffer,
__in ULONG FullNameBufferSize, _In_ ULONG FullNameBufferSize,
__out_opt PULONG FullNameSize, _Out_opt_ PULONG FullNameSize,
__out_ecount_opt(AbbrevNameBufferSize) PSTR AbbrevNameBuffer, _Out_writes_opt_(AbbrevNameBufferSize) PSTR AbbrevNameBuffer,
__in ULONG AbbrevNameBufferSize, _In_ ULONG AbbrevNameBufferSize,
__out_opt PULONG AbbrevNameSize _Out_opt_ PULONG AbbrevNameSize
) PURE; ) PURE;
// Gets and sets the type of processor to // Gets and sets the type of processor to
// use when doing things like setting // use when doing things like setting
// breakpoints, accessing registers, // breakpoints, accessing registers,
// getting stack traces and so on. // getting stack traces and so on.
STDMETHOD(GetEffectiveProcessorType)( STDMETHOD(GetEffectiveProcessorType)(
THIS_ THIS_
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
STDMETHOD(SetEffectiveProcessorType)( STDMETHOD(SetEffectiveProcessorType)(
THIS_ THIS_
__in ULONG Type _In_ ULONG Type
) PURE; ) PURE;
// Returns information about whether and how // Returns information about whether and how
// the debuggee is running. Status will // the debuggee is running. Status will
// be GO if the debuggee is running and // be GO if the debuggee is running and
// BREAK if it isnt. // BREAK if it isnt.
// If no debuggee exists the status is // If no debuggee exists the status is
// NO_DEBUGGEE. // NO_DEBUGGEE.
// This method is reentrant. // This method is reentrant.
STDMETHOD(GetExecutionStatus)( STDMETHOD(GetExecutionStatus)(
THIS_ THIS_
__out PULONG Status _Out_ PULONG Status
) PURE; ) PURE;
// Changes the execution status of the // Changes the execution status of the
// engine from stopped to running. // engine from stopped to running.
// Status must be one of the go or step // Status must be one of the go or step
// status values. // status values.
STDMETHOD(SetExecutionStatus)( STDMETHOD(SetExecutionStatus)(
THIS_ THIS_
__in ULONG Status _In_ ULONG Status
) PURE; ) PURE;
// Controls what code interpretation level the debugger // Controls what code interpretation level the debugger
// runs at. The debugger checks the code level when // runs at. The debugger checks the code level when
// deciding whether to step by a source line or // deciding whether to step by a source line or
// assembly instruction along with other related operations. // assembly instruction along with other related operations.
STDMETHOD(GetCodeLevel)( STDMETHOD(GetCodeLevel)(
THIS_ THIS_
__out PULONG Level _Out_ PULONG Level
) PURE; ) PURE;
STDMETHOD(SetCodeLevel)( STDMETHOD(SetCodeLevel)(
THIS_ THIS_
__in ULONG Level _In_ ULONG Level
) PURE; ) PURE;
// Gets and sets engine control flags. // Gets and sets engine control flags.
// These methods are reentrant. // These methods are reentrant.
STDMETHOD(GetEngineOptions)( STDMETHOD(GetEngineOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddEngineOptions)( STDMETHOD(AddEngineOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveEngineOptions)( STDMETHOD(RemoveEngineOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetEngineOptions)( STDMETHOD(SetEngineOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
// Gets and sets control values for // Gets and sets control values for
// handling system error events. // handling system error events.
// If the system error level is less // If the system error level is less
// than or equal to the given levels // than or equal to the given levels
// the error may be displayed and // the error may be displayed and
// the default break for the event // the default break for the event
// may be set. // may be set.
STDMETHOD(GetSystemErrorControl)( STDMETHOD(GetSystemErrorControl)(
THIS_ THIS_
__out PULONG OutputLevel, _Out_ PULONG OutputLevel,
__out PULONG BreakLevel _Out_ PULONG BreakLevel
) PURE; ) PURE;
STDMETHOD(SetSystemErrorControl)( STDMETHOD(SetSystemErrorControl)(
THIS_ THIS_
__in ULONG OutputLevel, _In_ ULONG OutputLevel,
__in ULONG BreakLevel _In_ ULONG BreakLevel
) PURE; ) PURE;
// The command processor supports simple // The command processor supports simple
// string replacement macros in Evaluate and // string replacement macros in Evaluate and
// Execute. There are currently ten macro // Execute. There are currently ten macro
// slots available. Slots 0-9 map to // slots available. Slots 0-9 map to
// the command invocations $u0-$u9. // the command invocations $u0-$u9.
STDMETHOD(GetTextMacro)( STDMETHOD(GetTextMacro)(
THIS_ THIS_
__in ULONG Slot, _In_ ULONG Slot,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG MacroSize _Out_opt_ PULONG MacroSize
) PURE; ) PURE;
STDMETHOD(SetTextMacro)( STDMETHOD(SetTextMacro)(
THIS_ THIS_
__in ULONG Slot, _In_ ULONG Slot,
__in PCSTR Macro _In_ PCSTR Macro
) PURE; ) PURE;
// Controls the default number radix used // Controls the default number radix used
// in expressions and commands. // in expressions and commands.
STDMETHOD(GetRadix)( STDMETHOD(GetRadix)(
THIS_ THIS_
__out PULONG Radix _Out_ PULONG Radix
) PURE; ) PURE;
STDMETHOD(SetRadix)( STDMETHOD(SetRadix)(
THIS_ THIS_
__in ULONG Radix _In_ ULONG Radix
) PURE; ) PURE;
// Evaluates the given expression string and // Evaluates the given expression string and
// returns the resulting value. // returns the resulting value.
// If DesiredType is DEBUG_VALUE_INVALID then // If DesiredType is DEBUG_VALUE_INVALID then
// the natural type is used. // the natural type is used.
// RemainderIndex, if provided, is set to the index // RemainderIndex, if provided, is set to the index
// of the first character in the input string that was // of the first character in the input string that was
// not used when evaluating the expression. // not used when evaluating the expression.
STDMETHOD(Evaluate)( STDMETHOD(Evaluate)(
THIS_ THIS_
__in PCSTR Expression, _In_ PCSTR Expression,
__in ULONG DesiredType, _In_ ULONG DesiredType,
__out PDEBUG_VALUE Value, _Out_ PDEBUG_VALUE Value,
__out_opt PULONG RemainderIndex _Out_opt_ PULONG RemainderIndex
) PURE; ) PURE;
// Attempts to convert the input value to a value // Attempts to convert the input value to a value
// of the requested type in the output value. // of the requested type in the output value.
// Conversions can fail if no conversion exists. // Conversions can fail if no conversion exists.
// Successful conversions may be lossy. // Successful conversions may be lossy.
STDMETHOD(CoerceValue)( STDMETHOD(CoerceValue)(
THIS_ THIS_
__in PDEBUG_VALUE In, _In_ PDEBUG_VALUE In,
__in ULONG OutType, _In_ ULONG OutType,
__out PDEBUG_VALUE Out _Out_ PDEBUG_VALUE Out
) PURE; ) PURE;
STDMETHOD(CoerceValues)( STDMETHOD(CoerceValues)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount(Count) PDEBUG_VALUE In, _In_reads_(Count) PDEBUG_VALUE In,
__in_ecount(Count) PULONG OutTypes, _In_reads_(Count) PULONG OutTypes,
__out_ecount(Count) PDEBUG_VALUE Out _Out_writes_(Count) PDEBUG_VALUE Out
) PURE; ) PURE;
// Executes the given command string. // Executes the given command string.
// If the string has multiple commands // If the string has multiple commands
// Execute will not return until all // Execute will not return until all
// of them have been executed. If this // of them have been executed. If this
// requires waiting for the debuggee to // requires waiting for the debuggee to
// execute an internal wait will be done // execute an internal wait will be done
// so Execute can take an arbitrary amount // so Execute can take an arbitrary amount
// of time. // of time.
STDMETHOD(Execute)( STDMETHOD(Execute)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCSTR Command, _In_ PCSTR Command,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Executes the given command file by // Executes the given command file by
// reading a line at a time and processing // reading a line at a time and processing
// it with Execute. // it with Execute.
STDMETHOD(ExecuteCommandFile)( STDMETHOD(ExecuteCommandFile)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCSTR CommandFile, _In_ PCSTR CommandFile,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Breakpoint interfaces are described // Breakpoint interfaces are described
// elsewhere in this section. // elsewhere in this section.
STDMETHOD(GetNumberBreakpoints)( STDMETHOD(GetNumberBreakpoints)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
// It is possible for this retrieval function to // It is possible for this retrieval function to
// fail even with an index within the number of // fail even with an index within the number of
// existing breakpoints if the breakpoint is // existing breakpoints if the breakpoint is
// a private breakpoint. // a private breakpoint.
STDMETHOD(GetBreakpointByIndex)( STDMETHOD(GetBreakpointByIndex)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out PDEBUG_BREAKPOINT* Bp _Out_ PDEBUG_BREAKPOINT* Bp
) PURE; ) PURE;
STDMETHOD(GetBreakpointById)( STDMETHOD(GetBreakpointById)(
THIS_ THIS_
__in ULONG Id, _In_ ULONG Id,
__out PDEBUG_BREAKPOINT* Bp _Out_ PDEBUG_BREAKPOINT* Bp
) PURE; ) PURE;
// If Ids is non-NULL the Count breakpoints // If Ids is non-NULL the Count breakpoints
// referred to in the Ids array are returned, // referred to in the Ids array are returned,
// otherwise breakpoints from index Start to // otherwise breakpoints from index Start to
// Start + Count 1 are returned. // Start + Count 1 are returned.
STDMETHOD(GetBreakpointParameters)( STDMETHOD(GetBreakpointParameters)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Ids, _In_reads_opt_(Count) PULONG Ids,
__in ULONG Start, _In_ ULONG Start,
__out_ecount(Count) PDEBUG_BREAKPOINT_PARAMETERS Params _Out_writes_(Count) PDEBUG_BREAKPOINT_PARAMETERS Params
) PURE; ) PURE;
// Breakpoints are created empty and disabled. // Breakpoints are created empty and disabled.
// When their parameters have been set they // When their parameters have been set they
// should be enabled by setting the ENABLE flag. // should be enabled by setting the ENABLE flag.
// If DesiredId is DEBUG_ANY_ID then the // If DesiredId is DEBUG_ANY_ID then the
// engine picks an unused ID. If DesiredId // engine picks an unused ID. If DesiredId
// is any other number the engine attempts // is any other number the engine attempts
// to use the given ID for the breakpoint. // to use the given ID for the breakpoint.
// If another breakpoint exists with that ID // If another breakpoint exists with that ID
// the call will fail. // the call will fail.
STDMETHOD(AddBreakpoint)( STDMETHOD(AddBreakpoint)(
THIS_ THIS_
__in ULONG Type, _In_ ULONG Type,
__in ULONG DesiredId, _In_ ULONG DesiredId,
__out PDEBUG_BREAKPOINT* Bp _Out_ PDEBUG_BREAKPOINT* Bp
) PURE; ) PURE;
// Breakpoint interface is invalid after this call. // Breakpoint interface is invalid after this call.
STDMETHOD(RemoveBreakpoint)( STDMETHOD(RemoveBreakpoint)(
THIS_ THIS_
__in PDEBUG_BREAKPOINT Bp _In_ PDEBUG_BREAKPOINT Bp
) PURE; ) PURE;
// Control and use extension DLLs. // Control and use extension DLLs.
STDMETHOD(AddExtension)( STDMETHOD(AddExtension)(
THIS_ THIS_
__in PCSTR Path, _In_ PCSTR Path,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
STDMETHOD(RemoveExtension)( STDMETHOD(RemoveExtension)(
THIS_ THIS_
__in ULONG64 Handle _In_ ULONG64 Handle
) PURE; ) PURE;
STDMETHOD(GetExtensionByPath)( STDMETHOD(GetExtensionByPath)(
THIS_ THIS_
__in PCSTR Path, _In_ PCSTR Path,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
// If Handle is zero the extension // If Handle is zero the extension
// chain is walked searching for the // chain is walked searching for the
// function. // function.
STDMETHOD(CallExtension)( STDMETHOD(CallExtension)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in PCSTR Function, _In_ PCSTR Function,
__in_opt PCSTR Arguments _In_opt_ PCSTR Arguments
) PURE; ) PURE;
// GetExtensionFunction works like // GetExtensionFunction works like
// GetProcAddress on extension DLLs // GetProcAddress on extension DLLs
// to allow raw function-call-level // to allow raw function-call-level
// interaction with extension DLLs. // interaction with extension DLLs.
// Such functions do not need to // Such functions do not need to
// follow the standard extension prototype // follow the standard extension prototype
// if they are not going to be called // if they are not going to be called
// through the text extension interface. // through the text extension interface.
// This function cannot be called remotely. // This function cannot be called remotely.
STDMETHOD(GetExtensionFunction)( STDMETHOD(GetExtensionFunction)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in PCSTR FuncName, _In_ PCSTR FuncName,
__out FARPROC* Function _Out_ FARPROC* Function
) PURE; ) PURE;
// These methods return alternate // These methods return alternate
// extension interfaces in order to allow // extension interfaces in order to allow
// interface-style extension DLLs to mix in // interface-style extension DLLs to mix in
// older extension calls. // older extension calls.
// Structure sizes must be initialized before // Structure sizes must be initialized before
// the call. // the call.
// These methods cannot be called remotely. // These methods cannot be called remotely.
STDMETHOD(GetWindbgExtensionApis32)( STDMETHOD(GetWindbgExtensionApis32)(
THIS_ THIS_
__inout PWINDBG_EXTENSION_APIS32 Api _Inout_ PWINDBG_EXTENSION_APIS32 Api
) PURE; ) PURE;
STDMETHOD(GetWindbgExtensionApis64)( STDMETHOD(GetWindbgExtensionApis64)(
THIS_ THIS_
__inout PWINDBG_EXTENSION_APIS64 Api _Inout_ PWINDBG_EXTENSION_APIS64 Api
) PURE; ) PURE;
// The engine provides a simple mechanism // The engine provides a simple mechanism
// to filter common events. Arbitrarily complicated // to filter common events. Arbitrarily complicated
// filtering can be done by registering event callbacks // filtering can be done by registering event callbacks
// but simple event filtering only requires // but simple event filtering only requires
// setting the options of one of the predefined // setting the options of one of the predefined
// event filters. // event filters.
// Simple event filters are either for specific // Simple event filters are either for specific
// events and therefore have an enumerant or // events and therefore have an enumerant or
skipping to change at line 6238 skipping to change at line 8076
// All three groups of filters are indexed together // All three groups of filters are indexed together
// with the specific filters first, then the specific // with the specific filters first, then the specific
// exception filters and finally the arbitrary // exception filters and finally the arbitrary
// exception filters. // exception filters.
// The first specific exception is the default // The first specific exception is the default
// exception. If an exception event occurs for // exception. If an exception event occurs for
// an exception without settings the default // an exception without settings the default
// exception settings are used. // exception settings are used.
STDMETHOD(GetNumberEventFilters)( STDMETHOD(GetNumberEventFilters)(
THIS_ THIS_
__out PULONG SpecificEvents, _Out_ PULONG SpecificEvents,
__out PULONG SpecificExceptions, _Out_ PULONG SpecificExceptions,
__out PULONG ArbitraryExceptions _Out_ PULONG ArbitraryExceptions
) PURE; ) PURE;
// Some filters have descriptive text associated with them. // Some filters have descriptive text associated with them.
STDMETHOD(GetEventFilterText)( STDMETHOD(GetEventFilterText)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG TextSize _Out_opt_ PULONG TextSize
) PURE; ) PURE;
// All filters support executing a command when the // All filters support executing a command when the
// event occurs. // event occurs.
STDMETHOD(GetEventFilterCommand)( STDMETHOD(GetEventFilterCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG CommandSize _Out_opt_ PULONG CommandSize
) PURE; ) PURE;
STDMETHOD(SetEventFilterCommand)( STDMETHOD(SetEventFilterCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Command _In_ PCSTR Command
) PURE; ) PURE;
STDMETHOD(GetSpecificFilterParameters)( STDMETHOD(GetSpecificFilterParameters)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params _Out_writes_(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
) PURE; ) PURE;
STDMETHOD(SetSpecificFilterParameters)( STDMETHOD(SetSpecificFilterParameters)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__in_ecount(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params _In_reads_(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
) PURE; ) PURE;
// Some specific filters have arguments to further // Some specific filters have arguments to further
// qualify their operation. // qualify their operation.
STDMETHOD(GetSpecificFilterArgument)( STDMETHOD(GetSpecificFilterArgument)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ArgumentSize _Out_opt_ PULONG ArgumentSize
) PURE; ) PURE;
STDMETHOD(SetSpecificFilterArgument)( STDMETHOD(SetSpecificFilterArgument)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Argument _In_ PCSTR Argument
) PURE; ) PURE;
// If Codes is non-NULL Start is ignored. // If Codes is non-NULL Start is ignored.
STDMETHOD(GetExceptionFilterParameters)( STDMETHOD(GetExceptionFilterParameters)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Codes, _In_reads_opt_(Count) PULONG Codes,
__in ULONG Start, _In_ ULONG Start,
__out_ecount(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params _Out_writes_(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
) PURE; ) PURE;
// The codes in the parameter data control the application // The codes in the parameter data control the application
// of the parameter data. If a code is not already in // of the parameter data. If a code is not already in
// the set of filters it is added. If the ExecutionOption // the set of filters it is added. If the ExecutionOption
// for a code is REMOVE then the filter is removed. // for a code is REMOVE then the filter is removed.
// Specific exception filters cannot be removed. // Specific exception filters cannot be removed.
STDMETHOD(SetExceptionFilterParameters)( STDMETHOD(SetExceptionFilterParameters)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params _In_reads_(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
) PURE; ) PURE;
// Exception filters support an additional command for // Exception filters support an additional command for
// second-chance events. // second-chance events.
STDMETHOD(GetExceptionFilterSecondCommand)( STDMETHOD(GetExceptionFilterSecondCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG CommandSize _Out_opt_ PULONG CommandSize
) PURE; ) PURE;
STDMETHOD(SetExceptionFilterSecondCommand)( STDMETHOD(SetExceptionFilterSecondCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Command _In_ PCSTR Command
) PURE; ) PURE;
// Yields processing to the engine until // Yields processing to the engine until
// an event occurs. This method may // an event occurs. This method may
// only be called by the thread that started // only be called by the thread that started
// the debug session. // the debug session.
// When an event occurs the engine carries // When an event occurs the engine carries
// out all event processing such as calling // out all event processing such as calling
// callbacks. // callbacks.
// If the callbacks indicate that execution should // If the callbacks indicate that execution should
// break the wait will return, otherwise it // break the wait will return, otherwise it
// goes back to waiting for a new event. // goes back to waiting for a new event.
// If the timeout expires, S_FALSE is returned. // If the timeout expires, S_FALSE is returned.
// The timeout is not currently supported for // The timeout is not currently supported for
// kernel debugging. // kernel debugging.
STDMETHOD(WaitForEvent)( STDMETHOD(WaitForEvent)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG Timeout _In_ ULONG Timeout
) PURE; ) PURE;
// Retrieves information about the last event that occurred. // Retrieves information about the last event that occurred.
// EventType is one of the event callback mask bits. // EventType is one of the event callback mask bits.
// ExtraInformation contains additional event-specific // ExtraInformation contains additional event-specific
// information. Not all events have additional information. // information. Not all events have additional information.
STDMETHOD(GetLastEventInformation)( STDMETHOD(GetLastEventInformation)(
THIS_ THIS_
__out PULONG Type, _Out_ PULONG Type,
__out PULONG ProcessId, _Out_ PULONG ProcessId,
__out PULONG ThreadId, _Out_ PULONG ThreadId,
__out_bcount_opt(ExtraInformationSize) PVOID ExtraInformation, _Out_writes_bytes_opt_(ExtraInformationSize) PVOID ExtraInformation,
__in ULONG ExtraInformationSize, _In_ ULONG ExtraInformationSize,
__out_opt PULONG ExtraInformationUsed, _Out_opt_ PULONG ExtraInformationUsed,
__out_ecount_opt(DescriptionSize) PSTR Description, _Out_writes_opt_(DescriptionSize) PSTR Description,
__in ULONG DescriptionSize, _In_ ULONG DescriptionSize,
__out_opt PULONG DescriptionUsed _Out_opt_ PULONG DescriptionUsed
) PURE; ) PURE;
// IDebugControl2. // IDebugControl2.
STDMETHOD(GetCurrentTimeDate)( STDMETHOD(GetCurrentTimeDate)(
THIS_ THIS_
__out PULONG TimeDate _Out_ PULONG TimeDate
) PURE; ) PURE;
// Retrieves the number of seconds since the // Retrieves the number of seconds since the
// machine started running. // machine started running.
STDMETHOD(GetCurrentSystemUpTime)( STDMETHOD(GetCurrentSystemUpTime)(
THIS_ THIS_
__out PULONG UpTime _Out_ PULONG UpTime
) PURE; ) PURE;
// If the current session is a dump session, // If the current session is a dump session,
// retrieves any extended format information. // retrieves any extended format information.
STDMETHOD(GetDumpFormatFlags)( STDMETHOD(GetDumpFormatFlags)(
THIS_ THIS_
__out PULONG FormatFlags _Out_ PULONG FormatFlags
) PURE; ) PURE;
// The debugger has been enhanced to allow // The debugger has been enhanced to allow
// arbitrary text replacements in addition // arbitrary text replacements in addition
// to the simple $u0-$u9 text macros. // to the simple $u0-$u9 text macros.
// Text replacement takes a given source // Text replacement takes a given source
// text in commands and converts it to the // text in commands and converts it to the
// given destination text. Replacements // given destination text. Replacements
// are named by their source text so that // are named by their source text so that
// only one replacement for a source text // only one replacement for a source text
// string can exist. // string can exist.
STDMETHOD(GetNumberTextReplacements)( STDMETHOD(GetNumberTextReplacements)(
THIS_ THIS_
__out PULONG NumRepl _Out_ PULONG NumRepl
) PURE; ) PURE;
// If SrcText is non-NULL the replacement // If SrcText is non-NULL the replacement
// is looked up by source text, otherwise // is looked up by source text, otherwise
// Index is used to get the Nth replacement. // Index is used to get the Nth replacement.
STDMETHOD(GetTextReplacement)( STDMETHOD(GetTextReplacement)(
THIS_ THIS_
__in_opt PCSTR SrcText, _In_opt_ PCSTR SrcText,
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(SrcBufferSize) PSTR SrcBuffer, _Out_writes_opt_(SrcBufferSize) PSTR SrcBuffer,
__in ULONG SrcBufferSize, _In_ ULONG SrcBufferSize,
__out_opt PULONG SrcSize, _Out_opt_ PULONG SrcSize,
__out_ecount_opt(DstBufferSize) PSTR DstBuffer, _Out_writes_opt_(DstBufferSize) PSTR DstBuffer,
__in ULONG DstBufferSize, _In_ ULONG DstBufferSize,
__out_opt PULONG DstSize _Out_opt_ PULONG DstSize
) PURE; ) PURE;
// Setting the destination text to // Setting the destination text to
// NULL removes the alias. // NULL removes the alias.
STDMETHOD(SetTextReplacement)( STDMETHOD(SetTextReplacement)(
THIS_ THIS_
__in PCSTR SrcText, _In_ PCSTR SrcText,
__in_opt PCSTR DstText _In_opt_ PCSTR DstText
) PURE; ) PURE;
STDMETHOD(RemoveTextReplacements)( STDMETHOD(RemoveTextReplacements)(
THIS THIS
) PURE; ) PURE;
// Outputs the complete list of current // Outputs the complete list of current
// replacements. // replacements.
STDMETHOD(OutputTextReplacements)( STDMETHOD(OutputTextReplacements)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
}; };
// //
// Assembly/disassembly options. // Assembly/disassembly options.
// //
// The specific effects of these flags varies depending // The specific effects of these flags varies depending
// on the particular instruction set. // on the particular instruction set.
// //
skipping to change at line 6476 skipping to change at line 8314
// Value is a signed delta from the current index. // Value is a signed delta from the current index.
#define DEBUG_EINDEX_FROM_CURRENT 0x00000002 #define DEBUG_EINDEX_FROM_CURRENT 0x00000002
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugControl3 #define INTERFACE IDebugControl3
DECLARE_INTERFACE_(IDebugControl3, IUnknown) DECLARE_INTERFACE_(IDebugControl3, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugControl. // IDebugControl.
// Checks for a user interrupt, such a Ctrl-C // Checks for a user interrupt, such a Ctrl-C
// or stop button. // or stop button.
// This method is reentrant. // This method is reentrant.
STDMETHOD(GetInterrupt)( STDMETHOD(GetInterrupt)(
THIS THIS
) PURE; ) PURE;
// Registers a user interrupt. // Registers a user interrupt.
// This method is reentrant. // This method is reentrant.
STDMETHOD(SetInterrupt)( STDMETHOD(SetInterrupt)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Interrupting a user-mode process requires // Interrupting a user-mode process requires
// access to some system resources that the // access to some system resources that the
// process may hold itself, preventing the // process may hold itself, preventing the
// interrupt from occurring. The engine // interrupt from occurring. The engine
// will time-out pending interrupt requests // will time-out pending interrupt requests
// and simulate an interrupt if necessary. // and simulate an interrupt if necessary.
// These methods control the interrupt timeout. // These methods control the interrupt timeout.
STDMETHOD(GetInterruptTimeout)( STDMETHOD(GetInterruptTimeout)(
THIS_ THIS_
__out PULONG Seconds _Out_ PULONG Seconds
) PURE; ) PURE;
STDMETHOD(SetInterruptTimeout)( STDMETHOD(SetInterruptTimeout)(
THIS_ THIS_
__in ULONG Seconds _In_ ULONG Seconds
) PURE; ) PURE;
STDMETHOD(GetLogFile)( STDMETHOD(GetLogFile)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG FileSize, _Out_opt_ PULONG FileSize,
__out PBOOL Append _Out_ PBOOL Append
) PURE; ) PURE;
// Opens a log file which collects all // Opens a log file which collects all
// output. Output from every client except // output. Output from every client except
// those that explicitly disable logging // those that explicitly disable logging
// goes into the log. // goes into the log.
// Opening a log file closes any log file // Opening a log file closes any log file
// already open. // already open.
STDMETHOD(OpenLogFile)( STDMETHOD(OpenLogFile)(
THIS_ THIS_
__in PCSTR File, _In_ PCSTR File,
__in BOOL Append _In_ BOOL Append
) PURE; ) PURE;
STDMETHOD(CloseLogFile)( STDMETHOD(CloseLogFile)(
THIS THIS
) PURE; ) PURE;
// Controls what output is logged. // Controls what output is logged.
STDMETHOD(GetLogMask)( STDMETHOD(GetLogMask)(
THIS_ THIS_
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
STDMETHOD(SetLogMask)( STDMETHOD(SetLogMask)(
THIS_ THIS_
__in ULONG Mask _In_ ULONG Mask
) PURE; ) PURE;
// Input requests input from all clients. // Input requests input from all clients.
// The first input that is returned is used // The first input that is returned is used
// to satisfy the call. Other returned // to satisfy the call. Other returned
// input is discarded. // input is discarded.
STDMETHOD(Input)( STDMETHOD(Input)(
THIS_ THIS_
__out_ecount(BufferSize) PSTR Buffer, _Out_writes_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG InputSize _Out_opt_ PULONG InputSize
) PURE; ) PURE;
// This method is used by clients to return // This method is used by clients to return
// input when it is available. It will // input when it is available. It will
// return S_OK if the input is used to // return S_OK if the input is used to
// satisfy an Input call and S_FALSE if // satisfy an Input call and S_FALSE if
// the input is ignored. // the input is ignored.
// This method is reentrant. // This method is reentrant.
STDMETHOD(ReturnInput)( STDMETHOD(ReturnInput)(
THIS_ THIS_
__in PCSTR Buffer _In_ PCSTR Buffer
) PURE; ) PURE;
// Sends output through clients // Sends output through clients
// output callbacks if the mask is allowed // output callbacks if the mask is allowed
// by the current output control mask and // by the current output control mask and
// according to the output distribution // according to the output distribution
// settings. // settings.
STDMETHODV(Output)( STDMETHODV(Output)(
THIS_ THIS_
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
... ...
) PURE; ) PURE;
STDMETHOD(OutputVaList)( STDMETHOD(OutputVaList)(
THIS_ THIS_
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
__in va_list Args _In_ va_list Args
) PURE; ) PURE;
// The following methods allow direct control // The following methods allow direct control
// over the distribution of the given output // over the distribution of the given output
// for situations where something other than // for situations where something other than
// the default is desired. These methods require // the default is desired. These methods require
// extra work in the engine so they should // extra work in the engine so they should
// only be used when necessary. // only be used when necessary.
STDMETHODV(ControlledOutput)( STDMETHODV(ControlledOutput)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
... ...
) PURE; ) PURE;
STDMETHOD(ControlledOutputVaList)( STDMETHOD(ControlledOutputVaList)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
__in va_list Args _In_ va_list Args
) PURE; ) PURE;
// Displays the standard command-line prompt // Displays the standard command-line prompt
// followed by the given output. If Format // followed by the given output. If Format
// is NULL no additional output is produced. // is NULL no additional output is produced.
// Output is produced under the // Output is produced under the
// DEBUG_OUTPUT_PROMPT mask. // DEBUG_OUTPUT_PROMPT mask.
// This method only outputs the prompt; it // This method only outputs the prompt; it
// does not get input. // does not get input.
STDMETHODV(OutputPrompt)( STDMETHODV(OutputPrompt)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in_opt PCSTR Format, _In_opt_ PCSTR Format,
... ...
) PURE; ) PURE;
STDMETHOD(OutputPromptVaList)( STDMETHOD(OutputPromptVaList)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in_opt PCSTR Format, _In_opt_ PCSTR Format,
__in va_list Args _In_ va_list Args
) PURE; ) PURE;
// Gets the text that would be displayed by OutputPrompt. // Gets the text that would be displayed by OutputPrompt.
STDMETHOD(GetPromptText)( STDMETHOD(GetPromptText)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG TextSize _Out_opt_ PULONG TextSize
) PURE; ) PURE;
// Outputs information about the current // Outputs information about the current
// debuggee state such as a register // debuggee state such as a register
// summary, disassembly at the current PC, // summary, disassembly at the current PC,
// closest symbol and others. // closest symbol and others.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputCurrentState)( STDMETHOD(OutputCurrentState)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Outputs the debugger and extension version // Outputs the debugger and extension version
// information. This method is reentrant. // information. This method is reentrant.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputVersionInformation)( STDMETHOD(OutputVersionInformation)(
THIS_ THIS_
__in ULONG OutputControl _In_ ULONG OutputControl
) PURE; ) PURE;
// In user-mode debugging sessions the // In user-mode debugging sessions the
// engine will set an event when // engine will set an event when
// exceptions are continued. This can // exceptions are continued. This can
// be used to synchronize other processes // be used to synchronize other processes
// with the debuggers handling of events. // with the debuggers handling of events.
// For example, this is used to support // For example, this is used to support
// the e argument to ntsd. // the e argument to ntsd.
STDMETHOD(GetNotifyEventHandle)( STDMETHOD(GetNotifyEventHandle)(
THIS_ THIS_
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
STDMETHOD(SetNotifyEventHandle)( STDMETHOD(SetNotifyEventHandle)(
THIS_ THIS_
__in ULONG64 Handle _In_ ULONG64 Handle
) PURE; ) PURE;
STDMETHOD(Assemble)( STDMETHOD(Assemble)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in PCSTR Instr, _In_ PCSTR Instr,
__out PULONG64 EndOffset _Out_ PULONG64 EndOffset
) PURE; ) PURE;
STDMETHOD(Disassemble)( STDMETHOD(Disassemble)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DisassemblySize, _Out_opt_ PULONG DisassemblySize,
__out PULONG64 EndOffset _Out_ PULONG64 EndOffset
) PURE; ) PURE;
// Returns the value of the effective address // Returns the value of the effective address
// computed for the last Disassemble, if there // computed for the last Disassemble, if there
// was one. // was one.
STDMETHOD(GetDisassembleEffectiveOffset)( STDMETHOD(GetDisassembleEffectiveOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Uses the line prefix if necessary. // Uses the line prefix if necessary.
STDMETHOD(OutputDisassembly)( STDMETHOD(OutputDisassembly)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG64 EndOffset _Out_ PULONG64 EndOffset
) PURE; ) PURE;
// Produces multiple lines of disassembly output. // Produces multiple lines of disassembly output.
// There will be PreviousLines of disassembly before // There will be PreviousLines of disassembly before
// the given offset if a valid disassembly exists. // the given offset if a valid disassembly exists.
// In all, there will be TotalLines of output produced. // In all, there will be TotalLines of output produced.
// The first and last line offsets are returned // The first and last line offsets are returned
// specially and all lines offsets can be retrieved // specially and all lines offsets can be retrieved
// through LineOffsets. LineOffsets will contain // through LineOffsets. LineOffsets will contain
// offsets for each line where disassembly started. // offsets for each line where disassembly started.
// When disassembly of a single instruction takes // When disassembly of a single instruction takes
// multiple lines the initial offset will be followed // multiple lines the initial offset will be followed
// by DEBUG_INVALID_OFFSET. // by DEBUG_INVALID_OFFSET.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputDisassemblyLines)( STDMETHOD(OutputDisassemblyLines)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG PreviousLines, _In_ ULONG PreviousLines,
__in ULONG TotalLines, _In_ ULONG TotalLines,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out_opt PULONG OffsetLine, _Out_opt_ PULONG OffsetLine,
__out_opt PULONG64 StartOffset, _Out_opt_ PULONG64 StartOffset,
__out_opt PULONG64 EndOffset, _Out_opt_ PULONG64 EndOffset,
__out_ecount_opt(TotalLines) PULONG64 LineOffsets _Out_writes_opt_(TotalLines) PULONG64 LineOffsets
) PURE; ) PURE;
// Returns the offset of the start of // Returns the offset of the start of
// the instruction thats the given // the instruction thats the given
// delta away from the instruction // delta away from the instruction
// at the initial offset. // at the initial offset.
// This routine does not check for // This routine does not check for
// validity of the instruction or // validity of the instruction or
// the memory containing it. // the memory containing it.
STDMETHOD(GetNearInstruction)( STDMETHOD(GetNearInstruction)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in LONG Delta, _In_ LONG Delta,
__out PULONG64 NearOffset _Out_ PULONG64 NearOffset
) PURE; ) PURE;
// Offsets can be passed in as zero to use the current // Offsets can be passed in as zero to use the current
// thread state. // thread state.
STDMETHOD(GetStackTrace)( STDMETHOD(GetStackTrace)(
THIS_ THIS_
__in ULONG64 FrameOffset, _In_ ULONG64 FrameOffset,
__in ULONG64 StackOffset, _In_ ULONG64 StackOffset,
__in ULONG64 InstructionOffset, _In_ ULONG64 InstructionOffset,
__out_ecount(FramesSize) PDEBUG_STACK_FRAME Frames, _Out_writes_(FramesSize) PDEBUG_STACK_FRAME Frames,
__in ULONG FramesSize, _In_ ULONG FramesSize,
__out_opt PULONG FramesFilled _Out_opt_ PULONG FramesFilled
) PURE; ) PURE;
// Does a simple stack trace to determine // Does a simple stack trace to determine
// what the current return address is. // what the current return address is.
STDMETHOD(GetReturnOffset)( STDMETHOD(GetReturnOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// If Frames is NULL OutputStackTrace will // If Frames is NULL OutputStackTrace will
// use GetStackTrace to get FramesSize frames // use GetStackTrace to get FramesSize frames
// and then output them. The current register // and then output them. The current register
// values for frame, stack and instruction offsets // values for frame, stack and instruction offsets
// are used. // are used.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputStackTrace)( STDMETHOD(OutputStackTrace)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in_ecount_opt(FramesSize) PDEBUG_STACK_FRAME Frames, _In_reads_opt_(FramesSize) PDEBUG_STACK_FRAME Frames,
__in ULONG FramesSize, _In_ ULONG FramesSize,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Returns information about the debuggee such // Returns information about the debuggee such
// as user vs. kernel, dump vs. live, etc. // as user vs. kernel, dump vs. live, etc.
STDMETHOD(GetDebuggeeType)( STDMETHOD(GetDebuggeeType)(
THIS_ THIS_
__out PULONG Class, _Out_ PULONG Class,
__out PULONG Qualifier _Out_ PULONG Qualifier
) PURE; ) PURE;
// Returns the type of physical processors in // Returns the type of physical processors in
// the machine. // the machine.
// Returns one of the IMAGE_FILE_MACHINE values. // Returns one of the IMAGE_FILE_MACHINE values.
STDMETHOD(GetActualProcessorType)( STDMETHOD(GetActualProcessorType)(
THIS_ THIS_
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
// Returns the type of processor used in the // Returns the type of processor used in the
// current processor context. // current processor context.
STDMETHOD(GetExecutingProcessorType)( STDMETHOD(GetExecutingProcessorType)(
THIS_ THIS_
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
// Query all the possible processor types that // Query all the possible processor types that
// may be encountered during this debug session. // may be encountered during this debug session.
STDMETHOD(GetNumberPossibleExecutingProcessorTypes)( STDMETHOD(GetNumberPossibleExecutingProcessorTypes)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetPossibleExecutingProcessorTypes)( STDMETHOD(GetPossibleExecutingProcessorTypes)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PULONG Types _Out_writes_(Count) PULONG Types
) PURE; ) PURE;
// Get the number of actual processors in // Get the number of actual processors in
// the machine. // the machine.
STDMETHOD(GetNumberProcessors)( STDMETHOD(GetNumberProcessors)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
// PlatformId is one of the VER_PLATFORM values. // PlatformId is one of the VER_PLATFORM values.
// Major and minor are as given in the NT // Major and minor are as given in the NT
// kernel debugger protocol. // kernel debugger protocol.
// ServicePackString and ServicePackNumber indicate the // ServicePackString and ServicePackNumber indicate the
// system service pack level. ServicePackNumber is not // system service pack level. ServicePackNumber is not
// available in some sessions where the service pack level // available in some sessions where the service pack level
// is only expressed as a string. The service pack information // is only expressed as a string. The service pack information
// will be empty if the system does not have a service pack // will be empty if the system does not have a service pack
// applied. // applied.
// The build string is string information identifying the // The build string is string information identifying the
// particular build of the system. The build string is // particular build of the system. The build string is
// empty if the system has no particular identifying // empty if the system has no particular identifying
// information. // information.
STDMETHOD(GetSystemVersion)( STDMETHOD(GetSystemVersion)(
THIS_ THIS_
__out PULONG PlatformId, _Out_ PULONG PlatformId,
__out PULONG Major, _Out_ PULONG Major,
__out PULONG Minor, _Out_ PULONG Minor,
__out_ecount_opt(ServicePackStringSize) PSTR ServicePackString, _Out_writes_opt_(ServicePackStringSize) PSTR ServicePackString,
__in ULONG ServicePackStringSize, _In_ ULONG ServicePackStringSize,
__out_opt PULONG ServicePackStringUsed, _Out_opt_ PULONG ServicePackStringUsed,
__out PULONG ServicePackNumber, _Out_ PULONG ServicePackNumber,
__out_ecount_opt(BuildStringSize) PSTR BuildString, _Out_writes_opt_(BuildStringSize) PSTR BuildString,
__in ULONG BuildStringSize, _In_ ULONG BuildStringSize,
__out_opt PULONG BuildStringUsed _Out_opt_ PULONG BuildStringUsed
) PURE; ) PURE;
// Returns the page size for the currently executing // Returns the page size for the currently executing
// processor context. The page size may vary between // processor context. The page size may vary between
// processor types. // processor types.
STDMETHOD(GetPageSize)( STDMETHOD(GetPageSize)(
THIS_ THIS_
__out PULONG Size _Out_ PULONG Size
) PURE; ) PURE;
// Returns S_OK if the current processor context uses // Returns S_OK if the current processor context uses
// 64-bit addresses, otherwise S_FALSE. // 64-bit addresses, otherwise S_FALSE.
STDMETHOD(IsPointer64Bit)( STDMETHOD(IsPointer64Bit)(
THIS THIS
) PURE; ) PURE;
// Reads the bugcheck data area and returns the // Reads the bugcheck data area and returns the
// current contents. This method only works // current contents. This method only works
// in kernel debugging sessions. // in kernel debugging sessions.
STDMETHOD(ReadBugCheckData)( STDMETHOD(ReadBugCheckData)(
THIS_ THIS_
__out PULONG Code, _Out_ PULONG Code,
__out PULONG64 Arg1, _Out_ PULONG64 Arg1,
__out PULONG64 Arg2, _Out_ PULONG64 Arg2,
__out PULONG64 Arg3, _Out_ PULONG64 Arg3,
__out PULONG64 Arg4 _Out_ PULONG64 Arg4
) PURE; ) PURE;
// Query all the processor types supported by // Query all the processor types supported by
// the engine. This is a complete list and is // the engine. This is a complete list and is
// not related to the machine running the engine // not related to the machine running the engine
// or the debuggee. // or the debuggee.
STDMETHOD(GetNumberSupportedProcessorTypes)( STDMETHOD(GetNumberSupportedProcessorTypes)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetSupportedProcessorTypes)( STDMETHOD(GetSupportedProcessorTypes)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PULONG Types _Out_writes_(Count) PULONG Types
) PURE; ) PURE;
// Returns a full, descriptive name and an // Returns a full, descriptive name and an
// abbreviated name for a processor type. // abbreviated name for a processor type.
STDMETHOD(GetProcessorTypeNames)( STDMETHOD(GetProcessorTypeNames)(
THIS_ THIS_
__in ULONG Type, _In_ ULONG Type,
__out_ecount_opt(FullNameBufferSize) PSTR FullNameBuffer, _Out_writes_opt_(FullNameBufferSize) PSTR FullNameBuffer,
__in ULONG FullNameBufferSize, _In_ ULONG FullNameBufferSize,
__out_opt PULONG FullNameSize, _Out_opt_ PULONG FullNameSize,
__out_ecount_opt(AbbrevNameBufferSize) PSTR AbbrevNameBuffer, _Out_writes_opt_(AbbrevNameBufferSize) PSTR AbbrevNameBuffer,
__in ULONG AbbrevNameBufferSize, _In_ ULONG AbbrevNameBufferSize,
__out_opt PULONG AbbrevNameSize _Out_opt_ PULONG AbbrevNameSize
) PURE; ) PURE;
// Gets and sets the type of processor to // Gets and sets the type of processor to
// use when doing things like setting // use when doing things like setting
// breakpoints, accessing registers, // breakpoints, accessing registers,
// getting stack traces and so on. // getting stack traces and so on.
STDMETHOD(GetEffectiveProcessorType)( STDMETHOD(GetEffectiveProcessorType)(
THIS_ THIS_
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
STDMETHOD(SetEffectiveProcessorType)( STDMETHOD(SetEffectiveProcessorType)(
THIS_ THIS_
__in ULONG Type _In_ ULONG Type
) PURE; ) PURE;
// Returns information about whether and how // Returns information about whether and how
// the debuggee is running. Status will // the debuggee is running. Status will
// be GO if the debuggee is running and // be GO if the debuggee is running and
// BREAK if it isnt. // BREAK if it isnt.
// If no debuggee exists the status is // If no debuggee exists the status is
// NO_DEBUGGEE. // NO_DEBUGGEE.
// This method is reentrant. // This method is reentrant.
STDMETHOD(GetExecutionStatus)( STDMETHOD(GetExecutionStatus)(
THIS_ THIS_
__out PULONG Status _Out_ PULONG Status
) PURE; ) PURE;
// Changes the execution status of the // Changes the execution status of the
// engine from stopped to running. // engine from stopped to running.
// Status must be one of the go or step // Status must be one of the go or step
// status values. // status values.
STDMETHOD(SetExecutionStatus)( STDMETHOD(SetExecutionStatus)(
THIS_ THIS_
__in ULONG Status _In_ ULONG Status
) PURE; ) PURE;
// Controls what code interpretation level the debugger // Controls what code interpretation level the debugger
// runs at. The debugger checks the code level when // runs at. The debugger checks the code level when
// deciding whether to step by a source line or // deciding whether to step by a source line or
// assembly instruction along with other related operations. // assembly instruction along with other related operations.
STDMETHOD(GetCodeLevel)( STDMETHOD(GetCodeLevel)(
THIS_ THIS_
__out PULONG Level _Out_ PULONG Level
) PURE; ) PURE;
STDMETHOD(SetCodeLevel)( STDMETHOD(SetCodeLevel)(
THIS_ THIS_
__in ULONG Level _In_ ULONG Level
) PURE; ) PURE;
// Gets and sets engine control flags. // Gets and sets engine control flags.
// These methods are reentrant. // These methods are reentrant.
STDMETHOD(GetEngineOptions)( STDMETHOD(GetEngineOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddEngineOptions)( STDMETHOD(AddEngineOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveEngineOptions)( STDMETHOD(RemoveEngineOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetEngineOptions)( STDMETHOD(SetEngineOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
// Gets and sets control values for // Gets and sets control values for
// handling system error events. // handling system error events.
// If the system error level is less // If the system error level is less
// than or equal to the given levels // than or equal to the given levels
// the error may be displayed and // the error may be displayed and
// the default break for the event // the default break for the event
// may be set. // may be set.
STDMETHOD(GetSystemErrorControl)( STDMETHOD(GetSystemErrorControl)(
THIS_ THIS_
__out PULONG OutputLevel, _Out_ PULONG OutputLevel,
__out PULONG BreakLevel _Out_ PULONG BreakLevel
) PURE; ) PURE;
STDMETHOD(SetSystemErrorControl)( STDMETHOD(SetSystemErrorControl)(
THIS_ THIS_
__in ULONG OutputLevel, _In_ ULONG OutputLevel,
__in ULONG BreakLevel _In_ ULONG BreakLevel
) PURE; ) PURE;
// The command processor supports simple // The command processor supports simple
// string replacement macros in Evaluate and // string replacement macros in Evaluate and
// Execute. There are currently ten macro // Execute. There are currently ten macro
// slots available. Slots 0-9 map to // slots available. Slots 0-9 map to
// the command invocations $u0-$u9. // the command invocations $u0-$u9.
STDMETHOD(GetTextMacro)( STDMETHOD(GetTextMacro)(
THIS_ THIS_
__in ULONG Slot, _In_ ULONG Slot,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG MacroSize _Out_opt_ PULONG MacroSize
) PURE; ) PURE;
STDMETHOD(SetTextMacro)( STDMETHOD(SetTextMacro)(
THIS_ THIS_
__in ULONG Slot, _In_ ULONG Slot,
__in PCSTR Macro _In_ PCSTR Macro
) PURE; ) PURE;
// Controls the default number radix used // Controls the default number radix used
// in expressions and commands. // in expressions and commands.
STDMETHOD(GetRadix)( STDMETHOD(GetRadix)(
THIS_ THIS_
__out PULONG Radix _Out_ PULONG Radix
) PURE; ) PURE;
STDMETHOD(SetRadix)( STDMETHOD(SetRadix)(
THIS_ THIS_
__in ULONG Radix _In_ ULONG Radix
) PURE; ) PURE;
// Evaluates the given expression string and // Evaluates the given expression string and
// returns the resulting value. // returns the resulting value.
// If DesiredType is DEBUG_VALUE_INVALID then // If DesiredType is DEBUG_VALUE_INVALID then
// the natural type is used. // the natural type is used.
// RemainderIndex, if provided, is set to the index // RemainderIndex, if provided, is set to the index
// of the first character in the input string that was // of the first character in the input string that was
// not used when evaluating the expression. // not used when evaluating the expression.
STDMETHOD(Evaluate)( STDMETHOD(Evaluate)(
THIS_ THIS_
__in PCSTR Expression, _In_ PCSTR Expression,
__in ULONG DesiredType, _In_ ULONG DesiredType,
__out PDEBUG_VALUE Value, _Out_ PDEBUG_VALUE Value,
__out_opt PULONG RemainderIndex _Out_opt_ PULONG RemainderIndex
) PURE; ) PURE;
// Attempts to convert the input value to a value // Attempts to convert the input value to a value
// of the requested type in the output value. // of the requested type in the output value.
// Conversions can fail if no conversion exists. // Conversions can fail if no conversion exists.
// Successful conversions may be lossy. // Successful conversions may be lossy.
STDMETHOD(CoerceValue)( STDMETHOD(CoerceValue)(
THIS_ THIS_
__in PDEBUG_VALUE In, _In_ PDEBUG_VALUE In,
__in ULONG OutType, _In_ ULONG OutType,
__out PDEBUG_VALUE Out _Out_ PDEBUG_VALUE Out
) PURE; ) PURE;
STDMETHOD(CoerceValues)( STDMETHOD(CoerceValues)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount(Count) PDEBUG_VALUE In, _In_reads_(Count) PDEBUG_VALUE In,
__in_ecount(Count) PULONG OutTypes, _In_reads_(Count) PULONG OutTypes,
__out_ecount(Count) PDEBUG_VALUE Out _Out_writes_(Count) PDEBUG_VALUE Out
) PURE; ) PURE;
// Executes the given command string. // Executes the given command string.
// If the string has multiple commands // If the string has multiple commands
// Execute will not return until all // Execute will not return until all
// of them have been executed. If this // of them have been executed. If this
// requires waiting for the debuggee to // requires waiting for the debuggee to
// execute an internal wait will be done // execute an internal wait will be done
// so Execute can take an arbitrary amount // so Execute can take an arbitrary amount
// of time. // of time.
STDMETHOD(Execute)( STDMETHOD(Execute)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCSTR Command, _In_ PCSTR Command,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Executes the given command file by // Executes the given command file by
// reading a line at a time and processing // reading a line at a time and processing
// it with Execute. // it with Execute.
STDMETHOD(ExecuteCommandFile)( STDMETHOD(ExecuteCommandFile)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCSTR CommandFile, _In_ PCSTR CommandFile,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Breakpoint interfaces are described // Breakpoint interfaces are described
// elsewhere in this section. // elsewhere in this section.
STDMETHOD(GetNumberBreakpoints)( STDMETHOD(GetNumberBreakpoints)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
// It is possible for this retrieval function to // It is possible for this retrieval function to
// fail even with an index within the number of // fail even with an index within the number of
// existing breakpoints if the breakpoint is // existing breakpoints if the breakpoint is
// a private breakpoint. // a private breakpoint.
STDMETHOD(GetBreakpointByIndex)( STDMETHOD(GetBreakpointByIndex)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out PDEBUG_BREAKPOINT* Bp _Out_ PDEBUG_BREAKPOINT* Bp
) PURE; ) PURE;
STDMETHOD(GetBreakpointById)( STDMETHOD(GetBreakpointById)(
THIS_ THIS_
__in ULONG Id, _In_ ULONG Id,
__out PDEBUG_BREAKPOINT* Bp _Out_ PDEBUG_BREAKPOINT* Bp
) PURE; ) PURE;
// If Ids is non-NULL the Count breakpoints // If Ids is non-NULL the Count breakpoints
// referred to in the Ids array are returned, // referred to in the Ids array are returned,
// otherwise breakpoints from index Start to // otherwise breakpoints from index Start to
// Start + Count 1 are returned. // Start + Count 1 are returned.
STDMETHOD(GetBreakpointParameters)( STDMETHOD(GetBreakpointParameters)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Ids, _In_reads_opt_(Count) PULONG Ids,
__in ULONG Start, _In_ ULONG Start,
__out_ecount(Count) PDEBUG_BREAKPOINT_PARAMETERS Params _Out_writes_(Count) PDEBUG_BREAKPOINT_PARAMETERS Params
) PURE; ) PURE;
// Breakpoints are created empty and disabled. // Breakpoints are created empty and disabled.
// When their parameters have been set they // When their parameters have been set they
// should be enabled by setting the ENABLE flag. // should be enabled by setting the ENABLE flag.
// If DesiredId is DEBUG_ANY_ID then the // If DesiredId is DEBUG_ANY_ID then the
// engine picks an unused ID. If DesiredId // engine picks an unused ID. If DesiredId
// is any other number the engine attempts // is any other number the engine attempts
// to use the given ID for the breakpoint. // to use the given ID for the breakpoint.
// If another breakpoint exists with that ID // If another breakpoint exists with that ID
// the call will fail. // the call will fail.
STDMETHOD(AddBreakpoint)( STDMETHOD(AddBreakpoint)(
THIS_ THIS_
__in ULONG Type, _In_ ULONG Type,
__in ULONG DesiredId, _In_ ULONG DesiredId,
__out PDEBUG_BREAKPOINT* Bp _Out_ PDEBUG_BREAKPOINT* Bp
) PURE; ) PURE;
// Breakpoint interface is invalid after this call. // Breakpoint interface is invalid after this call.
STDMETHOD(RemoveBreakpoint)( STDMETHOD(RemoveBreakpoint)(
THIS_ THIS_
__in PDEBUG_BREAKPOINT Bp _In_ PDEBUG_BREAKPOINT Bp
) PURE; ) PURE;
// Control and use extension DLLs. // Control and use extension DLLs.
STDMETHOD(AddExtension)( STDMETHOD(AddExtension)(
THIS_ THIS_
__in PCSTR Path, _In_ PCSTR Path,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
STDMETHOD(RemoveExtension)( STDMETHOD(RemoveExtension)(
THIS_ THIS_
__in ULONG64 Handle _In_ ULONG64 Handle
) PURE; ) PURE;
STDMETHOD(GetExtensionByPath)( STDMETHOD(GetExtensionByPath)(
THIS_ THIS_
__in PCSTR Path, _In_ PCSTR Path,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
// If Handle is zero the extension // If Handle is zero the extension
// chain is walked searching for the // chain is walked searching for the
// function. // function.
STDMETHOD(CallExtension)( STDMETHOD(CallExtension)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in PCSTR Function, _In_ PCSTR Function,
__in_opt PCSTR Arguments _In_opt_ PCSTR Arguments
) PURE; ) PURE;
// GetExtensionFunction works like // GetExtensionFunction works like
// GetProcAddress on extension DLLs // GetProcAddress on extension DLLs
// to allow raw function-call-level // to allow raw function-call-level
// interaction with extension DLLs. // interaction with extension DLLs.
// Such functions do not need to // Such functions do not need to
// follow the standard extension prototype // follow the standard extension prototype
// if they are not going to be called // if they are not going to be called
// through the text extension interface. // through the text extension interface.
// This function cannot be called remotely. // This function cannot be called remotely.
STDMETHOD(GetExtensionFunction)( STDMETHOD(GetExtensionFunction)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in PCSTR FuncName, _In_ PCSTR FuncName,
__out FARPROC* Function _Out_ FARPROC* Function
) PURE; ) PURE;
// These methods return alternate // These methods return alternate
// extension interfaces in order to allow // extension interfaces in order to allow
// interface-style extension DLLs to mix in // interface-style extension DLLs to mix in
// older extension calls. // older extension calls.
// Structure sizes must be initialized before // Structure sizes must be initialized before
// the call. // the call.
// These methods cannot be called remotely. // These methods cannot be called remotely.
STDMETHOD(GetWindbgExtensionApis32)( STDMETHOD(GetWindbgExtensionApis32)(
THIS_ THIS_
__inout PWINDBG_EXTENSION_APIS32 Api _Inout_ PWINDBG_EXTENSION_APIS32 Api
) PURE; ) PURE;
STDMETHOD(GetWindbgExtensionApis64)( STDMETHOD(GetWindbgExtensionApis64)(
THIS_ THIS_
__inout PWINDBG_EXTENSION_APIS64 Api _Inout_ PWINDBG_EXTENSION_APIS64 Api
) PURE; ) PURE;
// The engine provides a simple mechanism // The engine provides a simple mechanism
// to filter common events. Arbitrarily complicated // to filter common events. Arbitrarily complicated
// filtering can be done by registering event callbacks // filtering can be done by registering event callbacks
// but simple event filtering only requires // but simple event filtering only requires
// setting the options of one of the predefined // setting the options of one of the predefined
// event filters. // event filters.
// Simple event filters are either for specific // Simple event filters are either for specific
// events and therefore have an enumerant or // events and therefore have an enumerant or
skipping to change at line 7180 skipping to change at line 9018
// All three groups of filters are indexed together // All three groups of filters are indexed together
// with the specific filters first, then the specific // with the specific filters first, then the specific
// exception filters and finally the arbitrary // exception filters and finally the arbitrary
// exception filters. // exception filters.
// The first specific exception is the default // The first specific exception is the default
// exception. If an exception event occurs for // exception. If an exception event occurs for
// an exception without settings the default // an exception without settings the default
// exception settings are used. // exception settings are used.
STDMETHOD(GetNumberEventFilters)( STDMETHOD(GetNumberEventFilters)(
THIS_ THIS_
__out PULONG SpecificEvents, _Out_ PULONG SpecificEvents,
__out PULONG SpecificExceptions, _Out_ PULONG SpecificExceptions,
__out PULONG ArbitraryExceptions _Out_ PULONG ArbitraryExceptions
) PURE; ) PURE;
// Some filters have descriptive text associated with them. // Some filters have descriptive text associated with them.
STDMETHOD(GetEventFilterText)( STDMETHOD(GetEventFilterText)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG TextSize _Out_opt_ PULONG TextSize
) PURE; ) PURE;
// All filters support executing a command when the // All filters support executing a command when the
// event occurs. // event occurs.
STDMETHOD(GetEventFilterCommand)( STDMETHOD(GetEventFilterCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG CommandSize _Out_opt_ PULONG CommandSize
) PURE; ) PURE;
STDMETHOD(SetEventFilterCommand)( STDMETHOD(SetEventFilterCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Command _In_ PCSTR Command
) PURE; ) PURE;
STDMETHOD(GetSpecificFilterParameters)( STDMETHOD(GetSpecificFilterParameters)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params _Out_writes_(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
) PURE; ) PURE;
STDMETHOD(SetSpecificFilterParameters)( STDMETHOD(SetSpecificFilterParameters)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__in_ecount(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params _In_reads_(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
) PURE; ) PURE;
// Some specific filters have arguments to further // Some specific filters have arguments to further
// qualify their operation. // qualify their operation.
STDMETHOD(GetSpecificFilterArgument)( STDMETHOD(GetSpecificFilterArgument)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ArgumentSize _Out_opt_ PULONG ArgumentSize
) PURE; ) PURE;
STDMETHOD(SetSpecificFilterArgument)( STDMETHOD(SetSpecificFilterArgument)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Argument _In_ PCSTR Argument
) PURE; ) PURE;
// If Codes is non-NULL Start is ignored. // If Codes is non-NULL Start is ignored.
STDMETHOD(GetExceptionFilterParameters)( STDMETHOD(GetExceptionFilterParameters)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Codes, _In_reads_opt_(Count) PULONG Codes,
__in ULONG Start, _In_ ULONG Start,
__out_ecount(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params _Out_writes_(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
) PURE; ) PURE;
// The codes in the parameter data control the application // The codes in the parameter data control the application
// of the parameter data. If a code is not already in // of the parameter data. If a code is not already in
// the set of filters it is added. If the ExecutionOption // the set of filters it is added. If the ExecutionOption
// for a code is REMOVE then the filter is removed. // for a code is REMOVE then the filter is removed.
// Specific exception filters cannot be removed. // Specific exception filters cannot be removed.
STDMETHOD(SetExceptionFilterParameters)( STDMETHOD(SetExceptionFilterParameters)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params _In_reads_(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
) PURE; ) PURE;
// Exception filters support an additional command for // Exception filters support an additional command for
// second-chance events. // second-chance events.
STDMETHOD(GetExceptionFilterSecondCommand)( STDMETHOD(GetExceptionFilterSecondCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG CommandSize _Out_opt_ PULONG CommandSize
) PURE; ) PURE;
STDMETHOD(SetExceptionFilterSecondCommand)( STDMETHOD(SetExceptionFilterSecondCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Command _In_ PCSTR Command
) PURE; ) PURE;
// Yields processing to the engine until // Yields processing to the engine until
// an event occurs. This method may // an event occurs. This method may
// only be called by the thread that started // only be called by the thread that started
// the debug session. // the debug session.
// When an event occurs the engine carries // When an event occurs the engine carries
// out all event processing such as calling // out all event processing such as calling
// callbacks. // callbacks.
// If the callbacks indicate that execution should // If the callbacks indicate that execution should
// break the wait will return, otherwise it // break the wait will return, otherwise it
// goes back to waiting for a new event. // goes back to waiting for a new event.
// If the timeout expires, S_FALSE is returned. // If the timeout expires, S_FALSE is returned.
// The timeout is not currently supported for // The timeout is not currently supported for
// kernel debugging. // kernel debugging.
STDMETHOD(WaitForEvent)( STDMETHOD(WaitForEvent)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG Timeout _In_ ULONG Timeout
) PURE; ) PURE;
// Retrieves information about the last event that occurred. // Retrieves information about the last event that occurred.
// EventType is one of the event callback mask bits. // EventType is one of the event callback mask bits.
// ExtraInformation contains additional event-specific // ExtraInformation contains additional event-specific
// information. Not all events have additional information. // information. Not all events have additional information.
STDMETHOD(GetLastEventInformation)( STDMETHOD(GetLastEventInformation)(
THIS_ THIS_
__out PULONG Type, _Out_ PULONG Type,
__out PULONG ProcessId, _Out_ PULONG ProcessId,
__out PULONG ThreadId, _Out_ PULONG ThreadId,
__out_bcount_opt(ExtraInformationSize) PVOID ExtraInformation, _Out_writes_bytes_opt_(ExtraInformationSize) PVOID ExtraInformation,
__in ULONG ExtraInformationSize, _In_ ULONG ExtraInformationSize,
__out_opt PULONG ExtraInformationUsed, _Out_opt_ PULONG ExtraInformationUsed,
__out_ecount_opt(DescriptionSize) PSTR Description, _Out_writes_opt_(DescriptionSize) PSTR Description,
__in ULONG DescriptionSize, _In_ ULONG DescriptionSize,
__out_opt PULONG DescriptionUsed _Out_opt_ PULONG DescriptionUsed
) PURE; ) PURE;
// IDebugControl2. // IDebugControl2.
STDMETHOD(GetCurrentTimeDate)( STDMETHOD(GetCurrentTimeDate)(
THIS_ THIS_
__out PULONG TimeDate _Out_ PULONG TimeDate
) PURE; ) PURE;
// Retrieves the number of seconds since the // Retrieves the number of seconds since the
// machine started running. // machine started running.
STDMETHOD(GetCurrentSystemUpTime)( STDMETHOD(GetCurrentSystemUpTime)(
THIS_ THIS_
__out PULONG UpTime _Out_ PULONG UpTime
) PURE; ) PURE;
// If the current session is a dump session, // If the current session is a dump session,
// retrieves any extended format information. // retrieves any extended format information.
STDMETHOD(GetDumpFormatFlags)( STDMETHOD(GetDumpFormatFlags)(
THIS_ THIS_
__out PULONG FormatFlags _Out_ PULONG FormatFlags
) PURE; ) PURE;
// The debugger has been enhanced to allow // The debugger has been enhanced to allow
// arbitrary text replacements in addition // arbitrary text replacements in addition
// to the simple $u0-$u9 text macros. // to the simple $u0-$u9 text macros.
// Text replacement takes a given source // Text replacement takes a given source
// text in commands and converts it to the // text in commands and converts it to the
// given destination text. Replacements // given destination text. Replacements
// are named by their source text so that // are named by their source text so that
// only one replacement for a source text // only one replacement for a source text
// string can exist. // string can exist.
STDMETHOD(GetNumberTextReplacements)( STDMETHOD(GetNumberTextReplacements)(
THIS_ THIS_
__out PULONG NumRepl _Out_ PULONG NumRepl
) PURE; ) PURE;
// If SrcText is non-NULL the replacement // If SrcText is non-NULL the replacement
// is looked up by source text, otherwise // is looked up by source text, otherwise
// Index is used to get the Nth replacement. // Index is used to get the Nth replacement.
STDMETHOD(GetTextReplacement)( STDMETHOD(GetTextReplacement)(
THIS_ THIS_
__in_opt PCSTR SrcText, _In_opt_ PCSTR SrcText,
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(SrcBufferSize) PSTR SrcBuffer, _Out_writes_opt_(SrcBufferSize) PSTR SrcBuffer,
__in ULONG SrcBufferSize, _In_ ULONG SrcBufferSize,
__out_opt PULONG SrcSize, _Out_opt_ PULONG SrcSize,
__out_ecount_opt(DstBufferSize) PSTR DstBuffer, _Out_writes_opt_(DstBufferSize) PSTR DstBuffer,
__in ULONG DstBufferSize, _In_ ULONG DstBufferSize,
__out_opt PULONG DstSize _Out_opt_ PULONG DstSize
) PURE; ) PURE;
// Setting the destination text to // Setting the destination text to
// NULL removes the alias. // NULL removes the alias.
STDMETHOD(SetTextReplacement)( STDMETHOD(SetTextReplacement)(
THIS_ THIS_
__in PCSTR SrcText, _In_ PCSTR SrcText,
__in_opt PCSTR DstText _In_opt_ PCSTR DstText
) PURE; ) PURE;
STDMETHOD(RemoveTextReplacements)( STDMETHOD(RemoveTextReplacements)(
THIS THIS
) PURE; ) PURE;
// Outputs the complete list of current // Outputs the complete list of current
// replacements. // replacements.
STDMETHOD(OutputTextReplacements)( STDMETHOD(OutputTextReplacements)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// IDebugControl3. // IDebugControl3.
// Control options for assembly and disassembly. // Control options for assembly and disassembly.
STDMETHOD(GetAssemblyOptions)( STDMETHOD(GetAssemblyOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddAssemblyOptions)( STDMETHOD(AddAssemblyOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveAssemblyOptions)( STDMETHOD(RemoveAssemblyOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetAssemblyOptions)( STDMETHOD(SetAssemblyOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
// Control the expression syntax. // Control the expression syntax.
STDMETHOD(GetExpressionSyntax)( STDMETHOD(GetExpressionSyntax)(
THIS_ THIS_
__out PULONG Flags _Out_ PULONG Flags
) PURE; ) PURE;
STDMETHOD(SetExpressionSyntax)( STDMETHOD(SetExpressionSyntax)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Look up a syntax by its abbreviated // Look up a syntax by its abbreviated
// name and set it. // name and set it.
STDMETHOD(SetExpressionSyntaxByName)( STDMETHOD(SetExpressionSyntaxByName)(
THIS_ THIS_
__in PCSTR AbbrevName _In_ PCSTR AbbrevName
) PURE; ) PURE;
STDMETHOD(GetNumberExpressionSyntaxes)( STDMETHOD(GetNumberExpressionSyntaxes)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetExpressionSyntaxNames)( STDMETHOD(GetExpressionSyntaxNames)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(FullNameBufferSize) PSTR FullNameBuffer, _Out_writes_opt_(FullNameBufferSize) PSTR FullNameBuffer,
__in ULONG FullNameBufferSize, _In_ ULONG FullNameBufferSize,
__out_opt PULONG FullNameSize, _Out_opt_ PULONG FullNameSize,
__out_ecount_opt(AbbrevNameBufferSize) PSTR AbbrevNameBuffer, _Out_writes_opt_(AbbrevNameBufferSize) PSTR AbbrevNameBuffer,
__in ULONG AbbrevNameBufferSize, _In_ ULONG AbbrevNameBufferSize,
__out_opt PULONG AbbrevNameSize _Out_opt_ PULONG AbbrevNameSize
) PURE; ) PURE;
// //
// Some debug sessions have only a single // Some debug sessions have only a single
// possible event, such as a snapshot dump // possible event, such as a snapshot dump
// file; some have dynamic events, such as // file; some have dynamic events, such as
// a live debug session; and others may have // a live debug session; and others may have
// multiple events, such as a dump file that // multiple events, such as a dump file that
// contains snapshots from different points // contains snapshots from different points
// in time. The following methods allow // in time. The following methods allow
skipping to change at line 7444 skipping to change at line 9282
// which WaitForEvent must be used to process // which WaitForEvent must be used to process
// the selected event. // the selected event.
// //
// GetNumberEvents returns S_OK if this is the // GetNumberEvents returns S_OK if this is the
// complete set of events possible, such as for // complete set of events possible, such as for
// a static session; or S_FALSE if other events // a static session; or S_FALSE if other events
// may be possible, such as for a dynamic session. // may be possible, such as for a dynamic session.
STDMETHOD(GetNumberEvents)( STDMETHOD(GetNumberEvents)(
THIS_ THIS_
__out PULONG Events _Out_ PULONG Events
) PURE; ) PURE;
// Sessions may have descriptive information for // Sessions may have descriptive information for
// the various events available. The amount of // the various events available. The amount of
// information varies according to the specific // information varies according to the specific
// session and data. // session and data.
STDMETHOD(GetEventIndexDescription)( STDMETHOD(GetEventIndexDescription)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in ULONG Which, _In_ ULONG Which,
__in_opt PSTR Buffer, _In_opt_ PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DescSize _Out_opt_ PULONG DescSize
) PURE; ) PURE;
STDMETHOD(GetCurrentEventIndex)( STDMETHOD(GetCurrentEventIndex)(
THIS_ THIS_
__out PULONG Index _Out_ PULONG Index
) PURE; ) PURE;
// SetNextEventIndex works like seek in that // SetNextEventIndex works like seek in that
// it can set an absolute or relative index. // it can set an absolute or relative index.
// SetNextEventIndex works similarly to SetExecutionStatus // SetNextEventIndex works similarly to SetExecutionStatus
// by putting the session into a running state, after // by putting the session into a running state, after
// which the caller must call WaitForEvent. The // which the caller must call WaitForEvent. The
// current event index only changes when WaitForEvent // current event index only changes when WaitForEvent
// is called. // is called.
STDMETHOD(SetNextEventIndex)( STDMETHOD(SetNextEventIndex)(
THIS_ THIS_
__in ULONG Relation, _In_ ULONG Relation,
__in ULONG Value, _In_ ULONG Value,
__out PULONG NextIndex _Out_ PULONG NextIndex
) PURE; ) PURE;
}; };
// //
// Log file flags. // Log file flags.
// //
#define DEBUG_LOG_DEFAULT 0x00000000 #define DEBUG_LOG_DEFAULT 0x00000000
#define DEBUG_LOG_APPEND 0x00000001 #define DEBUG_LOG_APPEND 0x00000001
#define DEBUG_LOG_UNICODE 0x00000002 #define DEBUG_LOG_UNICODE 0x00000002
skipping to change at line 7522 skipping to change at line 9360
// Force managed support DLL load attempt. // Force managed support DLL load attempt.
#define DEBUG_MANRESET_LOAD_DLL 0x00000001 #define DEBUG_MANRESET_LOAD_DLL 0x00000001
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugControl4 #define INTERFACE IDebugControl4
DECLARE_INTERFACE_(IDebugControl4, IUnknown) DECLARE_INTERFACE_(IDebugControl4, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugControl. // IDebugControl.
// Checks for a user interrupt, such a Ctrl-C // Checks for a user interrupt, such a Ctrl-C
// or stop button. // or stop button.
// This method is reentrant. // This method is reentrant.
STDMETHOD(GetInterrupt)( STDMETHOD(GetInterrupt)(
THIS THIS
) PURE; ) PURE;
// Registers a user interrupt. // Registers a user interrupt.
// This method is reentrant. // This method is reentrant.
STDMETHOD(SetInterrupt)( STDMETHOD(SetInterrupt)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Interrupting a user-mode process requires // Interrupting a user-mode process requires
// access to some system resources that the // access to some system resources that the
// process may hold itself, preventing the // process may hold itself, preventing the
// interrupt from occurring. The engine // interrupt from occurring. The engine
// will time-out pending interrupt requests // will time-out pending interrupt requests
// and simulate an interrupt if necessary. // and simulate an interrupt if necessary.
// These methods control the interrupt timeout. // These methods control the interrupt timeout.
STDMETHOD(GetInterruptTimeout)( STDMETHOD(GetInterruptTimeout)(
THIS_ THIS_
__out PULONG Seconds _Out_ PULONG Seconds
) PURE; ) PURE;
STDMETHOD(SetInterruptTimeout)( STDMETHOD(SetInterruptTimeout)(
THIS_ THIS_
__in ULONG Seconds _In_ ULONG Seconds
) PURE; ) PURE;
STDMETHOD(GetLogFile)( STDMETHOD(GetLogFile)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG FileSize, _Out_opt_ PULONG FileSize,
__out PBOOL Append _Out_ PBOOL Append
) PURE; ) PURE;
// Opens a log file which collects all // Opens a log file which collects all
// output. Output from every client except // output. Output from every client except
// those that explicitly disable logging // those that explicitly disable logging
// goes into the log. // goes into the log.
// Opening a log file closes any log file // Opening a log file closes any log file
// already open. // already open.
STDMETHOD(OpenLogFile)( STDMETHOD(OpenLogFile)(
THIS_ THIS_
__in PCSTR File, _In_ PCSTR File,
__in BOOL Append _In_ BOOL Append
) PURE; ) PURE;
STDMETHOD(CloseLogFile)( STDMETHOD(CloseLogFile)(
THIS THIS
) PURE; ) PURE;
// Controls what output is logged. // Controls what output is logged.
STDMETHOD(GetLogMask)( STDMETHOD(GetLogMask)(
THIS_ THIS_
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
STDMETHOD(SetLogMask)( STDMETHOD(SetLogMask)(
THIS_ THIS_
__in ULONG Mask _In_ ULONG Mask
) PURE; ) PURE;
// Input requests input from all clients. // Input requests input from all clients.
// The first input that is returned is used // The first input that is returned is used
// to satisfy the call. Other returned // to satisfy the call. Other returned
// input is discarded. // input is discarded.
STDMETHOD(Input)( STDMETHOD(Input)(
THIS_ THIS_
__out_ecount(BufferSize) PSTR Buffer, _Out_writes_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG InputSize _Out_opt_ PULONG InputSize
) PURE; ) PURE;
// This method is used by clients to return // This method is used by clients to return
// input when it is available. It will // input when it is available. It will
// return S_OK if the input is used to // return S_OK if the input is used to
// satisfy an Input call and S_FALSE if // satisfy an Input call and S_FALSE if
// the input is ignored. // the input is ignored.
// This method is reentrant. // This method is reentrant.
STDMETHOD(ReturnInput)( STDMETHOD(ReturnInput)(
THIS_ THIS_
__in PCSTR Buffer _In_ PCSTR Buffer
) PURE; ) PURE;
// Sends output through clients // Sends output through clients
// output callbacks if the mask is allowed // output callbacks if the mask is allowed
// by the current output control mask and // by the current output control mask and
// according to the output distribution // according to the output distribution
// settings. // settings.
STDMETHODV(Output)( STDMETHODV(Output)(
THIS_ THIS_
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
... ...
) PURE; ) PURE;
STDMETHOD(OutputVaList)( STDMETHOD(OutputVaList)(
THIS_ THIS_
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
__in va_list Args _In_ va_list Args
) PURE; ) PURE;
// The following methods allow direct control // The following methods allow direct control
// over the distribution of the given output // over the distribution of the given output
// for situations where something other than // for situations where something other than
// the default is desired. These methods require // the default is desired. These methods require
// extra work in the engine so they should // extra work in the engine so they should
// only be used when necessary. // only be used when necessary.
STDMETHODV(ControlledOutput)( STDMETHODV(ControlledOutput)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
... ...
) PURE; ) PURE;
STDMETHOD(ControlledOutputVaList)( STDMETHOD(ControlledOutputVaList)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Format, _In_ PCSTR Format,
__in va_list Args _In_ va_list Args
) PURE; ) PURE;
// Displays the standard command-line prompt // Displays the standard command-line prompt
// followed by the given output. If Format // followed by the given output. If Format
// is NULL no additional output is produced. // is NULL no additional output is produced.
// Output is produced under the // Output is produced under the
// DEBUG_OUTPUT_PROMPT mask. // DEBUG_OUTPUT_PROMPT mask.
// This method only outputs the prompt; it // This method only outputs the prompt; it
// does not get input. // does not get input.
STDMETHODV(OutputPrompt)( STDMETHODV(OutputPrompt)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in_opt PCSTR Format, _In_opt_ PCSTR Format,
... ...
) PURE; ) PURE;
STDMETHOD(OutputPromptVaList)( STDMETHOD(OutputPromptVaList)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in_opt PCSTR Format, _In_opt_ PCSTR Format,
__in va_list Args _In_ va_list Args
) PURE; ) PURE;
// Gets the text that would be displayed by OutputPrompt. // Gets the text that would be displayed by OutputPrompt.
STDMETHOD(GetPromptText)( STDMETHOD(GetPromptText)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG TextSize _Out_opt_ PULONG TextSize
) PURE; ) PURE;
// Outputs information about the current // Outputs information about the current
// debuggee state such as a register // debuggee state such as a register
// summary, disassembly at the current PC, // summary, disassembly at the current PC,
// closest symbol and others. // closest symbol and others.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputCurrentState)( STDMETHOD(OutputCurrentState)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Outputs the debugger and extension version // Outputs the debugger and extension version
// information. This method is reentrant. // information. This method is reentrant.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputVersionInformation)( STDMETHOD(OutputVersionInformation)(
THIS_ THIS_
__in ULONG OutputControl _In_ ULONG OutputControl
) PURE; ) PURE;
// In user-mode debugging sessions the // In user-mode debugging sessions the
// engine will set an event when // engine will set an event when
// exceptions are continued. This can // exceptions are continued. This can
// be used to synchronize other processes // be used to synchronize other processes
// with the debuggers handling of events. // with the debuggers handling of events.
// For example, this is used to support // For example, this is used to support
// the e argument to ntsd. // the e argument to ntsd.
STDMETHOD(GetNotifyEventHandle)( STDMETHOD(GetNotifyEventHandle)(
THIS_ THIS_
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
STDMETHOD(SetNotifyEventHandle)( STDMETHOD(SetNotifyEventHandle)(
THIS_ THIS_
__in ULONG64 Handle _In_ ULONG64 Handle
) PURE; ) PURE;
STDMETHOD(Assemble)( STDMETHOD(Assemble)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in PCSTR Instr, _In_ PCSTR Instr,
__out PULONG64 EndOffset _Out_ PULONG64 EndOffset
) PURE; ) PURE;
STDMETHOD(Disassemble)( STDMETHOD(Disassemble)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DisassemblySize, _Out_opt_ PULONG DisassemblySize,
__out PULONG64 EndOffset _Out_ PULONG64 EndOffset
) PURE; ) PURE;
// Returns the value of the effective address // Returns the value of the effective address
// computed for the last Disassemble, if there // computed for the last Disassemble, if there
// was one. // was one.
STDMETHOD(GetDisassembleEffectiveOffset)( STDMETHOD(GetDisassembleEffectiveOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Uses the line prefix if necessary. // Uses the line prefix if necessary.
STDMETHOD(OutputDisassembly)( STDMETHOD(OutputDisassembly)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG64 EndOffset _Out_ PULONG64 EndOffset
) PURE; ) PURE;
// Produces multiple lines of disassembly output. // Produces multiple lines of disassembly output.
// There will be PreviousLines of disassembly before // There will be PreviousLines of disassembly before
// the given offset if a valid disassembly exists. // the given offset if a valid disassembly exists.
// In all, there will be TotalLines of output produced. // In all, there will be TotalLines of output produced.
// The first and last line offsets are returned // The first and last line offsets are returned
// specially and all lines offsets can be retrieved // specially and all lines offsets can be retrieved
// through LineOffsets. LineOffsets will contain // through LineOffsets. LineOffsets will contain
// offsets for each line where disassembly started. // offsets for each line where disassembly started.
// When disassembly of a single instruction takes // When disassembly of a single instruction takes
// multiple lines the initial offset will be followed // multiple lines the initial offset will be followed
// by DEBUG_INVALID_OFFSET. // by DEBUG_INVALID_OFFSET.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputDisassemblyLines)( STDMETHOD(OutputDisassemblyLines)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG PreviousLines, _In_ ULONG PreviousLines,
__in ULONG TotalLines, _In_ ULONG TotalLines,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out_opt PULONG OffsetLine, _Out_opt_ PULONG OffsetLine,
__out_opt PULONG64 StartOffset, _Out_opt_ PULONG64 StartOffset,
__out_opt PULONG64 EndOffset, _Out_opt_ PULONG64 EndOffset,
__out_ecount_opt(TotalLines) PULONG64 LineOffsets _Out_writes_opt_(TotalLines) PULONG64 LineOffsets
) PURE; ) PURE;
// Returns the offset of the start of // Returns the offset of the start of
// the instruction thats the given // the instruction thats the given
// delta away from the instruction // delta away from the instruction
// at the initial offset. // at the initial offset.
// This routine does not check for // This routine does not check for
// validity of the instruction or // validity of the instruction or
// the memory containing it. // the memory containing it.
STDMETHOD(GetNearInstruction)( STDMETHOD(GetNearInstruction)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in LONG Delta, _In_ LONG Delta,
__out PULONG64 NearOffset _Out_ PULONG64 NearOffset
) PURE; ) PURE;
// Offsets can be passed in as zero to use the current // Offsets can be passed in as zero to use the current
// thread state. // thread state.
STDMETHOD(GetStackTrace)( STDMETHOD(GetStackTrace)(
THIS_ THIS_
__in ULONG64 FrameOffset, _In_ ULONG64 FrameOffset,
__in ULONG64 StackOffset, _In_ ULONG64 StackOffset,
__in ULONG64 InstructionOffset, _In_ ULONG64 InstructionOffset,
__out_ecount(FramesSize) PDEBUG_STACK_FRAME Frames, _Out_writes_(FramesSize) PDEBUG_STACK_FRAME Frames,
__in ULONG FramesSize, _In_ ULONG FramesSize,
__out_opt PULONG FramesFilled _Out_opt_ PULONG FramesFilled
) PURE; ) PURE;
// Does a simple stack trace to determine // Does a simple stack trace to determine
// what the current return address is. // what the current return address is.
STDMETHOD(GetReturnOffset)( STDMETHOD(GetReturnOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// If Frames is NULL OutputStackTrace will // If Frames is NULL OutputStackTrace will
// use GetStackTrace to get FramesSize frames // use GetStackTrace to get FramesSize frames
// and then output them. The current register // and then output them. The current register
// values for frame, stack and instruction offsets // values for frame, stack and instruction offsets
// are used. // are used.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputStackTrace)( STDMETHOD(OutputStackTrace)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in_ecount_opt(FramesSize) PDEBUG_STACK_FRAME Frames, _In_reads_opt_(FramesSize) PDEBUG_STACK_FRAME Frames,
__in ULONG FramesSize, _In_ ULONG FramesSize,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Returns information about the debuggee such // Returns information about the debuggee such
// as user vs. kernel, dump vs. live, etc. // as user vs. kernel, dump vs. live, etc.
STDMETHOD(GetDebuggeeType)( STDMETHOD(GetDebuggeeType)(
THIS_ THIS_
__out PULONG Class, _Out_ PULONG Class,
__out PULONG Qualifier _Out_ PULONG Qualifier
) PURE; ) PURE;
// Returns the type of physical processors in // Returns the type of physical processors in
// the machine. // the machine.
// Returns one of the IMAGE_FILE_MACHINE values. // Returns one of the IMAGE_FILE_MACHINE values.
STDMETHOD(GetActualProcessorType)( STDMETHOD(GetActualProcessorType)(
THIS_ THIS_
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
// Returns the type of processor used in the // Returns the type of processor used in the
// current processor context. // current processor context.
STDMETHOD(GetExecutingProcessorType)( STDMETHOD(GetExecutingProcessorType)(
THIS_ THIS_
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
// Query all the possible processor types that // Query all the possible processor types that
// may be encountered during this debug session. // may be encountered during this debug session.
STDMETHOD(GetNumberPossibleExecutingProcessorTypes)( STDMETHOD(GetNumberPossibleExecutingProcessorTypes)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetPossibleExecutingProcessorTypes)( STDMETHOD(GetPossibleExecutingProcessorTypes)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PULONG Types _Out_writes_(Count) PULONG Types
) PURE; ) PURE;
// Get the number of actual processors in // Get the number of actual processors in
// the machine. // the machine.
STDMETHOD(GetNumberProcessors)( STDMETHOD(GetNumberProcessors)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
// PlatformId is one of the VER_PLATFORM values. // PlatformId is one of the VER_PLATFORM values.
// Major and minor are as given in the NT // Major and minor are as given in the NT
// kernel debugger protocol. // kernel debugger protocol.
// ServicePackString and ServicePackNumber indicate the // ServicePackString and ServicePackNumber indicate the
// system service pack level. ServicePackNumber is not // system service pack level. ServicePackNumber is not
// available in some sessions where the service pack level // available in some sessions where the service pack level
// is only expressed as a string. The service pack information // is only expressed as a string. The service pack information
// will be empty if the system does not have a service pack // will be empty if the system does not have a service pack
// applied. // applied.
// The build string is string information identifying the // The build string is string information identifying the
// particular build of the system. The build string is // particular build of the system. The build string is
// empty if the system has no particular identifying // empty if the system has no particular identifying
// information. // information.
STDMETHOD(GetSystemVersion)( STDMETHOD(GetSystemVersion)(
THIS_ THIS_
__out PULONG PlatformId, _Out_ PULONG PlatformId,
__out PULONG Major, _Out_ PULONG Major,
__out PULONG Minor, _Out_ PULONG Minor,
__out_ecount_opt(ServicePackStringSize) PSTR ServicePackString, _Out_writes_opt_(ServicePackStringSize) PSTR ServicePackString,
__in ULONG ServicePackStringSize, _In_ ULONG ServicePackStringSize,
__out_opt PULONG ServicePackStringUsed, _Out_opt_ PULONG ServicePackStringUsed,
__out PULONG ServicePackNumber, _Out_ PULONG ServicePackNumber,
__out_ecount_opt(BuildStringSize) PSTR BuildString, _Out_writes_opt_(BuildStringSize) PSTR BuildString,
__in ULONG BuildStringSize, _In_ ULONG BuildStringSize,
__out_opt PULONG BuildStringUsed _Out_opt_ PULONG BuildStringUsed
) PURE; ) PURE;
// Returns the page size for the currently executing // Returns the page size for the currently executing
// processor context. The page size may vary between // processor context. The page size may vary between
// processor types. // processor types.
STDMETHOD(GetPageSize)( STDMETHOD(GetPageSize)(
THIS_ THIS_
__out PULONG Size _Out_ PULONG Size
) PURE; ) PURE;
// Returns S_OK if the current processor context uses // Returns S_OK if the current processor context uses
// 64-bit addresses, otherwise S_FALSE. // 64-bit addresses, otherwise S_FALSE.
STDMETHOD(IsPointer64Bit)( STDMETHOD(IsPointer64Bit)(
THIS THIS
) PURE; ) PURE;
// Reads the bugcheck data area and returns the // Reads the bugcheck data area and returns the
// current contents. This method only works // current contents. This method only works
// in kernel debugging sessions. // in kernel debugging sessions.
STDMETHOD(ReadBugCheckData)( STDMETHOD(ReadBugCheckData)(
THIS_ THIS_
__out PULONG Code, _Out_ PULONG Code,
__out PULONG64 Arg1, _Out_ PULONG64 Arg1,
__out PULONG64 Arg2, _Out_ PULONG64 Arg2,
__out PULONG64 Arg3, _Out_ PULONG64 Arg3,
__out PULONG64 Arg4 _Out_ PULONG64 Arg4
) PURE; ) PURE;
// Query all the processor types supported by // Query all the processor types supported by
// the engine. This is a complete list and is // the engine. This is a complete list and is
// not related to the machine running the engine // not related to the machine running the engine
// or the debuggee. // or the debuggee.
STDMETHOD(GetNumberSupportedProcessorTypes)( STDMETHOD(GetNumberSupportedProcessorTypes)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetSupportedProcessorTypes)( STDMETHOD(GetSupportedProcessorTypes)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PULONG Types _Out_writes_(Count) PULONG Types
) PURE; ) PURE;
// Returns a full, descriptive name and an // Returns a full, descriptive name and an
// abbreviated name for a processor type. // abbreviated name for a processor type.
STDMETHOD(GetProcessorTypeNames)( STDMETHOD(GetProcessorTypeNames)(
THIS_ THIS_
__in ULONG Type, _In_ ULONG Type,
__out_ecount_opt(FullNameBufferSize) PSTR FullNameBuffer, _Out_writes_opt_(FullNameBufferSize) PSTR FullNameBuffer,
__in ULONG FullNameBufferSize, _In_ ULONG FullNameBufferSize,
__out_opt PULONG FullNameSize, _Out_opt_ PULONG FullNameSize,
__out_ecount_opt(AbbrevNameBufferSize) PSTR AbbrevNameBuffer, _Out_writes_opt_(AbbrevNameBufferSize) PSTR AbbrevNameBuffer,
__in ULONG AbbrevNameBufferSize, _In_ ULONG AbbrevNameBufferSize,
__out_opt PULONG AbbrevNameSize _Out_opt_ PULONG AbbrevNameSize
) PURE; ) PURE;
// Gets and sets the type of processor to // Gets and sets the type of processor to
// use when doing things like setting // use when doing things like setting
// breakpoints, accessing registers, // breakpoints, accessing registers,
// getting stack traces and so on. // getting stack traces and so on.
STDMETHOD(GetEffectiveProcessorType)( STDMETHOD(GetEffectiveProcessorType)(
THIS_ THIS_
__out PULONG Type _Out_ PULONG Type
) PURE; ) PURE;
STDMETHOD(SetEffectiveProcessorType)( STDMETHOD(SetEffectiveProcessorType)(
THIS_ THIS_
__in ULONG Type _In_ ULONG Type
) PURE; ) PURE;
// Returns information about whether and how // Returns information about whether and how
// the debuggee is running. Status will // the debuggee is running. Status will
// be GO if the debuggee is running and // be GO if the debuggee is running and
// BREAK if it isnt. // BREAK if it isnt.
// If no debuggee exists the status is // If no debuggee exists the status is
// NO_DEBUGGEE. // NO_DEBUGGEE.
// This method is reentrant. // This method is reentrant.
STDMETHOD(GetExecutionStatus)( STDMETHOD(GetExecutionStatus)(
THIS_ THIS_
__out PULONG Status _Out_ PULONG Status
) PURE; ) PURE;
// Changes the execution status of the // Changes the execution status of the
// engine from stopped to running. // engine from stopped to running.
// Status must be one of the go or step // Status must be one of the go or step
// status values. // status values.
STDMETHOD(SetExecutionStatus)( STDMETHOD(SetExecutionStatus)(
THIS_ THIS_
__in ULONG Status _In_ ULONG Status
) PURE; ) PURE;
// Controls what code interpretation level the debugger // Controls what code interpretation level the debugger
// runs at. The debugger checks the code level when // runs at. The debugger checks the code level when
// deciding whether to step by a source line or // deciding whether to step by a source line or
// assembly instruction along with other related operations. // assembly instruction along with other related operations.
STDMETHOD(GetCodeLevel)( STDMETHOD(GetCodeLevel)(
THIS_ THIS_
__out PULONG Level _Out_ PULONG Level
) PURE; ) PURE;
STDMETHOD(SetCodeLevel)( STDMETHOD(SetCodeLevel)(
THIS_ THIS_
__in ULONG Level _In_ ULONG Level
) PURE; ) PURE;
// Gets and sets engine control flags. // Gets and sets engine control flags.
// These methods are reentrant. // These methods are reentrant.
STDMETHOD(GetEngineOptions)( STDMETHOD(GetEngineOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddEngineOptions)( STDMETHOD(AddEngineOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveEngineOptions)( STDMETHOD(RemoveEngineOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetEngineOptions)( STDMETHOD(SetEngineOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
// Gets and sets control values for // Gets and sets control values for
// handling system error events. // handling system error events.
// If the system error level is less // If the system error level is less
// than or equal to the given levels // than or equal to the given levels
// the error may be displayed and // the error may be displayed and
// the default break for the event // the default break for the event
// may be set. // may be set.
STDMETHOD(GetSystemErrorControl)( STDMETHOD(GetSystemErrorControl)(
THIS_ THIS_
__out PULONG OutputLevel, _Out_ PULONG OutputLevel,
__out PULONG BreakLevel _Out_ PULONG BreakLevel
) PURE; ) PURE;
STDMETHOD(SetSystemErrorControl)( STDMETHOD(SetSystemErrorControl)(
THIS_ THIS_
__in ULONG OutputLevel, _In_ ULONG OutputLevel,
__in ULONG BreakLevel _In_ ULONG BreakLevel
) PURE; ) PURE;
// The command processor supports simple // The command processor supports simple
// string replacement macros in Evaluate and // string replacement macros in Evaluate and
// Execute. There are currently ten macro // Execute. There are currently ten macro
// slots available. Slots 0-9 map to // slots available. Slots 0-9 map to
// the command invocations $u0-$u9. // the command invocations $u0-$u9.
STDMETHOD(GetTextMacro)( STDMETHOD(GetTextMacro)(
THIS_ THIS_
__in ULONG Slot, _In_ ULONG Slot,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG MacroSize _Out_opt_ PULONG MacroSize
) PURE; ) PURE;
STDMETHOD(SetTextMacro)( STDMETHOD(SetTextMacro)(
THIS_ THIS_
__in ULONG Slot, _In_ ULONG Slot,
__in PCSTR Macro _In_ PCSTR Macro
) PURE; ) PURE;
// Controls the default number radix used // Controls the default number radix used
// in expressions and commands. // in expressions and commands.
STDMETHOD(GetRadix)( STDMETHOD(GetRadix)(
THIS_ THIS_
__out PULONG Radix _Out_ PULONG Radix
) PURE; ) PURE;
STDMETHOD(SetRadix)( STDMETHOD(SetRadix)(
THIS_ THIS_
__in ULONG Radix _In_ ULONG Radix
) PURE; ) PURE;
// Evaluates the given expression string and // Evaluates the given expression string and
// returns the resulting value. // returns the resulting value.
// If DesiredType is DEBUG_VALUE_INVALID then // If DesiredType is DEBUG_VALUE_INVALID then
// the natural type is used. // the natural type is used.
// RemainderIndex, if provided, is set to the index // RemainderIndex, if provided, is set to the index
// of the first character in the input string that was // of the first character in the input string that was
// not used when evaluating the expression. // not used when evaluating the expression.
STDMETHOD(Evaluate)( STDMETHOD(Evaluate)(
THIS_ THIS_
__in PCSTR Expression, _In_ PCSTR Expression,
__in ULONG DesiredType, _In_ ULONG DesiredType,
__out PDEBUG_VALUE Value, _Out_ PDEBUG_VALUE Value,
__out_opt PULONG RemainderIndex _Out_opt_ PULONG RemainderIndex
) PURE; ) PURE;
// Attempts to convert the input value to a value // Attempts to convert the input value to a value
// of the requested type in the output value. // of the requested type in the output value.
// Conversions can fail if no conversion exists. // Conversions can fail if no conversion exists.
// Successful conversions may be lossy. // Successful conversions may be lossy.
STDMETHOD(CoerceValue)( STDMETHOD(CoerceValue)(
THIS_ THIS_
__in PDEBUG_VALUE In, _In_ PDEBUG_VALUE In,
__in ULONG OutType, _In_ ULONG OutType,
__out PDEBUG_VALUE Out _Out_ PDEBUG_VALUE Out
) PURE; ) PURE;
STDMETHOD(CoerceValues)( STDMETHOD(CoerceValues)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount(Count) PDEBUG_VALUE In, _In_reads_(Count) PDEBUG_VALUE In,
__in_ecount(Count) PULONG OutTypes, _In_reads_(Count) PULONG OutTypes,
__out_ecount(Count) PDEBUG_VALUE Out _Out_writes_(Count) PDEBUG_VALUE Out
) PURE; ) PURE;
// Executes the given command string. // Executes the given command string.
// If the string has multiple commands // If the string has multiple commands
// Execute will not return until all // Execute will not return until all
// of them have been executed. If this // of them have been executed. If this
// requires waiting for the debuggee to // requires waiting for the debuggee to
// execute an internal wait will be done // execute an internal wait will be done
// so Execute can take an arbitrary amount // so Execute can take an arbitrary amount
// of time. // of time.
STDMETHOD(Execute)( STDMETHOD(Execute)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCSTR Command, _In_ PCSTR Command,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Executes the given command file by // Executes the given command file by
// reading a line at a time and processing // reading a line at a time and processing
// it with Execute. // it with Execute.
STDMETHOD(ExecuteCommandFile)( STDMETHOD(ExecuteCommandFile)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCSTR CommandFile, _In_ PCSTR CommandFile,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Breakpoint interfaces are described // Breakpoint interfaces are described
// elsewhere in this section. // elsewhere in this section.
STDMETHOD(GetNumberBreakpoints)( STDMETHOD(GetNumberBreakpoints)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
// It is possible for this retrieval function to // It is possible for this retrieval function to
// fail even with an index within the number of // fail even with an index within the number of
// existing breakpoints if the breakpoint is // existing breakpoints if the breakpoint is
// a private breakpoint. // a private breakpoint.
STDMETHOD(GetBreakpointByIndex)( STDMETHOD(GetBreakpointByIndex)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out PDEBUG_BREAKPOINT* Bp _Out_ PDEBUG_BREAKPOINT* Bp
) PURE; ) PURE;
STDMETHOD(GetBreakpointById)( STDMETHOD(GetBreakpointById)(
THIS_ THIS_
__in ULONG Id, _In_ ULONG Id,
__out PDEBUG_BREAKPOINT* Bp _Out_ PDEBUG_BREAKPOINT* Bp
) PURE; ) PURE;
// If Ids is non-NULL the Count breakpoints // If Ids is non-NULL the Count breakpoints
// referred to in the Ids array are returned, // referred to in the Ids array are returned,
// otherwise breakpoints from index Start to // otherwise breakpoints from index Start to
// Start + Count 1 are returned. // Start + Count 1 are returned.
STDMETHOD(GetBreakpointParameters)( STDMETHOD(GetBreakpointParameters)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Ids, _In_reads_opt_(Count) PULONG Ids,
__in ULONG Start, _In_ ULONG Start,
__out_ecount(Count) PDEBUG_BREAKPOINT_PARAMETERS Params _Out_writes_(Count) PDEBUG_BREAKPOINT_PARAMETERS Params
) PURE; ) PURE;
// Breakpoints are created empty and disabled. // Breakpoints are created empty and disabled.
// When their parameters have been set they // When their parameters have been set they
// should be enabled by setting the ENABLE flag. // should be enabled by setting the ENABLE flag.
// If DesiredId is DEBUG_ANY_ID then the // If DesiredId is DEBUG_ANY_ID then the
// engine picks an unused ID. If DesiredId // engine picks an unused ID. If DesiredId
// is any other number the engine attempts // is any other number the engine attempts
// to use the given ID for the breakpoint. // to use the given ID for the breakpoint.
// If another breakpoint exists with that ID // If another breakpoint exists with that ID
// the call will fail. // the call will fail.
STDMETHOD(AddBreakpoint)( STDMETHOD(AddBreakpoint)(
THIS_ THIS_
__in ULONG Type, _In_ ULONG Type,
__in ULONG DesiredId, _In_ ULONG DesiredId,
__out PDEBUG_BREAKPOINT* Bp _Out_ PDEBUG_BREAKPOINT* Bp
) PURE; ) PURE;
// Breakpoint interface is invalid after this call. // Breakpoint interface is invalid after this call.
STDMETHOD(RemoveBreakpoint)( STDMETHOD(RemoveBreakpoint)(
THIS_ THIS_
__in PDEBUG_BREAKPOINT Bp _In_ PDEBUG_BREAKPOINT Bp
) PURE; ) PURE;
// Control and use extension DLLs. // Control and use extension DLLs.
STDMETHOD(AddExtension)( STDMETHOD(AddExtension)(
THIS_ THIS_
__in PCSTR Path, _In_ PCSTR Path,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
STDMETHOD(RemoveExtension)( STDMETHOD(RemoveExtension)(
THIS_ THIS_
__in ULONG64 Handle _In_ ULONG64 Handle
) PURE; ) PURE;
STDMETHOD(GetExtensionByPath)( STDMETHOD(GetExtensionByPath)(
THIS_ THIS_
__in PCSTR Path, _In_ PCSTR Path,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
// If Handle is zero the extension // If Handle is zero the extension
// chain is walked searching for the // chain is walked searching for the
// function. // function.
STDMETHOD(CallExtension)( STDMETHOD(CallExtension)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in PCSTR Function, _In_ PCSTR Function,
__in_opt PCSTR Arguments _In_opt_ PCSTR Arguments
) PURE; ) PURE;
// GetExtensionFunction works like // GetExtensionFunction works like
// GetProcAddress on extension DLLs // GetProcAddress on extension DLLs
// to allow raw function-call-level // to allow raw function-call-level
// interaction with extension DLLs. // interaction with extension DLLs.
// Such functions do not need to // Such functions do not need to
// follow the standard extension prototype // follow the standard extension prototype
// if they are not going to be called // if they are not going to be called
// through the text extension interface. // through the text extension interface.
// This function cannot be called remotely. // This function cannot be called remotely.
STDMETHOD(GetExtensionFunction)( STDMETHOD(GetExtensionFunction)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in PCSTR FuncName, _In_ PCSTR FuncName,
__out FARPROC* Function _Out_ FARPROC* Function
) PURE; ) PURE;
// These methods return alternate // These methods return alternate
// extension interfaces in order to allow // extension interfaces in order to allow
// interface-style extension DLLs to mix in // interface-style extension DLLs to mix in
// older extension calls. // older extension calls.
// Structure sizes must be initialized before // Structure sizes must be initialized before
// the call. // the call.
// These methods cannot be called remotely. // These methods cannot be called remotely.
STDMETHOD(GetWindbgExtensionApis32)( STDMETHOD(GetWindbgExtensionApis32)(
THIS_ THIS_
__inout PWINDBG_EXTENSION_APIS32 Api _Inout_ PWINDBG_EXTENSION_APIS32 Api
) PURE; ) PURE;
STDMETHOD(GetWindbgExtensionApis64)( STDMETHOD(GetWindbgExtensionApis64)(
THIS_ THIS_
__inout PWINDBG_EXTENSION_APIS64 Api _Inout_ PWINDBG_EXTENSION_APIS64 Api
) PURE; ) PURE;
// The engine provides a simple mechanism // The engine provides a simple mechanism
// to filter common events. Arbitrarily complicated // to filter common events. Arbitrarily complicated
// filtering can be done by registering event callbacks // filtering can be done by registering event callbacks
// but simple event filtering only requires // but simple event filtering only requires
// setting the options of one of the predefined // setting the options of one of the predefined
// event filters. // event filters.
// Simple event filters are either for specific // Simple event filters are either for specific
// events and therefore have an enumerant or // events and therefore have an enumerant or
skipping to change at line 8226 skipping to change at line 10064
// All three groups of filters are indexed together // All three groups of filters are indexed together
// with the specific filters first, then the specific // with the specific filters first, then the specific
// exception filters and finally the arbitrary // exception filters and finally the arbitrary
// exception filters. // exception filters.
// The first specific exception is the default // The first specific exception is the default
// exception. If an exception event occurs for // exception. If an exception event occurs for
// an exception without settings the default // an exception without settings the default
// exception settings are used. // exception settings are used.
STDMETHOD(GetNumberEventFilters)( STDMETHOD(GetNumberEventFilters)(
THIS_ THIS_
__out PULONG SpecificEvents, _Out_ PULONG SpecificEvents,
__out PULONG SpecificExceptions, _Out_ PULONG SpecificExceptions,
__out PULONG ArbitraryExceptions _Out_ PULONG ArbitraryExceptions
) PURE; ) PURE;
// Some filters have descriptive text associated with them. // Some filters have descriptive text associated with them.
STDMETHOD(GetEventFilterText)( STDMETHOD(GetEventFilterText)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG TextSize _Out_opt_ PULONG TextSize
) PURE; ) PURE;
// All filters support executing a command when the // All filters support executing a command when the
// event occurs. // event occurs.
STDMETHOD(GetEventFilterCommand)( STDMETHOD(GetEventFilterCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG CommandSize _Out_opt_ PULONG CommandSize
) PURE; ) PURE;
STDMETHOD(SetEventFilterCommand)( STDMETHOD(SetEventFilterCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Command _In_ PCSTR Command
) PURE; ) PURE;
STDMETHOD(GetSpecificFilterParameters)( STDMETHOD(GetSpecificFilterParameters)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params _Out_writes_(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
) PURE; ) PURE;
STDMETHOD(SetSpecificFilterParameters)( STDMETHOD(SetSpecificFilterParameters)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__in_ecount(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params _In_reads_(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
) PURE; ) PURE;
// Some specific filters have arguments to further // Some specific filters have arguments to further
// qualify their operation. // qualify their operation.
STDMETHOD(GetSpecificFilterArgument)( STDMETHOD(GetSpecificFilterArgument)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ArgumentSize _Out_opt_ PULONG ArgumentSize
) PURE; ) PURE;
STDMETHOD(SetSpecificFilterArgument)( STDMETHOD(SetSpecificFilterArgument)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Argument _In_ PCSTR Argument
) PURE; ) PURE;
// If Codes is non-NULL Start is ignored. // If Codes is non-NULL Start is ignored.
STDMETHOD(GetExceptionFilterParameters)( STDMETHOD(GetExceptionFilterParameters)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Codes, _In_reads_opt_(Count) PULONG Codes,
__in ULONG Start, _In_ ULONG Start,
__out_ecount(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params _Out_writes_(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
) PURE; ) PURE;
// The codes in the parameter data control the application // The codes in the parameter data control the application
// of the parameter data. If a code is not already in // of the parameter data. If a code is not already in
// the set of filters it is added. If the ExecutionOption // the set of filters it is added. If the ExecutionOption
// for a code is REMOVE then the filter is removed. // for a code is REMOVE then the filter is removed.
// Specific exception filters cannot be removed. // Specific exception filters cannot be removed.
STDMETHOD(SetExceptionFilterParameters)( STDMETHOD(SetExceptionFilterParameters)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params _In_reads_(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
) PURE; ) PURE;
// Exception filters support an additional command for // Exception filters support an additional command for
// second-chance events. // second-chance events.
STDMETHOD(GetExceptionFilterSecondCommand)( STDMETHOD(GetExceptionFilterSecondCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG CommandSize _Out_opt_ PULONG CommandSize
) PURE; ) PURE;
STDMETHOD(SetExceptionFilterSecondCommand)( STDMETHOD(SetExceptionFilterSecondCommand)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Command _In_ PCSTR Command
) PURE; ) PURE;
// Yields processing to the engine until // Yields processing to the engine until
// an event occurs. This method may // an event occurs. This method may
// only be called by the thread that started // only be called by the thread that started
// the debug session. // the debug session.
// When an event occurs the engine carries // When an event occurs the engine carries
// out all event processing such as calling // out all event processing such as calling
// callbacks. // callbacks.
// If the callbacks indicate that execution should // If the callbacks indicate that execution should
// break the wait will return, otherwise it // break the wait will return, otherwise it
// goes back to waiting for a new event. // goes back to waiting for a new event.
// If the timeout expires, S_FALSE is returned. // If the timeout expires, S_FALSE is returned.
// The timeout is not currently supported for // The timeout is not currently supported for
// kernel debugging. // kernel debugging.
STDMETHOD(WaitForEvent)( STDMETHOD(WaitForEvent)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG Timeout _In_ ULONG Timeout
) PURE; ) PURE;
// Retrieves information about the last event that occurred. // Retrieves information about the last event that occurred.
// EventType is one of the event callback mask bits. // EventType is one of the event callback mask bits.
// ExtraInformation contains additional event-specific // ExtraInformation contains additional event-specific
// information. Not all events have additional information. // information. Not all events have additional information.
STDMETHOD(GetLastEventInformation)( STDMETHOD(GetLastEventInformation)(
THIS_ THIS_
__out PULONG Type, _Out_ PULONG Type,
__out PULONG ProcessId, _Out_ PULONG ProcessId,
__out PULONG ThreadId, _Out_ PULONG ThreadId,
__out_bcount_opt(ExtraInformationSize) PVOID ExtraInformation, _Out_writes_bytes_opt_(ExtraInformationSize) PVOID ExtraInformation,
__in ULONG ExtraInformationSize, _In_ ULONG ExtraInformationSize,
__out_opt PULONG ExtraInformationUsed, _Out_opt_ PULONG ExtraInformationUsed,
__out_ecount_opt(DescriptionSize) PSTR Description, _Out_writes_opt_(DescriptionSize) PSTR Description,
__in ULONG DescriptionSize, _In_ ULONG DescriptionSize,
__out_opt PULONG DescriptionUsed _Out_opt_ PULONG DescriptionUsed
) PURE; ) PURE;
// IDebugControl2. // IDebugControl2.
STDMETHOD(GetCurrentTimeDate)( STDMETHOD(GetCurrentTimeDate)(
THIS_ THIS_
__out PULONG TimeDate _Out_ PULONG TimeDate
) PURE; ) PURE;
// Retrieves the number of seconds since the // Retrieves the number of seconds since the
// machine started running. // machine started running.
STDMETHOD(GetCurrentSystemUpTime)( STDMETHOD(GetCurrentSystemUpTime)(
THIS_ THIS_
__out PULONG UpTime _Out_ PULONG UpTime
) PURE; ) PURE;
// If the current session is a dump session, // If the current session is a dump session,
// retrieves any extended format information. // retrieves any extended format information.
STDMETHOD(GetDumpFormatFlags)( STDMETHOD(GetDumpFormatFlags)(
THIS_ THIS_
__out PULONG FormatFlags _Out_ PULONG FormatFlags
) PURE; ) PURE;
// The debugger has been enhanced to allow // The debugger has been enhanced to allow
// arbitrary text replacements in addition // arbitrary text replacements in addition
// to the simple $u0-$u9 text macros. // to the simple $u0-$u9 text macros.
// Text replacement takes a given source // Text replacement takes a given source
// text in commands and converts it to the // text in commands and converts it to the
// given destination text. Replacements // given destination text. Replacements
// are named by their source text so that // are named by their source text so that
// only one replacement for a source text // only one replacement for a source text
// string can exist. // string can exist.
STDMETHOD(GetNumberTextReplacements)( STDMETHOD(GetNumberTextReplacements)(
THIS_ THIS_
__out PULONG NumRepl _Out_ PULONG NumRepl
) PURE; ) PURE;
// If SrcText is non-NULL the replacement // If SrcText is non-NULL the replacement
// is looked up by source text, otherwise // is looked up by source text, otherwise
// Index is used to get the Nth replacement. // Index is used to get the Nth replacement.
STDMETHOD(GetTextReplacement)( STDMETHOD(GetTextReplacement)(
THIS_ THIS_
__in_opt PCSTR SrcText, _In_opt_ PCSTR SrcText,
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(SrcBufferSize) PSTR SrcBuffer, _Out_writes_opt_(SrcBufferSize) PSTR SrcBuffer,
__in ULONG SrcBufferSize, _In_ ULONG SrcBufferSize,
__out_opt PULONG SrcSize, _Out_opt_ PULONG SrcSize,
__out_ecount_opt(DstBufferSize) PSTR DstBuffer, _Out_writes_opt_(DstBufferSize) PSTR DstBuffer,
__in ULONG DstBufferSize, _In_ ULONG DstBufferSize,
__out_opt PULONG DstSize _Out_opt_ PULONG DstSize
) PURE; ) PURE;
// Setting the destination text to // Setting the destination text to
// NULL removes the alias. // NULL removes the alias.
STDMETHOD(SetTextReplacement)( STDMETHOD(SetTextReplacement)(
THIS_ THIS_
__in PCSTR SrcText, _In_ PCSTR SrcText,
__in_opt PCSTR DstText _In_opt_ PCSTR DstText
) PURE; ) PURE;
STDMETHOD(RemoveTextReplacements)( STDMETHOD(RemoveTextReplacements)(
THIS THIS
) PURE; ) PURE;
// Outputs the complete list of current // Outputs the complete list of current
// replacements. // replacements.
STDMETHOD(OutputTextReplacements)( STDMETHOD(OutputTextReplacements)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// IDebugControl3. // IDebugControl3.
// Control options for assembly and disassembly. // Control options for assembly and disassembly.
STDMETHOD(GetAssemblyOptions)( STDMETHOD(GetAssemblyOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddAssemblyOptions)( STDMETHOD(AddAssemblyOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveAssemblyOptions)( STDMETHOD(RemoveAssemblyOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetAssemblyOptions)( STDMETHOD(SetAssemblyOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
// Control the expression syntax. // Control the expression syntax.
STDMETHOD(GetExpressionSyntax)( STDMETHOD(GetExpressionSyntax)(
THIS_ THIS_
__out PULONG Flags _Out_ PULONG Flags
) PURE; ) PURE;
STDMETHOD(SetExpressionSyntax)( STDMETHOD(SetExpressionSyntax)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Look up a syntax by its abbreviated // Look up a syntax by its abbreviated
// name and set it. // name and set it.
STDMETHOD(SetExpressionSyntaxByName)( STDMETHOD(SetExpressionSyntaxByName)(
THIS_ THIS_
__in PCSTR AbbrevName _In_ PCSTR AbbrevName
) PURE; ) PURE;
STDMETHOD(GetNumberExpressionSyntaxes)( STDMETHOD(GetNumberExpressionSyntaxes)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetExpressionSyntaxNames)( STDMETHOD(GetExpressionSyntaxNames)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(FullNameBufferSize) PSTR FullNameBuffer, _Out_writes_opt_(FullNameBufferSize) PSTR FullNameBuffer,
__in ULONG FullNameBufferSize, _In_ ULONG FullNameBufferSize,
__out_opt PULONG FullNameSize, _Out_opt_ PULONG FullNameSize,
__out_ecount_opt(AbbrevNameBufferSize) PSTR AbbrevNameBuffer, _Out_writes_opt_(AbbrevNameBufferSize) PSTR AbbrevNameBuffer,
__in ULONG AbbrevNameBufferSize, _In_ ULONG AbbrevNameBufferSize,
__out_opt PULONG AbbrevNameSize _Out_opt_ PULONG AbbrevNameSize
) PURE; ) PURE;
// //
// Some debug sessions have only a single // Some debug sessions have only a single
// possible event, such as a snapshot dump // possible event, such as a snapshot dump
// file; some have dynamic events, such as // file; some have dynamic events, such as
// a live debug session; and others may have // a live debug session; and others may have
// multiple events, such as a dump file that // multiple events, such as a dump file that
// contains snapshots from different points // contains snapshots from different points
// in time. The following methods allow // in time. The following methods allow
skipping to change at line 8490 skipping to change at line 10328
// which WaitForEvent must be used to process // which WaitForEvent must be used to process
// the selected event. // the selected event.
// //
// GetNumberEvents returns S_OK if this is the // GetNumberEvents returns S_OK if this is the
// complete set of events possible, such as for // complete set of events possible, such as for
// a static session; or S_FALSE if other events // a static session; or S_FALSE if other events
// may be possible, such as for a dynamic session. // may be possible, such as for a dynamic session.
STDMETHOD(GetNumberEvents)( STDMETHOD(GetNumberEvents)(
THIS_ THIS_
__out PULONG Events _Out_ PULONG Events
) PURE; ) PURE;
// Sessions may have descriptive information for // Sessions may have descriptive information for
// the various events available. The amount of // the various events available. The amount of
// information varies according to the specific // information varies according to the specific
// session and data. // session and data.
STDMETHOD(GetEventIndexDescription)( STDMETHOD(GetEventIndexDescription)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in ULONG Which, _In_ ULONG Which,
__in_opt PSTR Buffer, _In_opt_ PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DescSize _Out_opt_ PULONG DescSize
) PURE; ) PURE;
STDMETHOD(GetCurrentEventIndex)( STDMETHOD(GetCurrentEventIndex)(
THIS_ THIS_
__out PULONG Index _Out_ PULONG Index
) PURE; ) PURE;
// SetNextEventIndex works like seek in that // SetNextEventIndex works like seek in that
// it can set an absolute or relative index. // it can set an absolute or relative index.
// SetNextEventIndex works similarly to SetExecutionStatus // SetNextEventIndex works similarly to SetExecutionStatus
// by putting the session into a running state, after // by putting the session into a running state, after
// which the caller must call WaitForEvent. The // which the caller must call WaitForEvent. The
// current event index only changes when WaitForEvent // current event index only changes when WaitForEvent
// is called. // is called.
STDMETHOD(SetNextEventIndex)( STDMETHOD(SetNextEventIndex)(
THIS_ THIS_
__in ULONG Relation, _In_ ULONG Relation,
__in ULONG Value, _In_ ULONG Value,
__out PULONG NextIndex _Out_ PULONG NextIndex
) PURE; ) PURE;
// IDebugControl4. // IDebugControl4.
STDMETHOD(GetLogFileWide)( STDMETHOD(GetLogFileWide)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG FileSize, _Out_opt_ PULONG FileSize,
__out PBOOL Append _Out_ PBOOL Append
) PURE; ) PURE;
STDMETHOD(OpenLogFileWide)( STDMETHOD(OpenLogFileWide)(
THIS_ THIS_
__in PCWSTR File, _In_ PCWSTR File,
__in BOOL Append _In_ BOOL Append
) PURE; ) PURE;
STDMETHOD(InputWide)( STDMETHOD(InputWide)(
THIS_ THIS_
__out_ecount(BufferSize) PWSTR Buffer, _Out_writes_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG InputSize _Out_opt_ PULONG InputSize
) PURE; ) PURE;
STDMETHOD(ReturnInputWide)( STDMETHOD(ReturnInputWide)(
THIS_ THIS_
__in PCWSTR Buffer _In_ PCWSTR Buffer
) PURE; ) PURE;
STDMETHODV(OutputWide)( STDMETHODV(OutputWide)(
THIS_ THIS_
__in ULONG Mask, _In_ ULONG Mask,
__in PCWSTR Format, _In_ PCWSTR Format,
... ...
) PURE; ) PURE;
STDMETHOD(OutputVaListWide)( STDMETHOD(OutputVaListWide)(
THIS_ THIS_
__in ULONG Mask, _In_ ULONG Mask,
__in PCWSTR Format, _In_ PCWSTR Format,
__in va_list Args _In_ va_list Args
) PURE; ) PURE;
STDMETHODV(ControlledOutputWide)( STDMETHODV(ControlledOutputWide)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Mask, _In_ ULONG Mask,
__in PCWSTR Format, _In_ PCWSTR Format,
... ...
) PURE; ) PURE;
STDMETHOD(ControlledOutputVaListWide)( STDMETHOD(ControlledOutputVaListWide)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Mask, _In_ ULONG Mask,
__in PCWSTR Format, _In_ PCWSTR Format,
__in va_list Args _In_ va_list Args
) PURE; ) PURE;
STDMETHODV(OutputPromptWide)( STDMETHODV(OutputPromptWide)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in_opt PCWSTR Format, _In_opt_ PCWSTR Format,
... ...
) PURE; ) PURE;
STDMETHOD(OutputPromptVaListWide)( STDMETHOD(OutputPromptVaListWide)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in_opt PCWSTR Format, _In_opt_ PCWSTR Format,
__in va_list Args _In_ va_list Args
) PURE; ) PURE;
STDMETHOD(GetPromptTextWide)( STDMETHOD(GetPromptTextWide)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG TextSize _Out_opt_ PULONG TextSize
) PURE; ) PURE;
STDMETHOD(AssembleWide)( STDMETHOD(AssembleWide)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in PCWSTR Instr, _In_ PCWSTR Instr,
__out PULONG64 EndOffset _Out_ PULONG64 EndOffset
) PURE; ) PURE;
STDMETHOD(DisassembleWide)( STDMETHOD(DisassembleWide)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DisassemblySize, _Out_opt_ PULONG DisassemblySize,
__out PULONG64 EndOffset _Out_ PULONG64 EndOffset
) PURE; ) PURE;
STDMETHOD(GetProcessorTypeNamesWide)( STDMETHOD(GetProcessorTypeNamesWide)(
THIS_ THIS_
__in ULONG Type, _In_ ULONG Type,
__out_ecount_opt(FullNameBufferSize) PWSTR FullNameBuffer, _Out_writes_opt_(FullNameBufferSize) PWSTR FullNameBuffer,
__in ULONG FullNameBufferSize, _In_ ULONG FullNameBufferSize,
__out_opt PULONG FullNameSize, _Out_opt_ PULONG FullNameSize,
__out_ecount_opt(AbbrevNameBufferSize) PWSTR AbbrevNameBuffer, _Out_writes_opt_(AbbrevNameBufferSize) PWSTR AbbrevNameBuffer,
__in ULONG AbbrevNameBufferSize, _In_ ULONG AbbrevNameBufferSize,
__out_opt PULONG AbbrevNameSize _Out_opt_ PULONG AbbrevNameSize
) PURE; ) PURE;
STDMETHOD(GetTextMacroWide)( STDMETHOD(GetTextMacroWide)(
THIS_ THIS_
__in ULONG Slot, _In_ ULONG Slot,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG MacroSize _Out_opt_ PULONG MacroSize
) PURE; ) PURE;
STDMETHOD(SetTextMacroWide)( STDMETHOD(SetTextMacroWide)(
THIS_ THIS_
__in ULONG Slot, _In_ ULONG Slot,
__in PCWSTR Macro _In_ PCWSTR Macro
) PURE; ) PURE;
STDMETHOD(EvaluateWide)( STDMETHOD(EvaluateWide)(
THIS_ THIS_
__in PCWSTR Expression, _In_ PCWSTR Expression,
__in ULONG DesiredType, _In_ ULONG DesiredType,
__out PDEBUG_VALUE Value, _Out_ PDEBUG_VALUE Value,
__out_opt PULONG RemainderIndex _Out_opt_ PULONG RemainderIndex
) PURE; ) PURE;
STDMETHOD(ExecuteWide)( STDMETHOD(ExecuteWide)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCWSTR Command, _In_ PCWSTR Command,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
STDMETHOD(ExecuteCommandFileWide)( STDMETHOD(ExecuteCommandFileWide)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in PCWSTR CommandFile, _In_ PCWSTR CommandFile,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
STDMETHOD(GetBreakpointByIndex2)( STDMETHOD(GetBreakpointByIndex2)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out PDEBUG_BREAKPOINT2* Bp _Out_ PDEBUG_BREAKPOINT2* Bp
) PURE; ) PURE;
STDMETHOD(GetBreakpointById2)( STDMETHOD(GetBreakpointById2)(
THIS_ THIS_
__in ULONG Id, _In_ ULONG Id,
__out PDEBUG_BREAKPOINT2* Bp _Out_ PDEBUG_BREAKPOINT2* Bp
) PURE; ) PURE;
STDMETHOD(AddBreakpoint2)( STDMETHOD(AddBreakpoint2)(
THIS_ THIS_
__in ULONG Type, _In_ ULONG Type,
__in ULONG DesiredId, _In_ ULONG DesiredId,
__out PDEBUG_BREAKPOINT2* Bp _Out_ PDEBUG_BREAKPOINT2* Bp
) PURE; ) PURE;
STDMETHOD(RemoveBreakpoint2)( STDMETHOD(RemoveBreakpoint2)(
THIS_ THIS_
__in PDEBUG_BREAKPOINT2 Bp _In_ PDEBUG_BREAKPOINT2 Bp
) PURE; ) PURE;
STDMETHOD(AddExtensionWide)( STDMETHOD(AddExtensionWide)(
THIS_ THIS_
__in PCWSTR Path, _In_ PCWSTR Path,
__in ULONG Flags, _In_ ULONG Flags,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
STDMETHOD(GetExtensionByPathWide)( STDMETHOD(GetExtensionByPathWide)(
THIS_ THIS_
__in PCWSTR Path, _In_ PCWSTR Path,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
STDMETHOD(CallExtensionWide)( STDMETHOD(CallExtensionWide)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in PCWSTR Function, _In_ PCWSTR Function,
__in_opt PCWSTR Arguments _In_opt_ PCWSTR Arguments
) PURE; ) PURE;
STDMETHOD(GetExtensionFunctionWide)( STDMETHOD(GetExtensionFunctionWide)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in PCWSTR FuncName, _In_ PCWSTR FuncName,
__out FARPROC* Function _Out_ FARPROC* Function
) PURE; ) PURE;
STDMETHOD(GetEventFilterTextWide)( STDMETHOD(GetEventFilterTextWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG TextSize _Out_opt_ PULONG TextSize
) PURE; ) PURE;
STDMETHOD(GetEventFilterCommandWide)( STDMETHOD(GetEventFilterCommandWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG CommandSize _Out_opt_ PULONG CommandSize
) PURE; ) PURE;
STDMETHOD(SetEventFilterCommandWide)( STDMETHOD(SetEventFilterCommandWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCWSTR Command _In_ PCWSTR Command
) PURE; ) PURE;
STDMETHOD(GetSpecificFilterArgumentWide)( STDMETHOD(GetSpecificFilterArgumentWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ArgumentSize _Out_opt_ PULONG ArgumentSize
) PURE; ) PURE;
STDMETHOD(SetSpecificFilterArgumentWide)( STDMETHOD(SetSpecificFilterArgumentWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCWSTR Argument _In_ PCWSTR Argument
) PURE; ) PURE;
STDMETHOD(GetExceptionFilterSecondCommandWide)( STDMETHOD(GetExceptionFilterSecondCommandWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG CommandSize _Out_opt_ PULONG CommandSize
) PURE; ) PURE;
STDMETHOD(SetExceptionFilterSecondCommandWide)( STDMETHOD(SetExceptionFilterSecondCommandWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCWSTR Command _In_ PCWSTR Command
) PURE; ) PURE;
STDMETHOD(GetLastEventInformationWide)( STDMETHOD(GetLastEventInformationWide)(
THIS_ THIS_
__out PULONG Type, _Out_ PULONG Type,
__out PULONG ProcessId, _Out_ PULONG ProcessId,
__out PULONG ThreadId, _Out_ PULONG ThreadId,
__out_bcount_opt(ExtraInformationSize) PVOID ExtraInformation, _Out_writes_bytes_opt_(ExtraInformationSize) PVOID ExtraInformation,
__in ULONG ExtraInformationSize, _In_ ULONG ExtraInformationSize,
__out_opt PULONG ExtraInformationUsed, _Out_opt_ PULONG ExtraInformationUsed,
__out_ecount_opt(DescriptionSize) PWSTR Description, _Out_writes_opt_(DescriptionSize) PWSTR Description,
__in ULONG DescriptionSize, _In_ ULONG DescriptionSize,
__out_opt PULONG DescriptionUsed _Out_opt_ PULONG DescriptionUsed
) PURE; ) PURE;
STDMETHOD(GetTextReplacementWide)( STDMETHOD(GetTextReplacementWide)(
THIS_ THIS_
__in_opt PCWSTR SrcText, _In_opt_ PCWSTR SrcText,
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(SrcBufferSize) PWSTR SrcBuffer, _Out_writes_opt_(SrcBufferSize) PWSTR SrcBuffer,
__in ULONG SrcBufferSize, _In_ ULONG SrcBufferSize,
__out_opt PULONG SrcSize, _Out_opt_ PULONG SrcSize,
__out_ecount_opt(DstBufferSize) PWSTR DstBuffer, _Out_writes_opt_(DstBufferSize) PWSTR DstBuffer,
__in ULONG DstBufferSize, _In_ ULONG DstBufferSize,
__out_opt PULONG DstSize _Out_opt_ PULONG DstSize
) PURE; ) PURE;
STDMETHOD(SetTextReplacementWide)( STDMETHOD(SetTextReplacementWide)(
THIS_ THIS_
__in PCWSTR SrcText, _In_ PCWSTR SrcText,
__in_opt PCWSTR DstText _In_opt_ PCWSTR DstText
) PURE; ) PURE;
STDMETHOD(SetExpressionSyntaxByNameWide)( STDMETHOD(SetExpressionSyntaxByNameWide)(
THIS_ THIS_
__in PCWSTR AbbrevName _In_ PCWSTR AbbrevName
) PURE; ) PURE;
STDMETHOD(GetExpressionSyntaxNamesWide)( STDMETHOD(GetExpressionSyntaxNamesWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(FullNameBufferSize) PWSTR FullNameBuffer, _Out_writes_opt_(FullNameBufferSize) PWSTR FullNameBuffer,
__in ULONG FullNameBufferSize, _In_ ULONG FullNameBufferSize,
__out_opt PULONG FullNameSize, _Out_opt_ PULONG FullNameSize,
__out_ecount_opt(AbbrevNameBufferSize) PWSTR AbbrevNameBuffer, _Out_writes_opt_(AbbrevNameBufferSize) PWSTR AbbrevNameBuffer,
__in ULONG AbbrevNameBufferSize, _In_ ULONG AbbrevNameBufferSize,
__out_opt PULONG AbbrevNameSize _Out_opt_ PULONG AbbrevNameSize
) PURE; ) PURE;
STDMETHOD(GetEventIndexDescriptionWide)( STDMETHOD(GetEventIndexDescriptionWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in ULONG Which, _In_ ULONG Which,
__in_opt PWSTR Buffer, _In_opt_ PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DescSize _Out_opt_ PULONG DescSize
) PURE; ) PURE;
STDMETHOD(GetLogFile2)( STDMETHOD(GetLogFile2)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG FileSize, _Out_opt_ PULONG FileSize,
__out PULONG Flags _Out_ PULONG Flags
) PURE; ) PURE;
STDMETHOD(OpenLogFile2)( STDMETHOD(OpenLogFile2)(
THIS_ THIS_
__in PCSTR File, _In_ PCSTR File,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
STDMETHOD(GetLogFile2Wide)( STDMETHOD(GetLogFile2Wide)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG FileSize, _Out_opt_ PULONG FileSize,
__out PULONG Flags _Out_ PULONG Flags
) PURE; ) PURE;
STDMETHOD(OpenLogFile2Wide)( STDMETHOD(OpenLogFile2Wide)(
THIS_ THIS_
__in PCWSTR File, _In_ PCWSTR File,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// GetSystemVersion always returns the kd // GetSystemVersion always returns the kd
// major/minor version numbers, which are // major/minor version numbers, which are
// different than the Win32 version numbers. // different than the Win32 version numbers.
// GetSystemVersionValues can be used // GetSystemVersionValues can be used
// to determine the Win32 version values. // to determine the Win32 version values.
STDMETHOD(GetSystemVersionValues)( STDMETHOD(GetSystemVersionValues)(
THIS_ THIS_
__out PULONG PlatformId, _Out_ PULONG PlatformId,
__out PULONG Win32Major, _Out_ PULONG Win32Major,
__out PULONG Win32Minor, _Out_ PULONG Win32Minor,
__out_opt PULONG KdMajor, _Out_opt_ PULONG KdMajor,
__out_opt PULONG KdMinor _Out_opt_ PULONG KdMinor
) PURE; ) PURE;
// Strings are selected with DEBUG_SYSVERSTR_*. // Strings are selected with DEBUG_SYSVERSTR_*.
STDMETHOD(GetSystemVersionString)( STDMETHOD(GetSystemVersionString)(
THIS_ THIS_
__in ULONG Which, _In_ ULONG Which,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG StringSize _Out_opt_ PULONG StringSize
) PURE; ) PURE;
STDMETHOD(GetSystemVersionStringWide)( STDMETHOD(GetSystemVersionStringWide)(
THIS_ THIS_
__in ULONG Which, _In_ ULONG Which,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG StringSize _Out_opt_ PULONG StringSize
) PURE; ) PURE;
// Stack tracing with a full initial context // Stack tracing with a full initial context
// and full context return for each frame. // and full context return for each frame.
// The FrameContextsSize parameter is the total // The FrameContextsSize parameter is the total
// byte size of FrameContexts. FrameContextsEntrySize // byte size of FrameContexts. FrameContextsEntrySize
// gives the byte size of each entry in // gives the byte size of each entry in
// FrameContexts. // FrameContexts.
STDMETHOD(GetContextStackTrace)( STDMETHOD(GetContextStackTrace)(
THIS_ THIS_
__in_bcount_opt(StartContextSize) PVOID StartContext, _In_reads_bytes_opt_(StartContextSize) PVOID StartContext,
__in ULONG StartContextSize, _In_ ULONG StartContextSize,
__out_ecount_opt(FramesSize) PDEBUG_STACK_FRAME Frames, _Out_writes_opt_(FramesSize) PDEBUG_STACK_FRAME Frames,
__in ULONG FramesSize, _In_ ULONG FramesSize,
__out_bcount_opt(FrameContextsSize) PVOID FrameContexts, _Out_writes_bytes_opt_(FrameContextsSize) PVOID FrameContexts,
__in ULONG FrameContextsSize, _In_ ULONG FrameContextsSize,
__in ULONG FrameContextsEntrySize, _In_ ULONG FrameContextsEntrySize,
__out_opt PULONG FramesFilled _Out_opt_ PULONG FramesFilled
) PURE; ) PURE;
STDMETHOD(OutputContextStackTrace)( STDMETHOD(OutputContextStackTrace)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in_ecount(FramesSize) PDEBUG_STACK_FRAME Frames, _In_reads_(FramesSize) PDEBUG_STACK_FRAME Frames,
__in ULONG FramesSize, _In_ ULONG FramesSize,
__in_bcount(FrameContextsSize) PVOID FrameContexts, _In_reads_bytes_(FrameContextsSize) PVOID FrameContexts,
__in ULONG FrameContextsSize, _In_ ULONG FrameContextsSize,
__in ULONG FrameContextsEntrySize, _In_ ULONG FrameContextsEntrySize,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Some targets, such as user-mode minidump files, // Some targets, such as user-mode minidump files,
// have separate "event of interest" information // have separate "event of interest" information
// stored within them. This method allows // stored within them. This method allows
// access to that information. // access to that information.
STDMETHOD(GetStoredEventInformation)( STDMETHOD(GetStoredEventInformation)(
THIS_ THIS_
__out PULONG Type, _Out_ PULONG Type,
__out PULONG ProcessId, _Out_ PULONG ProcessId,
__out PULONG ThreadId, _Out_ PULONG ThreadId,
__out_bcount_opt(ContextSize) PVOID Context, _Out_writes_bytes_opt_(ContextSize) PVOID Context,
__in ULONG ContextSize, _In_ ULONG ContextSize,
__out_opt PULONG ContextUsed, _Out_opt_ PULONG ContextUsed,
__out_bcount_opt(ExtraInformationSize) PVOID ExtraInformation, _Out_writes_bytes_opt_(ExtraInformationSize) PVOID ExtraInformation,
__in ULONG ExtraInformationSize, _In_ ULONG ExtraInformationSize,
__out_opt PULONG ExtraInformationUsed _Out_opt_ PULONG ExtraInformationUsed
) PURE; ) PURE;
// Managed debugging support relies on debugging // Managed debugging support relies on debugging
// functionality provided by the Common Language Runtime. // functionality provided by the Common Language Runtime.
// This method provides feedback on the engine's // This method provides feedback on the engine's
// use of the runtime debugging APIs. // use of the runtime debugging APIs.
STDMETHOD(GetManagedStatus)( STDMETHOD(GetManagedStatus)(
THIS_ THIS_
__out_opt PULONG Flags, _Out_opt_ PULONG Flags,
__in ULONG WhichString, _In_ ULONG WhichString,
__out_ecount_opt(StringSize) PSTR String, _Out_writes_opt_(StringSize) PSTR String,
__in ULONG StringSize, _In_ ULONG StringSize,
__out_opt PULONG StringNeeded _Out_opt_ PULONG StringNeeded
) PURE; ) PURE;
STDMETHOD(GetManagedStatusWide)( STDMETHOD(GetManagedStatusWide)(
THIS_ THIS_
__out_opt PULONG Flags, _Out_opt_ PULONG Flags,
__in ULONG WhichString, _In_ ULONG WhichString,
__out_ecount_opt(StringSize) PWSTR String, _Out_writes_opt_(StringSize) PWSTR String,
__in ULONG StringSize, _In_ ULONG StringSize,
__out_opt PULONG StringNeeded _Out_opt_ PULONG StringNeeded
) PURE; ) PURE;
// Clears and reinitializes the engine's // Clears and reinitializes the engine's
// managed code debugging support. // managed code debugging support.
STDMETHOD(ResetManagedStatus)( STDMETHOD(ResetManagedStatus)(
THIS_ THIS_
__in ULONG Flags _In_ ULONG Flags
) PURE;
};
#undef INTERFACE
#define INTERFACE IDebugControl5
DECLARE_INTERFACE_(IDebugControl5, IUnknown)
{
// IUnknown.
STDMETHOD(QueryInterface)(
THIS_
_In_ REFIID InterfaceId,
_Out_ PVOID* Interface
) PURE;
STDMETHOD_(ULONG, AddRef)(
THIS
) PURE;
STDMETHOD_(ULONG, Release)(
THIS
) PURE;
// IDebugControl.
// Checks for a user interrupt, such a Ctrl-C
// or stop button.
// This method is reentrant.
STDMETHOD(GetInterrupt)(
THIS
) PURE;
// Registers a user interrupt.
// This method is reentrant.
STDMETHOD(SetInterrupt)(
THIS_
_In_ ULONG Flags
) PURE;
// Interrupting a user-mode process requires
// access to some system resources that the
// process may hold itself, preventing the
// interrupt from occurring. The engine
// will time-out pending interrupt requests
// and simulate an interrupt if necessary.
// These methods control the interrupt timeout.
STDMETHOD(GetInterruptTimeout)(
THIS_
_Out_ PULONG Seconds
) PURE;
STDMETHOD(SetInterruptTimeout)(
THIS_
_In_ ULONG Seconds
) PURE;
STDMETHOD(GetLogFile)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FileSize,
_Out_ PBOOL Append
) PURE;
// Opens a log file which collects all
// output. Output from every client except
// those that explicitly disable logging
// goes into the log.
// Opening a log file closes any log file
// already open.
STDMETHOD(OpenLogFile)(
THIS_
_In_ PCSTR File,
_In_ BOOL Append
) PURE;
STDMETHOD(CloseLogFile)(
THIS
) PURE;
// Controls what output is logged.
STDMETHOD(GetLogMask)(
THIS_
_Out_ PULONG Mask
) PURE;
STDMETHOD(SetLogMask)(
THIS_
_In_ ULONG Mask
) PURE;
// Input requests input from all clients.
// The first input that is returned is used
// to satisfy the call. Other returned
// input is discarded.
STDMETHOD(Input)(
THIS_
_Out_writes_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG InputSize
) PURE;
// This method is used by clients to return
// input when it is available. It will
// return S_OK if the input is used to
// satisfy an Input call and S_FALSE if
// the input is ignored.
// This method is reentrant.
STDMETHOD(ReturnInput)(
THIS_
_In_ PCSTR Buffer
) PURE;
// Sends output through clients
// output callbacks if the mask is allowed
// by the current output control mask and
// according to the output distribution
// settings.
STDMETHODV(Output)(
THIS_
_In_ ULONG Mask,
_In_ PCSTR Format,
...
) PURE;
STDMETHOD(OutputVaList)(
THIS_
_In_ ULONG Mask,
_In_ PCSTR Format,
_In_ va_list Args
) PURE;
// The following methods allow direct control
// over the distribution of the given output
// for situations where something other than
// the default is desired. These methods require
// extra work in the engine so they should
// only be used when necessary.
STDMETHODV(ControlledOutput)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Mask,
_In_ PCSTR Format,
...
) PURE;
STDMETHOD(ControlledOutputVaList)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Mask,
_In_ PCSTR Format,
_In_ va_list Args
) PURE;
// Displays the standard command-line prompt
// followed by the given output. If Format
// is NULL no additional output is produced.
// Output is produced under the
// DEBUG_OUTPUT_PROMPT mask.
// This method only outputs the prompt; it
// does not get input.
STDMETHODV(OutputPrompt)(
THIS_
_In_ ULONG OutputControl,
_In_opt_ PCSTR Format,
...
) PURE;
STDMETHOD(OutputPromptVaList)(
THIS_
_In_ ULONG OutputControl,
_In_opt_ PCSTR Format,
_In_ va_list Args
) PURE;
// Gets the text that would be displayed by OutputPrompt.
STDMETHOD(GetPromptText)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG TextSize
) PURE;
// Outputs information about the current
// debuggee state such as a register
// summary, disassembly at the current PC,
// closest symbol and others.
// Uses the line prefix.
STDMETHOD(OutputCurrentState)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Flags
) PURE;
// Outputs the debugger and extension version
// information. This method is reentrant.
// Uses the line prefix.
STDMETHOD(OutputVersionInformation)(
THIS_
_In_ ULONG OutputControl
) PURE;
// In user-mode debugging sessions the
// engine will set an event when
// exceptions are continued. This can
// be used to synchronize other processes
// with the debuggers handling of events.
// For example, this is used to support
// the e argument to ntsd.
STDMETHOD(GetNotifyEventHandle)(
THIS_
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(SetNotifyEventHandle)(
THIS_
_In_ ULONG64 Handle
) PURE;
STDMETHOD(Assemble)(
THIS_
_In_ ULONG64 Offset,
_In_ PCSTR Instr,
_Out_ PULONG64 EndOffset
) PURE;
STDMETHOD(Disassemble)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG DisassemblySize,
_Out_ PULONG64 EndOffset
) PURE;
// Returns the value of the effective address
// computed for the last Disassemble, if there
// was one.
STDMETHOD(GetDisassembleEffectiveOffset)(
THIS_
_Out_ PULONG64 Offset
) PURE;
// Uses the line prefix if necessary.
STDMETHOD(OutputDisassembly)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_ PULONG64 EndOffset
) PURE;
// Produces multiple lines of disassembly output.
// There will be PreviousLines of disassembly before
// the given offset if a valid disassembly exists.
// In all, there will be TotalLines of output produced.
// The first and last line offsets are returned
// specially and all lines offsets can be retrieved
// through LineOffsets. LineOffsets will contain
// offsets for each line where disassembly started.
// When disassembly of a single instruction takes
// multiple lines the initial offset will be followed
// by DEBUG_INVALID_OFFSET.
// Uses the line prefix.
STDMETHOD(OutputDisassemblyLines)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG PreviousLines,
_In_ ULONG TotalLines,
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_opt_ PULONG OffsetLine,
_Out_opt_ PULONG64 StartOffset,
_Out_opt_ PULONG64 EndOffset,
_Out_writes_opt_(TotalLines) PULONG64 LineOffsets
) PURE;
// Returns the offset of the start of
// the instruction thats the given
// delta away from the instruction
// at the initial offset.
// This routine does not check for
// validity of the instruction or
// the memory containing it.
STDMETHOD(GetNearInstruction)(
THIS_
_In_ ULONG64 Offset,
_In_ LONG Delta,
_Out_ PULONG64 NearOffset
) PURE;
// Offsets can be passed in as zero to use the current
// thread state.
STDMETHOD(GetStackTrace)(
THIS_
_In_ ULONG64 FrameOffset,
_In_ ULONG64 StackOffset,
_In_ ULONG64 InstructionOffset,
_Out_writes_to_(FramesSize,*FramesFilled) PDEBUG_STACK_FRAME Frames,
_In_ ULONG FramesSize,
_Out_opt_ PULONG FramesFilled
) PURE;
// Does a simple stack trace to determine
// what the current return address is.
STDMETHOD(GetReturnOffset)(
THIS_
_Out_ PULONG64 Offset
) PURE;
// If Frames is NULL OutputStackTrace will
// use GetStackTrace to get FramesSize frames
// and then output them. The current register
// values for frame, stack and instruction offsets
// are used.
// Uses the line prefix.
STDMETHOD(OutputStackTrace)(
THIS_
_In_ ULONG OutputControl,
_In_reads_opt_(FramesSize) PDEBUG_STACK_FRAME Frames,
_In_ ULONG FramesSize,
_In_ ULONG Flags
) PURE;
// Returns information about the debuggee such
// as user vs. kernel, dump vs. live, etc.
STDMETHOD(GetDebuggeeType)(
THIS_
_Out_ PULONG Class,
_Out_ PULONG Qualifier
) PURE;
// Returns the type of physical processors in
// the machine.
// Returns one of the IMAGE_FILE_MACHINE values.
STDMETHOD(GetActualProcessorType)(
THIS_
_Out_ PULONG Type
) PURE;
// Returns the type of processor used in the
// current processor context.
STDMETHOD(GetExecutingProcessorType)(
THIS_
_Out_ PULONG Type
) PURE;
// Query all the possible processor types that
// may be encountered during this debug session.
STDMETHOD(GetNumberPossibleExecutingProcessorTypes)(
THIS_
_Out_ PULONG Number
) PURE;
STDMETHOD(GetPossibleExecutingProcessorTypes)(
THIS_
_In_ ULONG Start,
_In_ ULONG Count,
_Out_writes_(Count) PULONG Types
) PURE;
// Get the number of actual processors in
// the machine.
STDMETHOD(GetNumberProcessors)(
THIS_
_Out_ PULONG Number
) PURE;
// PlatformId is one of the VER_PLATFORM values.
// Major and minor are as given in the NT
// kernel debugger protocol.
// ServicePackString and ServicePackNumber indicate the
// system service pack level. ServicePackNumber is not
// available in some sessions where the service pack level
// is only expressed as a string. The service pack information
// will be empty if the system does not have a service pack
// applied.
// The build string is string information identifying the
// particular build of the system. The build string is
// empty if the system has no particular identifying
// information.
STDMETHOD(GetSystemVersion)(
THIS_
_Out_ PULONG PlatformId,
_Out_ PULONG Major,
_Out_ PULONG Minor,
_Out_writes_opt_(ServicePackStringSize) PSTR ServicePackString,
_In_ ULONG ServicePackStringSize,
_Out_opt_ PULONG ServicePackStringUsed,
_Out_ PULONG ServicePackNumber,
_Out_writes_opt_(BuildStringSize) PSTR BuildString,
_In_ ULONG BuildStringSize,
_Out_opt_ PULONG BuildStringUsed
) PURE;
// Returns the page size for the currently executing
// processor context. The page size may vary between
// processor types.
STDMETHOD(GetPageSize)(
THIS_
_Out_ PULONG Size
) PURE;
// Returns S_OK if the current processor context uses
// 64-bit addresses, otherwise S_FALSE.
STDMETHOD(IsPointer64Bit)(
THIS
) PURE;
// Reads the bugcheck data area and returns the
// current contents. This method only works
// in kernel debugging sessions.
STDMETHOD(ReadBugCheckData)(
THIS_
_Out_ PULONG Code,
_Out_ PULONG64 Arg1,
_Out_ PULONG64 Arg2,
_Out_ PULONG64 Arg3,
_Out_ PULONG64 Arg4
) PURE;
// Query all the processor types supported by
// the engine. This is a complete list and is
// not related to the machine running the engine
// or the debuggee.
STDMETHOD(GetNumberSupportedProcessorTypes)(
THIS_
_Out_ PULONG Number
) PURE;
STDMETHOD(GetSupportedProcessorTypes)(
THIS_
_In_ ULONG Start,
_In_ ULONG Count,
_Out_writes_(Count) PULONG Types
) PURE;
// Returns a full, descriptive name and an
// abbreviated name for a processor type.
STDMETHOD(GetProcessorTypeNames)(
THIS_
_In_ ULONG Type,
_Out_writes_opt_(FullNameBufferSize) PSTR FullNameBuffer,
_In_ ULONG FullNameBufferSize,
_Out_opt_ PULONG FullNameSize,
_Out_writes_opt_(AbbrevNameBufferSize) PSTR AbbrevNameBuffer,
_In_ ULONG AbbrevNameBufferSize,
_Out_opt_ PULONG AbbrevNameSize
) PURE;
// Gets and sets the type of processor to
// use when doing things like setting
// breakpoints, accessing registers,
// getting stack traces and so on.
STDMETHOD(GetEffectiveProcessorType)(
THIS_
_Out_ PULONG Type
) PURE;
STDMETHOD(SetEffectiveProcessorType)(
THIS_
_In_ ULONG Type
) PURE;
// Returns information about whether and how
// the debuggee is running. Status will
// be GO if the debuggee is running and
// BREAK if it isnt.
// If no debuggee exists the status is
// NO_DEBUGGEE.
// This method is reentrant.
STDMETHOD(GetExecutionStatus)(
THIS_
_Out_ PULONG Status
) PURE;
// Changes the execution status of the
// engine from stopped to running.
// Status must be one of the go or step
// status values.
STDMETHOD(SetExecutionStatus)(
THIS_
_In_ ULONG Status
) PURE;
// Controls what code interpretation level the debugger
// runs at. The debugger checks the code level when
// deciding whether to step by a source line or
// assembly instruction along with other related operations.
STDMETHOD(GetCodeLevel)(
THIS_
_Out_ PULONG Level
) PURE;
STDMETHOD(SetCodeLevel)(
THIS_
_In_ ULONG Level
) PURE;
// Gets and sets engine control flags.
// These methods are reentrant.
STDMETHOD(GetEngineOptions)(
THIS_
_Out_ PULONG Options
) PURE;
STDMETHOD(AddEngineOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(RemoveEngineOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(SetEngineOptions)(
THIS_
_In_ ULONG Options
) PURE;
// Gets and sets control values for
// handling system error events.
// If the system error level is less
// than or equal to the given levels
// the error may be displayed and
// the default break for the event
// may be set.
STDMETHOD(GetSystemErrorControl)(
THIS_
_Out_ PULONG OutputLevel,
_Out_ PULONG BreakLevel
) PURE;
STDMETHOD(SetSystemErrorControl)(
THIS_
_In_ ULONG OutputLevel,
_In_ ULONG BreakLevel
) PURE;
// The command processor supports simple
// string replacement macros in Evaluate and
// Execute. There are currently ten macro
// slots available. Slots 0-9 map to
// the command invocations $u0-$u9.
STDMETHOD(GetTextMacro)(
THIS_
_In_ ULONG Slot,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG MacroSize
) PURE;
STDMETHOD(SetTextMacro)(
THIS_
_In_ ULONG Slot,
_In_ PCSTR Macro
) PURE;
// Controls the default number radix used
// in expressions and commands.
STDMETHOD(GetRadix)(
THIS_
_Out_ PULONG Radix
) PURE;
STDMETHOD(SetRadix)(
THIS_
_In_ ULONG Radix
) PURE;
// Evaluates the given expression string and
// returns the resulting value.
// If DesiredType is DEBUG_VALUE_INVALID then
// the natural type is used.
// RemainderIndex, if provided, is set to the index
// of the first character in the input string that was
// not used when evaluating the expression.
STDMETHOD(Evaluate)(
THIS_
_In_ PCSTR Expression,
_In_ ULONG DesiredType,
_Out_ PDEBUG_VALUE Value,
_Out_opt_ PULONG RemainderIndex
) PURE;
// Attempts to convert the input value to a value
// of the requested type in the output value.
// Conversions can fail if no conversion exists.
// Successful conversions may be lossy.
STDMETHOD(CoerceValue)(
THIS_
_In_ PDEBUG_VALUE In,
_In_ ULONG OutType,
_Out_ PDEBUG_VALUE Out
) PURE;
STDMETHOD(CoerceValues)(
THIS_
_In_ ULONG Count,
_In_reads_(Count) PDEBUG_VALUE In,
_In_reads_(Count) PULONG OutTypes,
_Out_writes_(Count) PDEBUG_VALUE Out
) PURE;
// Executes the given command string.
// If the string has multiple commands
// Execute will not return until all
// of them have been executed. If this
// requires waiting for the debuggee to
// execute an internal wait will be done
// so Execute can take an arbitrary amount
// of time.
STDMETHOD(Execute)(
THIS_
_In_ ULONG OutputControl,
_In_ PCSTR Command,
_In_ ULONG Flags
) PURE;
// Executes the given command file by
// reading a line at a time and processing
// it with Execute.
STDMETHOD(ExecuteCommandFile)(
THIS_
_In_ ULONG OutputControl,
_In_ PCSTR CommandFile,
_In_ ULONG Flags
) PURE;
// Breakpoint interfaces are described
// elsewhere in this section.
STDMETHOD(GetNumberBreakpoints)(
THIS_
_Out_ PULONG Number
) PURE;
// It is possible for this retrieval function to
// fail even with an index within the number of
// existing breakpoints if the breakpoint is
// a private breakpoint.
STDMETHOD(GetBreakpointByIndex)(
THIS_
_In_ ULONG Index,
_Out_ PDEBUG_BREAKPOINT* Bp
) PURE;
STDMETHOD(GetBreakpointById)(
THIS_
_In_ ULONG Id,
_Out_ PDEBUG_BREAKPOINT* Bp
) PURE;
// If Ids is non-NULL the Count breakpoints
// referred to in the Ids array are returned,
// otherwise breakpoints from index Start to
// Start + Count 1 are returned.
STDMETHOD(GetBreakpointParameters)(
THIS_
_In_ ULONG Count,
_In_reads_opt_(Count) PULONG Ids,
_In_ ULONG Start,
_Out_writes_(Count) PDEBUG_BREAKPOINT_PARAMETERS Params
) PURE;
// Breakpoints are created empty and disabled.
// When their parameters have been set they
// should be enabled by setting the ENABLE flag.
// If DesiredId is DEBUG_ANY_ID then the
// engine picks an unused ID. If DesiredId
// is any other number the engine attempts
// to use the given ID for the breakpoint.
// If another breakpoint exists with that ID
// the call will fail.
STDMETHOD(AddBreakpoint)(
THIS_
_In_ ULONG Type,
_In_ ULONG DesiredId,
_Out_ PDEBUG_BREAKPOINT* Bp
) PURE;
// Breakpoint interface is invalid after this call.
STDMETHOD(RemoveBreakpoint)(
THIS_
_In_ PDEBUG_BREAKPOINT Bp
) PURE;
// Control and use extension DLLs.
STDMETHOD(AddExtension)(
THIS_
_In_ PCSTR Path,
_In_ ULONG Flags,
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(RemoveExtension)(
THIS_
_In_ ULONG64 Handle
) PURE;
STDMETHOD(GetExtensionByPath)(
THIS_
_In_ PCSTR Path,
_Out_ PULONG64 Handle
) PURE;
// If Handle is zero the extension
// chain is walked searching for the
// function.
STDMETHOD(CallExtension)(
THIS_
_In_ ULONG64 Handle,
_In_ PCSTR Function,
_In_opt_ PCSTR Arguments
) PURE;
// GetExtensionFunction works like
// GetProcAddress on extension DLLs
// to allow raw function-call-level
// interaction with extension DLLs.
// Such functions do not need to
// follow the standard extension prototype
// if they are not going to be called
// through the text extension interface.
// This function cannot be called remotely.
STDMETHOD(GetExtensionFunction)(
THIS_
_In_ ULONG64 Handle,
_In_ PCSTR FuncName,
_Out_ FARPROC* Function
) PURE;
// These methods return alternate
// extension interfaces in order to allow
// interface-style extension DLLs to mix in
// older extension calls.
// Structure sizes must be initialized before
// the call.
// These methods cannot be called remotely.
STDMETHOD(GetWindbgExtensionApis32)(
THIS_
_Inout_ PWINDBG_EXTENSION_APIS32 Api
) PURE;
STDMETHOD(GetWindbgExtensionApis64)(
THIS_
_Inout_ PWINDBG_EXTENSION_APIS64 Api
) PURE;
// The engine provides a simple mechanism
// to filter common events. Arbitrarily complicated
// filtering can be done by registering event callbacks
// but simple event filtering only requires
// setting the options of one of the predefined
// event filters.
// Simple event filters are either for specific
// events and therefore have an enumerant or
// they are for an exception and are based on
// the exceptions code. Exception filters
// are further divided into exceptions specially
// handled by the engine, which is a fixed set,
// and arbitrary exceptions.
// All three groups of filters are indexed together
// with the specific filters first, then the specific
// exception filters and finally the arbitrary
// exception filters.
// The first specific exception is the default
// exception. If an exception event occurs for
// an exception without settings the default
// exception settings are used.
STDMETHOD(GetNumberEventFilters)(
THIS_
_Out_ PULONG SpecificEvents,
_Out_ PULONG SpecificExceptions,
_Out_ PULONG ArbitraryExceptions
) PURE;
// Some filters have descriptive text associated with them.
STDMETHOD(GetEventFilterText)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG TextSize
) PURE;
// All filters support executing a command when the
// event occurs.
STDMETHOD(GetEventFilterCommand)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG CommandSize
) PURE;
STDMETHOD(SetEventFilterCommand)(
THIS_
_In_ ULONG Index,
_In_ PCSTR Command
) PURE;
STDMETHOD(GetSpecificFilterParameters)(
THIS_
_In_ ULONG Start,
_In_ ULONG Count,
_Out_writes_(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
) PURE;
STDMETHOD(SetSpecificFilterParameters)(
THIS_
_In_ ULONG Start,
_In_ ULONG Count,
_In_reads_(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
) PURE;
// Some specific filters have arguments to further
// qualify their operation.
STDMETHOD(GetSpecificFilterArgument)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG ArgumentSize
) PURE;
STDMETHOD(SetSpecificFilterArgument)(
THIS_
_In_ ULONG Index,
_In_ PCSTR Argument
) PURE;
// If Codes is non-NULL Start is ignored.
STDMETHOD(GetExceptionFilterParameters)(
THIS_
_In_ ULONG Count,
_In_reads_opt_(Count) PULONG Codes,
_In_ ULONG Start,
_Out_writes_(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
) PURE;
// The codes in the parameter data control the application
// of the parameter data. If a code is not already in
// the set of filters it is added. If the ExecutionOption
// for a code is REMOVE then the filter is removed.
// Specific exception filters cannot be removed.
STDMETHOD(SetExceptionFilterParameters)(
THIS_
_In_ ULONG Count,
_In_reads_(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
) PURE;
// Exception filters support an additional command for
// second-chance events.
STDMETHOD(GetExceptionFilterSecondCommand)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG CommandSize
) PURE;
STDMETHOD(SetExceptionFilterSecondCommand)(
THIS_
_In_ ULONG Index,
_In_ PCSTR Command
) PURE;
// Yields processing to the engine until
// an event occurs. This method may
// only be called by the thread that started
// the debug session.
// When an event occurs the engine carries
// out all event processing such as calling
// callbacks.
// If the callbacks indicate that execution should
// break the wait will return, otherwise it
// goes back to waiting for a new event.
// If the timeout expires, S_FALSE is returned.
// The timeout is not currently supported for
// kernel debugging.
STDMETHOD(WaitForEvent)(
THIS_
_In_ ULONG Flags,
_In_ ULONG Timeout
) PURE;
// Retrieves information about the last event that occurred.
// EventType is one of the event callback mask bits.
// ExtraInformation contains additional event-specific
// information. Not all events have additional information.
STDMETHOD(GetLastEventInformation)(
THIS_
_Out_ PULONG Type,
_Out_ PULONG ProcessId,
_Out_ PULONG ThreadId,
_Out_writes_bytes_opt_(ExtraInformationSize) PVOID ExtraInformation,
_In_ ULONG ExtraInformationSize,
_Out_opt_ PULONG ExtraInformationUsed,
_Out_writes_opt_(DescriptionSize) PSTR Description,
_In_ ULONG DescriptionSize,
_Out_opt_ PULONG DescriptionUsed
) PURE;
// IDebugControl2.
STDMETHOD(GetCurrentTimeDate)(
THIS_
_Out_ PULONG TimeDate
) PURE;
// Retrieves the number of seconds since the
// machine started running.
STDMETHOD(GetCurrentSystemUpTime)(
THIS_
_Out_ PULONG UpTime
) PURE;
// If the current session is a dump session,
// retrieves any extended format information.
STDMETHOD(GetDumpFormatFlags)(
THIS_
_Out_ PULONG FormatFlags
) PURE;
// The debugger has been enhanced to allow
// arbitrary text replacements in addition
// to the simple $u0-$u9 text macros.
// Text replacement takes a given source
// text in commands and converts it to the
// given destination text. Replacements
// are named by their source text so that
// only one replacement for a source text
// string can exist.
STDMETHOD(GetNumberTextReplacements)(
THIS_
_Out_ PULONG NumRepl
) PURE;
// If SrcText is non-NULL the replacement
// is looked up by source text, otherwise
// Index is used to get the Nth replacement.
STDMETHOD(GetTextReplacement)(
THIS_
_In_opt_ PCSTR SrcText,
_In_ ULONG Index,
_Out_writes_opt_(SrcBufferSize) PSTR SrcBuffer,
_In_ ULONG SrcBufferSize,
_Out_opt_ PULONG SrcSize,
_Out_writes_opt_(DstBufferSize) PSTR DstBuffer,
_In_ ULONG DstBufferSize,
_Out_opt_ PULONG DstSize
) PURE;
// Setting the destination text to
// NULL removes the alias.
STDMETHOD(SetTextReplacement)(
THIS_
_In_ PCSTR SrcText,
_In_opt_ PCSTR DstText
) PURE;
STDMETHOD(RemoveTextReplacements)(
THIS
) PURE;
// Outputs the complete list of current
// replacements.
STDMETHOD(OutputTextReplacements)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Flags
) PURE;
// IDebugControl3.
// Control options for assembly and disassembly.
STDMETHOD(GetAssemblyOptions)(
THIS_
_Out_ PULONG Options
) PURE;
STDMETHOD(AddAssemblyOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(RemoveAssemblyOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(SetAssemblyOptions)(
THIS_
_In_ ULONG Options
) PURE;
// Control the expression syntax.
STDMETHOD(GetExpressionSyntax)(
THIS_
_Out_ PULONG Flags
) PURE;
STDMETHOD(SetExpressionSyntax)(
THIS_
_In_ ULONG Flags
) PURE;
// Look up a syntax by its abbreviated
// name and set it.
STDMETHOD(SetExpressionSyntaxByName)(
THIS_
_In_ PCSTR AbbrevName
) PURE;
STDMETHOD(GetNumberExpressionSyntaxes)(
THIS_
_Out_ PULONG Number
) PURE;
STDMETHOD(GetExpressionSyntaxNames)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(FullNameBufferSize) PSTR FullNameBuffer,
_In_ ULONG FullNameBufferSize,
_Out_opt_ PULONG FullNameSize,
_Out_writes_opt_(AbbrevNameBufferSize) PSTR AbbrevNameBuffer,
_In_ ULONG AbbrevNameBufferSize,
_Out_opt_ PULONG AbbrevNameSize
) PURE;
//
// Some debug sessions have only a single
// possible event, such as a snapshot dump
// file; some have dynamic events, such as
// a live debug session; and others may have
// multiple events, such as a dump file that
// contains snapshots from different points
// in time. The following methods allow
// discovery and selection of the available
// events for a session.
// Sessions with one or more static events
// will be able to report all of the events
// when queried. Sessions with dynamic events
// will only report a single event representing
// the current event.
// Switching events constitutes execution and
// changing the current event will alter the
// execution status to a running state, after
// which WaitForEvent must be used to process
// the selected event.
//
// GetNumberEvents returns S_OK if this is the
// complete set of events possible, such as for
// a static session; or S_FALSE if other events
// may be possible, such as for a dynamic session.
STDMETHOD(GetNumberEvents)(
THIS_
_Out_ PULONG Events
) PURE;
// Sessions may have descriptive information for
// the various events available. The amount of
// information varies according to the specific
// session and data.
STDMETHOD(GetEventIndexDescription)(
THIS_
_In_ ULONG Index,
_In_ ULONG Which,
_In_opt_ PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG DescSize
) PURE;
STDMETHOD(GetCurrentEventIndex)(
THIS_
_Out_ PULONG Index
) PURE;
// SetNextEventIndex works like seek in that
// it can set an absolute or relative index.
// SetNextEventIndex works similarly to SetExecutionStatus
// by putting the session into a running state, after
// which the caller must call WaitForEvent. The
// current event index only changes when WaitForEvent
// is called.
STDMETHOD(SetNextEventIndex)(
THIS_
_In_ ULONG Relation,
_In_ ULONG Value,
_Out_ PULONG NextIndex
) PURE;
// IDebugControl4.
STDMETHOD(GetLogFileWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FileSize,
_Out_ PBOOL Append
) PURE;
STDMETHOD(OpenLogFileWide)(
THIS_
_In_ PCWSTR File,
_In_ BOOL Append
) PURE;
STDMETHOD(InputWide)(
THIS_
_Out_writes_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG InputSize
) PURE;
STDMETHOD(ReturnInputWide)(
THIS_
_In_ PCWSTR Buffer
) PURE;
STDMETHODV(OutputWide)(
THIS_
_In_ ULONG Mask,
_In_ PCWSTR Format,
...
) PURE;
STDMETHOD(OutputVaListWide)(
THIS_
_In_ ULONG Mask,
_In_ PCWSTR Format,
_In_ va_list Args
) PURE;
STDMETHODV(ControlledOutputWide)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Mask,
_In_ PCWSTR Format,
...
) PURE;
STDMETHOD(ControlledOutputVaListWide)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Mask,
_In_ PCWSTR Format,
_In_ va_list Args
) PURE;
STDMETHODV(OutputPromptWide)(
THIS_
_In_ ULONG OutputControl,
_In_opt_ PCWSTR Format,
...
) PURE;
STDMETHOD(OutputPromptVaListWide)(
THIS_
_In_ ULONG OutputControl,
_In_opt_ PCWSTR Format,
_In_ va_list Args
) PURE;
STDMETHOD(GetPromptTextWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG TextSize
) PURE;
STDMETHOD(AssembleWide)(
THIS_
_In_ ULONG64 Offset,
_In_ PCWSTR Instr,
_Out_ PULONG64 EndOffset
) PURE;
STDMETHOD(DisassembleWide)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG DisassemblySize,
_Out_ PULONG64 EndOffset
) PURE;
STDMETHOD(GetProcessorTypeNamesWide)(
THIS_
_In_ ULONG Type,
_Out_writes_opt_(FullNameBufferSize) PWSTR FullNameBuffer,
_In_ ULONG FullNameBufferSize,
_Out_opt_ PULONG FullNameSize,
_Out_writes_opt_(AbbrevNameBufferSize) PWSTR AbbrevNameBuffer,
_In_ ULONG AbbrevNameBufferSize,
_Out_opt_ PULONG AbbrevNameSize
) PURE;
STDMETHOD(GetTextMacroWide)(
THIS_
_In_ ULONG Slot,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG MacroSize
) PURE;
STDMETHOD(SetTextMacroWide)(
THIS_
_In_ ULONG Slot,
_In_ PCWSTR Macro
) PURE;
STDMETHOD(EvaluateWide)(
THIS_
_In_ PCWSTR Expression,
_In_ ULONG DesiredType,
_Out_ PDEBUG_VALUE Value,
_Out_opt_ PULONG RemainderIndex
) PURE;
STDMETHOD(ExecuteWide)(
THIS_
_In_ ULONG OutputControl,
_In_ PCWSTR Command,
_In_ ULONG Flags
) PURE;
STDMETHOD(ExecuteCommandFileWide)(
THIS_
_In_ ULONG OutputControl,
_In_ PCWSTR CommandFile,
_In_ ULONG Flags
) PURE;
STDMETHOD(GetBreakpointByIndex2)(
THIS_
_In_ ULONG Index,
_Out_ PDEBUG_BREAKPOINT2* Bp
) PURE;
STDMETHOD(GetBreakpointById2)(
THIS_
_In_ ULONG Id,
_Out_ PDEBUG_BREAKPOINT2* Bp
) PURE;
STDMETHOD(AddBreakpoint2)(
THIS_
_In_ ULONG Type,
_In_ ULONG DesiredId,
_Out_ PDEBUG_BREAKPOINT2* Bp
) PURE;
STDMETHOD(RemoveBreakpoint2)(
THIS_
_In_ PDEBUG_BREAKPOINT2 Bp
) PURE;
STDMETHOD(AddExtensionWide)(
THIS_
_In_ PCWSTR Path,
_In_ ULONG Flags,
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(GetExtensionByPathWide)(
THIS_
_In_ PCWSTR Path,
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(CallExtensionWide)(
THIS_
_In_ ULONG64 Handle,
_In_ PCWSTR Function,
_In_opt_ PCWSTR Arguments
) PURE;
STDMETHOD(GetExtensionFunctionWide)(
THIS_
_In_ ULONG64 Handle,
_In_ PCWSTR FuncName,
_Out_ FARPROC* Function
) PURE;
STDMETHOD(GetEventFilterTextWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG TextSize
) PURE;
STDMETHOD(GetEventFilterCommandWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG CommandSize
) PURE;
STDMETHOD(SetEventFilterCommandWide)(
THIS_
_In_ ULONG Index,
_In_ PCWSTR Command
) PURE;
STDMETHOD(GetSpecificFilterArgumentWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG ArgumentSize
) PURE;
STDMETHOD(SetSpecificFilterArgumentWide)(
THIS_
_In_ ULONG Index,
_In_ PCWSTR Argument
) PURE;
STDMETHOD(GetExceptionFilterSecondCommandWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG CommandSize
) PURE;
STDMETHOD(SetExceptionFilterSecondCommandWide)(
THIS_
_In_ ULONG Index,
_In_ PCWSTR Command
) PURE;
STDMETHOD(GetLastEventInformationWide)(
THIS_
_Out_ PULONG Type,
_Out_ PULONG ProcessId,
_Out_ PULONG ThreadId,
_Out_writes_bytes_opt_(ExtraInformationSize) PVOID ExtraInformation,
_In_ ULONG ExtraInformationSize,
_Out_opt_ PULONG ExtraInformationUsed,
_Out_writes_opt_(DescriptionSize) PWSTR Description,
_In_ ULONG DescriptionSize,
_Out_opt_ PULONG DescriptionUsed
) PURE;
STDMETHOD(GetTextReplacementWide)(
THIS_
_In_opt_ PCWSTR SrcText,
_In_ ULONG Index,
_Out_writes_opt_(SrcBufferSize) PWSTR SrcBuffer,
_In_ ULONG SrcBufferSize,
_Out_opt_ PULONG SrcSize,
_Out_writes_opt_(DstBufferSize) PWSTR DstBuffer,
_In_ ULONG DstBufferSize,
_Out_opt_ PULONG DstSize
) PURE;
STDMETHOD(SetTextReplacementWide)(
THIS_
_In_ PCWSTR SrcText,
_In_opt_ PCWSTR DstText
) PURE;
STDMETHOD(SetExpressionSyntaxByNameWide)(
THIS_
_In_ PCWSTR AbbrevName
) PURE;
STDMETHOD(GetExpressionSyntaxNamesWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(FullNameBufferSize) PWSTR FullNameBuffer,
_In_ ULONG FullNameBufferSize,
_Out_opt_ PULONG FullNameSize,
_Out_writes_opt_(AbbrevNameBufferSize) PWSTR AbbrevNameBuffer,
_In_ ULONG AbbrevNameBufferSize,
_Out_opt_ PULONG AbbrevNameSize
) PURE;
STDMETHOD(GetEventIndexDescriptionWide)(
THIS_
_In_ ULONG Index,
_In_ ULONG Which,
_In_opt_ PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG DescSize
) PURE;
STDMETHOD(GetLogFile2)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FileSize,
_Out_ PULONG Flags
) PURE;
STDMETHOD(OpenLogFile2)(
THIS_
_In_ PCSTR File,
_In_ ULONG Flags
) PURE;
STDMETHOD(GetLogFile2Wide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FileSize,
_Out_ PULONG Flags
) PURE;
STDMETHOD(OpenLogFile2Wide)(
THIS_
_In_ PCWSTR File,
_In_ ULONG Flags
) PURE;
// GetSystemVersion always returns the kd
// major/minor version numbers, which are
// different than the Win32 version numbers.
// GetSystemVersionValues can be used
// to determine the Win32 version values.
STDMETHOD(GetSystemVersionValues)(
THIS_
_Out_ PULONG PlatformId,
_Out_ PULONG Win32Major,
_Out_ PULONG Win32Minor,
_Out_opt_ PULONG KdMajor,
_Out_opt_ PULONG KdMinor
) PURE;
// Strings are selected with DEBUG_SYSVERSTR_*.
STDMETHOD(GetSystemVersionString)(
THIS_
_In_ ULONG Which,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
STDMETHOD(GetSystemVersionStringWide)(
THIS_
_In_ ULONG Which,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
// Stack tracing with a full initial context
// and full context return for each frame.
// The FrameContextsSize parameter is the total
// byte size of FrameContexts. FrameContextsEntrySize
// gives the byte size of each entry in
// FrameContexts.
STDMETHOD(GetContextStackTrace)(
THIS_
_In_reads_bytes_opt_(StartContextSize) PVOID StartContext,
_In_ ULONG StartContextSize,
_Out_writes_to_opt_(FramesSize,*FramesFilled) PDEBUG_STACK_FRAME Frames,
_In_ ULONG FramesSize,
_Out_writes_bytes_opt_(FrameContextsSize) PVOID FrameContexts,
_In_ ULONG FrameContextsSize,
_In_ ULONG FrameContextsEntrySize,
_Out_opt_ PULONG FramesFilled
) PURE;
STDMETHOD(OutputContextStackTrace)(
THIS_
_In_ ULONG OutputControl,
_In_reads_(FramesSize) PDEBUG_STACK_FRAME Frames,
_In_ ULONG FramesSize,
_In_reads_bytes_(FrameContextsSize) PVOID FrameContexts,
_In_ ULONG FrameContextsSize,
_In_ ULONG FrameContextsEntrySize,
_In_ ULONG Flags
) PURE;
// Some targets, such as user-mode minidump files,
// have separate "event of interest" information
// stored within them. This method allows
// access to that information.
STDMETHOD(GetStoredEventInformation)(
THIS_
_Out_ PULONG Type,
_Out_ PULONG ProcessId,
_Out_ PULONG ThreadId,
_Out_writes_bytes_opt_(ContextSize) PVOID Context,
_In_ ULONG ContextSize,
_Out_opt_ PULONG ContextUsed,
_Out_writes_bytes_opt_(ExtraInformationSize) PVOID ExtraInformation,
_In_ ULONG ExtraInformationSize,
_Out_opt_ PULONG ExtraInformationUsed
) PURE;
// Managed debugging support relies on debugging
// functionality provided by the Common Language Runtime.
// This method provides feedback on the engine's
// use of the runtime debugging APIs.
STDMETHOD(GetManagedStatus)(
THIS_
_Out_opt_ PULONG Flags,
_In_ ULONG WhichString,
_Out_writes_opt_(StringSize) PSTR String,
_In_ ULONG StringSize,
_Out_opt_ PULONG StringNeeded
) PURE;
STDMETHOD(GetManagedStatusWide)(
THIS_
_Out_opt_ PULONG Flags,
_In_ ULONG WhichString,
_Out_writes_opt_(StringSize) PWSTR String,
_In_ ULONG StringSize,
_Out_opt_ PULONG StringNeeded
) PURE;
// Clears and reinitializes the engine's
// managed code debugging support.
STDMETHOD(ResetManagedStatus)(
THIS_
_In_ ULONG Flags
) PURE;
// IDebugControl5
STDMETHOD(GetStackTraceEx)(
THIS_
_In_ ULONG64 FrameOffset,
_In_ ULONG64 StackOffset,
_In_ ULONG64 InstructionOffset,
_Out_writes_to_(FramesSize,*FramesFilled) PDEBUG_STACK_FRAME_EX Frames,
_In_ ULONG FramesSize,
_Out_opt_ PULONG FramesFilled
) PURE;
STDMETHOD(OutputStackTraceEx)(
THIS_
_In_ ULONG OutputControl,
_In_reads_opt_(FramesSize) PDEBUG_STACK_FRAME_EX Frames,
_In_ ULONG FramesSize,
_In_ ULONG Flags
) PURE;
STDMETHOD(GetContextStackTraceEx)(
THIS_
_In_reads_bytes_opt_(StartContextSize) PVOID StartContext,
_In_ ULONG StartContextSize,
_Out_writes_to_opt_(FramesSize,*FramesFilled) PDEBUG_STACK_FRAME_EX Fram
es,
_In_ ULONG FramesSize,
_Out_writes_bytes_opt_(FrameContextsSize) PVOID FrameContexts,
_In_ ULONG FrameContextsSize,
_In_ ULONG FrameContextsEntrySize,
_Out_opt_ PULONG FramesFilled
) PURE;
STDMETHOD(OutputContextStackTraceEx)(
THIS_
_In_ ULONG OutputControl,
_In_reads_(FramesSize) PDEBUG_STACK_FRAME_EX Frames,
_In_ ULONG FramesSize,
_In_reads_bytes_(FrameContextsSize) PVOID FrameContexts,
_In_ ULONG FrameContextsSize,
_In_ ULONG FrameContextsEntrySize,
_In_ ULONG Flags
) PURE;
STDMETHOD(GetBreakpointByGuid)(
THIS_
_In_ LPGUID Guid,
_Out_ PDEBUG_BREAKPOINT3* Bp
) PURE;
};
#undef INTERFACE
#define INTERFACE IDebugControl6
DECLARE_INTERFACE_(IDebugControl6, IUnknown)
{
// IUnknown.
STDMETHOD(QueryInterface)(
THIS_
_In_ REFIID InterfaceId,
_Out_ PVOID* Interface
) PURE;
STDMETHOD_(ULONG, AddRef)(
THIS
) PURE;
STDMETHOD_(ULONG, Release)(
THIS
) PURE;
// IDebugControl.
// Checks for a user interrupt, such a Ctrl-C
// or stop button.
// This method is reentrant.
STDMETHOD(GetInterrupt)(
THIS
) PURE;
// Registers a user interrupt.
// This method is reentrant.
STDMETHOD(SetInterrupt)(
THIS_
_In_ ULONG Flags
) PURE;
// Interrupting a user-mode process requires
// access to some system resources that the
// process may hold itself, preventing the
// interrupt from occurring. The engine
// will time-out pending interrupt requests
// and simulate an interrupt if necessary.
// These methods control the interrupt timeout.
STDMETHOD(GetInterruptTimeout)(
THIS_
_Out_ PULONG Seconds
) PURE;
STDMETHOD(SetInterruptTimeout)(
THIS_
_In_ ULONG Seconds
) PURE;
STDMETHOD(GetLogFile)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FileSize,
_Out_ PBOOL Append
) PURE;
// Opens a log file which collects all
// output. Output from every client except
// those that explicitly disable logging
// goes into the log.
// Opening a log file closes any log file
// already open.
STDMETHOD(OpenLogFile)(
THIS_
_In_ PCSTR File,
_In_ BOOL Append
) PURE;
STDMETHOD(CloseLogFile)(
THIS
) PURE;
// Controls what output is logged.
STDMETHOD(GetLogMask)(
THIS_
_Out_ PULONG Mask
) PURE;
STDMETHOD(SetLogMask)(
THIS_
_In_ ULONG Mask
) PURE;
// Input requests input from all clients.
// The first input that is returned is used
// to satisfy the call. Other returned
// input is discarded.
STDMETHOD(Input)(
THIS_
_Out_writes_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG InputSize
) PURE;
// This method is used by clients to return
// input when it is available. It will
// return S_OK if the input is used to
// satisfy an Input call and S_FALSE if
// the input is ignored.
// This method is reentrant.
STDMETHOD(ReturnInput)(
THIS_
_In_ PCSTR Buffer
) PURE;
// Sends output through clients
// output callbacks if the mask is allowed
// by the current output control mask and
// according to the output distribution
// settings.
STDMETHODV(Output)(
THIS_
_In_ ULONG Mask,
_In_ PCSTR Format,
...
) PURE;
STDMETHOD(OutputVaList)(
THIS_
_In_ ULONG Mask,
_In_ PCSTR Format,
_In_ va_list Args
) PURE;
// The following methods allow direct control
// over the distribution of the given output
// for situations where something other than
// the default is desired. These methods require
// extra work in the engine so they should
// only be used when necessary.
STDMETHODV(ControlledOutput)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Mask,
_In_ PCSTR Format,
...
) PURE;
STDMETHOD(ControlledOutputVaList)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Mask,
_In_ PCSTR Format,
_In_ va_list Args
) PURE;
// Displays the standard command-line prompt
// followed by the given output. If Format
// is NULL no additional output is produced.
// Output is produced under the
// DEBUG_OUTPUT_PROMPT mask.
// This method only outputs the prompt; it
// does not get input.
STDMETHODV(OutputPrompt)(
THIS_
_In_ ULONG OutputControl,
_In_opt_ PCSTR Format,
...
) PURE;
STDMETHOD(OutputPromptVaList)(
THIS_
_In_ ULONG OutputControl,
_In_opt_ PCSTR Format,
_In_ va_list Args
) PURE;
// Gets the text that would be displayed by OutputPrompt.
STDMETHOD(GetPromptText)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG TextSize
) PURE;
// Outputs information about the current
// debuggee state such as a register
// summary, disassembly at the current PC,
// closest symbol and others.
// Uses the line prefix.
STDMETHOD(OutputCurrentState)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Flags
) PURE;
// Outputs the debugger and extension version
// information. This method is reentrant.
// Uses the line prefix.
STDMETHOD(OutputVersionInformation)(
THIS_
_In_ ULONG OutputControl
) PURE;
// In user-mode debugging sessions the
// engine will set an event when
// exceptions are continued. This can
// be used to synchronize other processes
// with the debuggers handling of events.
// For example, this is used to support
// the e argument to ntsd.
STDMETHOD(GetNotifyEventHandle)(
THIS_
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(SetNotifyEventHandle)(
THIS_
_In_ ULONG64 Handle
) PURE;
STDMETHOD(Assemble)(
THIS_
_In_ ULONG64 Offset,
_In_ PCSTR Instr,
_Out_ PULONG64 EndOffset
) PURE;
STDMETHOD(Disassemble)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG DisassemblySize,
_Out_ PULONG64 EndOffset
) PURE;
// Returns the value of the effective address
// computed for the last Disassemble, if there
// was one.
STDMETHOD(GetDisassembleEffectiveOffset)(
THIS_
_Out_ PULONG64 Offset
) PURE;
// Uses the line prefix if necessary.
STDMETHOD(OutputDisassembly)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_ PULONG64 EndOffset
) PURE;
// Produces multiple lines of disassembly output.
// There will be PreviousLines of disassembly before
// the given offset if a valid disassembly exists.
// In all, there will be TotalLines of output produced.
// The first and last line offsets are returned
// specially and all lines offsets can be retrieved
// through LineOffsets. LineOffsets will contain
// offsets for each line where disassembly started.
// When disassembly of a single instruction takes
// multiple lines the initial offset will be followed
// by DEBUG_INVALID_OFFSET.
// Uses the line prefix.
STDMETHOD(OutputDisassemblyLines)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG PreviousLines,
_In_ ULONG TotalLines,
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_opt_ PULONG OffsetLine,
_Out_opt_ PULONG64 StartOffset,
_Out_opt_ PULONG64 EndOffset,
_Out_writes_opt_(TotalLines) PULONG64 LineOffsets
) PURE;
// Returns the offset of the start of
// the instruction thats the given
// delta away from the instruction
// at the initial offset.
// This routine does not check for
// validity of the instruction or
// the memory containing it.
STDMETHOD(GetNearInstruction)(
THIS_
_In_ ULONG64 Offset,
_In_ LONG Delta,
_Out_ PULONG64 NearOffset
) PURE;
// Offsets can be passed in as zero to use the current
// thread state.
STDMETHOD(GetStackTrace)(
THIS_
_In_ ULONG64 FrameOffset,
_In_ ULONG64 StackOffset,
_In_ ULONG64 InstructionOffset,
_Out_writes_to_(FramesSize,*FramesFilled) PDEBUG_STACK_FRAME Frames,
_In_ ULONG FramesSize,
_Out_opt_ PULONG FramesFilled
) PURE;
// Does a simple stack trace to determine
// what the current return address is.
STDMETHOD(GetReturnOffset)(
THIS_
_Out_ PULONG64 Offset
) PURE;
// If Frames is NULL OutputStackTrace will
// use GetStackTrace to get FramesSize frames
// and then output them. The current register
// values for frame, stack and instruction offsets
// are used.
// Uses the line prefix.
STDMETHOD(OutputStackTrace)(
THIS_
_In_ ULONG OutputControl,
_In_reads_opt_(FramesSize) PDEBUG_STACK_FRAME Frames,
_In_ ULONG FramesSize,
_In_ ULONG Flags
) PURE;
// Returns information about the debuggee such
// as user vs. kernel, dump vs. live, etc.
STDMETHOD(GetDebuggeeType)(
THIS_
_Out_ PULONG Class,
_Out_ PULONG Qualifier
) PURE;
// Returns the type of physical processors in
// the machine.
// Returns one of the IMAGE_FILE_MACHINE values.
STDMETHOD(GetActualProcessorType)(
THIS_
_Out_ PULONG Type
) PURE;
// Returns the type of processor used in the
// current processor context.
STDMETHOD(GetExecutingProcessorType)(
THIS_
_Out_ PULONG Type
) PURE;
// Query all the possible processor types that
// may be encountered during this debug session.
STDMETHOD(GetNumberPossibleExecutingProcessorTypes)(
THIS_
_Out_ PULONG Number
) PURE;
STDMETHOD(GetPossibleExecutingProcessorTypes)(
THIS_
_In_ ULONG Start,
_In_ ULONG Count,
_Out_writes_(Count) PULONG Types
) PURE;
// Get the number of actual processors in
// the machine.
STDMETHOD(GetNumberProcessors)(
THIS_
_Out_ PULONG Number
) PURE;
// PlatformId is one of the VER_PLATFORM values.
// Major and minor are as given in the NT
// kernel debugger protocol.
// ServicePackString and ServicePackNumber indicate the
// system service pack level. ServicePackNumber is not
// available in some sessions where the service pack level
// is only expressed as a string. The service pack information
// will be empty if the system does not have a service pack
// applied.
// The build string is string information identifying the
// particular build of the system. The build string is
// empty if the system has no particular identifying
// information.
STDMETHOD(GetSystemVersion)(
THIS_
_Out_ PULONG PlatformId,
_Out_ PULONG Major,
_Out_ PULONG Minor,
_Out_writes_opt_(ServicePackStringSize) PSTR ServicePackString,
_In_ ULONG ServicePackStringSize,
_Out_opt_ PULONG ServicePackStringUsed,
_Out_ PULONG ServicePackNumber,
_Out_writes_opt_(BuildStringSize) PSTR BuildString,
_In_ ULONG BuildStringSize,
_Out_opt_ PULONG BuildStringUsed
) PURE;
// Returns the page size for the currently executing
// processor context. The page size may vary between
// processor types.
STDMETHOD(GetPageSize)(
THIS_
_Out_ PULONG Size
) PURE;
// Returns S_OK if the current processor context uses
// 64-bit addresses, otherwise S_FALSE.
STDMETHOD(IsPointer64Bit)(
THIS
) PURE;
// Reads the bugcheck data area and returns the
// current contents. This method only works
// in kernel debugging sessions.
STDMETHOD(ReadBugCheckData)(
THIS_
_Out_ PULONG Code,
_Out_ PULONG64 Arg1,
_Out_ PULONG64 Arg2,
_Out_ PULONG64 Arg3,
_Out_ PULONG64 Arg4
) PURE;
// Query all the processor types supported by
// the engine. This is a complete list and is
// not related to the machine running the engine
// or the debuggee.
STDMETHOD(GetNumberSupportedProcessorTypes)(
THIS_
_Out_ PULONG Number
) PURE;
STDMETHOD(GetSupportedProcessorTypes)(
THIS_
_In_ ULONG Start,
_In_ ULONG Count,
_Out_writes_(Count) PULONG Types
) PURE;
// Returns a full, descriptive name and an
// abbreviated name for a processor type.
STDMETHOD(GetProcessorTypeNames)(
THIS_
_In_ ULONG Type,
_Out_writes_opt_(FullNameBufferSize) PSTR FullNameBuffer,
_In_ ULONG FullNameBufferSize,
_Out_opt_ PULONG FullNameSize,
_Out_writes_opt_(AbbrevNameBufferSize) PSTR AbbrevNameBuffer,
_In_ ULONG AbbrevNameBufferSize,
_Out_opt_ PULONG AbbrevNameSize
) PURE;
// Gets and sets the type of processor to
// use when doing things like setting
// breakpoints, accessing registers,
// getting stack traces and so on.
STDMETHOD(GetEffectiveProcessorType)(
THIS_
_Out_ PULONG Type
) PURE;
STDMETHOD(SetEffectiveProcessorType)(
THIS_
_In_ ULONG Type
) PURE;
// Returns information about whether and how
// the debuggee is running. Status will
// be GO if the debuggee is running and
// BREAK if it isnt.
// If no debuggee exists the status is
// NO_DEBUGGEE.
// This method is reentrant.
STDMETHOD(GetExecutionStatus)(
THIS_
_Out_ PULONG Status
) PURE;
// Changes the execution status of the
// engine from stopped to running.
// Status must be one of the go or step
// status values.
STDMETHOD(SetExecutionStatus)(
THIS_
_In_ ULONG Status
) PURE;
// Controls what code interpretation level the debugger
// runs at. The debugger checks the code level when
// deciding whether to step by a source line or
// assembly instruction along with other related operations.
STDMETHOD(GetCodeLevel)(
THIS_
_Out_ PULONG Level
) PURE;
STDMETHOD(SetCodeLevel)(
THIS_
_In_ ULONG Level
) PURE;
// Gets and sets engine control flags.
// These methods are reentrant.
STDMETHOD(GetEngineOptions)(
THIS_
_Out_ PULONG Options
) PURE;
STDMETHOD(AddEngineOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(RemoveEngineOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(SetEngineOptions)(
THIS_
_In_ ULONG Options
) PURE;
// Gets and sets control values for
// handling system error events.
// If the system error level is less
// than or equal to the given levels
// the error may be displayed and
// the default break for the event
// may be set.
STDMETHOD(GetSystemErrorControl)(
THIS_
_Out_ PULONG OutputLevel,
_Out_ PULONG BreakLevel
) PURE;
STDMETHOD(SetSystemErrorControl)(
THIS_
_In_ ULONG OutputLevel,
_In_ ULONG BreakLevel
) PURE;
// The command processor supports simple
// string replacement macros in Evaluate and
// Execute. There are currently ten macro
// slots available. Slots 0-9 map to
// the command invocations $u0-$u9.
STDMETHOD(GetTextMacro)(
THIS_
_In_ ULONG Slot,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG MacroSize
) PURE;
STDMETHOD(SetTextMacro)(
THIS_
_In_ ULONG Slot,
_In_ PCSTR Macro
) PURE;
// Controls the default number radix used
// in expressions and commands.
STDMETHOD(GetRadix)(
THIS_
_Out_ PULONG Radix
) PURE;
STDMETHOD(SetRadix)(
THIS_
_In_ ULONG Radix
) PURE;
// Evaluates the given expression string and
// returns the resulting value.
// If DesiredType is DEBUG_VALUE_INVALID then
// the natural type is used.
// RemainderIndex, if provided, is set to the index
// of the first character in the input string that was
// not used when evaluating the expression.
STDMETHOD(Evaluate)(
THIS_
_In_ PCSTR Expression,
_In_ ULONG DesiredType,
_Out_ PDEBUG_VALUE Value,
_Out_opt_ PULONG RemainderIndex
) PURE;
// Attempts to convert the input value to a value
// of the requested type in the output value.
// Conversions can fail if no conversion exists.
// Successful conversions may be lossy.
STDMETHOD(CoerceValue)(
THIS_
_In_ PDEBUG_VALUE In,
_In_ ULONG OutType,
_Out_ PDEBUG_VALUE Out
) PURE;
STDMETHOD(CoerceValues)(
THIS_
_In_ ULONG Count,
_In_reads_(Count) PDEBUG_VALUE In,
_In_reads_(Count) PULONG OutTypes,
_Out_writes_(Count) PDEBUG_VALUE Out
) PURE;
// Executes the given command string.
// If the string has multiple commands
// Execute will not return until all
// of them have been executed. If this
// requires waiting for the debuggee to
// execute an internal wait will be done
// so Execute can take an arbitrary amount
// of time.
STDMETHOD(Execute)(
THIS_
_In_ ULONG OutputControl,
_In_ PCSTR Command,
_In_ ULONG Flags
) PURE;
// Executes the given command file by
// reading a line at a time and processing
// it with Execute.
STDMETHOD(ExecuteCommandFile)(
THIS_
_In_ ULONG OutputControl,
_In_ PCSTR CommandFile,
_In_ ULONG Flags
) PURE;
// Breakpoint interfaces are described
// elsewhere in this section.
STDMETHOD(GetNumberBreakpoints)(
THIS_
_Out_ PULONG Number
) PURE;
// It is possible for this retrieval function to
// fail even with an index within the number of
// existing breakpoints if the breakpoint is
// a private breakpoint.
STDMETHOD(GetBreakpointByIndex)(
THIS_
_In_ ULONG Index,
_Out_ PDEBUG_BREAKPOINT* Bp
) PURE;
STDMETHOD(GetBreakpointById)(
THIS_
_In_ ULONG Id,
_Out_ PDEBUG_BREAKPOINT* Bp
) PURE;
// If Ids is non-NULL the Count breakpoints
// referred to in the Ids array are returned,
// otherwise breakpoints from index Start to
// Start + Count 1 are returned.
STDMETHOD(GetBreakpointParameters)(
THIS_
_In_ ULONG Count,
_In_reads_opt_(Count) PULONG Ids,
_In_ ULONG Start,
_Out_writes_(Count) PDEBUG_BREAKPOINT_PARAMETERS Params
) PURE;
// Breakpoints are created empty and disabled.
// When their parameters have been set they
// should be enabled by setting the ENABLE flag.
// If DesiredId is DEBUG_ANY_ID then the
// engine picks an unused ID. If DesiredId
// is any other number the engine attempts
// to use the given ID for the breakpoint.
// If another breakpoint exists with that ID
// the call will fail.
STDMETHOD(AddBreakpoint)(
THIS_
_In_ ULONG Type,
_In_ ULONG DesiredId,
_Out_ PDEBUG_BREAKPOINT* Bp
) PURE;
// Breakpoint interface is invalid after this call.
STDMETHOD(RemoveBreakpoint)(
THIS_
_In_ PDEBUG_BREAKPOINT Bp
) PURE;
// Control and use extension DLLs.
STDMETHOD(AddExtension)(
THIS_
_In_ PCSTR Path,
_In_ ULONG Flags,
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(RemoveExtension)(
THIS_
_In_ ULONG64 Handle
) PURE;
STDMETHOD(GetExtensionByPath)(
THIS_
_In_ PCSTR Path,
_Out_ PULONG64 Handle
) PURE;
// If Handle is zero the extension
// chain is walked searching for the
// function.
STDMETHOD(CallExtension)(
THIS_
_In_ ULONG64 Handle,
_In_ PCSTR Function,
_In_opt_ PCSTR Arguments
) PURE;
// GetExtensionFunction works like
// GetProcAddress on extension DLLs
// to allow raw function-call-level
// interaction with extension DLLs.
// Such functions do not need to
// follow the standard extension prototype
// if they are not going to be called
// through the text extension interface.
// This function cannot be called remotely.
STDMETHOD(GetExtensionFunction)(
THIS_
_In_ ULONG64 Handle,
_In_ PCSTR FuncName,
_Out_ FARPROC* Function
) PURE;
// These methods return alternate
// extension interfaces in order to allow
// interface-style extension DLLs to mix in
// older extension calls.
// Structure sizes must be initialized before
// the call.
// These methods cannot be called remotely.
STDMETHOD(GetWindbgExtensionApis32)(
THIS_
_Inout_ PWINDBG_EXTENSION_APIS32 Api
) PURE;
STDMETHOD(GetWindbgExtensionApis64)(
THIS_
_Inout_ PWINDBG_EXTENSION_APIS64 Api
) PURE;
// The engine provides a simple mechanism
// to filter common events. Arbitrarily complicated
// filtering can be done by registering event callbacks
// but simple event filtering only requires
// setting the options of one of the predefined
// event filters.
// Simple event filters are either for specific
// events and therefore have an enumerant or
// they are for an exception and are based on
// the exceptions code. Exception filters
// are further divided into exceptions specially
// handled by the engine, which is a fixed set,
// and arbitrary exceptions.
// All three groups of filters are indexed together
// with the specific filters first, then the specific
// exception filters and finally the arbitrary
// exception filters.
// The first specific exception is the default
// exception. If an exception event occurs for
// an exception without settings the default
// exception settings are used.
STDMETHOD(GetNumberEventFilters)(
THIS_
_Out_ PULONG SpecificEvents,
_Out_ PULONG SpecificExceptions,
_Out_ PULONG ArbitraryExceptions
) PURE;
// Some filters have descriptive text associated with them.
STDMETHOD(GetEventFilterText)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG TextSize
) PURE;
// All filters support executing a command when the
// event occurs.
STDMETHOD(GetEventFilterCommand)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG CommandSize
) PURE;
STDMETHOD(SetEventFilterCommand)(
THIS_
_In_ ULONG Index,
_In_ PCSTR Command
) PURE;
STDMETHOD(GetSpecificFilterParameters)(
THIS_
_In_ ULONG Start,
_In_ ULONG Count,
_Out_writes_(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
) PURE;
STDMETHOD(SetSpecificFilterParameters)(
THIS_
_In_ ULONG Start,
_In_ ULONG Count,
_In_reads_(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
) PURE;
// Some specific filters have arguments to further
// qualify their operation.
STDMETHOD(GetSpecificFilterArgument)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG ArgumentSize
) PURE;
STDMETHOD(SetSpecificFilterArgument)(
THIS_
_In_ ULONG Index,
_In_ PCSTR Argument
) PURE;
// If Codes is non-NULL Start is ignored.
STDMETHOD(GetExceptionFilterParameters)(
THIS_
_In_ ULONG Count,
_In_reads_opt_(Count) PULONG Codes,
_In_ ULONG Start,
_Out_writes_(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
) PURE;
// The codes in the parameter data control the application
// of the parameter data. If a code is not already in
// the set of filters it is added. If the ExecutionOption
// for a code is REMOVE then the filter is removed.
// Specific exception filters cannot be removed.
STDMETHOD(SetExceptionFilterParameters)(
THIS_
_In_ ULONG Count,
_In_reads_(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
) PURE;
// Exception filters support an additional command for
// second-chance events.
STDMETHOD(GetExceptionFilterSecondCommand)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG CommandSize
) PURE;
STDMETHOD(SetExceptionFilterSecondCommand)(
THIS_
_In_ ULONG Index,
_In_ PCSTR Command
) PURE;
// Yields processing to the engine until
// an event occurs. This method may
// only be called by the thread that started
// the debug session.
// When an event occurs the engine carries
// out all event processing such as calling
// callbacks.
// If the callbacks indicate that execution should
// break the wait will return, otherwise it
// goes back to waiting for a new event.
// If the timeout expires, S_FALSE is returned.
// The timeout is not currently supported for
// kernel debugging.
STDMETHOD(WaitForEvent)(
THIS_
_In_ ULONG Flags,
_In_ ULONG Timeout
) PURE;
// Retrieves information about the last event that occurred.
// EventType is one of the event callback mask bits.
// ExtraInformation contains additional event-specific
// information. Not all events have additional information.
STDMETHOD(GetLastEventInformation)(
THIS_
_Out_ PULONG Type,
_Out_ PULONG ProcessId,
_Out_ PULONG ThreadId,
_Out_writes_bytes_opt_(ExtraInformationSize) PVOID ExtraInformation,
_In_ ULONG ExtraInformationSize,
_Out_opt_ PULONG ExtraInformationUsed,
_Out_writes_opt_(DescriptionSize) PSTR Description,
_In_ ULONG DescriptionSize,
_Out_opt_ PULONG DescriptionUsed
) PURE;
// IDebugControl2.
STDMETHOD(GetCurrentTimeDate)(
THIS_
_Out_ PULONG TimeDate
) PURE;
// Retrieves the number of seconds since the
// machine started running.
STDMETHOD(GetCurrentSystemUpTime)(
THIS_
_Out_ PULONG UpTime
) PURE;
// If the current session is a dump session,
// retrieves any extended format information.
STDMETHOD(GetDumpFormatFlags)(
THIS_
_Out_ PULONG FormatFlags
) PURE;
// The debugger has been enhanced to allow
// arbitrary text replacements in addition
// to the simple $u0-$u9 text macros.
// Text replacement takes a given source
// text in commands and converts it to the
// given destination text. Replacements
// are named by their source text so that
// only one replacement for a source text
// string can exist.
STDMETHOD(GetNumberTextReplacements)(
THIS_
_Out_ PULONG NumRepl
) PURE;
// If SrcText is non-NULL the replacement
// is looked up by source text, otherwise
// Index is used to get the Nth replacement.
STDMETHOD(GetTextReplacement)(
THIS_
_In_opt_ PCSTR SrcText,
_In_ ULONG Index,
_Out_writes_opt_(SrcBufferSize) PSTR SrcBuffer,
_In_ ULONG SrcBufferSize,
_Out_opt_ PULONG SrcSize,
_Out_writes_opt_(DstBufferSize) PSTR DstBuffer,
_In_ ULONG DstBufferSize,
_Out_opt_ PULONG DstSize
) PURE;
// Setting the destination text to
// NULL removes the alias.
STDMETHOD(SetTextReplacement)(
THIS_
_In_ PCSTR SrcText,
_In_opt_ PCSTR DstText
) PURE;
STDMETHOD(RemoveTextReplacements)(
THIS
) PURE;
// Outputs the complete list of current
// replacements.
STDMETHOD(OutputTextReplacements)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Flags
) PURE;
// IDebugControl3.
// Control options for assembly and disassembly.
STDMETHOD(GetAssemblyOptions)(
THIS_
_Out_ PULONG Options
) PURE;
STDMETHOD(AddAssemblyOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(RemoveAssemblyOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(SetAssemblyOptions)(
THIS_
_In_ ULONG Options
) PURE;
// Control the expression syntax.
STDMETHOD(GetExpressionSyntax)(
THIS_
_Out_ PULONG Flags
) PURE;
STDMETHOD(SetExpressionSyntax)(
THIS_
_In_ ULONG Flags
) PURE;
// Look up a syntax by its abbreviated
// name and set it.
STDMETHOD(SetExpressionSyntaxByName)(
THIS_
_In_ PCSTR AbbrevName
) PURE;
STDMETHOD(GetNumberExpressionSyntaxes)(
THIS_
_Out_ PULONG Number
) PURE;
STDMETHOD(GetExpressionSyntaxNames)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(FullNameBufferSize) PSTR FullNameBuffer,
_In_ ULONG FullNameBufferSize,
_Out_opt_ PULONG FullNameSize,
_Out_writes_opt_(AbbrevNameBufferSize) PSTR AbbrevNameBuffer,
_In_ ULONG AbbrevNameBufferSize,
_Out_opt_ PULONG AbbrevNameSize
) PURE;
//
// Some debug sessions have only a single
// possible event, such as a snapshot dump
// file; some have dynamic events, such as
// a live debug session; and others may have
// multiple events, such as a dump file that
// contains snapshots from different points
// in time. The following methods allow
// discovery and selection of the available
// events for a session.
// Sessions with one or more static events
// will be able to report all of the events
// when queried. Sessions with dynamic events
// will only report a single event representing
// the current event.
// Switching events constitutes execution and
// changing the current event will alter the
// execution status to a running state, after
// which WaitForEvent must be used to process
// the selected event.
//
// GetNumberEvents returns S_OK if this is the
// complete set of events possible, such as for
// a static session; or S_FALSE if other events
// may be possible, such as for a dynamic session.
STDMETHOD(GetNumberEvents)(
THIS_
_Out_ PULONG Events
) PURE;
// Sessions may have descriptive information for
// the various events available. The amount of
// information varies according to the specific
// session and data.
STDMETHOD(GetEventIndexDescription)(
THIS_
_In_ ULONG Index,
_In_ ULONG Which,
_In_opt_ PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG DescSize
) PURE;
STDMETHOD(GetCurrentEventIndex)(
THIS_
_Out_ PULONG Index
) PURE;
// SetNextEventIndex works like seek in that
// it can set an absolute or relative index.
// SetNextEventIndex works similarly to SetExecutionStatus
// by putting the session into a running state, after
// which the caller must call WaitForEvent. The
// current event index only changes when WaitForEvent
// is called.
STDMETHOD(SetNextEventIndex)(
THIS_
_In_ ULONG Relation,
_In_ ULONG Value,
_Out_ PULONG NextIndex
) PURE;
// IDebugControl4.
STDMETHOD(GetLogFileWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FileSize,
_Out_ PBOOL Append
) PURE;
STDMETHOD(OpenLogFileWide)(
THIS_
_In_ PCWSTR File,
_In_ BOOL Append
) PURE;
STDMETHOD(InputWide)(
THIS_
_Out_writes_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG InputSize
) PURE;
STDMETHOD(ReturnInputWide)(
THIS_
_In_ PCWSTR Buffer
) PURE;
STDMETHODV(OutputWide)(
THIS_
_In_ ULONG Mask,
_In_ PCWSTR Format,
...
) PURE;
STDMETHOD(OutputVaListWide)(
THIS_
_In_ ULONG Mask,
_In_ PCWSTR Format,
_In_ va_list Args
) PURE;
STDMETHODV(ControlledOutputWide)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Mask,
_In_ PCWSTR Format,
...
) PURE;
STDMETHOD(ControlledOutputVaListWide)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Mask,
_In_ PCWSTR Format,
_In_ va_list Args
) PURE;
STDMETHODV(OutputPromptWide)(
THIS_
_In_ ULONG OutputControl,
_In_opt_ PCWSTR Format,
...
) PURE;
STDMETHOD(OutputPromptVaListWide)(
THIS_
_In_ ULONG OutputControl,
_In_opt_ PCWSTR Format,
_In_ va_list Args
) PURE;
STDMETHOD(GetPromptTextWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG TextSize
) PURE;
STDMETHOD(AssembleWide)(
THIS_
_In_ ULONG64 Offset,
_In_ PCWSTR Instr,
_Out_ PULONG64 EndOffset
) PURE;
STDMETHOD(DisassembleWide)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG DisassemblySize,
_Out_ PULONG64 EndOffset
) PURE;
STDMETHOD(GetProcessorTypeNamesWide)(
THIS_
_In_ ULONG Type,
_Out_writes_opt_(FullNameBufferSize) PWSTR FullNameBuffer,
_In_ ULONG FullNameBufferSize,
_Out_opt_ PULONG FullNameSize,
_Out_writes_opt_(AbbrevNameBufferSize) PWSTR AbbrevNameBuffer,
_In_ ULONG AbbrevNameBufferSize,
_Out_opt_ PULONG AbbrevNameSize
) PURE;
STDMETHOD(GetTextMacroWide)(
THIS_
_In_ ULONG Slot,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG MacroSize
) PURE;
STDMETHOD(SetTextMacroWide)(
THIS_
_In_ ULONG Slot,
_In_ PCWSTR Macro
) PURE;
STDMETHOD(EvaluateWide)(
THIS_
_In_ PCWSTR Expression,
_In_ ULONG DesiredType,
_Out_ PDEBUG_VALUE Value,
_Out_opt_ PULONG RemainderIndex
) PURE;
STDMETHOD(ExecuteWide)(
THIS_
_In_ ULONG OutputControl,
_In_ PCWSTR Command,
_In_ ULONG Flags
) PURE;
STDMETHOD(ExecuteCommandFileWide)(
THIS_
_In_ ULONG OutputControl,
_In_ PCWSTR CommandFile,
_In_ ULONG Flags
) PURE;
STDMETHOD(GetBreakpointByIndex2)(
THIS_
_In_ ULONG Index,
_Out_ PDEBUG_BREAKPOINT2* Bp
) PURE;
STDMETHOD(GetBreakpointById2)(
THIS_
_In_ ULONG Id,
_Out_ PDEBUG_BREAKPOINT2* Bp
) PURE;
STDMETHOD(AddBreakpoint2)(
THIS_
_In_ ULONG Type,
_In_ ULONG DesiredId,
_Out_ PDEBUG_BREAKPOINT2* Bp
) PURE;
STDMETHOD(RemoveBreakpoint2)(
THIS_
_In_ PDEBUG_BREAKPOINT2 Bp
) PURE;
STDMETHOD(AddExtensionWide)(
THIS_
_In_ PCWSTR Path,
_In_ ULONG Flags,
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(GetExtensionByPathWide)(
THIS_
_In_ PCWSTR Path,
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(CallExtensionWide)(
THIS_
_In_ ULONG64 Handle,
_In_ PCWSTR Function,
_In_opt_ PCWSTR Arguments
) PURE;
STDMETHOD(GetExtensionFunctionWide)(
THIS_
_In_ ULONG64 Handle,
_In_ PCWSTR FuncName,
_Out_ FARPROC* Function
) PURE;
STDMETHOD(GetEventFilterTextWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG TextSize
) PURE;
STDMETHOD(GetEventFilterCommandWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG CommandSize
) PURE;
STDMETHOD(SetEventFilterCommandWide)(
THIS_
_In_ ULONG Index,
_In_ PCWSTR Command
) PURE;
STDMETHOD(GetSpecificFilterArgumentWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG ArgumentSize
) PURE;
STDMETHOD(SetSpecificFilterArgumentWide)(
THIS_
_In_ ULONG Index,
_In_ PCWSTR Argument
) PURE;
STDMETHOD(GetExceptionFilterSecondCommandWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG CommandSize
) PURE;
STDMETHOD(SetExceptionFilterSecondCommandWide)(
THIS_
_In_ ULONG Index,
_In_ PCWSTR Command
) PURE;
STDMETHOD(GetLastEventInformationWide)(
THIS_
_Out_ PULONG Type,
_Out_ PULONG ProcessId,
_Out_ PULONG ThreadId,
_Out_writes_bytes_opt_(ExtraInformationSize) PVOID ExtraInformation,
_In_ ULONG ExtraInformationSize,
_Out_opt_ PULONG ExtraInformationUsed,
_Out_writes_opt_(DescriptionSize) PWSTR Description,
_In_ ULONG DescriptionSize,
_Out_opt_ PULONG DescriptionUsed
) PURE;
STDMETHOD(GetTextReplacementWide)(
THIS_
_In_opt_ PCWSTR SrcText,
_In_ ULONG Index,
_Out_writes_opt_(SrcBufferSize) PWSTR SrcBuffer,
_In_ ULONG SrcBufferSize,
_Out_opt_ PULONG SrcSize,
_Out_writes_opt_(DstBufferSize) PWSTR DstBuffer,
_In_ ULONG DstBufferSize,
_Out_opt_ PULONG DstSize
) PURE;
STDMETHOD(SetTextReplacementWide)(
THIS_
_In_ PCWSTR SrcText,
_In_opt_ PCWSTR DstText
) PURE;
STDMETHOD(SetExpressionSyntaxByNameWide)(
THIS_
_In_ PCWSTR AbbrevName
) PURE;
STDMETHOD(GetExpressionSyntaxNamesWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(FullNameBufferSize) PWSTR FullNameBuffer,
_In_ ULONG FullNameBufferSize,
_Out_opt_ PULONG FullNameSize,
_Out_writes_opt_(AbbrevNameBufferSize) PWSTR AbbrevNameBuffer,
_In_ ULONG AbbrevNameBufferSize,
_Out_opt_ PULONG AbbrevNameSize
) PURE;
STDMETHOD(GetEventIndexDescriptionWide)(
THIS_
_In_ ULONG Index,
_In_ ULONG Which,
_In_opt_ PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG DescSize
) PURE;
STDMETHOD(GetLogFile2)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FileSize,
_Out_ PULONG Flags
) PURE;
STDMETHOD(OpenLogFile2)(
THIS_
_In_ PCSTR File,
_In_ ULONG Flags
) PURE;
STDMETHOD(GetLogFile2Wide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FileSize,
_Out_ PULONG Flags
) PURE;
STDMETHOD(OpenLogFile2Wide)(
THIS_
_In_ PCWSTR File,
_In_ ULONG Flags
) PURE;
// GetSystemVersion always returns the kd
// major/minor version numbers, which are
// different than the Win32 version numbers.
// GetSystemVersionValues can be used
// to determine the Win32 version values.
STDMETHOD(GetSystemVersionValues)(
THIS_
_Out_ PULONG PlatformId,
_Out_ PULONG Win32Major,
_Out_ PULONG Win32Minor,
_Out_opt_ PULONG KdMajor,
_Out_opt_ PULONG KdMinor
) PURE;
// Strings are selected with DEBUG_SYSVERSTR_*.
STDMETHOD(GetSystemVersionString)(
THIS_
_In_ ULONG Which,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
STDMETHOD(GetSystemVersionStringWide)(
THIS_
_In_ ULONG Which,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
// Stack tracing with a full initial context
// and full context return for each frame.
// The FrameContextsSize parameter is the total
// byte size of FrameContexts. FrameContextsEntrySize
// gives the byte size of each entry in
// FrameContexts.
STDMETHOD(GetContextStackTrace)(
THIS_
_In_reads_bytes_opt_(StartContextSize) PVOID StartContext,
_In_ ULONG StartContextSize,
_Out_writes_to_opt_(FramesSize,*FramesFilled) PDEBUG_STACK_FRAME Frames,
_In_ ULONG FramesSize,
_Out_writes_bytes_opt_(FrameContextsSize) PVOID FrameContexts,
_In_ ULONG FrameContextsSize,
_In_ ULONG FrameContextsEntrySize,
_Out_opt_ PULONG FramesFilled
) PURE;
STDMETHOD(OutputContextStackTrace)(
THIS_
_In_ ULONG OutputControl,
_In_reads_(FramesSize) PDEBUG_STACK_FRAME Frames,
_In_ ULONG FramesSize,
_In_reads_bytes_(FrameContextsSize) PVOID FrameContexts,
_In_ ULONG FrameContextsSize,
_In_ ULONG FrameContextsEntrySize,
_In_ ULONG Flags
) PURE;
// Some targets, such as user-mode minidump files,
// have separate "event of interest" information
// stored within them. This method allows
// access to that information.
STDMETHOD(GetStoredEventInformation)(
THIS_
_Out_ PULONG Type,
_Out_ PULONG ProcessId,
_Out_ PULONG ThreadId,
_Out_writes_bytes_opt_(ContextSize) PVOID Context,
_In_ ULONG ContextSize,
_Out_opt_ PULONG ContextUsed,
_Out_writes_bytes_opt_(ExtraInformationSize) PVOID ExtraInformation,
_In_ ULONG ExtraInformationSize,
_Out_opt_ PULONG ExtraInformationUsed
) PURE;
// Managed debugging support relies on debugging
// functionality provided by the Common Language Runtime.
// This method provides feedback on the engine's
// use of the runtime debugging APIs.
STDMETHOD(GetManagedStatus)(
THIS_
_Out_opt_ PULONG Flags,
_In_ ULONG WhichString,
_Out_writes_opt_(StringSize) PSTR String,
_In_ ULONG StringSize,
_Out_opt_ PULONG StringNeeded
) PURE;
STDMETHOD(GetManagedStatusWide)(
THIS_
_Out_opt_ PULONG Flags,
_In_ ULONG WhichString,
_Out_writes_opt_(StringSize) PWSTR String,
_In_ ULONG StringSize,
_Out_opt_ PULONG StringNeeded
) PURE;
// Clears and reinitializes the engine's
// managed code debugging support.
STDMETHOD(ResetManagedStatus)(
THIS_
_In_ ULONG Flags
) PURE;
// IDebugControl5
STDMETHOD(GetStackTraceEx)(
THIS_
_In_ ULONG64 FrameOffset,
_In_ ULONG64 StackOffset,
_In_ ULONG64 InstructionOffset,
_Out_writes_to_(FramesSize,*FramesFilled) PDEBUG_STACK_FRAME_EX Frames,
_In_ ULONG FramesSize,
_Out_opt_ PULONG FramesFilled
) PURE;
STDMETHOD(OutputStackTraceEx)(
THIS_
_In_ ULONG OutputControl,
_In_reads_opt_(FramesSize) PDEBUG_STACK_FRAME_EX Frames,
_In_ ULONG FramesSize,
_In_ ULONG Flags
) PURE;
STDMETHOD(GetContextStackTraceEx)(
THIS_
_In_reads_bytes_opt_(StartContextSize) PVOID StartContext,
_In_ ULONG StartContextSize,
_Out_writes_to_opt_(FramesSize,*FramesFilled) PDEBUG_STACK_FRAME_EX Fram
es,
_In_ ULONG FramesSize,
_Out_writes_bytes_opt_(FrameContextsSize) PVOID FrameContexts,
_In_ ULONG FrameContextsSize,
_In_ ULONG FrameContextsEntrySize,
_Out_opt_ PULONG FramesFilled
) PURE;
STDMETHOD(OutputContextStackTraceEx)(
THIS_
_In_ ULONG OutputControl,
_In_reads_(FramesSize) PDEBUG_STACK_FRAME_EX Frames,
_In_ ULONG FramesSize,
_In_reads_bytes_(FrameContextsSize) PVOID FrameContexts,
_In_ ULONG FrameContextsSize,
_In_ ULONG FrameContextsEntrySize,
_In_ ULONG Flags
) PURE;
STDMETHOD(GetBreakpointByGuid)(
THIS_
_In_ LPGUID Guid,
_Out_ PDEBUG_BREAKPOINT3* Bp
) PURE;
// IDebugControl6
// Returns additional info states for
STDMETHOD(GetExecutionStatusEx)(
THIS_
_Out_ PULONG Status
) PURE;
STDMETHOD(GetSynchronizationStatus)(
THIS_
_Out_ PULONG SendsAttempted,
_Out_ PULONG SecondsSinceLastResponse
) PURE;
};
#define DEBUG_EXEC_FLAGS_NONBLOCK 0x00000001
#undef INTERFACE
#define INTERFACE IDebugControl7
DECLARE_INTERFACE_(IDebugControl7, IUnknown)
{
// IUnknown.
STDMETHOD(QueryInterface)(
THIS_
_In_ REFIID InterfaceId,
_Out_ PVOID* Interface
) PURE;
STDMETHOD_(ULONG, AddRef)(
THIS
) PURE;
STDMETHOD_(ULONG, Release)(
THIS
) PURE;
// IDebugControl.
// Checks for a user interrupt, such a Ctrl-C
// or stop button.
// This method is reentrant.
STDMETHOD(GetInterrupt)(
THIS
) PURE;
// Registers a user interrupt.
// This method is reentrant.
STDMETHOD(SetInterrupt)(
THIS_
_In_ ULONG Flags
) PURE;
// Interrupting a user-mode process requires
// access to some system resources that the
// process may hold itself, preventing the
// interrupt from occurring. The engine
// will time-out pending interrupt requests
// and simulate an interrupt if necessary.
// These methods control the interrupt timeout.
STDMETHOD(GetInterruptTimeout)(
THIS_
_Out_ PULONG Seconds
) PURE;
STDMETHOD(SetInterruptTimeout)(
THIS_
_In_ ULONG Seconds
) PURE;
STDMETHOD(GetLogFile)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FileSize,
_Out_ PBOOL Append
) PURE;
// Opens a log file which collects all
// output. Output from every client except
// those that explicitly disable logging
// goes into the log.
// Opening a log file closes any log file
// already open.
STDMETHOD(OpenLogFile)(
THIS_
_In_ PCSTR File,
_In_ BOOL Append
) PURE;
STDMETHOD(CloseLogFile)(
THIS
) PURE;
// Controls what output is logged.
STDMETHOD(GetLogMask)(
THIS_
_Out_ PULONG Mask
) PURE;
STDMETHOD(SetLogMask)(
THIS_
_In_ ULONG Mask
) PURE;
// Input requests input from all clients.
// The first input that is returned is used
// to satisfy the call. Other returned
// input is discarded.
STDMETHOD(Input)(
THIS_
_Out_writes_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG InputSize
) PURE;
// This method is used by clients to return
// input when it is available. It will
// return S_OK if the input is used to
// satisfy an Input call and S_FALSE if
// the input is ignored.
// This method is reentrant.
STDMETHOD(ReturnInput)(
THIS_
_In_ PCSTR Buffer
) PURE;
// Sends output through clients
// output callbacks if the mask is allowed
// by the current output control mask and
// according to the output distribution
// settings.
STDMETHODV(Output)(
THIS_
_In_ ULONG Mask,
_In_ PCSTR Format,
...
) PURE;
STDMETHOD(OutputVaList)(
THIS_
_In_ ULONG Mask,
_In_ PCSTR Format,
_In_ va_list Args
) PURE;
// The following methods allow direct control
// over the distribution of the given output
// for situations where something other than
// the default is desired. These methods require
// extra work in the engine so they should
// only be used when necessary.
STDMETHODV(ControlledOutput)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Mask,
_In_ PCSTR Format,
...
) PURE;
STDMETHOD(ControlledOutputVaList)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Mask,
_In_ PCSTR Format,
_In_ va_list Args
) PURE;
// Displays the standard command-line prompt
// followed by the given output. If Format
// is NULL no additional output is produced.
// Output is produced under the
// DEBUG_OUTPUT_PROMPT mask.
// This method only outputs the prompt; it
// does not get input.
STDMETHODV(OutputPrompt)(
THIS_
_In_ ULONG OutputControl,
_In_opt_ PCSTR Format,
...
) PURE;
STDMETHOD(OutputPromptVaList)(
THIS_
_In_ ULONG OutputControl,
_In_opt_ PCSTR Format,
_In_ va_list Args
) PURE;
// Gets the text that would be displayed by OutputPrompt.
STDMETHOD(GetPromptText)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG TextSize
) PURE;
// Outputs information about the current
// debuggee state such as a register
// summary, disassembly at the current PC,
// closest symbol and others.
// Uses the line prefix.
STDMETHOD(OutputCurrentState)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Flags
) PURE;
// Outputs the debugger and extension version
// information. This method is reentrant.
// Uses the line prefix.
STDMETHOD(OutputVersionInformation)(
THIS_
_In_ ULONG OutputControl
) PURE;
// In user-mode debugging sessions the
// engine will set an event when
// exceptions are continued. This can
// be used to synchronize other processes
// with the debuggers handling of events.
// For example, this is used to support
// the e argument to ntsd.
STDMETHOD(GetNotifyEventHandle)(
THIS_
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(SetNotifyEventHandle)(
THIS_
_In_ ULONG64 Handle
) PURE;
STDMETHOD(Assemble)(
THIS_
_In_ ULONG64 Offset,
_In_ PCSTR Instr,
_Out_ PULONG64 EndOffset
) PURE;
STDMETHOD(Disassemble)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG DisassemblySize,
_Out_ PULONG64 EndOffset
) PURE;
// Returns the value of the effective address
// computed for the last Disassemble, if there
// was one.
STDMETHOD(GetDisassembleEffectiveOffset)(
THIS_
_Out_ PULONG64 Offset
) PURE;
// Uses the line prefix if necessary.
STDMETHOD(OutputDisassembly)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_ PULONG64 EndOffset
) PURE;
// Produces multiple lines of disassembly output.
// There will be PreviousLines of disassembly before
// the given offset if a valid disassembly exists.
// In all, there will be TotalLines of output produced.
// The first and last line offsets are returned
// specially and all lines offsets can be retrieved
// through LineOffsets. LineOffsets will contain
// offsets for each line where disassembly started.
// When disassembly of a single instruction takes
// multiple lines the initial offset will be followed
// by DEBUG_INVALID_OFFSET.
// Uses the line prefix.
STDMETHOD(OutputDisassemblyLines)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG PreviousLines,
_In_ ULONG TotalLines,
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_opt_ PULONG OffsetLine,
_Out_opt_ PULONG64 StartOffset,
_Out_opt_ PULONG64 EndOffset,
_Out_writes_opt_(TotalLines) PULONG64 LineOffsets
) PURE;
// Returns the offset of the start of
// the instruction thats the given
// delta away from the instruction
// at the initial offset.
// This routine does not check for
// validity of the instruction or
// the memory containing it.
STDMETHOD(GetNearInstruction)(
THIS_
_In_ ULONG64 Offset,
_In_ LONG Delta,
_Out_ PULONG64 NearOffset
) PURE;
// Offsets can be passed in as zero to use the current
// thread state.
STDMETHOD(GetStackTrace)(
THIS_
_In_ ULONG64 FrameOffset,
_In_ ULONG64 StackOffset,
_In_ ULONG64 InstructionOffset,
_Out_writes_to_(FramesSize,*FramesFilled) PDEBUG_STACK_FRAME Frames,
_In_ ULONG FramesSize,
_Out_opt_ PULONG FramesFilled
) PURE;
// Does a simple stack trace to determine
// what the current return address is.
STDMETHOD(GetReturnOffset)(
THIS_
_Out_ PULONG64 Offset
) PURE;
// If Frames is NULL OutputStackTrace will
// use GetStackTrace to get FramesSize frames
// and then output them. The current register
// values for frame, stack and instruction offsets
// are used.
// Uses the line prefix.
STDMETHOD(OutputStackTrace)(
THIS_
_In_ ULONG OutputControl,
_In_reads_opt_(FramesSize) PDEBUG_STACK_FRAME Frames,
_In_ ULONG FramesSize,
_In_ ULONG Flags
) PURE;
// Returns information about the debuggee such
// as user vs. kernel, dump vs. live, etc.
STDMETHOD(GetDebuggeeType)(
THIS_
_Out_ PULONG Class,
_Out_ PULONG Qualifier
) PURE;
// Returns the type of physical processors in
// the machine.
// Returns one of the IMAGE_FILE_MACHINE values.
STDMETHOD(GetActualProcessorType)(
THIS_
_Out_ PULONG Type
) PURE;
// Returns the type of processor used in the
// current processor context.
STDMETHOD(GetExecutingProcessorType)(
THIS_
_Out_ PULONG Type
) PURE;
// Query all the possible processor types that
// may be encountered during this debug session.
STDMETHOD(GetNumberPossibleExecutingProcessorTypes)(
THIS_
_Out_ PULONG Number
) PURE;
STDMETHOD(GetPossibleExecutingProcessorTypes)(
THIS_
_In_ ULONG Start,
_In_ ULONG Count,
_Out_writes_(Count) PULONG Types
) PURE;
// Get the number of actual processors in
// the machine.
STDMETHOD(GetNumberProcessors)(
THIS_
_Out_ PULONG Number
) PURE;
// PlatformId is one of the VER_PLATFORM values.
// Major and minor are as given in the NT
// kernel debugger protocol.
// ServicePackString and ServicePackNumber indicate the
// system service pack level. ServicePackNumber is not
// available in some sessions where the service pack level
// is only expressed as a string. The service pack information
// will be empty if the system does not have a service pack
// applied.
// The build string is string information identifying the
// particular build of the system. The build string is
// empty if the system has no particular identifying
// information.
STDMETHOD(GetSystemVersion)(
THIS_
_Out_ PULONG PlatformId,
_Out_ PULONG Major,
_Out_ PULONG Minor,
_Out_writes_opt_(ServicePackStringSize) PSTR ServicePackString,
_In_ ULONG ServicePackStringSize,
_Out_opt_ PULONG ServicePackStringUsed,
_Out_ PULONG ServicePackNumber,
_Out_writes_opt_(BuildStringSize) PSTR BuildString,
_In_ ULONG BuildStringSize,
_Out_opt_ PULONG BuildStringUsed
) PURE;
// Returns the page size for the currently executing
// processor context. The page size may vary between
// processor types.
STDMETHOD(GetPageSize)(
THIS_
_Out_ PULONG Size
) PURE;
// Returns S_OK if the current processor context uses
// 64-bit addresses, otherwise S_FALSE.
STDMETHOD(IsPointer64Bit)(
THIS
) PURE;
// Reads the bugcheck data area and returns the
// current contents. This method only works
// in kernel debugging sessions.
STDMETHOD(ReadBugCheckData)(
THIS_
_Out_ PULONG Code,
_Out_ PULONG64 Arg1,
_Out_ PULONG64 Arg2,
_Out_ PULONG64 Arg3,
_Out_ PULONG64 Arg4
) PURE;
// Query all the processor types supported by
// the engine. This is a complete list and is
// not related to the machine running the engine
// or the debuggee.
STDMETHOD(GetNumberSupportedProcessorTypes)(
THIS_
_Out_ PULONG Number
) PURE;
STDMETHOD(GetSupportedProcessorTypes)(
THIS_
_In_ ULONG Start,
_In_ ULONG Count,
_Out_writes_(Count) PULONG Types
) PURE;
// Returns a full, descriptive name and an
// abbreviated name for a processor type.
STDMETHOD(GetProcessorTypeNames)(
THIS_
_In_ ULONG Type,
_Out_writes_opt_(FullNameBufferSize) PSTR FullNameBuffer,
_In_ ULONG FullNameBufferSize,
_Out_opt_ PULONG FullNameSize,
_Out_writes_opt_(AbbrevNameBufferSize) PSTR AbbrevNameBuffer,
_In_ ULONG AbbrevNameBufferSize,
_Out_opt_ PULONG AbbrevNameSize
) PURE;
// Gets and sets the type of processor to
// use when doing things like setting
// breakpoints, accessing registers,
// getting stack traces and so on.
STDMETHOD(GetEffectiveProcessorType)(
THIS_
_Out_ PULONG Type
) PURE;
STDMETHOD(SetEffectiveProcessorType)(
THIS_
_In_ ULONG Type
) PURE;
// Returns information about whether and how
// the debuggee is running. Status will
// be GO if the debuggee is running and
// BREAK if it isnt.
// If no debuggee exists the status is
// NO_DEBUGGEE.
// This method is reentrant.
STDMETHOD(GetExecutionStatus)(
THIS_
_Out_ PULONG Status
) PURE;
// Changes the execution status of the
// engine from stopped to running.
// Status must be one of the go or step
// status values.
STDMETHOD(SetExecutionStatus)(
THIS_
_In_ ULONG Status
) PURE;
// Controls what code interpretation level the debugger
// runs at. The debugger checks the code level when
// deciding whether to step by a source line or
// assembly instruction along with other related operations.
STDMETHOD(GetCodeLevel)(
THIS_
_Out_ PULONG Level
) PURE;
STDMETHOD(SetCodeLevel)(
THIS_
_In_ ULONG Level
) PURE;
// Gets and sets engine control flags.
// These methods are reentrant.
STDMETHOD(GetEngineOptions)(
THIS_
_Out_ PULONG Options
) PURE;
STDMETHOD(AddEngineOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(RemoveEngineOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(SetEngineOptions)(
THIS_
_In_ ULONG Options
) PURE;
// Gets and sets control values for
// handling system error events.
// If the system error level is less
// than or equal to the given levels
// the error may be displayed and
// the default break for the event
// may be set.
STDMETHOD(GetSystemErrorControl)(
THIS_
_Out_ PULONG OutputLevel,
_Out_ PULONG BreakLevel
) PURE;
STDMETHOD(SetSystemErrorControl)(
THIS_
_In_ ULONG OutputLevel,
_In_ ULONG BreakLevel
) PURE;
// The command processor supports simple
// string replacement macros in Evaluate and
// Execute. There are currently ten macro
// slots available. Slots 0-9 map to
// the command invocations $u0-$u9.
STDMETHOD(GetTextMacro)(
THIS_
_In_ ULONG Slot,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG MacroSize
) PURE;
STDMETHOD(SetTextMacro)(
THIS_
_In_ ULONG Slot,
_In_ PCSTR Macro
) PURE;
// Controls the default number radix used
// in expressions and commands.
STDMETHOD(GetRadix)(
THIS_
_Out_ PULONG Radix
) PURE;
STDMETHOD(SetRadix)(
THIS_
_In_ ULONG Radix
) PURE;
// Evaluates the given expression string and
// returns the resulting value.
// If DesiredType is DEBUG_VALUE_INVALID then
// the natural type is used.
// RemainderIndex, if provided, is set to the index
// of the first character in the input string that was
// not used when evaluating the expression.
STDMETHOD(Evaluate)(
THIS_
_In_ PCSTR Expression,
_In_ ULONG DesiredType,
_Out_ PDEBUG_VALUE Value,
_Out_opt_ PULONG RemainderIndex
) PURE;
// Attempts to convert the input value to a value
// of the requested type in the output value.
// Conversions can fail if no conversion exists.
// Successful conversions may be lossy.
STDMETHOD(CoerceValue)(
THIS_
_In_ PDEBUG_VALUE In,
_In_ ULONG OutType,
_Out_ PDEBUG_VALUE Out
) PURE;
STDMETHOD(CoerceValues)(
THIS_
_In_ ULONG Count,
_In_reads_(Count) PDEBUG_VALUE In,
_In_reads_(Count) PULONG OutTypes,
_Out_writes_(Count) PDEBUG_VALUE Out
) PURE;
// Executes the given command string.
// If the string has multiple commands
// Execute will not return until all
// of them have been executed. If this
// requires waiting for the debuggee to
// execute an internal wait will be done
// so Execute can take an arbitrary amount
// of time.
STDMETHOD(Execute)(
THIS_
_In_ ULONG OutputControl,
_In_ PCSTR Command,
_In_ ULONG Flags
) PURE;
// Executes the given command file by
// reading a line at a time and processing
// it with Execute.
STDMETHOD(ExecuteCommandFile)(
THIS_
_In_ ULONG OutputControl,
_In_ PCSTR CommandFile,
_In_ ULONG Flags
) PURE;
// Breakpoint interfaces are described
// elsewhere in this section.
STDMETHOD(GetNumberBreakpoints)(
THIS_
_Out_ PULONG Number
) PURE;
// It is possible for this retrieval function to
// fail even with an index within the number of
// existing breakpoints if the breakpoint is
// a private breakpoint.
STDMETHOD(GetBreakpointByIndex)(
THIS_
_In_ ULONG Index,
_Out_ PDEBUG_BREAKPOINT* Bp
) PURE;
STDMETHOD(GetBreakpointById)(
THIS_
_In_ ULONG Id,
_Out_ PDEBUG_BREAKPOINT* Bp
) PURE;
// If Ids is non-NULL the Count breakpoints
// referred to in the Ids array are returned,
// otherwise breakpoints from index Start to
// Start + Count 1 are returned.
STDMETHOD(GetBreakpointParameters)(
THIS_
_In_ ULONG Count,
_In_reads_opt_(Count) PULONG Ids,
_In_ ULONG Start,
_Out_writes_(Count) PDEBUG_BREAKPOINT_PARAMETERS Params
) PURE;
// Breakpoints are created empty and disabled.
// When their parameters have been set they
// should be enabled by setting the ENABLE flag.
// If DesiredId is DEBUG_ANY_ID then the
// engine picks an unused ID. If DesiredId
// is any other number the engine attempts
// to use the given ID for the breakpoint.
// If another breakpoint exists with that ID
// the call will fail.
STDMETHOD(AddBreakpoint)(
THIS_
_In_ ULONG Type,
_In_ ULONG DesiredId,
_Out_ PDEBUG_BREAKPOINT* Bp
) PURE;
// Breakpoint interface is invalid after this call.
STDMETHOD(RemoveBreakpoint)(
THIS_
_In_ PDEBUG_BREAKPOINT Bp
) PURE;
// Control and use extension DLLs.
STDMETHOD(AddExtension)(
THIS_
_In_ PCSTR Path,
_In_ ULONG Flags,
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(RemoveExtension)(
THIS_
_In_ ULONG64 Handle
) PURE;
STDMETHOD(GetExtensionByPath)(
THIS_
_In_ PCSTR Path,
_Out_ PULONG64 Handle
) PURE;
// If Handle is zero the extension
// chain is walked searching for the
// function.
STDMETHOD(CallExtension)(
THIS_
_In_ ULONG64 Handle,
_In_ PCSTR Function,
_In_opt_ PCSTR Arguments
) PURE;
// GetExtensionFunction works like
// GetProcAddress on extension DLLs
// to allow raw function-call-level
// interaction with extension DLLs.
// Such functions do not need to
// follow the standard extension prototype
// if they are not going to be called
// through the text extension interface.
// This function cannot be called remotely.
STDMETHOD(GetExtensionFunction)(
THIS_
_In_ ULONG64 Handle,
_In_ PCSTR FuncName,
_Out_ FARPROC* Function
) PURE;
// These methods return alternate
// extension interfaces in order to allow
// interface-style extension DLLs to mix in
// older extension calls.
// Structure sizes must be initialized before
// the call.
// These methods cannot be called remotely.
STDMETHOD(GetWindbgExtensionApis32)(
THIS_
_Inout_ PWINDBG_EXTENSION_APIS32 Api
) PURE;
STDMETHOD(GetWindbgExtensionApis64)(
THIS_
_Inout_ PWINDBG_EXTENSION_APIS64 Api
) PURE;
// The engine provides a simple mechanism
// to filter common events. Arbitrarily complicated
// filtering can be done by registering event callbacks
// but simple event filtering only requires
// setting the options of one of the predefined
// event filters.
// Simple event filters are either for specific
// events and therefore have an enumerant or
// they are for an exception and are based on
// the exceptions code. Exception filters
// are further divided into exceptions specially
// handled by the engine, which is a fixed set,
// and arbitrary exceptions.
// All three groups of filters are indexed together
// with the specific filters first, then the specific
// exception filters and finally the arbitrary
// exception filters.
// The first specific exception is the default
// exception. If an exception event occurs for
// an exception without settings the default
// exception settings are used.
STDMETHOD(GetNumberEventFilters)(
THIS_
_Out_ PULONG SpecificEvents,
_Out_ PULONG SpecificExceptions,
_Out_ PULONG ArbitraryExceptions
) PURE;
// Some filters have descriptive text associated with them.
STDMETHOD(GetEventFilterText)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG TextSize
) PURE;
// All filters support executing a command when the
// event occurs.
STDMETHOD(GetEventFilterCommand)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG CommandSize
) PURE;
STDMETHOD(SetEventFilterCommand)(
THIS_
_In_ ULONG Index,
_In_ PCSTR Command
) PURE;
STDMETHOD(GetSpecificFilterParameters)(
THIS_
_In_ ULONG Start,
_In_ ULONG Count,
_Out_writes_(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
) PURE;
STDMETHOD(SetSpecificFilterParameters)(
THIS_
_In_ ULONG Start,
_In_ ULONG Count,
_In_reads_(Count) PDEBUG_SPECIFIC_FILTER_PARAMETERS Params
) PURE;
// Some specific filters have arguments to further
// qualify their operation.
STDMETHOD(GetSpecificFilterArgument)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG ArgumentSize
) PURE;
STDMETHOD(SetSpecificFilterArgument)(
THIS_
_In_ ULONG Index,
_In_ PCSTR Argument
) PURE;
// If Codes is non-NULL Start is ignored.
STDMETHOD(GetExceptionFilterParameters)(
THIS_
_In_ ULONG Count,
_In_reads_opt_(Count) PULONG Codes,
_In_ ULONG Start,
_Out_writes_(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
) PURE;
// The codes in the parameter data control the application
// of the parameter data. If a code is not already in
// the set of filters it is added. If the ExecutionOption
// for a code is REMOVE then the filter is removed.
// Specific exception filters cannot be removed.
STDMETHOD(SetExceptionFilterParameters)(
THIS_
_In_ ULONG Count,
_In_reads_(Count) PDEBUG_EXCEPTION_FILTER_PARAMETERS Params
) PURE;
// Exception filters support an additional command for
// second-chance events.
STDMETHOD(GetExceptionFilterSecondCommand)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG CommandSize
) PURE;
STDMETHOD(SetExceptionFilterSecondCommand)(
THIS_
_In_ ULONG Index,
_In_ PCSTR Command
) PURE;
// Yields processing to the engine until
// an event occurs. This method may
// only be called by the thread that started
// the debug session.
// When an event occurs the engine carries
// out all event processing such as calling
// callbacks.
// If the callbacks indicate that execution should
// break the wait will return, otherwise it
// goes back to waiting for a new event.
// If the timeout expires, S_FALSE is returned.
// The timeout is not currently supported for
// kernel debugging.
STDMETHOD(WaitForEvent)(
THIS_
_In_ ULONG Flags,
_In_ ULONG Timeout
) PURE;
// Retrieves information about the last event that occurred.
// EventType is one of the event callback mask bits.
// ExtraInformation contains additional event-specific
// information. Not all events have additional information.
STDMETHOD(GetLastEventInformation)(
THIS_
_Out_ PULONG Type,
_Out_ PULONG ProcessId,
_Out_ PULONG ThreadId,
_Out_writes_bytes_opt_(ExtraInformationSize) PVOID ExtraInformation,
_In_ ULONG ExtraInformationSize,
_Out_opt_ PULONG ExtraInformationUsed,
_Out_writes_opt_(DescriptionSize) PSTR Description,
_In_ ULONG DescriptionSize,
_Out_opt_ PULONG DescriptionUsed
) PURE;
// IDebugControl2.
STDMETHOD(GetCurrentTimeDate)(
THIS_
_Out_ PULONG TimeDate
) PURE;
// Retrieves the number of seconds since the
// machine started running.
STDMETHOD(GetCurrentSystemUpTime)(
THIS_
_Out_ PULONG UpTime
) PURE;
// If the current session is a dump session,
// retrieves any extended format information.
STDMETHOD(GetDumpFormatFlags)(
THIS_
_Out_ PULONG FormatFlags
) PURE;
// The debugger has been enhanced to allow
// arbitrary text replacements in addition
// to the simple $u0-$u9 text macros.
// Text replacement takes a given source
// text in commands and converts it to the
// given destination text. Replacements
// are named by their source text so that
// only one replacement for a source text
// string can exist.
STDMETHOD(GetNumberTextReplacements)(
THIS_
_Out_ PULONG NumRepl
) PURE;
// If SrcText is non-NULL the replacement
// is looked up by source text, otherwise
// Index is used to get the Nth replacement.
STDMETHOD(GetTextReplacement)(
THIS_
_In_opt_ PCSTR SrcText,
_In_ ULONG Index,
_Out_writes_opt_(SrcBufferSize) PSTR SrcBuffer,
_In_ ULONG SrcBufferSize,
_Out_opt_ PULONG SrcSize,
_Out_writes_opt_(DstBufferSize) PSTR DstBuffer,
_In_ ULONG DstBufferSize,
_Out_opt_ PULONG DstSize
) PURE;
// Setting the destination text to
// NULL removes the alias.
STDMETHOD(SetTextReplacement)(
THIS_
_In_ PCSTR SrcText,
_In_opt_ PCSTR DstText
) PURE;
STDMETHOD(RemoveTextReplacements)(
THIS
) PURE;
// Outputs the complete list of current
// replacements.
STDMETHOD(OutputTextReplacements)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Flags
) PURE;
// IDebugControl3.
// Control options for assembly and disassembly.
STDMETHOD(GetAssemblyOptions)(
THIS_
_Out_ PULONG Options
) PURE;
STDMETHOD(AddAssemblyOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(RemoveAssemblyOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(SetAssemblyOptions)(
THIS_
_In_ ULONG Options
) PURE;
// Control the expression syntax.
STDMETHOD(GetExpressionSyntax)(
THIS_
_Out_ PULONG Flags
) PURE;
STDMETHOD(SetExpressionSyntax)(
THIS_
_In_ ULONG Flags
) PURE;
// Look up a syntax by its abbreviated
// name and set it.
STDMETHOD(SetExpressionSyntaxByName)(
THIS_
_In_ PCSTR AbbrevName
) PURE;
STDMETHOD(GetNumberExpressionSyntaxes)(
THIS_
_Out_ PULONG Number
) PURE;
STDMETHOD(GetExpressionSyntaxNames)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(FullNameBufferSize) PSTR FullNameBuffer,
_In_ ULONG FullNameBufferSize,
_Out_opt_ PULONG FullNameSize,
_Out_writes_opt_(AbbrevNameBufferSize) PSTR AbbrevNameBuffer,
_In_ ULONG AbbrevNameBufferSize,
_Out_opt_ PULONG AbbrevNameSize
) PURE;
//
// Some debug sessions have only a single
// possible event, such as a snapshot dump
// file; some have dynamic events, such as
// a live debug session; and others may have
// multiple events, such as a dump file that
// contains snapshots from different points
// in time. The following methods allow
// discovery and selection of the available
// events for a session.
// Sessions with one or more static events
// will be able to report all of the events
// when queried. Sessions with dynamic events
// will only report a single event representing
// the current event.
// Switching events constitutes execution and
// changing the current event will alter the
// execution status to a running state, after
// which WaitForEvent must be used to process
// the selected event.
//
// GetNumberEvents returns S_OK if this is the
// complete set of events possible, such as for
// a static session; or S_FALSE if other events
// may be possible, such as for a dynamic session.
STDMETHOD(GetNumberEvents)(
THIS_
_Out_ PULONG Events
) PURE;
// Sessions may have descriptive information for
// the various events available. The amount of
// information varies according to the specific
// session and data.
STDMETHOD(GetEventIndexDescription)(
THIS_
_In_ ULONG Index,
_In_ ULONG Which,
_In_opt_ PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG DescSize
) PURE;
STDMETHOD(GetCurrentEventIndex)(
THIS_
_Out_ PULONG Index
) PURE;
// SetNextEventIndex works like seek in that
// it can set an absolute or relative index.
// SetNextEventIndex works similarly to SetExecutionStatus
// by putting the session into a running state, after
// which the caller must call WaitForEvent. The
// current event index only changes when WaitForEvent
// is called.
STDMETHOD(SetNextEventIndex)(
THIS_
_In_ ULONG Relation,
_In_ ULONG Value,
_Out_ PULONG NextIndex
) PURE;
// IDebugControl4.
STDMETHOD(GetLogFileWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FileSize,
_Out_ PBOOL Append
) PURE;
STDMETHOD(OpenLogFileWide)(
THIS_
_In_ PCWSTR File,
_In_ BOOL Append
) PURE;
STDMETHOD(InputWide)(
THIS_
_Out_writes_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG InputSize
) PURE;
STDMETHOD(ReturnInputWide)(
THIS_
_In_ PCWSTR Buffer
) PURE;
STDMETHODV(OutputWide)(
THIS_
_In_ ULONG Mask,
_In_ PCWSTR Format,
...
) PURE;
STDMETHOD(OutputVaListWide)(
THIS_
_In_ ULONG Mask,
_In_ PCWSTR Format,
_In_ va_list Args
) PURE;
STDMETHODV(ControlledOutputWide)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Mask,
_In_ PCWSTR Format,
...
) PURE;
STDMETHOD(ControlledOutputVaListWide)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Mask,
_In_ PCWSTR Format,
_In_ va_list Args
) PURE;
STDMETHODV(OutputPromptWide)(
THIS_
_In_ ULONG OutputControl,
_In_opt_ PCWSTR Format,
...
) PURE;
STDMETHOD(OutputPromptVaListWide)(
THIS_
_In_ ULONG OutputControl,
_In_opt_ PCWSTR Format,
_In_ va_list Args
) PURE;
STDMETHOD(GetPromptTextWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG TextSize
) PURE;
STDMETHOD(AssembleWide)(
THIS_
_In_ ULONG64 Offset,
_In_ PCWSTR Instr,
_Out_ PULONG64 EndOffset
) PURE;
STDMETHOD(DisassembleWide)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG DisassemblySize,
_Out_ PULONG64 EndOffset
) PURE;
STDMETHOD(GetProcessorTypeNamesWide)(
THIS_
_In_ ULONG Type,
_Out_writes_opt_(FullNameBufferSize) PWSTR FullNameBuffer,
_In_ ULONG FullNameBufferSize,
_Out_opt_ PULONG FullNameSize,
_Out_writes_opt_(AbbrevNameBufferSize) PWSTR AbbrevNameBuffer,
_In_ ULONG AbbrevNameBufferSize,
_Out_opt_ PULONG AbbrevNameSize
) PURE;
STDMETHOD(GetTextMacroWide)(
THIS_
_In_ ULONG Slot,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG MacroSize
) PURE;
STDMETHOD(SetTextMacroWide)(
THIS_
_In_ ULONG Slot,
_In_ PCWSTR Macro
) PURE;
STDMETHOD(EvaluateWide)(
THIS_
_In_ PCWSTR Expression,
_In_ ULONG DesiredType,
_Out_ PDEBUG_VALUE Value,
_Out_opt_ PULONG RemainderIndex
) PURE;
STDMETHOD(ExecuteWide)(
THIS_
_In_ ULONG OutputControl,
_In_ PCWSTR Command,
_In_ ULONG Flags
) PURE;
STDMETHOD(ExecuteCommandFileWide)(
THIS_
_In_ ULONG OutputControl,
_In_ PCWSTR CommandFile,
_In_ ULONG Flags
) PURE;
STDMETHOD(GetBreakpointByIndex2)(
THIS_
_In_ ULONG Index,
_Out_ PDEBUG_BREAKPOINT2* Bp
) PURE;
STDMETHOD(GetBreakpointById2)(
THIS_
_In_ ULONG Id,
_Out_ PDEBUG_BREAKPOINT2* Bp
) PURE;
STDMETHOD(AddBreakpoint2)(
THIS_
_In_ ULONG Type,
_In_ ULONG DesiredId,
_Out_ PDEBUG_BREAKPOINT2* Bp
) PURE;
STDMETHOD(RemoveBreakpoint2)(
THIS_
_In_ PDEBUG_BREAKPOINT2 Bp
) PURE;
STDMETHOD(AddExtensionWide)(
THIS_
_In_ PCWSTR Path,
_In_ ULONG Flags,
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(GetExtensionByPathWide)(
THIS_
_In_ PCWSTR Path,
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(CallExtensionWide)(
THIS_
_In_ ULONG64 Handle,
_In_ PCWSTR Function,
_In_opt_ PCWSTR Arguments
) PURE;
STDMETHOD(GetExtensionFunctionWide)(
THIS_
_In_ ULONG64 Handle,
_In_ PCWSTR FuncName,
_Out_ FARPROC* Function
) PURE;
STDMETHOD(GetEventFilterTextWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG TextSize
) PURE;
STDMETHOD(GetEventFilterCommandWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG CommandSize
) PURE;
STDMETHOD(SetEventFilterCommandWide)(
THIS_
_In_ ULONG Index,
_In_ PCWSTR Command
) PURE;
STDMETHOD(GetSpecificFilterArgumentWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG ArgumentSize
) PURE;
STDMETHOD(SetSpecificFilterArgumentWide)(
THIS_
_In_ ULONG Index,
_In_ PCWSTR Argument
) PURE;
STDMETHOD(GetExceptionFilterSecondCommandWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG CommandSize
) PURE;
STDMETHOD(SetExceptionFilterSecondCommandWide)(
THIS_
_In_ ULONG Index,
_In_ PCWSTR Command
) PURE;
STDMETHOD(GetLastEventInformationWide)(
THIS_
_Out_ PULONG Type,
_Out_ PULONG ProcessId,
_Out_ PULONG ThreadId,
_Out_writes_bytes_opt_(ExtraInformationSize) PVOID ExtraInformation,
_In_ ULONG ExtraInformationSize,
_Out_opt_ PULONG ExtraInformationUsed,
_Out_writes_opt_(DescriptionSize) PWSTR Description,
_In_ ULONG DescriptionSize,
_Out_opt_ PULONG DescriptionUsed
) PURE;
STDMETHOD(GetTextReplacementWide)(
THIS_
_In_opt_ PCWSTR SrcText,
_In_ ULONG Index,
_Out_writes_opt_(SrcBufferSize) PWSTR SrcBuffer,
_In_ ULONG SrcBufferSize,
_Out_opt_ PULONG SrcSize,
_Out_writes_opt_(DstBufferSize) PWSTR DstBuffer,
_In_ ULONG DstBufferSize,
_Out_opt_ PULONG DstSize
) PURE;
STDMETHOD(SetTextReplacementWide)(
THIS_
_In_ PCWSTR SrcText,
_In_opt_ PCWSTR DstText
) PURE;
STDMETHOD(SetExpressionSyntaxByNameWide)(
THIS_
_In_ PCWSTR AbbrevName
) PURE;
STDMETHOD(GetExpressionSyntaxNamesWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(FullNameBufferSize) PWSTR FullNameBuffer,
_In_ ULONG FullNameBufferSize,
_Out_opt_ PULONG FullNameSize,
_Out_writes_opt_(AbbrevNameBufferSize) PWSTR AbbrevNameBuffer,
_In_ ULONG AbbrevNameBufferSize,
_Out_opt_ PULONG AbbrevNameSize
) PURE;
STDMETHOD(GetEventIndexDescriptionWide)(
THIS_
_In_ ULONG Index,
_In_ ULONG Which,
_In_opt_ PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG DescSize
) PURE;
STDMETHOD(GetLogFile2)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FileSize,
_Out_ PULONG Flags
) PURE;
STDMETHOD(OpenLogFile2)(
THIS_
_In_ PCSTR File,
_In_ ULONG Flags
) PURE;
STDMETHOD(GetLogFile2Wide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FileSize,
_Out_ PULONG Flags
) PURE;
STDMETHOD(OpenLogFile2Wide)(
THIS_
_In_ PCWSTR File,
_In_ ULONG Flags
) PURE;
// GetSystemVersion always returns the kd
// major/minor version numbers, which are
// different than the Win32 version numbers.
// GetSystemVersionValues can be used
// to determine the Win32 version values.
STDMETHOD(GetSystemVersionValues)(
THIS_
_Out_ PULONG PlatformId,
_Out_ PULONG Win32Major,
_Out_ PULONG Win32Minor,
_Out_opt_ PULONG KdMajor,
_Out_opt_ PULONG KdMinor
) PURE;
// Strings are selected with DEBUG_SYSVERSTR_*.
STDMETHOD(GetSystemVersionString)(
THIS_
_In_ ULONG Which,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
STDMETHOD(GetSystemVersionStringWide)(
THIS_
_In_ ULONG Which,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
// Stack tracing with a full initial context
// and full context return for each frame.
// The FrameContextsSize parameter is the total
// byte size of FrameContexts. FrameContextsEntrySize
// gives the byte size of each entry in
// FrameContexts.
STDMETHOD(GetContextStackTrace)(
THIS_
_In_reads_bytes_opt_(StartContextSize) PVOID StartContext,
_In_ ULONG StartContextSize,
_Out_writes_to_opt_(FramesSize,*FramesFilled) PDEBUG_STACK_FRAME Frames,
_In_ ULONG FramesSize,
_Out_writes_bytes_opt_(FrameContextsSize) PVOID FrameContexts,
_In_ ULONG FrameContextsSize,
_In_ ULONG FrameContextsEntrySize,
_Out_opt_ PULONG FramesFilled
) PURE;
STDMETHOD(OutputContextStackTrace)(
THIS_
_In_ ULONG OutputControl,
_In_reads_(FramesSize) PDEBUG_STACK_FRAME Frames,
_In_ ULONG FramesSize,
_In_reads_bytes_(FrameContextsSize) PVOID FrameContexts,
_In_ ULONG FrameContextsSize,
_In_ ULONG FrameContextsEntrySize,
_In_ ULONG Flags
) PURE;
// Some targets, such as user-mode minidump files,
// have separate "event of interest" information
// stored within them. This method allows
// access to that information.
STDMETHOD(GetStoredEventInformation)(
THIS_
_Out_ PULONG Type,
_Out_ PULONG ProcessId,
_Out_ PULONG ThreadId,
_Out_writes_bytes_opt_(ContextSize) PVOID Context,
_In_ ULONG ContextSize,
_Out_opt_ PULONG ContextUsed,
_Out_writes_bytes_opt_(ExtraInformationSize) PVOID ExtraInformation,
_In_ ULONG ExtraInformationSize,
_Out_opt_ PULONG ExtraInformationUsed
) PURE;
// Managed debugging support relies on debugging
// functionality provided by the Common Language Runtime.
// This method provides feedback on the engine's
// use of the runtime debugging APIs.
STDMETHOD(GetManagedStatus)(
THIS_
_Out_opt_ PULONG Flags,
_In_ ULONG WhichString,
_Out_writes_opt_(StringSize) PSTR String,
_In_ ULONG StringSize,
_Out_opt_ PULONG StringNeeded
) PURE;
STDMETHOD(GetManagedStatusWide)(
THIS_
_Out_opt_ PULONG Flags,
_In_ ULONG WhichString,
_Out_writes_opt_(StringSize) PWSTR String,
_In_ ULONG StringSize,
_Out_opt_ PULONG StringNeeded
) PURE;
// Clears and reinitializes the engine's
// managed code debugging support.
STDMETHOD(ResetManagedStatus)(
THIS_
_In_ ULONG Flags
) PURE;
// IDebugControl5
STDMETHOD(GetStackTraceEx)(
THIS_
_In_ ULONG64 FrameOffset,
_In_ ULONG64 StackOffset,
_In_ ULONG64 InstructionOffset,
_Out_writes_to_(FramesSize,*FramesFilled) PDEBUG_STACK_FRAME_EX Frames,
_In_ ULONG FramesSize,
_Out_opt_ PULONG FramesFilled
) PURE;
STDMETHOD(OutputStackTraceEx)(
THIS_
_In_ ULONG OutputControl,
_In_reads_opt_(FramesSize) PDEBUG_STACK_FRAME_EX Frames,
_In_ ULONG FramesSize,
_In_ ULONG Flags
) PURE;
STDMETHOD(GetContextStackTraceEx)(
THIS_
_In_reads_bytes_opt_(StartContextSize) PVOID StartContext,
_In_ ULONG StartContextSize,
_Out_writes_to_opt_(FramesSize,*FramesFilled) PDEBUG_STACK_FRAME_EX Fram
es,
_In_ ULONG FramesSize,
_Out_writes_bytes_opt_(FrameContextsSize) PVOID FrameContexts,
_In_ ULONG FrameContextsSize,
_In_ ULONG FrameContextsEntrySize,
_Out_opt_ PULONG FramesFilled
) PURE;
STDMETHOD(OutputContextStackTraceEx)(
THIS_
_In_ ULONG OutputControl,
_In_reads_(FramesSize) PDEBUG_STACK_FRAME_EX Frames,
_In_ ULONG FramesSize,
_In_reads_bytes_(FrameContextsSize) PVOID FrameContexts,
_In_ ULONG FrameContextsSize,
_In_ ULONG FrameContextsEntrySize,
_In_ ULONG Flags
) PURE;
STDMETHOD(GetBreakpointByGuid)(
THIS_
_In_ LPGUID Guid,
_Out_ PDEBUG_BREAKPOINT3* Bp
) PURE;
// IDebugControl6
// Returns additional info states for
STDMETHOD(GetExecutionStatusEx)(
THIS_
_Out_ PULONG Status
) PURE;
STDMETHOD(GetSynchronizationStatus)(
THIS_
_Out_ PULONG SendsAttempted,
_Out_ PULONG SecondsSinceLastResponse
) PURE;
// IDebugControl7
STDMETHOD(GetDebuggeeType2)(
THIS_
_In_ ULONG Flags,
_Out_ PULONG Class,
_Out_ PULONG Qualifier
) PURE; ) PURE;
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// IDebugDataSpaces. // IDebugDataSpaces.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// Data space indices for callbacks and other methods. // Data space indices for callbacks and other methods.
skipping to change at line 9057 skipping to change at line 15309
#define DEBUG_DATA_PaeEnabled 100000 #define DEBUG_DATA_PaeEnabled 100000
#define DEBUG_DATA_SharedUserData 100008 #define DEBUG_DATA_SharedUserData 100008
#define DEBUG_DATA_ProductType 100016 #define DEBUG_DATA_ProductType 100016
#define DEBUG_DATA_SuiteMask 100024 #define DEBUG_DATA_SuiteMask 100024
#define DEBUG_DATA_DumpWriterStatus 100032 #define DEBUG_DATA_DumpWriterStatus 100032
#define DEBUG_DATA_DumpFormatVersion 100040 #define DEBUG_DATA_DumpFormatVersion 100040
#define DEBUG_DATA_DumpWriterVersion 100048 #define DEBUG_DATA_DumpWriterVersion 100048
#define DEBUG_DATA_DumpPowerState 100056 #define DEBUG_DATA_DumpPowerState 100056
#define DEBUG_DATA_DumpMmStorage 100064 #define DEBUG_DATA_DumpMmStorage 100064
#define DEBUG_DATA_DumpAttributes 100072
// //
// Processor information structures. // Processor information structures.
// //
typedef struct _DEBUG_PROCESSOR_IDENTIFICATION_ALPHA typedef struct _DEBUG_PROCESSOR_IDENTIFICATION_ALPHA
{ {
ULONG Type; ULONG Type;
ULONG Revision; ULONG Revision;
} DEBUG_PROCESSOR_IDENTIFICATION_ALPHA, *PDEBUG_PROCESSOR_IDENTIFICATION_ALPHA; } DEBUG_PROCESSOR_IDENTIFICATION_ALPHA, *PDEBUG_PROCESSOR_IDENTIFICATION_ALPHA;
skipping to change at line 9095 skipping to change at line 15348
typedef struct _DEBUG_PROCESSOR_IDENTIFICATION_X86 typedef struct _DEBUG_PROCESSOR_IDENTIFICATION_X86
{ {
ULONG Family; ULONG Family;
ULONG Model; ULONG Model;
ULONG Stepping; ULONG Stepping;
CHAR VendorString[16]; CHAR VendorString[16];
} DEBUG_PROCESSOR_IDENTIFICATION_X86, *PDEBUG_PROCESSOR_IDENTIFICATION_X86; } DEBUG_PROCESSOR_IDENTIFICATION_X86, *PDEBUG_PROCESSOR_IDENTIFICATION_X86;
typedef struct _DEBUG_PROCESSOR_IDENTIFICATION_ARM typedef struct _DEBUG_PROCESSOR_IDENTIFICATION_ARM
{ {
ULONG Type; ULONG Model;
ULONG Revision; ULONG Revision;
CHAR VendorString[16];
} DEBUG_PROCESSOR_IDENTIFICATION_ARM, *PDEBUG_PROCESSOR_IDENTIFICATION_ARM; } DEBUG_PROCESSOR_IDENTIFICATION_ARM, *PDEBUG_PROCESSOR_IDENTIFICATION_ARM;
typedef union _DEBUG_PROCESSOR_IDENTIFICATION_ALL typedef union _DEBUG_PROCESSOR_IDENTIFICATION_ALL
{ {
DEBUG_PROCESSOR_IDENTIFICATION_ALPHA Alpha; DEBUG_PROCESSOR_IDENTIFICATION_ALPHA Alpha;
DEBUG_PROCESSOR_IDENTIFICATION_AMD64 Amd64; DEBUG_PROCESSOR_IDENTIFICATION_AMD64 Amd64;
DEBUG_PROCESSOR_IDENTIFICATION_IA64 Ia64; DEBUG_PROCESSOR_IDENTIFICATION_IA64 Ia64;
DEBUG_PROCESSOR_IDENTIFICATION_X86 X86; DEBUG_PROCESSOR_IDENTIFICATION_X86 X86;
DEBUG_PROCESSOR_IDENTIFICATION_ARM Arm; DEBUG_PROCESSOR_IDENTIFICATION_ARM Arm;
} DEBUG_PROCESSOR_IDENTIFICATION_ALL, *PDEBUG_PROCESSOR_IDENTIFICATION_ALL; } DEBUG_PROCESSOR_IDENTIFICATION_ALL, *PDEBUG_PROCESSOR_IDENTIFICATION_ALL;
skipping to change at line 9123 skipping to change at line 15377
#define DEBUG_DATA_PROCESSOR_IDENTIFICATION 4 #define DEBUG_DATA_PROCESSOR_IDENTIFICATION 4
#define DEBUG_DATA_PROCESSOR_SPEED 5 #define DEBUG_DATA_PROCESSOR_SPEED 5
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugDataSpaces #define INTERFACE IDebugDataSpaces
DECLARE_INTERFACE_(IDebugDataSpaces, IUnknown) DECLARE_INTERFACE_(IDebugDataSpaces, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugDataSpaces. // IDebugDataSpaces.
STDMETHOD(ReadVirtual)( STDMETHOD(ReadVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteVirtual)( STDMETHOD(WriteVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
// SearchVirtual searches the given virtual // SearchVirtual searches the given virtual
// address range for the given pattern. PatternSize // address range for the given pattern. PatternSize
// gives the byte length of the pattern and PatternGranularity // gives the byte length of the pattern and PatternGranularity
// controls the granularity of comparisons during // controls the granularity of comparisons during
// the search. // the search.
// For example, a DWORD-granular search would // For example, a DWORD-granular search would
// use a pattern granularity of four to search by DWORD // use a pattern granularity of four to search by DWORD
// increments. // increments.
STDMETHOD(SearchVirtual)( STDMETHOD(SearchVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Length, _In_ ULONG64 Length,
__in_bcount(PatternSize) PVOID Pattern, _In_reads_bytes_(PatternSize) PVOID Pattern,
__in ULONG PatternSize, _In_ ULONG PatternSize,
__in ULONG PatternGranularity, _In_ ULONG PatternGranularity,
__out PULONG64 MatchOffset _Out_ PULONG64 MatchOffset
) PURE; ) PURE;
// These methods are identical to Read/WriteVirtual // These methods are identical to Read/WriteVirtual
// except that they avoid the kernel virtual memory // except that they avoid the kernel virtual memory
// cache entirely and are therefore useful for reading // cache entirely and are therefore useful for reading
// virtual memory which is inherently volatile, such // virtual memory which is inherently volatile, such
// as memory-mapped device areas, without contaminating // as memory-mapped device areas, without contaminating
// or invalidating the cache. // or invalidating the cache.
// In user-mode they are the same as Read/WriteVirtual. // In user-mode they are the same as Read/WriteVirtual.
STDMETHOD(ReadVirtualUncached)( STDMETHOD(ReadVirtualUncached)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteVirtualUncached)( STDMETHOD(WriteVirtualUncached)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
// The following two methods are convenience // The following two methods are convenience
// methods for accessing pointer values. // methods for accessing pointer values.
// They automatically convert between native pointers // They automatically convert between native pointers
// and canonical 64-bit values as necessary. // and canonical 64-bit values as necessary.
// These routines stop at the first failure. // These routines stop at the first failure.
STDMETHOD(ReadPointersVirtual)( STDMETHOD(ReadPointersVirtual)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_ecount(Count) PULONG64 Ptrs _Out_writes_(Count) PULONG64 Ptrs
) PURE; ) PURE;
STDMETHOD(WritePointersVirtual)( STDMETHOD(WritePointersVirtual)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_ecount(Count) PULONG64 Ptrs _In_reads_(Count) PULONG64 Ptrs
) PURE; ) PURE;
// All non-virtual data spaces are only // All non-virtual data spaces are only
// available when kernel debugging. // available when kernel debugging.
STDMETHOD(ReadPhysical)( STDMETHOD(ReadPhysical)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WritePhysical)( STDMETHOD(WritePhysical)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(ReadControl)( STDMETHOD(ReadControl)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteControl)( STDMETHOD(WriteControl)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(ReadIo)( STDMETHOD(ReadIo)(
THIS_ THIS_
__in ULONG InterfaceType, _In_ ULONG InterfaceType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG AddressSpace, _In_ ULONG AddressSpace,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteIo)( STDMETHOD(WriteIo)(
THIS_ THIS_
__in ULONG InterfaceType, _In_ ULONG InterfaceType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG AddressSpace, _In_ ULONG AddressSpace,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(ReadMsr)( STDMETHOD(ReadMsr)(
THIS_ THIS_
__in ULONG Msr, _In_ ULONG Msr,
__out PULONG64 Value _Out_ PULONG64 Value
) PURE; ) PURE;
STDMETHOD(WriteMsr)( STDMETHOD(WriteMsr)(
THIS_ THIS_
__in ULONG Msr, _In_ ULONG Msr,
__in ULONG64 Value _In_ ULONG64 Value
) PURE; ) PURE;
STDMETHOD(ReadBusData)( STDMETHOD(ReadBusData)(
THIS_ THIS_
__in ULONG BusDataType, _In_ ULONG BusDataType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG SlotNumber, _In_ ULONG SlotNumber,
__in ULONG Offset, _In_ ULONG Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteBusData)( STDMETHOD(WriteBusData)(
THIS_ THIS_
__in ULONG BusDataType, _In_ ULONG BusDataType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG SlotNumber, _In_ ULONG SlotNumber,
__in ULONG Offset, _In_ ULONG Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(CheckLowMemory)( STDMETHOD(CheckLowMemory)(
THIS THIS
) PURE; ) PURE;
STDMETHOD(ReadDebuggerData)( STDMETHOD(ReadDebuggerData)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DataSize _Out_opt_ PULONG DataSize
) PURE; ) PURE;
STDMETHOD(ReadProcessorSystemData)( STDMETHOD(ReadProcessorSystemData)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__in ULONG Index, _In_ ULONG Index,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DataSize _Out_opt_ PULONG DataSize
) PURE; ) PURE;
}; };
// //
// Handle data types and structures. // Handle data types and structures.
// //
#define DEBUG_HANDLE_DATA_TYPE_BASIC 0 #define DEBUG_HANDLE_DATA_TYPE_BASIC 0
#define DEBUG_HANDLE_DATA_TYPE_TYPE_NAME 1 #define DEBUG_HANDLE_DATA_TYPE_TYPE_NAME 1
#define DEBUG_HANDLE_DATA_TYPE_OBJECT_NAME 2 #define DEBUG_HANDLE_DATA_TYPE_OBJECT_NAME 2
#define DEBUG_HANDLE_DATA_TYPE_HANDLE_COUNT 3 #define DEBUG_HANDLE_DATA_TYPE_HANDLE_COUNT 3
#define DEBUG_HANDLE_DATA_TYPE_TYPE_NAME_WIDE 4 #define DEBUG_HANDLE_DATA_TYPE_TYPE_NAME_WIDE 4
#define DEBUG_HANDLE_DATA_TYPE_OBJECT_NAME_WIDE 5 #define DEBUG_HANDLE_DATA_TYPE_OBJECT_NAME_WIDE 5
#define DEBUG_HANDLE_DATA_TYPE_MINI_THREAD_1 6 #define DEBUG_HANDLE_DATA_TYPE_MINI_THREAD_1 6
#define DEBUG_HANDLE_DATA_TYPE_MINI_MUTANT_1 7 #define DEBUG_HANDLE_DATA_TYPE_MINI_MUTANT_1 7
#define DEBUG_HANDLE_DATA_TYPE_MINI_MUTANT_2 8 #define DEBUG_HANDLE_DATA_TYPE_MINI_MUTANT_2 8
#define DEBUG_HANDLE_DATA_TYPE_PER_HANDLE_OPERATIONS 9 #define DEBUG_HANDLE_DATA_TYPE_PER_HANDLE_OPERATIONS 9
#define DEBUG_HANDLE_DATA_TYPE_ALL_HANDLE_OPERATIONS 10 #define DEBUG_HANDLE_DATA_TYPE_ALL_HANDLE_OPERATIONS 10
#define DEBUG_HANDLE_DATA_TYPE_MINI_PROCESS_1 11 #define DEBUG_HANDLE_DATA_TYPE_MINI_PROCESS_1 11
#define DEBUG_HANDLE_DATA_TYPE_MINI_PROCESS_2 12 #define DEBUG_HANDLE_DATA_TYPE_MINI_PROCESS_2 12
#define DEBUG_HANDLE_DATA_TYPE_MINI_EVENT_1 13
#define DEBUG_HANDLE_DATA_TYPE_MINI_SECTION_1 14
typedef struct _DEBUG_HANDLE_DATA_BASIC typedef struct _DEBUG_HANDLE_DATA_BASIC
{ {
ULONG TypeNameSize; ULONG TypeNameSize;
ULONG ObjectNameSize; ULONG ObjectNameSize;
ULONG Attributes; ULONG Attributes;
ULONG GrantedAccess; ULONG GrantedAccess;
ULONG HandleCount; ULONG HandleCount;
ULONG PointerCount; ULONG PointerCount;
} DEBUG_HANDLE_DATA_BASIC, *PDEBUG_HANDLE_DATA_BASIC; } DEBUG_HANDLE_DATA_BASIC, *PDEBUG_HANDLE_DATA_BASIC;
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugDataSpaces2 #define INTERFACE IDebugDataSpaces2
DECLARE_INTERFACE_(IDebugDataSpaces2, IUnknown) DECLARE_INTERFACE_(IDebugDataSpaces2, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugDataSpaces. // IDebugDataSpaces.
STDMETHOD(ReadVirtual)( STDMETHOD(ReadVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteVirtual)( STDMETHOD(WriteVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
// SearchVirtual searches the given virtual // SearchVirtual searches the given virtual
// address range for the given pattern. PatternSize // address range for the given pattern. PatternSize
// gives the byte length of the pattern and PatternGranularity // gives the byte length of the pattern and PatternGranularity
// controls the granularity of comparisons during // controls the granularity of comparisons during
// the search. // the search.
// For example, a DWORD-granular search would // For example, a DWORD-granular search would
// use a pattern granularity of four to search by DWORD // use a pattern granularity of four to search by DWORD
// increments. // increments.
STDMETHOD(SearchVirtual)( STDMETHOD(SearchVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Length, _In_ ULONG64 Length,
__in_bcount(PatternSize) PVOID Pattern, _In_reads_bytes_(PatternSize) PVOID Pattern,
__in ULONG PatternSize, _In_ ULONG PatternSize,
__in ULONG PatternGranularity, _In_ ULONG PatternGranularity,
__out PULONG64 MatchOffset _Out_ PULONG64 MatchOffset
) PURE; ) PURE;
// These methods are identical to Read/WriteVirtual // These methods are identical to Read/WriteVirtual
// except that they avoid the kernel virtual memory // except that they avoid the kernel virtual memory
// cache entirely and are therefore useful for reading // cache entirely and are therefore useful for reading
// virtual memory which is inherently volatile, such // virtual memory which is inherently volatile, such
// as memory-mapped device areas, without contaminating // as memory-mapped device areas, without contaminating
// or invalidating the cache. // or invalidating the cache.
// In user-mode they are the same as Read/WriteVirtual. // In user-mode they are the same as Read/WriteVirtual.
STDMETHOD(ReadVirtualUncached)( STDMETHOD(ReadVirtualUncached)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteVirtualUncached)( STDMETHOD(WriteVirtualUncached)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
// The following two methods are convenience // The following two methods are convenience
// methods for accessing pointer values. // methods for accessing pointer values.
// They automatically convert between native pointers // They automatically convert between native pointers
// and canonical 64-bit values as necessary. // and canonical 64-bit values as necessary.
// These routines stop at the first failure. // These routines stop at the first failure.
STDMETHOD(ReadPointersVirtual)( STDMETHOD(ReadPointersVirtual)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_ecount(Count) PULONG64 Ptrs _Out_writes_(Count) PULONG64 Ptrs
) PURE; ) PURE;
STDMETHOD(WritePointersVirtual)( STDMETHOD(WritePointersVirtual)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_ecount(Count) PULONG64 Ptrs _In_reads_(Count) PULONG64 Ptrs
) PURE; ) PURE;
// All non-virtual data spaces are only // All non-virtual data spaces are only
// available when kernel debugging. // available when kernel debugging.
STDMETHOD(ReadPhysical)( STDMETHOD(ReadPhysical)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WritePhysical)( STDMETHOD(WritePhysical)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(ReadControl)( STDMETHOD(ReadControl)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteControl)( STDMETHOD(WriteControl)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(ReadIo)( STDMETHOD(ReadIo)(
THIS_ THIS_
__in ULONG InterfaceType, _In_ ULONG InterfaceType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG AddressSpace, _In_ ULONG AddressSpace,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteIo)( STDMETHOD(WriteIo)(
THIS_ THIS_
__in ULONG InterfaceType, _In_ ULONG InterfaceType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG AddressSpace, _In_ ULONG AddressSpace,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(ReadMsr)( STDMETHOD(ReadMsr)(
THIS_ THIS_
__in ULONG Msr, _In_ ULONG Msr,
__out PULONG64 Value _Out_ PULONG64 Value
) PURE; ) PURE;
STDMETHOD(WriteMsr)( STDMETHOD(WriteMsr)(
THIS_ THIS_
__in ULONG Msr, _In_ ULONG Msr,
__in ULONG64 Value _In_ ULONG64 Value
) PURE; ) PURE;
STDMETHOD(ReadBusData)( STDMETHOD(ReadBusData)(
THIS_ THIS_
__in ULONG BusDataType, _In_ ULONG BusDataType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG SlotNumber, _In_ ULONG SlotNumber,
__in ULONG Offset, _In_ ULONG Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteBusData)( STDMETHOD(WriteBusData)(
THIS_ THIS_
__in ULONG BusDataType, _In_ ULONG BusDataType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG SlotNumber, _In_ ULONG SlotNumber,
__in ULONG Offset, _In_ ULONG Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(CheckLowMemory)( STDMETHOD(CheckLowMemory)(
THIS THIS
) PURE; ) PURE;
STDMETHOD(ReadDebuggerData)( STDMETHOD(ReadDebuggerData)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DataSize _Out_opt_ PULONG DataSize
) PURE; ) PURE;
STDMETHOD(ReadProcessorSystemData)( STDMETHOD(ReadProcessorSystemData)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__in ULONG Index, _In_ ULONG Index,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DataSize _Out_opt_ PULONG DataSize
) PURE; ) PURE;
// IDebugDataSpaces2. // IDebugDataSpaces2.
STDMETHOD(VirtualToPhysical)( STDMETHOD(VirtualToPhysical)(
THIS_ THIS_
__in ULONG64 Virtual, _In_ ULONG64 Virtual,
__out PULONG64 Physical _Out_ PULONG64 Physical
) PURE; ) PURE;
// Returns the physical addresses for the // Returns the physical addresses for the
// N levels of the systems paging structures. // N levels of the systems paging structures.
// Level zero is the starting base physical // Level zero is the starting base physical
// address for virtual translations. // address for virtual translations.
// Levels one-(N-1) will point to the appropriate // Levels one-(N-1) will point to the appropriate
// paging descriptor for the virtual address at // paging descriptor for the virtual address at
// the given level of the paging hierarchy. The // the given level of the paging hierarchy. The
// exact number of levels depends on many factors. // exact number of levels depends on many factors.
// The last level will be the fully translated // The last level will be the fully translated
// physical address, matching what VirtualToPhysical // physical address, matching what VirtualToPhysical
// returns. If the address can only be partially // returns. If the address can only be partially
// translated S_FALSE is returned. // translated S_FALSE is returned.
STDMETHOD(GetVirtualTranslationPhysicalOffsets)( STDMETHOD(GetVirtualTranslationPhysicalOffsets)(
THIS_ THIS_
__in ULONG64 Virtual, _In_ ULONG64 Virtual,
__out_ecount_opt(OffsetsSize) PULONG64 Offsets, _Out_writes_opt_(OffsetsSize) PULONG64 Offsets,
__in ULONG OffsetsSize, _In_ ULONG OffsetsSize,
__out_opt PULONG Levels _Out_opt_ PULONG Levels
) PURE; ) PURE;
// System handle data is accessible in certain // System handle data is accessible in certain
// debug sessions. The particular data available // debug sessions. The particular data available
// varies from session to session and platform // varies from session to session and platform
// to platform. // to platform.
STDMETHOD(ReadHandleData)( STDMETHOD(ReadHandleData)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in ULONG DataType, _In_ ULONG DataType,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DataSize _Out_opt_ PULONG DataSize
) PURE; ) PURE;
// Fills memory with the given pattern. // Fills memory with the given pattern.
// The fill stops at the first non-writable byte. // The fill stops at the first non-writable byte.
STDMETHOD(FillVirtual)( STDMETHOD(FillVirtual)(
THIS_ THIS_
__in ULONG64 Start, _In_ ULONG64 Start,
__in ULONG Size, _In_ ULONG Size,
__in_bcount(PatternSize) PVOID Pattern, _In_reads_bytes_(PatternSize) PVOID Pattern,
__in ULONG PatternSize, _In_ ULONG PatternSize,
__out_opt PULONG Filled _Out_opt_ PULONG Filled
) PURE; ) PURE;
STDMETHOD(FillPhysical)( STDMETHOD(FillPhysical)(
THIS_ THIS_
__in ULONG64 Start, _In_ ULONG64 Start,
__in ULONG Size, _In_ ULONG Size,
__in_bcount(PatternSize) PVOID Pattern, _In_reads_bytes_(PatternSize) PVOID Pattern,
__in ULONG PatternSize, _In_ ULONG PatternSize,
__out_opt PULONG Filled _Out_opt_ PULONG Filled
) PURE; ) PURE;
// Queries virtual memory mapping information given // Queries virtual memory mapping information given
// an address similarly to the Win32 API VirtualQuery. // an address similarly to the Win32 API VirtualQuery.
// MEMORY_BASIC_INFORMATION64 is defined in crash.h. // MEMORY_BASIC_INFORMATION64 is defined in crash.h.
// This method currently only works for user-mode sessions. // This method currently only works for user-mode sessions.
STDMETHOD(QueryVirtual)( STDMETHOD(QueryVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PMEMORY_BASIC_INFORMATION64 Info _Out_ PMEMORY_BASIC_INFORMATION64 Info
) PURE; ) PURE;
}; };
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugDataSpaces3 #define INTERFACE IDebugDataSpaces3
DECLARE_INTERFACE_(IDebugDataSpaces3, IUnknown) DECLARE_INTERFACE_(IDebugDataSpaces3, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugDataSpaces. // IDebugDataSpaces.
STDMETHOD(ReadVirtual)( STDMETHOD(ReadVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteVirtual)( STDMETHOD(WriteVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
// SearchVirtual searches the given virtual // SearchVirtual searches the given virtual
// address range for the given pattern. PatternSize // address range for the given pattern. PatternSize
// gives the byte length of the pattern and PatternGranularity // gives the byte length of the pattern and PatternGranularity
// controls the granularity of comparisons during // controls the granularity of comparisons during
// the search. // the search.
// For example, a DWORD-granular search would // For example, a DWORD-granular search would
// use a pattern granularity of four to search by DWORD // use a pattern granularity of four to search by DWORD
// increments. // increments.
STDMETHOD(SearchVirtual)( STDMETHOD(SearchVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Length, _In_ ULONG64 Length,
__in_bcount(PatternSize) PVOID Pattern, _In_reads_bytes_(PatternSize) PVOID Pattern,
__in ULONG PatternSize, _In_ ULONG PatternSize,
__in ULONG PatternGranularity, _In_ ULONG PatternGranularity,
__out PULONG64 MatchOffset _Out_ PULONG64 MatchOffset
) PURE; ) PURE;
// These methods are identical to Read/WriteVirtual // These methods are identical to Read/WriteVirtual
// except that they avoid the kernel virtual memory // except that they avoid the kernel virtual memory
// cache entirely and are therefore useful for reading // cache entirely and are therefore useful for reading
// virtual memory which is inherently volatile, such // virtual memory which is inherently volatile, such
// as memory-mapped device areas, without contaminating // as memory-mapped device areas, without contaminating
// or invalidating the cache. // or invalidating the cache.
// In user-mode they are the same as Read/WriteVirtual. // In user-mode they are the same as Read/WriteVirtual.
STDMETHOD(ReadVirtualUncached)( STDMETHOD(ReadVirtualUncached)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteVirtualUncached)( STDMETHOD(WriteVirtualUncached)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
// The following two methods are convenience // The following two methods are convenience
// methods for accessing pointer values. // methods for accessing pointer values.
// They automatically convert between native pointers // They automatically convert between native pointers
// and canonical 64-bit values as necessary. // and canonical 64-bit values as necessary.
// These routines stop at the first failure. // These routines stop at the first failure.
STDMETHOD(ReadPointersVirtual)( STDMETHOD(ReadPointersVirtual)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_ecount(Count) PULONG64 Ptrs _Out_writes_(Count) PULONG64 Ptrs
) PURE; ) PURE;
STDMETHOD(WritePointersVirtual)( STDMETHOD(WritePointersVirtual)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_ecount(Count) PULONG64 Ptrs _In_reads_(Count) PULONG64 Ptrs
) PURE; ) PURE;
// All non-virtual data spaces are only // All non-virtual data spaces are only
// available when kernel debugging. // available when kernel debugging.
STDMETHOD(ReadPhysical)( STDMETHOD(ReadPhysical)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WritePhysical)( STDMETHOD(WritePhysical)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(ReadControl)( STDMETHOD(ReadControl)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteControl)( STDMETHOD(WriteControl)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(ReadIo)( STDMETHOD(ReadIo)(
THIS_ THIS_
__in ULONG InterfaceType, _In_ ULONG InterfaceType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG AddressSpace, _In_ ULONG AddressSpace,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteIo)( STDMETHOD(WriteIo)(
THIS_ THIS_
__in ULONG InterfaceType, _In_ ULONG InterfaceType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG AddressSpace, _In_ ULONG AddressSpace,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(ReadMsr)( STDMETHOD(ReadMsr)(
THIS_ THIS_
__in ULONG Msr, _In_ ULONG Msr,
__out PULONG64 Value _Out_ PULONG64 Value
) PURE; ) PURE;
STDMETHOD(WriteMsr)( STDMETHOD(WriteMsr)(
THIS_ THIS_
__in ULONG Msr, _In_ ULONG Msr,
__in ULONG64 Value _In_ ULONG64 Value
) PURE; ) PURE;
STDMETHOD(ReadBusData)( STDMETHOD(ReadBusData)(
THIS_ THIS_
__in ULONG BusDataType, _In_ ULONG BusDataType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG SlotNumber, _In_ ULONG SlotNumber,
__in ULONG Offset, _In_ ULONG Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteBusData)( STDMETHOD(WriteBusData)(
THIS_ THIS_
__in ULONG BusDataType, _In_ ULONG BusDataType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG SlotNumber, _In_ ULONG SlotNumber,
__in ULONG Offset, _In_ ULONG Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(CheckLowMemory)( STDMETHOD(CheckLowMemory)(
THIS THIS
) PURE; ) PURE;
STDMETHOD(ReadDebuggerData)( STDMETHOD(ReadDebuggerData)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DataSize _Out_opt_ PULONG DataSize
) PURE; ) PURE;
STDMETHOD(ReadProcessorSystemData)( STDMETHOD(ReadProcessorSystemData)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__in ULONG Index, _In_ ULONG Index,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DataSize _Out_opt_ PULONG DataSize
) PURE; ) PURE;
// IDebugDataSpaces2. // IDebugDataSpaces2.
STDMETHOD(VirtualToPhysical)( STDMETHOD(VirtualToPhysical)(
THIS_ THIS_
__in ULONG64 Virtual, _In_ ULONG64 Virtual,
__out PULONG64 Physical _Out_ PULONG64 Physical
) PURE; ) PURE;
// Returns the physical addresses for the // Returns the physical addresses for the
// N levels of the systems paging structures. // N levels of the systems paging structures.
// Level zero is the starting base physical // Level zero is the starting base physical
// address for virtual translations. // address for virtual translations.
// Levels one-(N-1) will point to the appropriate // Levels one-(N-1) will point to the appropriate
// paging descriptor for the virtual address at // paging descriptor for the virtual address at
// the given level of the paging hierarchy. The // the given level of the paging hierarchy. The
// exact number of levels depends on many factors. // exact number of levels depends on many factors.
// The last level will be the fully translated // The last level will be the fully translated
// physical address, matching what VirtualToPhysical // physical address, matching what VirtualToPhysical
// returns. If the address can only be partially // returns. If the address can only be partially
// translated S_FALSE is returned. // translated S_FALSE is returned.
STDMETHOD(GetVirtualTranslationPhysicalOffsets)( STDMETHOD(GetVirtualTranslationPhysicalOffsets)(
THIS_ THIS_
__in ULONG64 Virtual, _In_ ULONG64 Virtual,
__out_ecount_opt(OffsetsSize) PULONG64 Offsets, _Out_writes_opt_(OffsetsSize) PULONG64 Offsets,
__in ULONG OffsetsSize, _In_ ULONG OffsetsSize,
__out_opt PULONG Levels _Out_opt_ PULONG Levels
) PURE; ) PURE;
// System handle data is accessible in certain // System handle data is accessible in certain
// debug sessions. The particular data available // debug sessions. The particular data available
// varies from session to session and platform // varies from session to session and platform
// to platform. // to platform.
STDMETHOD(ReadHandleData)( STDMETHOD(ReadHandleData)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in ULONG DataType, _In_ ULONG DataType,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DataSize _Out_opt_ PULONG DataSize
) PURE; ) PURE;
// Fills memory with the given pattern. // Fills memory with the given pattern.
// The fill stops at the first non-writable byte. // The fill stops at the first non-writable byte.
STDMETHOD(FillVirtual)( STDMETHOD(FillVirtual)(
THIS_ THIS_
__in ULONG64 Start, _In_ ULONG64 Start,
__in ULONG Size, _In_ ULONG Size,
__in_bcount(PatternSize) PVOID Pattern, _In_reads_bytes_(PatternSize) PVOID Pattern,
__in ULONG PatternSize, _In_ ULONG PatternSize,
__out_opt PULONG Filled _Out_opt_ PULONG Filled
) PURE; ) PURE;
STDMETHOD(FillPhysical)( STDMETHOD(FillPhysical)(
THIS_ THIS_
__in ULONG64 Start, _In_ ULONG64 Start,
__in ULONG Size, _In_ ULONG Size,
__in_bcount(PatternSize) PVOID Pattern, _In_reads_bytes_(PatternSize) PVOID Pattern,
__in ULONG PatternSize, _In_ ULONG PatternSize,
__out_opt PULONG Filled _Out_opt_ PULONG Filled
) PURE; ) PURE;
// Queries virtual memory mapping information given // Queries virtual memory mapping information given
// an address similarly to the Win32 API VirtualQuery. // an address similarly to the Win32 API VirtualQuery.
// MEMORY_BASIC_INFORMATION64 is defined in crash.h. // MEMORY_BASIC_INFORMATION64 is defined in crash.h.
// This method currently only works for user-mode sessions. // This method currently only works for user-mode sessions.
STDMETHOD(QueryVirtual)( STDMETHOD(QueryVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PMEMORY_BASIC_INFORMATION64 Info _Out_ PMEMORY_BASIC_INFORMATION64 Info
) PURE; ) PURE;
// IDebugDataSpaces3. // IDebugDataSpaces3.
// Convenience method for reading an image // Convenience method for reading an image
// header from virtual memory. Given the // header from virtual memory. Given the
// image base, this method determines where // image base, this method determines where
// the NT headers are, validates the necessary // the NT headers are, validates the necessary
// markers and converts the headers into // markers and converts the headers into
// 64-bit form for consistency. // 64-bit form for consistency.
// A caller can check whether the headers were // A caller can check whether the headers were
// originally 32-bit by checking the optional // originally 32-bit by checking the optional
// header magic value. // header magic value.
// This method will not read ROM headers. // This method will not read ROM headers.
STDMETHOD(ReadImageNtHeaders)( STDMETHOD(ReadImageNtHeaders)(
THIS_ THIS_
__in ULONG64 ImageBase, _In_ ULONG64 ImageBase,
__out PIMAGE_NT_HEADERS64 Headers _Out_ PIMAGE_NT_HEADERS64 Headers
) PURE; ) PURE;
// Some debug sessions have arbitrary additional // Some debug sessions have arbitrary additional
// data available. For example, additional dump // data available. For example, additional dump
// information files may contain extra information // information files may contain extra information
// gathered at the same time as the primary dump. // gathered at the same time as the primary dump.
// Such information is tagged with a unique identifier // Such information is tagged with a unique identifier
// and can only be retrieved via the tag. // and can only be retrieved via the tag.
// Tagged data cannot be partially available; the // Tagged data cannot be partially available; the
// tagged block is either fully present or completely // tagged block is either fully present or completely
// absent. // absent.
STDMETHOD(ReadTagged)( STDMETHOD(ReadTagged)(
THIS_ THIS_
__in LPGUID Tag, _In_ LPGUID Tag,
__in ULONG Offset, _In_ ULONG Offset,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG TotalSize _Out_opt_ PULONG TotalSize
) PURE; ) PURE;
STDMETHOD(StartEnumTagged)( STDMETHOD(StartEnumTagged)(
THIS_ THIS_
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
STDMETHOD(GetNextTagged)( STDMETHOD(GetNextTagged)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__out LPGUID Tag, _Out_ LPGUID Tag,
__out PULONG Size _Out_ PULONG Size
) PURE; ) PURE;
STDMETHOD(EndEnumTagged)( STDMETHOD(EndEnumTagged)(
THIS_ THIS_
__in ULONG64 Handle _In_ ULONG64 Handle
) PURE; ) PURE;
}; };
#define DEBUG_OFFSINFO_VIRTUAL_SOURCE 0x00000001 #define DEBUG_OFFSINFO_VIRTUAL_SOURCE 0x00000001
#define DEBUG_VSOURCE_INVALID 0x00000000 #define DEBUG_VSOURCE_INVALID 0x00000000
#define DEBUG_VSOURCE_DEBUGGEE 0x00000001 #define DEBUG_VSOURCE_DEBUGGEE 0x00000001
#define DEBUG_VSOURCE_MAPPED_IMAGE 0x00000002 #define DEBUG_VSOURCE_MAPPED_IMAGE 0x00000002
#define DEBUG_VSOURCE_DUMP_WITHOUT_MEMINFO 0x00000003 #define DEBUG_VSOURCE_DUMP_WITHOUT_MEMINFO 0x00000003
skipping to change at line 9921 skipping to change at line 16177
#define DEBUG_PHYSICAL_UNCACHED 0x00000002 #define DEBUG_PHYSICAL_UNCACHED 0x00000002
#define DEBUG_PHYSICAL_WRITE_COMBINED 0x00000003 #define DEBUG_PHYSICAL_WRITE_COMBINED 0x00000003
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugDataSpaces4 #define INTERFACE IDebugDataSpaces4
DECLARE_INTERFACE_(IDebugDataSpaces4, IUnknown) DECLARE_INTERFACE_(IDebugDataSpaces4, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugDataSpaces. // IDebugDataSpaces.
STDMETHOD(ReadVirtual)( STDMETHOD(ReadVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteVirtual)( STDMETHOD(WriteVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
// SearchVirtual searches the given virtual // SearchVirtual searches the given virtual
// address range for the given pattern. PatternSize // address range for the given pattern. PatternSize
// gives the byte length of the pattern and PatternGranularity // gives the byte length of the pattern and PatternGranularity
// controls the granularity of comparisons during // controls the granularity of comparisons during
// the search. // the search.
// For example, a DWORD-granular search would // For example, a DWORD-granular search would
// use a pattern granularity of four to search by DWORD // use a pattern granularity of four to search by DWORD
// increments. // increments.
STDMETHOD(SearchVirtual)( STDMETHOD(SearchVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Length, _In_ ULONG64 Length,
__in_bcount(PatternSize) PVOID Pattern, _In_reads_bytes_(PatternSize) PVOID Pattern,
__in ULONG PatternSize, _In_ ULONG PatternSize,
__in ULONG PatternGranularity, _In_ ULONG PatternGranularity,
__out PULONG64 MatchOffset _Out_ PULONG64 MatchOffset
) PURE; ) PURE;
// These methods are identical to Read/WriteVirtual // These methods are identical to Read/WriteVirtual
// except that they avoid the kernel virtual memory // except that they avoid the kernel virtual memory
// cache entirely and are therefore useful for reading // cache entirely and are therefore useful for reading
// virtual memory which is inherently volatile, such // virtual memory which is inherently volatile, such
// as memory-mapped device areas, without contaminating // as memory-mapped device areas, without contaminating
// or invalidating the cache. // or invalidating the cache.
// In user-mode they are the same as Read/WriteVirtual. // In user-mode they are the same as Read/WriteVirtual.
STDMETHOD(ReadVirtualUncached)( STDMETHOD(ReadVirtualUncached)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteVirtualUncached)( STDMETHOD(WriteVirtualUncached)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
// The following two methods are convenience // The following two methods are convenience
// methods for accessing pointer values. // methods for accessing pointer values.
// They automatically convert between native pointers // They automatically convert between native pointers
// and canonical 64-bit values as necessary. // and canonical 64-bit values as necessary.
// These routines stop at the first failure. // These routines stop at the first failure.
STDMETHOD(ReadPointersVirtual)( STDMETHOD(ReadPointersVirtual)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_ecount(Count) PULONG64 Ptrs _Out_writes_(Count) PULONG64 Ptrs
) PURE; ) PURE;
STDMETHOD(WritePointersVirtual)( STDMETHOD(WritePointersVirtual)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_ecount(Count) PULONG64 Ptrs _In_reads_(Count) PULONG64 Ptrs
) PURE; ) PURE;
// All non-virtual data spaces are only // All non-virtual data spaces are only
// available when kernel debugging. // available when kernel debugging.
STDMETHOD(ReadPhysical)( STDMETHOD(ReadPhysical)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WritePhysical)( STDMETHOD(WritePhysical)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(ReadControl)( STDMETHOD(ReadControl)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteControl)( STDMETHOD(WriteControl)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(ReadIo)( STDMETHOD(ReadIo)(
THIS_ THIS_
__in ULONG InterfaceType, _In_ ULONG InterfaceType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG AddressSpace, _In_ ULONG AddressSpace,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteIo)( STDMETHOD(WriteIo)(
THIS_ THIS_
__in ULONG InterfaceType, _In_ ULONG InterfaceType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG AddressSpace, _In_ ULONG AddressSpace,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(ReadMsr)( STDMETHOD(ReadMsr)(
THIS_ THIS_
__in ULONG Msr, _In_ ULONG Msr,
__out PULONG64 Value _Out_ PULONG64 Value
) PURE; ) PURE;
STDMETHOD(WriteMsr)( STDMETHOD(WriteMsr)(
THIS_ THIS_
__in ULONG Msr, _In_ ULONG Msr,
__in ULONG64 Value _In_ ULONG64 Value
) PURE; ) PURE;
STDMETHOD(ReadBusData)( STDMETHOD(ReadBusData)(
THIS_ THIS_
__in ULONG BusDataType, _In_ ULONG BusDataType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG SlotNumber, _In_ ULONG SlotNumber,
__in ULONG Offset, _In_ ULONG Offset,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteBusData)( STDMETHOD(WriteBusData)(
THIS_ THIS_
__in ULONG BusDataType, _In_ ULONG BusDataType,
__in ULONG BusNumber, _In_ ULONG BusNumber,
__in ULONG SlotNumber, _In_ ULONG SlotNumber,
__in ULONG Offset, _In_ ULONG Offset,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(CheckLowMemory)( STDMETHOD(CheckLowMemory)(
THIS THIS
) PURE; ) PURE;
STDMETHOD(ReadDebuggerData)( STDMETHOD(ReadDebuggerData)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DataSize _Out_opt_ PULONG DataSize
) PURE; ) PURE;
STDMETHOD(ReadProcessorSystemData)( STDMETHOD(ReadProcessorSystemData)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__in ULONG Index, _In_ ULONG Index,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DataSize _Out_opt_ PULONG DataSize
) PURE; ) PURE;
// IDebugDataSpaces2. // IDebugDataSpaces2.
STDMETHOD(VirtualToPhysical)( STDMETHOD(VirtualToPhysical)(
THIS_ THIS_
__in ULONG64 Virtual, _In_ ULONG64 Virtual,
__out PULONG64 Physical _Out_ PULONG64 Physical
) PURE; ) PURE;
// Returns the physical addresses for the // Returns the physical addresses for the
// N levels of the systems paging structures. // N levels of the systems paging structures.
// Level zero is the starting base physical // Level zero is the starting base physical
// address for virtual translations. // address for virtual translations.
// Levels one-(N-1) will point to the appropriate // Levels one-(N-1) will point to the appropriate
// paging descriptor for the virtual address at // paging descriptor for the virtual address at
// the given level of the paging hierarchy. The // the given level of the paging hierarchy. The
// exact number of levels depends on many factors. // exact number of levels depends on many factors.
// The last level will be the fully translated // The last level will be the fully translated
// physical address, matching what VirtualToPhysical // physical address, matching what VirtualToPhysical
// returns. If the address can only be partially // returns. If the address can only be partially
// translated S_FALSE is returned. // translated S_FALSE is returned.
STDMETHOD(GetVirtualTranslationPhysicalOffsets)( STDMETHOD(GetVirtualTranslationPhysicalOffsets)(
THIS_ THIS_
__in ULONG64 Virtual, _In_ ULONG64 Virtual,
__out_ecount_opt(OffsetsSize) PULONG64 Offsets, _Out_writes_opt_(OffsetsSize) PULONG64 Offsets,
__in ULONG OffsetsSize, _In_ ULONG OffsetsSize,
__out_opt PULONG Levels _Out_opt_ PULONG Levels
) PURE; ) PURE;
// System handle data is accessible in certain // System handle data is accessible in certain
// debug sessions. The particular data available // debug sessions. The particular data available
// varies from session to session and platform // varies from session to session and platform
// to platform. // to platform.
STDMETHOD(ReadHandleData)( STDMETHOD(ReadHandleData)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in ULONG DataType, _In_ ULONG DataType,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG DataSize _Out_opt_ PULONG DataSize
) PURE; ) PURE;
// Fills memory with the given pattern. // Fills memory with the given pattern.
// The fill stops at the first non-writable byte. // The fill stops at the first non-writable byte.
STDMETHOD(FillVirtual)( STDMETHOD(FillVirtual)(
THIS_ THIS_
__in ULONG64 Start, _In_ ULONG64 Start,
__in ULONG Size, _In_ ULONG Size,
__in_bcount(PatternSize) PVOID Pattern, _In_reads_bytes_(PatternSize) PVOID Pattern,
__in ULONG PatternSize, _In_ ULONG PatternSize,
__out_opt PULONG Filled _Out_opt_ PULONG Filled
) PURE; ) PURE;
STDMETHOD(FillPhysical)( STDMETHOD(FillPhysical)(
THIS_ THIS_
__in ULONG64 Start, _In_ ULONG64 Start,
__in ULONG Size, _In_ ULONG Size,
__in_bcount(PatternSize) PVOID Pattern, _In_reads_bytes_(PatternSize) PVOID Pattern,
__in ULONG PatternSize, _In_ ULONG PatternSize,
__out_opt PULONG Filled _Out_opt_ PULONG Filled
) PURE; ) PURE;
// Queries virtual memory mapping information given // Queries virtual memory mapping information given
// an address similarly to the Win32 API VirtualQuery. // an address similarly to the Win32 API VirtualQuery.
// MEMORY_BASIC_INFORMATION64 is defined in crash.h. // MEMORY_BASIC_INFORMATION64 is defined in crash.h.
// This method currently only works for user-mode sessions. // This method currently only works for user-mode sessions.
STDMETHOD(QueryVirtual)( STDMETHOD(QueryVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PMEMORY_BASIC_INFORMATION64 Info _Out_ PMEMORY_BASIC_INFORMATION64 Info
) PURE; ) PURE;
// IDebugDataSpaces3. // IDebugDataSpaces3.
// Convenience method for reading an image // Convenience method for reading an image
// header from virtual memory. Given the // header from virtual memory. Given the
// image base, this method determines where // image base, this method determines where
// the NT headers are, validates the necessary // the NT headers are, validates the necessary
// markers and converts the headers into // markers and converts the headers into
// 64-bit form for consistency. // 64-bit form for consistency.
// A caller can check whether the headers were // A caller can check whether the headers were
// originally 32-bit by checking the optional // originally 32-bit by checking the optional
// header magic value. // header magic value.
// This method will not read ROM headers. // This method will not read ROM headers.
STDMETHOD(ReadImageNtHeaders)( STDMETHOD(ReadImageNtHeaders)(
THIS_ THIS_
__in ULONG64 ImageBase, _In_ ULONG64 ImageBase,
__out PIMAGE_NT_HEADERS64 Headers _Out_ PIMAGE_NT_HEADERS64 Headers
) PURE; ) PURE;
// Some debug sessions have arbitrary additional // Some debug sessions have arbitrary additional
// data available. For example, additional dump // data available. For example, additional dump
// information files may contain extra information // information files may contain extra information
// gathered at the same time as the primary dump. // gathered at the same time as the primary dump.
// Such information is tagged with a unique identifier // Such information is tagged with a unique identifier
// and can only be retrieved via the tag. // and can only be retrieved via the tag.
// Tagged data cannot be partially available; the // Tagged data cannot be partially available; the
// tagged block is either fully present or completely // tagged block is either fully present or completely
// absent. // absent.
STDMETHOD(ReadTagged)( STDMETHOD(ReadTagged)(
THIS_ THIS_
__in LPGUID Tag, _In_ LPGUID Tag,
__in ULONG Offset, _In_ ULONG Offset,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG TotalSize _Out_opt_ PULONG TotalSize
) PURE; ) PURE;
STDMETHOD(StartEnumTagged)( STDMETHOD(StartEnumTagged)(
THIS_ THIS_
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
STDMETHOD(GetNextTagged)( STDMETHOD(GetNextTagged)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__out LPGUID Tag, _Out_ LPGUID Tag,
__out PULONG Size _Out_ PULONG Size
) PURE; ) PURE;
STDMETHOD(EndEnumTagged)( STDMETHOD(EndEnumTagged)(
THIS_ THIS_
__in ULONG64 Handle _In_ ULONG64 Handle
) PURE; ) PURE;
// IDebugDataSpaces4. // IDebugDataSpaces4.
// General information about an address in the given data space. // General information about an address in the given data space.
// Queries are from DEBUG_OFFSINFO_*. // Queries are from DEBUG_OFFSINFO_*.
STDMETHOD(GetOffsetInformation)( STDMETHOD(GetOffsetInformation)(
THIS_ THIS_
__in ULONG Space, _In_ ULONG Space,
__in ULONG Which, _In_ ULONG Which,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG InfoSize _Out_opt_ PULONG InfoSize
) PURE; ) PURE;
// Given a particular address, return the // Given a particular address, return the
// next address which has a different validity. // next address which has a different validity.
// For example, in debug sessions such as a live // For example, in debug sessions such as a live
// user-mode session where virtual address validity // user-mode session where virtual address validity
// changes from page to page this will return the // changes from page to page this will return the
// page after the given page. In sessions such as // page after the given page. In sessions such as
// a user-mode dump file where validity can change // a user-mode dump file where validity can change
// from byte to byte this will return the start of // from byte to byte this will return the start of
// the next region that has different validity. // the next region that has different validity.
STDMETHOD(GetNextDifferentlyValidOffsetVirtual)( STDMETHOD(GetNextDifferentlyValidOffsetVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG64 NextOffset _Out_ PULONG64 NextOffset
) PURE; ) PURE;
// Given a particular range of virtual addresses, // Given a particular range of virtual addresses,
// find the first region which is valid memory. // find the first region which is valid memory.
STDMETHOD(GetValidRegionVirtual)( STDMETHOD(GetValidRegionVirtual)(
THIS_ THIS_
__in ULONG64 Base, _In_ ULONG64 Base,
__in ULONG Size, _In_ ULONG Size,
__out PULONG64 ValidBase, _Out_ PULONG64 ValidBase,
__out PULONG ValidSize _Out_ PULONG ValidSize
) PURE; ) PURE;
STDMETHOD(SearchVirtual2)( STDMETHOD(SearchVirtual2)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Length, _In_ ULONG64 Length,
__in ULONG Flags, _In_ ULONG Flags,
__in_bcount(PatternSize) PVOID Pattern, _In_reads_bytes_(PatternSize) PVOID Pattern,
__in ULONG PatternSize, _In_ ULONG PatternSize,
__in ULONG PatternGranularity, _In_ ULONG PatternGranularity,
__out PULONG64 MatchOffset _Out_ PULONG64 MatchOffset
) PURE; ) PURE;
// Attempts to read a multi-byte string // Attempts to read a multi-byte string
// starting at the given virtual address. // starting at the given virtual address.
// The possible string length, including terminator, // The possible string length, including terminator,
// is capped at the given max size. // is capped at the given max size.
// If a return buffer is given it will always // If a return buffer is given it will always
// be terminated. // be terminated.
STDMETHOD(ReadMultiByteStringVirtual)( STDMETHOD(ReadMultiByteStringVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG MaxBytes, _In_ ULONG MaxBytes,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG StringBytes _Out_opt_ PULONG StringBytes
) PURE; ) PURE;
// Reads a multi-byte string and converts // Reads a multi-byte string and converts
// it to Unicode using the given code page. // it to Unicode using the given code page.
STDMETHOD(ReadMultiByteStringVirtualWide)( STDMETHOD(ReadMultiByteStringVirtualWide)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG MaxBytes, _In_ ULONG MaxBytes,
__in ULONG CodePage, _In_ ULONG CodePage,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG StringBytes _Out_opt_ PULONG StringBytes
) PURE; ) PURE;
STDMETHOD(ReadUnicodeStringVirtual)( STDMETHOD(ReadUnicodeStringVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG MaxBytes, _In_ ULONG MaxBytes,
__in ULONG CodePage, _In_ ULONG CodePage,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG StringBytes _Out_opt_ PULONG StringBytes
) PURE; ) PURE;
STDMETHOD(ReadUnicodeStringVirtualWide)( STDMETHOD(ReadUnicodeStringVirtualWide)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG MaxBytes, _In_ ULONG MaxBytes,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG StringBytes _Out_opt_ PULONG StringBytes
) PURE; ) PURE;
STDMETHOD(ReadPhysical2)( STDMETHOD(ReadPhysical2)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WritePhysical2)( STDMETHOD(WritePhysical2)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// IDebugEventCallbacks. // IDebugEventCallbacks.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// Interest mask bits. // Interest mask bits.
skipping to change at line 10383 skipping to change at line 16639
// Argument is zero. // Argument is zero.
#define DEBUG_CDS_ALL 0xffffffff #define DEBUG_CDS_ALL 0xffffffff
// Registers have changed. If only a single register // Registers have changed. If only a single register
// changed, argument is the index of the register. // changed, argument is the index of the register.
// Otherwise it is DEBUG_ANY_ID. // Otherwise it is DEBUG_ANY_ID.
#define DEBUG_CDS_REGISTERS 0x00000001 #define DEBUG_CDS_REGISTERS 0x00000001
// Data spaces have changed. If only a single // Data spaces have changed. If only a single
// space was affected, argument is the data // space was affected, argument is the data
// space. Otherwise it is DEBUG_ANY_ID. // space. Otherwise it is DEBUG_ANY_ID.
#define DEBUG_CDS_DATA 0x00000002 #define DEBUG_CDS_DATA 0x00000002
// Inform the GUI clients to refresh debugger windows.
#define DEBUG_CDS_REFRESH 0x00000004
// DEBUG_CDS_REFRESH IDs
#define DEBUG_CDS_REFRESH_EVALUATE 1
#define DEBUG_CDS_REFRESH_EXECUTE 2
#define DEBUG_CDS_REFRESH_EXECUTECOMMANDFILE 3
#define DEBUG_CDS_REFRESH_ADDBREAKPOINT 4
#define DEBUG_CDS_REFRESH_REMOVEBREAKPOINT 5
#define DEBUG_CDS_REFRESH_WRITEVIRTUAL 6
#define DEBUG_CDS_REFRESH_WRITEVIRTUALUNCACHED 7
#define DEBUG_CDS_REFRESH_WRITEPHYSICAL 8
#define DEBUG_CDS_REFRESH_WRITEPHYSICAL2 9
#define DEBUG_CDS_REFRESH_SETVALUE 10
#define DEBUG_CDS_REFRESH_SETVALUE2 11
#define DEBUG_CDS_REFRESH_SETSCOPE 12
#define DEBUG_CDS_REFRESH_SETSCOPEFRAMEBYINDEX 13
#define DEBUG_CDS_REFRESH_SETSCOPEFROMJITDEBUGINFO 14
#define DEBUG_CDS_REFRESH_SETSCOPEFROMSTOREDEVENT 15
#define DEBUG_CDS_REFRESH_INLINESTEP 16
#define DEBUG_CDS_REFRESH_INLINESTEP_PSEUDO 17
// ChangeEngineState flags. // ChangeEngineState flags.
// The engine state has changed generally. // The engine state has changed generally.
// Argument is zero. // Argument is zero.
#define DEBUG_CES_ALL 0xffffffff #define DEBUG_CES_ALL 0xffffffff
// Current thread changed. This may imply a change // Current thread changed. This may imply a change
// of system and process also. Argument is the ID of the new // of system and process also. Argument is the ID of the new
// current thread or DEBUG_ANY_ID if no thread is current. // current thread or DEBUG_ANY_ID if no thread is current.
#define DEBUG_CES_CURRENT_THREAD 0x00000001 #define DEBUG_CES_CURRENT_THREAD 0x00000001
// Effective processor changed. Argument is the // Effective processor changed. Argument is the
skipping to change at line 10470 skipping to change at line 16747
// options value. // options value.
#define DEBUG_CSS_TYPE_OPTIONS 0x00000020 #define DEBUG_CSS_TYPE_OPTIONS 0x00000020
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugEventCallbacks #define INTERFACE IDebugEventCallbacks
DECLARE_INTERFACE_(IDebugEventCallbacks, IUnknown) DECLARE_INTERFACE_(IDebugEventCallbacks, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugEventCallbacks. // IDebugEventCallbacks.
// The engine calls GetInterestMask once when // The engine calls GetInterestMask once when
// the event callbacks are set for a client. // the event callbacks are set for a client.
STDMETHOD(GetInterestMask)( STDMETHOD(GetInterestMask)(
THIS_ THIS_
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
// A breakpoint event is generated when // A breakpoint event is generated when
// a breakpoint exception is received and // a breakpoint exception is received and
// it can be mapped to an existing breakpoint. // it can be mapped to an existing breakpoint.
// The callback method is given a reference // The callback method is given a reference
// to the breakpoint and should release it when // to the breakpoint and should release it when
// it is done with it. // it is done with it.
STDMETHOD(Breakpoint)( STDMETHOD(Breakpoint)(
THIS_ THIS_
__in PDEBUG_BREAKPOINT Bp _In_ PDEBUG_BREAKPOINT Bp
) PURE; ) PURE;
// Exceptions include breaks which cannot // Exceptions include breaks which cannot
// be mapped to an existing breakpoint // be mapped to an existing breakpoint
// instance. // instance.
STDMETHOD(Exception)( STDMETHOD(Exception)(
THIS_ THIS_
__in PEXCEPTION_RECORD64 Exception, _In_ PEXCEPTION_RECORD64 Exception,
__in ULONG FirstChance _In_ ULONG FirstChance
) PURE; ) PURE;
// Any of these values can be zero if they // Any of these values can be zero if they
// cannot be provided by the engine. // cannot be provided by the engine.
// Currently the kernel does not return thread // Currently the kernel does not return thread
// or process change events. // or process change events.
STDMETHOD(CreateThread)( STDMETHOD(CreateThread)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in ULONG64 DataOffset, _In_ ULONG64 DataOffset,
__in ULONG64 StartOffset _In_ ULONG64 StartOffset
) PURE; ) PURE;
STDMETHOD(ExitThread)( STDMETHOD(ExitThread)(
THIS_ THIS_
__in ULONG ExitCode _In_ ULONG ExitCode
) PURE; ) PURE;
// Any of these values can be zero if they // Any of these values can be zero if they
// cannot be provided by the engine. // cannot be provided by the engine.
STDMETHOD(CreateProcess)( STDMETHOD(CreateProcess)(
THIS_ THIS_
__in ULONG64 ImageFileHandle, _In_ ULONG64 ImageFileHandle,
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in ULONG64 BaseOffset, _In_ ULONG64 BaseOffset,
__in ULONG ModuleSize, _In_ ULONG ModuleSize,
__in_opt PCSTR ModuleName, _In_opt_ PCSTR ModuleName,
__in_opt PCSTR ImageName, _In_opt_ PCSTR ImageName,
__in ULONG CheckSum, _In_ ULONG CheckSum,
__in ULONG TimeDateStamp, _In_ ULONG TimeDateStamp,
__in ULONG64 InitialThreadHandle, _In_ ULONG64 InitialThreadHandle,
__in ULONG64 ThreadDataOffset, _In_ ULONG64 ThreadDataOffset,
__in ULONG64 StartOffset _In_ ULONG64 StartOffset
) PURE; ) PURE;
_Analysis_noreturn_
STDMETHOD(ExitProcess)( STDMETHOD(ExitProcess)(
THIS_ THIS_
__in ULONG ExitCode _In_ ULONG ExitCode
) PURE; ) PURE;
// Any of these values may be zero. // Any of these values may be zero.
STDMETHOD(LoadModule)( STDMETHOD(LoadModule)(
THIS_ THIS_
__in ULONG64 ImageFileHandle, _In_ ULONG64 ImageFileHandle,
__in ULONG64 BaseOffset, _In_ ULONG64 BaseOffset,
__in ULONG ModuleSize, _In_ ULONG ModuleSize,
__in_opt PCSTR ModuleName, _In_opt_ PCSTR ModuleName,
__in_opt PCSTR ImageName, _In_opt_ PCSTR ImageName,
__in ULONG CheckSum, _In_ ULONG CheckSum,
__in ULONG TimeDateStamp _In_ ULONG TimeDateStamp
) PURE; ) PURE;
STDMETHOD(UnloadModule)( STDMETHOD(UnloadModule)(
THIS_ THIS_
__in_opt PCSTR ImageBaseName, _In_opt_ PCSTR ImageBaseName,
__in ULONG64 BaseOffset _In_ ULONG64 BaseOffset
) PURE; ) PURE;
STDMETHOD(SystemError)( STDMETHOD(SystemError)(
THIS_ THIS_
__in ULONG Error, _In_ ULONG Error,
__in ULONG Level _In_ ULONG Level
) PURE; ) PURE;
// Session status is synchronous like the other // Session status is synchronous like the other
// wait callbacks but it is called as the state // wait callbacks but it is called as the state
// of the session is changing rather than at // of the session is changing rather than at
// specific events so its return value does not // specific events so its return value does not
// influence waiting. Implementations should just // influence waiting. Implementations should just
// return DEBUG_STATUS_NO_CHANGE. // return DEBUG_STATUS_NO_CHANGE.
// Also, because some of the status // Also, because some of the status
// notifications are very early or very // notifications are very early or very
// late in the session lifetime there may not be // late in the session lifetime there may not be
// current processes or threads when the notification // current processes or threads when the notification
// is generated. // is generated.
STDMETHOD(SessionStatus)( STDMETHOD(SessionStatus)(
THIS_ THIS_
__in ULONG Status _In_ ULONG Status
) PURE; ) PURE;
// The following callbacks are informational // The following callbacks are informational
// callbacks notifying the provider about // callbacks notifying the provider about
// changes in debug state. The return value // changes in debug state. The return value
// of these callbacks is ignored. Implementations // of these callbacks is ignored. Implementations
// can not call back into the engine. // can not call back into the engine.
// Debuggee state, such as registers or data spaces, // Debuggee state, such as registers or data spaces,
// has changed. // has changed.
STDMETHOD(ChangeDebuggeeState)( STDMETHOD(ChangeDebuggeeState)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG64 Argument _In_ ULONG64 Argument
) PURE; ) PURE;
// Engine state has changed. // Engine state has changed.
STDMETHOD(ChangeEngineState)( STDMETHOD(ChangeEngineState)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG64 Argument _In_ ULONG64 Argument
) PURE; ) PURE;
// Symbol state has changed. // Symbol state has changed.
STDMETHOD(ChangeSymbolState)( STDMETHOD(ChangeSymbolState)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG64 Argument _In_ ULONG64 Argument
) PURE; ) PURE;
}; };
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugEventCallbacksWide #define INTERFACE IDebugEventCallbacksWide
DECLARE_INTERFACE_(IDebugEventCallbacksWide, IUnknown) DECLARE_INTERFACE_(IDebugEventCallbacksWide, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugEventCallbacksWide. // IDebugEventCallbacksWide.
// The engine calls GetInterestMask once when // The engine calls GetInterestMask once when
// the event callbacks are set for a client. // the event callbacks are set for a client.
STDMETHOD(GetInterestMask)( STDMETHOD(GetInterestMask)(
THIS_ THIS_
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
// A breakpoint event is generated when // A breakpoint event is generated when
// a breakpoint exception is received and // a breakpoint exception is received and
// it can be mapped to an existing breakpoint. // it can be mapped to an existing breakpoint.
// The callback method is given a reference // The callback method is given a reference
// to the breakpoint and should release it when // to the breakpoint and should release it when
// it is done with it. // it is done with it.
STDMETHOD(Breakpoint)( STDMETHOD(Breakpoint)(
THIS_ THIS_
__in PDEBUG_BREAKPOINT2 Bp _In_ PDEBUG_BREAKPOINT2 Bp
) PURE; ) PURE;
// Exceptions include breaks which cannot // Exceptions include breaks which cannot
// be mapped to an existing breakpoint // be mapped to an existing breakpoint
// instance. // instance.
STDMETHOD(Exception)( STDMETHOD(Exception)(
THIS_ THIS_
__in PEXCEPTION_RECORD64 Exception, _In_ PEXCEPTION_RECORD64 Exception,
__in ULONG FirstChance _In_ ULONG FirstChance
) PURE; ) PURE;
// Any of these values can be zero if they // Any of these values can be zero if they
// cannot be provided by the engine. // cannot be provided by the engine.
// Currently the kernel does not return thread // Currently the kernel does not return thread
// or process change events. // or process change events.
STDMETHOD(CreateThread)( STDMETHOD(CreateThread)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in ULONG64 DataOffset, _In_ ULONG64 DataOffset,
__in ULONG64 StartOffset _In_ ULONG64 StartOffset
) PURE; ) PURE;
_Analysis_noreturn_
STDMETHOD(ExitThread)( STDMETHOD(ExitThread)(
THIS_ THIS_
__in ULONG ExitCode _In_ ULONG ExitCode
) PURE; ) PURE;
// Any of these values can be zero if they // Any of these values can be zero if they
// cannot be provided by the engine. // cannot be provided by the engine.
STDMETHOD(CreateProcess)( STDMETHOD(CreateProcess)(
THIS_ THIS_
__in ULONG64 ImageFileHandle, _In_ ULONG64 ImageFileHandle,
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in ULONG64 BaseOffset, _In_ ULONG64 BaseOffset,
__in ULONG ModuleSize, _In_ ULONG ModuleSize,
__in_opt PCWSTR ModuleName, _In_opt_ PCWSTR ModuleName,
__in_opt PCWSTR ImageName, _In_opt_ PCWSTR ImageName,
__in ULONG CheckSum, _In_ ULONG CheckSum,
__in ULONG TimeDateStamp, _In_ ULONG TimeDateStamp,
__in ULONG64 InitialThreadHandle, _In_ ULONG64 InitialThreadHandle,
__in ULONG64 ThreadDataOffset, _In_ ULONG64 ThreadDataOffset,
__in ULONG64 StartOffset _In_ ULONG64 StartOffset
) PURE; ) PURE;
STDMETHOD(ExitProcess)( STDMETHOD(ExitProcess)(
THIS_ THIS_
__in ULONG ExitCode _In_ ULONG ExitCode
) PURE; ) PURE;
// Any of these values may be zero. // Any of these values may be zero.
STDMETHOD(LoadModule)( STDMETHOD(LoadModule)(
THIS_ THIS_
__in ULONG64 ImageFileHandle, _In_ ULONG64 ImageFileHandle,
__in ULONG64 BaseOffset, _In_ ULONG64 BaseOffset,
__in ULONG ModuleSize, _In_ ULONG ModuleSize,
__in_opt PCWSTR ModuleName, _In_opt_ PCWSTR ModuleName,
__in_opt PCWSTR ImageName, _In_opt_ PCWSTR ImageName,
__in ULONG CheckSum, _In_ ULONG CheckSum,
__in ULONG TimeDateStamp _In_ ULONG TimeDateStamp
) PURE; ) PURE;
STDMETHOD(UnloadModule)( STDMETHOD(UnloadModule)(
THIS_ THIS_
__in_opt PCWSTR ImageBaseName, _In_opt_ PCWSTR ImageBaseName,
__in ULONG64 BaseOffset _In_ ULONG64 BaseOffset
) PURE; ) PURE;
STDMETHOD(SystemError)( STDMETHOD(SystemError)(
THIS_ THIS_
__in ULONG Error, _In_ ULONG Error,
__in ULONG Level _In_ ULONG Level
) PURE; ) PURE;
// Session status is synchronous like the other // Session status is synchronous like the other
// wait callbacks but it is called as the state // wait callbacks but it is called as the state
// of the session is changing rather than at // of the session is changing rather than at
// specific events so its return value does not // specific events so its return value does not
// influence waiting. Implementations should just // influence waiting. Implementations should just
// return DEBUG_STATUS_NO_CHANGE. // return DEBUG_STATUS_NO_CHANGE.
// Also, because some of the status // Also, because some of the status
// notifications are very early or very // notifications are very early or very
// late in the session lifetime there may not be // late in the session lifetime there may not be
// current processes or threads when the notification // current processes or threads when the notification
// is generated. // is generated.
STDMETHOD(SessionStatus)( STDMETHOD(SessionStatus)(
THIS_ THIS_
__in ULONG Status _In_ ULONG Status
) PURE; ) PURE;
// The following callbacks are informational // The following callbacks are informational
// callbacks notifying the provider about // callbacks notifying the provider about
// changes in debug state. The return value // changes in debug state. The return value
// of these callbacks is ignored. Implementations // of these callbacks is ignored. Implementations
// can not call back into the engine. // can not call back into the engine.
// Debuggee state, such as registers or data spaces, // Debuggee state, such as registers or data spaces,
// has changed. // has changed.
STDMETHOD(ChangeDebuggeeState)( STDMETHOD(ChangeDebuggeeState)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG64 Argument _In_ ULONG64 Argument
) PURE; ) PURE;
// Engine state has changed. // Engine state has changed.
STDMETHOD(ChangeEngineState)( STDMETHOD(ChangeEngineState)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG64 Argument _In_ ULONG64 Argument
) PURE; ) PURE;
// Symbol state has changed. // Symbol state has changed.
STDMETHOD(ChangeSymbolState)( STDMETHOD(ChangeSymbolState)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG64 Argument _In_ ULONG64 Argument
) PURE;
};
typedef struct _DEBUG_EVENT_CONTEXT
{
ULONG Size;
ULONG ProcessEngineId;
ULONG ThreadEngineId;
ULONG FrameEngineId;
} DEBUG_EVENT_CONTEXT, *PDEBUG_EVENT_CONTEXT;
#undef INTERFACE
#define INTERFACE IDebugEventContextCallbacks
DECLARE_INTERFACE_(IDebugEventContextCallbacks, IUnknown)
{
// IUnknown.
STDMETHOD(QueryInterface)(
THIS_
_In_ REFIID InterfaceId,
_Out_ PVOID* Interface
) PURE;
STDMETHOD_(ULONG, AddRef)(
THIS
) PURE;
STDMETHOD_(ULONG, Release)(
THIS
) PURE;
// IDebugEventContextCallbacks.
// The engine calls GetInterestMask once when
// the event callbacks are set for a client.
STDMETHOD(GetInterestMask)(
THIS_
_Out_ PULONG Mask
) PURE;
// A breakpoint event is generated when
// a breakpoint exception is received and
// it can be mapped to an existing breakpoint.
// The callback method is given a reference
// to the breakpoint and should release it when
// it is done with it.
STDMETHOD(Breakpoint)(
THIS_
_In_ PDEBUG_BREAKPOINT2 Bp,
_In_reads_bytes_(ContextSize) PVOID Context,
_In_ ULONG ContextSize
) PURE;
// Exceptions include breaks which cannot
// be mapped to an existing breakpoint
// instance.
STDMETHOD(Exception)(
THIS_
_In_ PEXCEPTION_RECORD64 Exception,
_In_ ULONG FirstChance,
_In_reads_bytes_(ContextSize) PVOID Context,
_In_ ULONG ContextSize
) PURE;
// Any of these values can be zero if they
// cannot be provided by the engine.
// Currently the kernel does not return thread
// or process change events.
STDMETHOD(CreateThread)(
THIS_
_In_ ULONG64 Handle,
_In_ ULONG64 DataOffset,
_In_ ULONG64 StartOffset,
_In_reads_bytes_(ContextSize) PVOID Context,
_In_ ULONG ContextSize
) PURE;
STDMETHOD(ExitThread)(
THIS_
_In_ ULONG ExitCode,
_In_reads_bytes_(ContextSize) PVOID Context,
_In_ ULONG ContextSize
) PURE;
// Any of these values can be zero if they
// cannot be provided by the engine.
STDMETHOD(CreateProcess)(
THIS_
_In_ ULONG64 ImageFileHandle,
_In_ ULONG64 Handle,
_In_ ULONG64 BaseOffset,
_In_ ULONG ModuleSize,
_In_opt_ PCWSTR ModuleName,
_In_opt_ PCWSTR ImageName,
_In_ ULONG CheckSum,
_In_ ULONG TimeDateStamp,
_In_ ULONG64 InitialThreadHandle,
_In_ ULONG64 ThreadDataOffset,
_In_ ULONG64 StartOffset,
_In_reads_bytes_(ContextSize) PVOID Context,
_In_ ULONG ContextSize
) PURE;
STDMETHOD(ExitProcess)(
THIS_
_In_ ULONG ExitCode,
_In_reads_bytes_(ContextSize) PVOID Context,
_In_ ULONG ContextSize
) PURE;
// Any of these values may be zero.
STDMETHOD(LoadModule)(
THIS_
_In_ ULONG64 ImageFileHandle,
_In_ ULONG64 BaseOffset,
_In_ ULONG ModuleSize,
_In_opt_ PCWSTR ModuleName,
_In_opt_ PCWSTR ImageName,
_In_ ULONG CheckSum,
_In_ ULONG TimeDateStamp,
_In_reads_bytes_(ContextSize) PVOID Context,
_In_ ULONG ContextSize
) PURE;
STDMETHOD(UnloadModule)(
THIS_
_In_opt_ PCWSTR ImageBaseName,
_In_ ULONG64 BaseOffset,
_In_reads_bytes_(ContextSize) PVOID Context,
_In_ ULONG ContextSize
) PURE;
STDMETHOD(SystemError)(
THIS_
_In_ ULONG Error,
_In_ ULONG Level,
_In_reads_bytes_(ContextSize) PVOID Context,
_In_ ULONG ContextSize
) PURE;
// Session status is synchronous like the other
// wait callbacks but it is called as the state
// of the session is changing rather than at
// specific events so its return value does not
// influence waiting. Implementations should just
// return DEBUG_STATUS_NO_CHANGE.
// Also, because some of the status
// notifications are very early or very
// late in the session lifetime there may not be
// current processes or threads when the notification
// is generated.
STDMETHOD(SessionStatus)(
THIS_
_In_ ULONG Status
) PURE;
// The following callbacks are informational
// callbacks notifying the provider about
// changes in debug state. The return value
// of these callbacks is ignored. Implementations
// can not call back into the engine.
// Debuggee state, such as registers or data spaces,
// has changed.
STDMETHOD(ChangeDebuggeeState)(
THIS_
_In_ ULONG Flags,
_In_ ULONG64 Argument,
_In_reads_bytes_(ContextSize) PVOID Context,
_In_ ULONG ContextSize
) PURE;
// Engine state has changed.
STDMETHOD(ChangeEngineState)(
THIS_
_In_ ULONG Flags,
_In_ ULONG64 Argument,
_In_reads_bytes_(ContextSize) PVOID Context,
_In_ ULONG ContextSize
) PURE;
// Symbol state has changed.
STDMETHOD(ChangeSymbolState)(
THIS_
_In_ ULONG Flags,
_In_ ULONG64 Argument
) PURE; ) PURE;
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// IDebugInputCallbacks. // IDebugInputCallbacks.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugInputCallbacks #define INTERFACE IDebugInputCallbacks
DECLARE_INTERFACE_(IDebugInputCallbacks, IUnknown) DECLARE_INTERFACE_(IDebugInputCallbacks, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugInputCallbacks. // IDebugInputCallbacks.
// A call to the StartInput method is a request for // A call to the StartInput method is a request for
// a line of input from any client. The returned input // a line of input from any client. The returned input
// should always be zero-terminated. The buffer size // should always be zero-terminated. The buffer size
// provided is only a guideline. A client can return // provided is only a guideline. A client can return
// more if necessary and the engine will truncate it // more if necessary and the engine will truncate it
// before returning from IDebugControl::Input. // before returning from IDebugControl::Input.
// The return value is ignored. // The return value is ignored.
STDMETHOD(StartInput)( STDMETHOD(StartInput)(
THIS_ THIS_
__in ULONG BufferSize _In_ ULONG BufferSize
) PURE; ) PURE;
// The return value is ignored. // The return value is ignored.
STDMETHOD(EndInput)( STDMETHOD(EndInput)(
THIS THIS
) PURE; ) PURE;
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// IDebugOutputCallbacks. // IDebugOutputCallbacks.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugOutputCallbacks #define INTERFACE IDebugOutputCallbacks
DECLARE_INTERFACE_(IDebugOutputCallbacks, IUnknown) DECLARE_INTERFACE_(IDebugOutputCallbacks, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugOutputCallbacks. // IDebugOutputCallbacks.
// This method is only called if the supplied mask // This method is only called if the supplied mask
// is allowed by the clients output control. // is allowed by the clients output control.
// The return value is ignored. // The return value is ignored.
STDMETHOD(Output)( STDMETHOD(Output)(
THIS_ THIS_
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Text _In_ PCSTR Text
) PURE; ) PURE;
}; };
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugOutputCallbacksWide #define INTERFACE IDebugOutputCallbacksWide
DECLARE_INTERFACE_(IDebugOutputCallbacksWide, IUnknown) DECLARE_INTERFACE_(IDebugOutputCallbacksWide, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugOutputCallbacksWide. // IDebugOutputCallbacksWide.
// This method is only called if the supplied mask // This method is only called if the supplied mask
// is allowed by the clients output control. // is allowed by the clients output control.
// The return value is ignored. // The return value is ignored.
STDMETHOD(Output)( STDMETHOD(Output)(
THIS_ THIS_
__in ULONG Mask, _In_ ULONG Mask,
__in PCWSTR Text _In_ PCWSTR Text
) PURE; ) PURE;
}; };
// //
// IDebugOutputCallbacks2 interest mask flags. // IDebugOutputCallbacks2 interest mask flags.
// //
// Indicates that the callback wants notifications // Indicates that the callback wants notifications
// of all explicit flushes. // of all explicit flushes.
#define DEBUG_OUTCBI_EXPLICIT_FLUSH 0x00000001 #define DEBUG_OUTCBI_EXPLICIT_FLUSH 0x00000001
skipping to change at line 10916 skipping to change at line 17373
// The markup content has encoded special characters like ", &, < and >. // The markup content has encoded special characters like ", &, < and >.
#define DEBUG_OUTCBF_DML_HAS_SPECIAL_CHARACTERS 0x00000004 #define DEBUG_OUTCBF_DML_HAS_SPECIAL_CHARACTERS 0x00000004
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugOutputCallbacks2 #define INTERFACE IDebugOutputCallbacks2
DECLARE_INTERFACE_(IDebugOutputCallbacks2, IUnknown) DECLARE_INTERFACE_(IDebugOutputCallbacks2, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugOutputCallbacks. // IDebugOutputCallbacks.
// This method is not used. // This method is not used.
STDMETHOD(Output)( STDMETHOD(Output)(
THIS_ THIS_
__in ULONG Mask, _In_ ULONG Mask,
__in PCSTR Text _In_ PCSTR Text
) PURE; ) PURE;
// IDebugOutputCallbacks2. // IDebugOutputCallbacks2.
// The engine calls GetInterestMask once when // The engine calls GetInterestMask once when
// the callbacks are set for a client. // the callbacks are set for a client.
STDMETHOD(GetInterestMask)( STDMETHOD(GetInterestMask)(
THIS_ THIS_
__out PULONG Mask _Out_ PULONG Mask
) PURE; ) PURE;
STDMETHOD(Output2)( STDMETHOD(Output2)(
THIS_ THIS_
__in ULONG Which, _In_ ULONG Which,
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG64 Arg, _In_ ULONG64 Arg,
__in_opt PCWSTR Text _In_opt_ PCWSTR Text
) PURE; ) PURE;
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// IDebugRegisters. // IDebugRegisters.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#define DEBUG_REGISTERS_DEFAULT 0x00000000 #define DEBUG_REGISTERS_DEFAULT 0x00000000
skipping to change at line 10993 skipping to change at line 17450
ULONG Reserved0; ULONG Reserved0;
} DEBUG_REGISTER_DESCRIPTION, *PDEBUG_REGISTER_DESCRIPTION; } DEBUG_REGISTER_DESCRIPTION, *PDEBUG_REGISTER_DESCRIPTION;
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugRegisters #define INTERFACE IDebugRegisters
DECLARE_INTERFACE_(IDebugRegisters, IUnknown) DECLARE_INTERFACE_(IDebugRegisters, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugRegisters. // IDebugRegisters.
STDMETHOD(GetNumberRegisters)( STDMETHOD(GetNumberRegisters)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetDescription)( STDMETHOD(GetDescription)(
THIS_ THIS_
__in ULONG Register, _In_ ULONG Register,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PDEBUG_REGISTER_DESCRIPTION Desc _Out_opt_ PDEBUG_REGISTER_DESCRIPTION Desc
) PURE; ) PURE;
STDMETHOD(GetIndexByName)( STDMETHOD(GetIndexByName)(
THIS_ THIS_
__in PCSTR Name, _In_ PCSTR Name,
__out PULONG Index _Out_ PULONG Index
) PURE; ) PURE;
STDMETHOD(GetValue)( STDMETHOD(GetValue)(
THIS_ THIS_
__in ULONG Register, _In_ ULONG Register,
__out PDEBUG_VALUE Value _Out_ PDEBUG_VALUE Value
) PURE; ) PURE;
// SetValue makes a best effort at coercing // SetValue makes a best effort at coercing
// the given value into the given registers // the given value into the given registers
// value type. If the given value is larger // value type. If the given value is larger
// than the register can hold the least // than the register can hold the least
// significant bits will be dropped. Float // significant bits will be dropped. Float
// to int and int to float will be done // to int and int to float will be done
// if necessary. Subregister bits will be // if necessary. Subregister bits will be
// inserted into the master register. // inserted into the master register.
STDMETHOD(SetValue)( STDMETHOD(SetValue)(
THIS_ THIS_
__in ULONG Register, _In_ ULONG Register,
__in PDEBUG_VALUE Value _In_ PDEBUG_VALUE Value
) PURE; ) PURE;
// Gets Count register values. If Indices is // Gets Count register values. If Indices is
// non-NULL it must contain Count register // non-NULL it must contain Count register
// indices which control the registers affected. // indices which control the registers affected.
// If Indices is NULL the registers from Start // If Indices is NULL the registers from Start
// to Start + Count 1 are retrieved. // to Start + Count 1 are retrieved.
STDMETHOD(GetValues)( STDMETHOD(GetValues)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Indices, _In_reads_opt_(Count) PULONG Indices,
__in ULONG Start, _In_ ULONG Start,
__out_ecount(Count) PDEBUG_VALUE Values _Out_writes_(Count) PDEBUG_VALUE Values
) PURE; ) PURE;
STDMETHOD(SetValues)( STDMETHOD(SetValues)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Indices, _In_reads_opt_(Count) PULONG Indices,
__in ULONG Start, _In_ ULONG Start,
__in_ecount(Count) PDEBUG_VALUE Values _In_reads_(Count) PDEBUG_VALUE Values
) PURE; ) PURE;
// Outputs a group of registers in a well-formatted // Outputs a group of registers in a well-formatted
// way thats specific to the platforms register set. // way thats specific to the platforms register set.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputRegisters)( STDMETHOD(OutputRegisters)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Abstracted pieces of processor information. // Abstracted pieces of processor information.
// The mapping of these values to architectural // The mapping of these values to architectural
// registers is architecture-specific and their // registers is architecture-specific and their
// interpretation and existence may vary. They // interpretation and existence may vary. They
// are intended to be directly compatible with // are intended to be directly compatible with
// calls which take this information, such as // calls which take this information, such as
// stack walking. // stack walking.
STDMETHOD(GetInstructionOffset)( STDMETHOD(GetInstructionOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(GetStackOffset)( STDMETHOD(GetStackOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(GetFrameOffset)( STDMETHOD(GetFrameOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
}; };
// //
// The engine maintains several separate // The engine maintains several separate
// pieces of context information. There is // pieces of context information. There is
// the current debuggee context, a possible // the current debuggee context, a possible
// override context, such as from .cxr, // override context, such as from .cxr,
// a context for the current scope frame and so on. // a context for the current scope frame and so on.
// //
skipping to change at line 11118 skipping to change at line 17575
// in all cases. // in all cases.
#define DEBUG_REGSRC_FRAME 0x00000002 #define DEBUG_REGSRC_FRAME 0x00000002
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugRegisters2 #define INTERFACE IDebugRegisters2
DECLARE_INTERFACE_(IDebugRegisters2, IUnknown) DECLARE_INTERFACE_(IDebugRegisters2, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugRegisters. // IDebugRegisters.
STDMETHOD(GetNumberRegisters)( STDMETHOD(GetNumberRegisters)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetDescription)( STDMETHOD(GetDescription)(
THIS_ THIS_
__in ULONG Register, _In_ ULONG Register,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PDEBUG_REGISTER_DESCRIPTION Desc _Out_opt_ PDEBUG_REGISTER_DESCRIPTION Desc
) PURE; ) PURE;
STDMETHOD(GetIndexByName)( STDMETHOD(GetIndexByName)(
THIS_ THIS_
__in PCSTR Name, _In_ PCSTR Name,
__out PULONG Index _Out_ PULONG Index
) PURE; ) PURE;
STDMETHOD(GetValue)( STDMETHOD(GetValue)(
THIS_ THIS_
__in ULONG Register, _In_ ULONG Register,
__out PDEBUG_VALUE Value _Out_ PDEBUG_VALUE Value
) PURE; ) PURE;
// SetValue makes a best effort at coercing // SetValue makes a best effort at coercing
// the given value into the given registers // the given value into the given registers
// value type. If the given value is larger // value type. If the given value is larger
// than the register can hold the least // than the register can hold the least
// significant bits will be dropped. Float // significant bits will be dropped. Float
// to int and int to float will be done // to int and int to float will be done
// if necessary. Subregister bits will be // if necessary. Subregister bits will be
// inserted into the master register. // inserted into the master register.
STDMETHOD(SetValue)( STDMETHOD(SetValue)(
THIS_ THIS_
__in ULONG Register, _In_ ULONG Register,
__in PDEBUG_VALUE Value _In_ PDEBUG_VALUE Value
) PURE; ) PURE;
// Gets Count register values. If Indices is // Gets Count register values. If Indices is
// non-NULL it must contain Count register // non-NULL it must contain Count register
// indices which control the registers affected. // indices which control the registers affected.
// If Indices is NULL the registers from Start // If Indices is NULL the registers from Start
// to Start + Count 1 are retrieved. // to Start + Count 1 are retrieved.
STDMETHOD(GetValues)( STDMETHOD(GetValues)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Indices, _In_reads_opt_(Count) PULONG Indices,
__in ULONG Start, _In_ ULONG Start,
__out_ecount(Count) PDEBUG_VALUE Values _Out_writes_(Count) PDEBUG_VALUE Values
) PURE; ) PURE;
STDMETHOD(SetValues)( STDMETHOD(SetValues)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Indices, _In_reads_opt_(Count) PULONG Indices,
__in ULONG Start, _In_ ULONG Start,
__in_ecount(Count) PDEBUG_VALUE Values _In_reads_(Count) PDEBUG_VALUE Values
) PURE; ) PURE;
// Outputs a group of registers in a well-formatted // Outputs a group of registers in a well-formatted
// way thats specific to the platforms register set. // way thats specific to the platforms register set.
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputRegisters)( STDMETHOD(OutputRegisters)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Abstracted pieces of processor information. // Abstracted pieces of processor information.
// The mapping of these values to architectural // The mapping of these values to architectural
// registers is architecture-specific and their // registers is architecture-specific and their
// interpretation and existence may vary. They // interpretation and existence may vary. They
// are intended to be directly compatible with // are intended to be directly compatible with
// calls which take this information, such as // calls which take this information, such as
// stack walking. // stack walking.
STDMETHOD(GetInstructionOffset)( STDMETHOD(GetInstructionOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(GetStackOffset)( STDMETHOD(GetStackOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(GetFrameOffset)( STDMETHOD(GetFrameOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// IDebugRegisters2. // IDebugRegisters2.
STDMETHOD(GetDescriptionWide)( STDMETHOD(GetDescriptionWide)(
THIS_ THIS_
__in ULONG Register, _In_ ULONG Register,
__out_ecount_opt(NameBufferSize) PWSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PDEBUG_REGISTER_DESCRIPTION Desc _Out_opt_ PDEBUG_REGISTER_DESCRIPTION Desc
) PURE; ) PURE;
STDMETHOD(GetIndexByNameWide)( STDMETHOD(GetIndexByNameWide)(
THIS_ THIS_
__in PCWSTR Name, _In_ PCWSTR Name,
__out PULONG Index _Out_ PULONG Index
) PURE; ) PURE;
// Pseudo-registers are synthetic values derived // Pseudo-registers are synthetic values derived
// by the engine that are presented in a manner // by the engine that are presented in a manner
// similar to regular registers. They are simple // similar to regular registers. They are simple
// value holders, similar to actual registers. // value holders, similar to actual registers.
// Pseudo-registers are defined for concepts, // Pseudo-registers are defined for concepts,
// such as current-instruction-pointer or // such as current-instruction-pointer or
// current-thread-data. As such they have // current-thread-data. As such they have
// types appropriate for their data. // types appropriate for their data.
STDMETHOD(GetNumberPseudoRegisters)( STDMETHOD(GetNumberPseudoRegisters)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetPseudoDescription)( STDMETHOD(GetPseudoDescription)(
THIS_ THIS_
__in ULONG Register, _In_ ULONG Register,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PULONG64 TypeModule, _Out_opt_ PULONG64 TypeModule,
__out_opt PULONG TypeId _Out_opt_ PULONG TypeId
) PURE; ) PURE;
STDMETHOD(GetPseudoDescriptionWide)( STDMETHOD(GetPseudoDescriptionWide)(
THIS_ THIS_
__in ULONG Register, _In_ ULONG Register,
__out_ecount_opt(NameBufferSize) PWSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PULONG64 TypeModule, _Out_opt_ PULONG64 TypeModule,
__out_opt PULONG TypeId _Out_opt_ PULONG TypeId
) PURE; ) PURE;
STDMETHOD(GetPseudoIndexByName)( STDMETHOD(GetPseudoIndexByName)(
THIS_ THIS_
__in PCSTR Name, _In_ PCSTR Name,
__out PULONG Index _Out_ PULONG Index
) PURE; ) PURE;
STDMETHOD(GetPseudoIndexByNameWide)( STDMETHOD(GetPseudoIndexByNameWide)(
THIS_ THIS_
__in PCWSTR Name, _In_ PCWSTR Name,
__out PULONG Index _Out_ PULONG Index
) PURE; ) PURE;
// Some pseudo-register values are affected // Some pseudo-register values are affected
// by the register source, others are not. // by the register source, others are not.
STDMETHOD(GetPseudoValues)( STDMETHOD(GetPseudoValues)(
THIS_ THIS_
__in ULONG Source, _In_ ULONG Source,
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Indices, _In_reads_opt_(Count) PULONG Indices,
__in ULONG Start, _In_ ULONG Start,
__out_ecount(Count) PDEBUG_VALUE Values _Out_writes_(Count) PDEBUG_VALUE Values
) PURE; ) PURE;
// Many pseudo-registers are read-only and cannot be set. // Many pseudo-registers are read-only and cannot be set.
STDMETHOD(SetPseudoValues)( STDMETHOD(SetPseudoValues)(
THIS_ THIS_
__in ULONG Source, _In_ ULONG Source,
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Indices, _In_reads_opt_(Count) PULONG Indices,
__in ULONG Start, _In_ ULONG Start,
__in_ecount(Count) PDEBUG_VALUE Values _In_reads_(Count) PDEBUG_VALUE Values
) PURE; ) PURE;
// These expanded methods allow selection // These expanded methods allow selection
// of the source of register information. // of the source of register information.
STDMETHOD(GetValues2)( STDMETHOD(GetValues2)(
THIS_ THIS_
__in ULONG Source, _In_ ULONG Source,
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Indices, _In_reads_opt_(Count) PULONG Indices,
__in ULONG Start, _In_ ULONG Start,
__out_ecount(Count) PDEBUG_VALUE Values _Out_writes_(Count) PDEBUG_VALUE Values
) PURE; ) PURE;
STDMETHOD(SetValues2)( STDMETHOD(SetValues2)(
THIS_ THIS_
__in ULONG Source, _In_ ULONG Source,
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG Indices, _In_reads_opt_(Count) PULONG Indices,
__in ULONG Start, _In_ ULONG Start,
__in_ecount(Count) PDEBUG_VALUE Values _In_reads_(Count) PDEBUG_VALUE Values
) PURE; ) PURE;
STDMETHOD(OutputRegisters2)( STDMETHOD(OutputRegisters2)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Source, _In_ ULONG Source,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
STDMETHOD(GetInstructionOffset2)( STDMETHOD(GetInstructionOffset2)(
THIS_ THIS_
__in ULONG Source, _In_ ULONG Source,
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(GetStackOffset2)( STDMETHOD(GetStackOffset2)(
THIS_ THIS_
__in ULONG Source, _In_ ULONG Source,
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(GetFrameOffset2)( STDMETHOD(GetFrameOffset2)(
THIS_ THIS_
__in ULONG Source, _In_ ULONG Source,
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// IDebugSymbolGroup // IDebugSymbolGroup
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// OutputSymbols flags. // OutputSymbols flags.
skipping to change at line 11407 skipping to change at line 17864
ULONG64 Reserved; ULONG64 Reserved;
} DEBUG_SYMBOL_PARAMETERS, *PDEBUG_SYMBOL_PARAMETERS; } DEBUG_SYMBOL_PARAMETERS, *PDEBUG_SYMBOL_PARAMETERS;
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugSymbolGroup #define INTERFACE IDebugSymbolGroup
DECLARE_INTERFACE_(IDebugSymbolGroup, IUnknown) DECLARE_INTERFACE_(IDebugSymbolGroup, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugSymbolGroup. // IDebugSymbolGroup.
STDMETHOD(GetNumberSymbols)( STDMETHOD(GetNumberSymbols)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
// On input Index indicates the desired insertion // On input Index indicates the desired insertion
// index. On output Index contains the actual index. // index. On output Index contains the actual index.
// Use DEBUG_ANY_ID to append a symbol to the end. // Use DEBUG_ANY_ID to append a symbol to the end.
STDMETHOD(AddSymbol)( STDMETHOD(AddSymbol)(
THIS_ THIS_
__in PCSTR Name, _In_ PCSTR Name,
__inout PULONG Index _Inout_ PULONG Index
) PURE; ) PURE;
STDMETHOD(RemoveSymbolByName)( STDMETHOD(RemoveSymbolByName)(
THIS_ THIS_
__in PCSTR Name _In_ PCSTR Name
) PURE; ) PURE;
STDMETHOD(RemoveSymbolByIndex)( STDMETHOD(RemoveSymbolByIndex)(
THIS_ THIS_
__in ULONG Index _In_ ULONG Index
) PURE; ) PURE;
STDMETHOD(GetSymbolName)( STDMETHOD(GetSymbolName)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
STDMETHOD(GetSymbolParameters)( STDMETHOD(GetSymbolParameters)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PDEBUG_SYMBOL_PARAMETERS Params _Out_writes_(Count) PDEBUG_SYMBOL_PARAMETERS Params
) PURE; ) PURE;
STDMETHOD(ExpandSymbol)( STDMETHOD(ExpandSymbol)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in BOOL Expand _In_ BOOL Expand
) PURE; ) PURE;
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputSymbols)( STDMETHOD(OutputSymbols)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count _In_ ULONG Count
) PURE; ) PURE;
STDMETHOD(WriteSymbol)( STDMETHOD(WriteSymbol)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Value _In_ PCSTR Value
) PURE; ) PURE;
STDMETHOD(OutputAsType)( STDMETHOD(OutputAsType)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Type _In_ PCSTR Type
) PURE; ) PURE;
}; };
#define DEBUG_SYMENT_IS_CODE 0x00000001 #define DEBUG_SYMENT_IS_CODE 0x00000001
#define DEBUG_SYMENT_IS_DATA 0x00000002 #define DEBUG_SYMENT_IS_DATA 0x00000002
#define DEBUG_SYMENT_IS_PARAMETER 0x00000004 #define DEBUG_SYMENT_IS_PARAMETER 0x00000004
#define DEBUG_SYMENT_IS_LOCAL 0x00000008 #define DEBUG_SYMENT_IS_LOCAL 0x00000008
#define DEBUG_SYMENT_IS_MANAGED 0x00000010 #define DEBUG_SYMENT_IS_MANAGED 0x00000010
#define DEBUG_SYMENT_IS_SYNTHETIC 0x00000020 #define DEBUG_SYMENT_IS_SYNTHETIC 0x00000020
skipping to change at line 11506 skipping to change at line 17963
ULONG Reserved; ULONG Reserved;
} DEBUG_SYMBOL_ENTRY, *PDEBUG_SYMBOL_ENTRY; } DEBUG_SYMBOL_ENTRY, *PDEBUG_SYMBOL_ENTRY;
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugSymbolGroup2 #define INTERFACE IDebugSymbolGroup2
DECLARE_INTERFACE_(IDebugSymbolGroup2, IUnknown) DECLARE_INTERFACE_(IDebugSymbolGroup2, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugSymbolGroup. // IDebugSymbolGroup.
STDMETHOD(GetNumberSymbols)( STDMETHOD(GetNumberSymbols)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
// On input Index indicates the desired insertion // On input Index indicates the desired insertion
// index. On output Index contains the actual index. // index. On output Index contains the actual index.
// Use DEBUG_ANY_ID to append a symbol to the end. // Use DEBUG_ANY_ID to append a symbol to the end.
STDMETHOD(AddSymbol)( STDMETHOD(AddSymbol)(
THIS_ THIS_
__in PCSTR Name, _In_ PCSTR Name,
__inout PULONG Index _Inout_ PULONG Index
) PURE; ) PURE;
STDMETHOD(RemoveSymbolByName)( STDMETHOD(RemoveSymbolByName)(
THIS_ THIS_
__in PCSTR Name _In_ PCSTR Name
) PURE; ) PURE;
STDMETHOD(RemoveSymbolByIndex)( STDMETHOD(RemoveSymbolByIndex)(
THIS_ THIS_
__in ULONG Index _In_ ULONG Index
) PURE; ) PURE;
STDMETHOD(GetSymbolName)( STDMETHOD(GetSymbolName)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
STDMETHOD(GetSymbolParameters)( STDMETHOD(GetSymbolParameters)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PDEBUG_SYMBOL_PARAMETERS Params _Out_writes_(Count) PDEBUG_SYMBOL_PARAMETERS Params
) PURE; ) PURE;
STDMETHOD(ExpandSymbol)( STDMETHOD(ExpandSymbol)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in BOOL Expand _In_ BOOL Expand
) PURE; ) PURE;
// Uses the line prefix. // Uses the line prefix.
STDMETHOD(OutputSymbols)( STDMETHOD(OutputSymbols)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count _In_ ULONG Count
) PURE; ) PURE;
STDMETHOD(WriteSymbol)( STDMETHOD(WriteSymbol)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Value _In_ PCSTR Value
) PURE; ) PURE;
STDMETHOD(OutputAsType)( STDMETHOD(OutputAsType)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCSTR Type _In_ PCSTR Type
) PURE; ) PURE;
// IDebugSymbolGroup2. // IDebugSymbolGroup2.
STDMETHOD(AddSymbolWide)( STDMETHOD(AddSymbolWide)(
THIS_ THIS_
__in PCWSTR Name, _In_ PCWSTR Name,
__inout PULONG Index _Inout_ PULONG Index
) PURE; ) PURE;
STDMETHOD(RemoveSymbolByNameWide)( STDMETHOD(RemoveSymbolByNameWide)(
THIS_ THIS_
__in PCWSTR Name _In_ PCWSTR Name
) PURE; ) PURE;
STDMETHOD(GetSymbolNameWide)( STDMETHOD(GetSymbolNameWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
STDMETHOD(WriteSymbolWide)( STDMETHOD(WriteSymbolWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCWSTR Value _In_ PCWSTR Value
) PURE; ) PURE;
STDMETHOD(OutputAsTypeWide)( STDMETHOD(OutputAsTypeWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in PCWSTR Type _In_ PCWSTR Type
) PURE; ) PURE;
STDMETHOD(GetSymbolTypeName)( STDMETHOD(GetSymbolTypeName)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
STDMETHOD(GetSymbolTypeNameWide)( STDMETHOD(GetSymbolTypeNameWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
STDMETHOD(GetSymbolSize)( STDMETHOD(GetSymbolSize)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out PULONG Size _Out_ PULONG Size
) PURE; ) PURE;
// If the symbol has an absolute address // If the symbol has an absolute address
// this method will retrieve it. // this method will retrieve it.
STDMETHOD(GetSymbolOffset)( STDMETHOD(GetSymbolOffset)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// If the symbol is enregistered this // If the symbol is enregistered this
// method will return the register index. // method will return the register index.
STDMETHOD(GetSymbolRegister)( STDMETHOD(GetSymbolRegister)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out PULONG Register _Out_ PULONG Register
) PURE; ) PURE;
STDMETHOD(GetSymbolValueText)( STDMETHOD(GetSymbolValueText)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
STDMETHOD(GetSymbolValueTextWide)( STDMETHOD(GetSymbolValueTextWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
STDMETHOD(GetSymbolEntryInformation)( STDMETHOD(GetSymbolEntryInformation)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out PDEBUG_SYMBOL_ENTRY Entry _Out_ PDEBUG_SYMBOL_ENTRY Entry
) PURE; ) PURE;
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// IDebugSymbols. // IDebugSymbols.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
skipping to change at line 11757 skipping to change at line 18214
#define MODULE_ORDERS_LOADTIME 0x10000000 #define MODULE_ORDERS_LOADTIME 0x10000000
#define MODULE_ORDERS_MODULENAME 0x20000000 #define MODULE_ORDERS_MODULENAME 0x20000000
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugSymbols #define INTERFACE IDebugSymbols
DECLARE_INTERFACE_(IDebugSymbols, IUnknown) DECLARE_INTERFACE_(IDebugSymbols, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugSymbols. // IDebugSymbols.
// Controls the symbol options used during // Controls the symbol options used during
// symbol operations. // symbol operations.
// Uses the same flags as dbghelps SymSetOptions. // Uses the same flags as dbghelps SymSetOptions.
STDMETHOD(GetSymbolOptions)( STDMETHOD(GetSymbolOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddSymbolOptions)( STDMETHOD(AddSymbolOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveSymbolOptions)( STDMETHOD(RemoveSymbolOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetSymbolOptions)( STDMETHOD(SetSymbolOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(GetNameByOffset)( STDMETHOD(GetNameByOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PULONG64 Displacement _Out_opt_ PULONG64 Displacement
) PURE; ) PURE;
// A symbol name may not be unique, particularly // A symbol name may not be unique, particularly
// when overloaded functions exist which all // when overloaded functions exist which all
// have the same name. If GetOffsetByName // have the same name. If GetOffsetByName
// finds multiple matches for the name it // finds multiple matches for the name it
// can return any one of them. In that // can return any one of them. In that
// case it will return S_FALSE to indicate // case it will return S_FALSE to indicate
// that ambiguity was arbitrarily resolved. // that ambiguity was arbitrarily resolved.
// A caller can then use SearchSymbols to // A caller can then use SearchSymbols to
// find all of the matches if it wishes to // find all of the matches if it wishes to
// perform different disambiguation. // perform different disambiguation.
STDMETHOD(GetOffsetByName)( STDMETHOD(GetOffsetByName)(
THIS_ THIS_
__in PCSTR Symbol, _In_ PCSTR Symbol,
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// GetNearNameByOffset returns symbols // GetNearNameByOffset returns symbols
// located near the symbol closest to // located near the symbol closest to
// to the offset, such as the previous // to the offset, such as the previous
// or next symbol. If Delta is zero it // or next symbol. If Delta is zero it
// operates identically to GetNameByOffset. // operates identically to GetNameByOffset.
// If Delta is nonzero and such a symbol // If Delta is nonzero and such a symbol
// does not exist an error is returned. // does not exist an error is returned.
// The next symbol, if one exists, will // The next symbol, if one exists, will
// always have a higher offset than the // always have a higher offset than the
// input offset so the displacement is // input offset so the displacement is
// always negative. The situation is // always negative. The situation is
// reversed for the previous symbol. // reversed for the previous symbol.
STDMETHOD(GetNearNameByOffset)( STDMETHOD(GetNearNameByOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in LONG Delta, _In_ LONG Delta,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PULONG64 Displacement _Out_opt_ PULONG64 Displacement
) PURE; ) PURE;
STDMETHOD(GetLineByOffset)( STDMETHOD(GetLineByOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_opt PULONG Line, _Out_opt_ PULONG Line,
__out_ecount_opt(FileBufferSize) PSTR FileBuffer, _Out_writes_opt_(FileBufferSize) PSTR FileBuffer,
__in ULONG FileBufferSize, _In_ ULONG FileBufferSize,
__out_opt PULONG FileSize, _Out_opt_ PULONG FileSize,
__out_opt PULONG64 Displacement _Out_opt_ PULONG64 Displacement
) PURE; ) PURE;
STDMETHOD(GetOffsetByLine)( STDMETHOD(GetOffsetByLine)(
THIS_ THIS_
__in ULONG Line, _In_ ULONG Line,
__in PCSTR File, _In_ PCSTR File,
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Enumerates the engines list of modules // Enumerates the engines list of modules
// loaded for the current process. This may // loaded for the current process. This may
// or may not match the system module list // or may not match the system module list
// for the process. Reload can be used to // for the process. Reload can be used to
// synchronize the engines list with the system // synchronize the engines list with the system
// if necessary. // if necessary.
// Some sessions also track recently unloaded // Some sessions also track recently unloaded
// code modules for help in analyzing failures // code modules for help in analyzing failures
// where an attempt is made to call unloaded code. // where an attempt is made to call unloaded code.
// These modules are indexed after the loaded // These modules are indexed after the loaded
// modules. // modules.
STDMETHOD(GetNumberModules)( STDMETHOD(GetNumberModules)(
THIS_ THIS_
__out PULONG Loaded, _Out_ PULONG Loaded,
__out PULONG Unloaded _Out_ PULONG Unloaded
) PURE; ) PURE;
STDMETHOD(GetModuleByIndex)( STDMETHOD(GetModuleByIndex)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out PULONG64 Base _Out_ PULONG64 Base
) PURE; ) PURE;
// The module name may not be unique. // The module name may not be unique.
// This method returns the first match. // This method returns the first match.
STDMETHOD(GetModuleByModuleName)( STDMETHOD(GetModuleByModuleName)(
THIS_ THIS_
__in PCSTR Name, _In_ PCSTR Name,
__in ULONG StartIndex, _In_ ULONG StartIndex,
__out_opt PULONG Index, _Out_opt_ PULONG Index,
__out_opt PULONG64 Base _Out_opt_ PULONG64 Base
) PURE; ) PURE;
// Offset can be any offset within // Offset can be any offset within
// the module extent. Extents may // the module extent. Extents may
// not be unique when including unloaded // not be unique when including unloaded
// drivers. This method returns the // drivers. This method returns the
// first match. // first match.
STDMETHOD(GetModuleByOffset)( STDMETHOD(GetModuleByOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG StartIndex, _In_ ULONG StartIndex,
__out_opt PULONG Index, _Out_opt_ PULONG Index,
__out_opt PULONG64 Base _Out_opt_ PULONG64 Base
) PURE; ) PURE;
// If Index is DEBUG_ANY_ID the base address // If Index is DEBUG_ANY_ID the base address
// is used to look up the module instead. // is used to look up the module instead.
STDMETHOD(GetModuleNames)( STDMETHOD(GetModuleNames)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in ULONG64 Base, _In_ ULONG64 Base,
__out_ecount_opt(ImageNameBufferSize) PSTR ImageNameBuffer, _Out_writes_opt_(ImageNameBufferSize) PSTR ImageNameBuffer,
__in ULONG ImageNameBufferSize, _In_ ULONG ImageNameBufferSize,
__out_opt PULONG ImageNameSize, _Out_opt_ PULONG ImageNameSize,
__out_ecount_opt(ModuleNameBufferSize) PSTR ModuleNameBuffer, _Out_writes_opt_(ModuleNameBufferSize) PSTR ModuleNameBuffer,
__in ULONG ModuleNameBufferSize, _In_ ULONG ModuleNameBufferSize,
__out_opt PULONG ModuleNameSize, _Out_opt_ PULONG ModuleNameSize,
__out_ecount_opt(LoadedImageNameBufferSize) PSTR LoadedImageNameBuffer, _Out_writes_opt_(LoadedImageNameBufferSize) PSTR LoadedImageNameBuffer,
__in ULONG LoadedImageNameBufferSize, _In_ ULONG LoadedImageNameBufferSize,
__out_opt PULONG LoadedImageNameSize _Out_opt_ PULONG LoadedImageNameSize
) PURE; ) PURE;
STDMETHOD(GetModuleParameters)( STDMETHOD(GetModuleParameters)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG64 Bases, _In_reads_opt_(Count) PULONG64 Bases,
__in ULONG Start, _In_ ULONG Start,
__out_ecount(Count) PDEBUG_MODULE_PARAMETERS Params _Out_writes_(Count) PDEBUG_MODULE_PARAMETERS Params
) PURE; ) PURE;
// Looks up the module from a <Module>!<Symbol> // Looks up the module from a <Module>!<Symbol>
// string. // string.
STDMETHOD(GetSymbolModule)( STDMETHOD(GetSymbolModule)(
THIS_ THIS_
__in PCSTR Symbol, _In_ PCSTR Symbol,
__out PULONG64 Base _Out_ PULONG64 Base
) PURE; ) PURE;
// Returns the string name of a type. // Returns the string name of a type.
STDMETHOD(GetTypeName)( STDMETHOD(GetTypeName)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
// Returns the ID for a type name. // Returns the ID for a type name.
STDMETHOD(GetTypeId)( STDMETHOD(GetTypeId)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in PCSTR Name, _In_ PCSTR Name,
__out PULONG TypeId _Out_ PULONG TypeId
) PURE; ) PURE;
STDMETHOD(GetTypeSize)( STDMETHOD(GetTypeSize)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__out PULONG Size _Out_ PULONG Size
) PURE; ) PURE;
// Given a type which can contain members // Given a type which can contain members
// this method returns the offset of a // this method returns the offset of a
// particular member within the type. // particular member within the type.
// TypeId should give the container type ID // TypeId should give the container type ID
// and Field gives the dot-separated path // and Field gives the dot-separated path
// to the field of interest. // to the field of interest.
STDMETHOD(GetFieldOffset)( STDMETHOD(GetFieldOffset)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in PCSTR Field, _In_ PCSTR Field,
__out PULONG Offset _Out_ PULONG Offset
) PURE; ) PURE;
STDMETHOD(GetSymbolTypeId)( STDMETHOD(GetSymbolTypeId)(
THIS_ THIS_
__in PCSTR Symbol, _In_ PCSTR Symbol,
__out PULONG TypeId, _Out_ PULONG TypeId,
__out_opt PULONG64 Module _Out_opt_ PULONG64 Module
) PURE; ) PURE;
// As with GetOffsetByName a symbol's // As with GetOffsetByName a symbol's
// name may be ambiguous. GetOffsetTypeId // name may be ambiguous. GetOffsetTypeId
// returns the type for the symbol closest // returns the type for the symbol closest
// to the given offset and can be used // to the given offset and can be used
// to avoid ambiguity. // to avoid ambiguity.
STDMETHOD(GetOffsetTypeId)( STDMETHOD(GetOffsetTypeId)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG TypeId, _Out_ PULONG TypeId,
__out_opt PULONG64 Module _Out_opt_ PULONG64 Module
) PURE; ) PURE;
// Helpers for virtual and physical data // Helpers for virtual and physical data
// which combine creation of a location with // which combine creation of a location with
// the actual operation. // the actual operation.
STDMETHOD(ReadTypedDataVirtual)( STDMETHOD(ReadTypedDataVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteTypedDataVirtual)( STDMETHOD(WriteTypedDataVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(OutputTypedDataVirtual)( STDMETHOD(OutputTypedDataVirtual)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
STDMETHOD(ReadTypedDataPhysical)( STDMETHOD(ReadTypedDataPhysical)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteTypedDataPhysical)( STDMETHOD(WriteTypedDataPhysical)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(OutputTypedDataPhysical)( STDMETHOD(OutputTypedDataPhysical)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Function arguments and scope block symbols // Function arguments and scope block symbols
// can be retrieved relative to currently // can be retrieved relative to currently
// executing code. A caller can provide just // executing code. A caller can provide just
// a code offset for scoping purposes and look // a code offset for scoping purposes and look
// up names or the caller can provide a full frame // up names or the caller can provide a full frame
// and look up actual values. The values for // and look up actual values. The values for
// scoped symbols are best-guess and may or may not // scoped symbols are best-guess and may or may not
// be accurate depending on program optimizations, // be accurate depending on program optimizations,
// the machine architecture, the current point // the machine architecture, the current point
// in the programs execution and so on. // in the programs execution and so on.
// A caller can also provide a complete register // A caller can also provide a complete register
// context for setting a scope to a previous // context for setting a scope to a previous
// machine state such as a context saved for // machine state such as a context saved for
// an exception. Usually this isnt necessary // an exception. Usually this isnt necessary
// and the current register context is used. // and the current register context is used.
STDMETHOD(GetScope)( STDMETHOD(GetScope)(
THIS_ THIS_
__out_opt PULONG64 InstructionOffset, _Out_opt_ PULONG64 InstructionOffset,
__out_opt PDEBUG_STACK_FRAME ScopeFrame, _Out_opt_ PDEBUG_STACK_FRAME ScopeFrame,
__out_bcount_opt(ScopeContextSize) PVOID ScopeContext, _Out_writes_bytes_opt_(ScopeContextSize) PVOID ScopeContext,
__in ULONG ScopeContextSize _In_ ULONG ScopeContextSize
) PURE; ) PURE;
// If ScopeFrame or ScopeContext is non-NULL then // If ScopeFrame or ScopeContext is non-NULL then
// InstructionOffset is ignored. // InstructionOffset is ignored.
// If ScopeContext is NULL the current // If ScopeContext is NULL the current
// register context is used. // register context is used.
// If the scope identified by the given // If the scope identified by the given
// information is the same as before // information is the same as before
// SetScope returns S_OK. If the scope // SetScope returns S_OK. If the scope
// information changes, such as when the // information changes, such as when the
// scope moves between functions or scope // scope moves between functions or scope
// blocks, SetScope returns S_FALSE. // blocks, SetScope returns S_FALSE.
STDMETHOD(SetScope)( STDMETHOD(SetScope)(
THIS_ THIS_
__in ULONG64 InstructionOffset, _In_ ULONG64 InstructionOffset,
__in_opt PDEBUG_STACK_FRAME ScopeFrame, _In_opt_ PDEBUG_STACK_FRAME ScopeFrame,
__in_bcount_opt(ScopeContextSize) PVOID ScopeContext, _In_reads_bytes_opt_(ScopeContextSize) PVOID ScopeContext,
__in ULONG ScopeContextSize _In_ ULONG ScopeContextSize
) PURE; ) PURE;
// ResetScope clears the scope information // ResetScope clears the scope information
// for situations where scoped symbols // for situations where scoped symbols
// mask global symbols or when resetting // mask global symbols or when resetting
// from explicit information to the current // from explicit information to the current
// information. // information.
STDMETHOD(ResetScope)( STDMETHOD(ResetScope)(
THIS THIS
) PURE; ) PURE;
// A scope symbol is tied to its particular // A scope symbol is tied to its particular
// scope and only is meaningful within the scope. // scope and only is meaningful within the scope.
// The returned group can be updated by passing it back // The returned group can be updated by passing it back
// into the method for lower-cost // into the method for lower-cost
// incremental updates when stepping. // incremental updates when stepping.
STDMETHOD(GetScopeSymbolGroup)( STDMETHOD(GetScopeSymbolGroup)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in_opt PDEBUG_SYMBOL_GROUP Update, _In_opt_ PDEBUG_SYMBOL_GROUP Update,
__out PDEBUG_SYMBOL_GROUP* Symbols _Out_ PDEBUG_SYMBOL_GROUP* Symbols
) PURE; ) PURE;
// Create a new symbol group. // Create a new symbol group.
STDMETHOD(CreateSymbolGroup)( STDMETHOD(CreateSymbolGroup)(
THIS_ THIS_
__out PDEBUG_SYMBOL_GROUP* Group _Out_ PDEBUG_SYMBOL_GROUP* Group
) PURE; ) PURE;
// StartSymbolMatch matches symbol names // StartSymbolMatch matches symbol names
// against the given pattern using simple // against the given pattern using simple
// regular expressions. The search results // regular expressions. The search results
// are iterated through using GetNextSymbolMatch. // are iterated through using GetNextSymbolMatch.
// When the caller is done examining results // When the caller is done examining results
// the match should be freed via EndSymbolMatch. // the match should be freed via EndSymbolMatch.
// If the match pattern contains a module name // If the match pattern contains a module name
// the search is restricted to a single module. // the search is restricted to a single module.
// Pattern matching is only done on symbol names, // Pattern matching is only done on symbol names,
// not module names. // not module names.
// All active symbol match handles are invalidated // All active symbol match handles are invalidated
// when the set of loaded symbols changes. // when the set of loaded symbols changes.
STDMETHOD(StartSymbolMatch)( STDMETHOD(StartSymbolMatch)(
THIS_ THIS_
__in PCSTR Pattern, _In_ PCSTR Pattern,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
// If Buffer is NULL the match does not // If Buffer is NULL the match does not
// advance. // advance.
STDMETHOD(GetNextSymbolMatch)( STDMETHOD(GetNextSymbolMatch)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG MatchSize, _Out_opt_ PULONG MatchSize,
__out_opt PULONG64 Offset _Out_opt_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(EndSymbolMatch)( STDMETHOD(EndSymbolMatch)(
THIS_ THIS_
__in ULONG64 Handle _In_ ULONG64 Handle
) PURE; ) PURE;
STDMETHOD(Reload)( STDMETHOD(Reload)(
THIS_ THIS_
__in PCSTR Module _In_ PCSTR Module
) PURE; ) PURE;
STDMETHOD(GetSymbolPath)( STDMETHOD(GetSymbolPath)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PathSize _Out_opt_ PULONG PathSize
) PURE; ) PURE;
STDMETHOD(SetSymbolPath)( STDMETHOD(SetSymbolPath)(
THIS_ THIS_
__in PCSTR Path _In_ PCSTR Path
) PURE; ) PURE;
STDMETHOD(AppendSymbolPath)( STDMETHOD(AppendSymbolPath)(
THIS_ THIS_
__in PCSTR Addition _In_ PCSTR Addition
) PURE; ) PURE;
// Manipulate the path for executable images. // Manipulate the path for executable images.
// Some dump files need to load executable images // Some dump files need to load executable images
// in order to resolve dump information. This // in order to resolve dump information. This
// path controls where the engine looks for // path controls where the engine looks for
// images. // images.
STDMETHOD(GetImagePath)( STDMETHOD(GetImagePath)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PathSize _Out_opt_ PULONG PathSize
) PURE; ) PURE;
STDMETHOD(SetImagePath)( STDMETHOD(SetImagePath)(
THIS_ THIS_
__in PCSTR Path _In_ PCSTR Path
) PURE; ) PURE;
STDMETHOD(AppendImagePath)( STDMETHOD(AppendImagePath)(
THIS_ THIS_
__in PCSTR Addition _In_ PCSTR Addition
) PURE; ) PURE;
// Path routines for source file location // Path routines for source file location
// methods. // methods.
STDMETHOD(GetSourcePath)( STDMETHOD(GetSourcePath)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PathSize _Out_opt_ PULONG PathSize
) PURE; ) PURE;
// Gets the nth part of the source path. // Gets the nth part of the source path.
STDMETHOD(GetSourcePathElement)( STDMETHOD(GetSourcePathElement)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ElementSize _Out_opt_ PULONG ElementSize
) PURE; ) PURE;
STDMETHOD(SetSourcePath)( STDMETHOD(SetSourcePath)(
THIS_ THIS_
__in PCSTR Path _In_ PCSTR Path
) PURE; ) PURE;
STDMETHOD(AppendSourcePath)( STDMETHOD(AppendSourcePath)(
THIS_ THIS_
__in PCSTR Addition _In_ PCSTR Addition
) PURE; ) PURE;
// Uses the given file path and the source path // Uses the given file path and the source path
// information to try and locate an existing file. // information to try and locate an existing file.
// The given file path is merged with elements // The given file path is merged with elements
// of the source path and checked for existence. // of the source path and checked for existence.
// If a match is found the element used is returned. // If a match is found the element used is returned.
// A starting element can be specified to restrict // A starting element can be specified to restrict
// the search to a subset of the path elements; // the search to a subset of the path elements;
// this can be useful when checking for multiple // this can be useful when checking for multiple
// matches along the source path. // matches along the source path.
// The returned element can be 1, indicating // The returned element can be 1, indicating
// the file was found directly and not on the path. // the file was found directly and not on the path.
STDMETHOD(FindSourceFile)( STDMETHOD(FindSourceFile)(
THIS_ THIS_
__in ULONG StartElement, _In_ ULONG StartElement,
__in PCSTR File, _In_ PCSTR File,
__in ULONG Flags, _In_ ULONG Flags,
__out_opt PULONG FoundElement, _Out_opt_ PULONG FoundElement,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG FoundSize _Out_opt_ PULONG FoundSize
) PURE; ) PURE;
// Retrieves all the line offset information // Retrieves all the line offset information
// for a particular source file. Buffer is // for a particular source file. Buffer is
// first intialized to DEBUG_INVALID_OFFSET for // first intialized to DEBUG_INVALID_OFFSET for
// every entry. Then for each piece of line // every entry. Then for each piece of line
// symbol information Buffer[Line] set to // symbol information Buffer[Line] set to
// Lines offset. This produces a per-line // Lines offset. This produces a per-line
// map of the offsets for the lines of the // map of the offsets for the lines of the
// given file. Line numbers are decremented // given file. Line numbers are decremented
// for the map so Buffer[0] contains the offset // for the map so Buffer[0] contains the offset
// for line number 1. // for line number 1.
// If there is no line information at all for // If there is no line information at all for
// the given file the method fails rather // the given file the method fails rather
// than returning a map of invalid offsets. // than returning a map of invalid offsets.
STDMETHOD(GetSourceFileLineOffsets)( STDMETHOD(GetSourceFileLineOffsets)(
THIS_ THIS_
__in PCSTR File, _In_ PCSTR File,
__out_ecount_opt(BufferLines) PULONG64 Buffer, _Out_writes_opt_(BufferLines) PULONG64 Buffer,
__in ULONG BufferLines, _In_ ULONG BufferLines,
__out_opt PULONG FileLines _Out_opt_ PULONG FileLines
) PURE; ) PURE;
}; };
// //
// GetModuleNameString strings. // GetModuleNameString strings.
// //
#define DEBUG_MODNAME_IMAGE 0x00000000 #define DEBUG_MODNAME_IMAGE 0x00000000
#define DEBUG_MODNAME_MODULE 0x00000001 #define DEBUG_MODNAME_MODULE 0x00000001
#define DEBUG_MODNAME_LOADED_IMAGE 0x00000002 #define DEBUG_MODNAME_LOADED_IMAGE 0x00000002
skipping to change at line 12268 skipping to change at line 18725
// multiple type/symbol match for a given name // multiple type/symbol match for a given name
#define DEBUG_TYPEOPTS_MATCH_MAXSIZE 0x00000008 #define DEBUG_TYPEOPTS_MATCH_MAXSIZE 0x00000008
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugSymbols2 #define INTERFACE IDebugSymbols2
DECLARE_INTERFACE_(IDebugSymbols2, IUnknown) DECLARE_INTERFACE_(IDebugSymbols2, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugSymbols. // IDebugSymbols.
// Controls the symbol options used during // Controls the symbol options used during
// symbol operations. // symbol operations.
// Uses the same flags as dbghelps SymSetOptions. // Uses the same flags as dbghelps SymSetOptions.
STDMETHOD(GetSymbolOptions)( STDMETHOD(GetSymbolOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddSymbolOptions)( STDMETHOD(AddSymbolOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveSymbolOptions)( STDMETHOD(RemoveSymbolOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetSymbolOptions)( STDMETHOD(SetSymbolOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(GetNameByOffset)( STDMETHOD(GetNameByOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PULONG64 Displacement _Out_opt_ PULONG64 Displacement
) PURE; ) PURE;
// A symbol name may not be unique, particularly // A symbol name may not be unique, particularly
// when overloaded functions exist which all // when overloaded functions exist which all
// have the same name. If GetOffsetByName // have the same name. If GetOffsetByName
// finds multiple matches for the name it // finds multiple matches for the name it
// can return any one of them. In that // can return any one of them. In that
// case it will return S_FALSE to indicate // case it will return S_FALSE to indicate
// that ambiguity was arbitrarily resolved. // that ambiguity was arbitrarily resolved.
// A caller can then use SearchSymbols to // A caller can then use SearchSymbols to
// find all of the matches if it wishes to // find all of the matches if it wishes to
// perform different disambiguation. // perform different disambiguation.
STDMETHOD(GetOffsetByName)( STDMETHOD(GetOffsetByName)(
THIS_ THIS_
__in PCSTR Symbol, _In_ PCSTR Symbol,
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// GetNearNameByOffset returns symbols // GetNearNameByOffset returns symbols
// located near the symbol closest to // located near the symbol closest to
// to the offset, such as the previous // to the offset, such as the previous
// or next symbol. If Delta is zero it // or next symbol. If Delta is zero it
// operates identically to GetNameByOffset. // operates identically to GetNameByOffset.
// If Delta is nonzero and such a symbol // If Delta is nonzero and such a symbol
// does not exist an error is returned. // does not exist an error is returned.
// The next symbol, if one exists, will // The next symbol, if one exists, will
// always have a higher offset than the // always have a higher offset than the
// input offset so the displacement is // input offset so the displacement is
// always negative. The situation is // always negative. The situation is
// reversed for the previous symbol. // reversed for the previous symbol.
STDMETHOD(GetNearNameByOffset)( STDMETHOD(GetNearNameByOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in LONG Delta, _In_ LONG Delta,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PULONG64 Displacement _Out_opt_ PULONG64 Displacement
) PURE; ) PURE;
STDMETHOD(GetLineByOffset)( STDMETHOD(GetLineByOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_opt PULONG Line, _Out_opt_ PULONG Line,
__out_ecount_opt(FileBufferSize) PSTR FileBuffer, _Out_writes_opt_(FileBufferSize) PSTR FileBuffer,
__in ULONG FileBufferSize, _In_ ULONG FileBufferSize,
__out_opt PULONG FileSize, _Out_opt_ PULONG FileSize,
__out_opt PULONG64 Displacement _Out_opt_ PULONG64 Displacement
) PURE; ) PURE;
STDMETHOD(GetOffsetByLine)( STDMETHOD(GetOffsetByLine)(
THIS_ THIS_
__in ULONG Line, _In_ ULONG Line,
__in PCSTR File, _In_ PCSTR File,
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Enumerates the engines list of modules // Enumerates the engines list of modules
// loaded for the current process. This may // loaded for the current process. This may
// or may not match the system module list // or may not match the system module list
// for the process. Reload can be used to // for the process. Reload can be used to
// synchronize the engines list with the system // synchronize the engines list with the system
// if necessary. // if necessary.
// Some sessions also track recently unloaded // Some sessions also track recently unloaded
// code modules for help in analyzing failures // code modules for help in analyzing failures
// where an attempt is made to call unloaded code. // where an attempt is made to call unloaded code.
// These modules are indexed after the loaded // These modules are indexed after the loaded
// modules. // modules.
STDMETHOD(GetNumberModules)( STDMETHOD(GetNumberModules)(
THIS_ THIS_
__out PULONG Loaded, _Out_ PULONG Loaded,
__out PULONG Unloaded _Out_ PULONG Unloaded
) PURE; ) PURE;
STDMETHOD(GetModuleByIndex)( STDMETHOD(GetModuleByIndex)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out PULONG64 Base _Out_ PULONG64 Base
) PURE; ) PURE;
// The module name may not be unique. // The module name may not be unique.
// This method returns the first match. // This method returns the first match.
STDMETHOD(GetModuleByModuleName)( STDMETHOD(GetModuleByModuleName)(
THIS_ THIS_
__in PCSTR Name, _In_ PCSTR Name,
__in ULONG StartIndex, _In_ ULONG StartIndex,
__out_opt PULONG Index, _Out_opt_ PULONG Index,
__out_opt PULONG64 Base _Out_opt_ PULONG64 Base
) PURE; ) PURE;
// Offset can be any offset within // Offset can be any offset within
// the module extent. Extents may // the module extent. Extents may
// not be unique when including unloaded // not be unique when including unloaded
// drivers. This method returns the // drivers. This method returns the
// first match. // first match.
STDMETHOD(GetModuleByOffset)( STDMETHOD(GetModuleByOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG StartIndex, _In_ ULONG StartIndex,
__out_opt PULONG Index, _Out_opt_ PULONG Index,
__out_opt PULONG64 Base _Out_opt_ PULONG64 Base
) PURE; ) PURE;
// If Index is DEBUG_ANY_ID the base address // If Index is DEBUG_ANY_ID the base address
// is used to look up the module instead. // is used to look up the module instead.
STDMETHOD(GetModuleNames)( STDMETHOD(GetModuleNames)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in ULONG64 Base, _In_ ULONG64 Base,
__out_ecount_opt(ImageNameBufferSize) PSTR ImageNameBuffer, _Out_writes_opt_(ImageNameBufferSize) PSTR ImageNameBuffer,
__in ULONG ImageNameBufferSize, _In_ ULONG ImageNameBufferSize,
__out_opt PULONG ImageNameSize, _Out_opt_ PULONG ImageNameSize,
__out_ecount_opt(ModuleNameBufferSize) PSTR ModuleNameBuffer, _Out_writes_opt_(ModuleNameBufferSize) PSTR ModuleNameBuffer,
__in ULONG ModuleNameBufferSize, _In_ ULONG ModuleNameBufferSize,
__out_opt PULONG ModuleNameSize, _Out_opt_ PULONG ModuleNameSize,
__out_ecount_opt(LoadedImageNameBufferSize) PSTR LoadedImageNameBuffer, _Out_writes_opt_(LoadedImageNameBufferSize) PSTR LoadedImageNameBuffer,
__in ULONG LoadedImageNameBufferSize, _In_ ULONG LoadedImageNameBufferSize,
__out_opt PULONG LoadedImageNameSize _Out_opt_ PULONG LoadedImageNameSize
) PURE; ) PURE;
STDMETHOD(GetModuleParameters)( STDMETHOD(GetModuleParameters)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG64 Bases, _In_reads_opt_(Count) PULONG64 Bases,
__in ULONG Start, _In_ ULONG Start,
__out_ecount(Count) PDEBUG_MODULE_PARAMETERS Params _Out_writes_(Count) PDEBUG_MODULE_PARAMETERS Params
) PURE; ) PURE;
// Looks up the module from a <Module>!<Symbol> // Looks up the module from a <Module>!<Symbol>
// string. // string.
STDMETHOD(GetSymbolModule)( STDMETHOD(GetSymbolModule)(
THIS_ THIS_
__in PCSTR Symbol, _In_ PCSTR Symbol,
__out PULONG64 Base _Out_ PULONG64 Base
) PURE; ) PURE;
// Returns the string name of a type. // Returns the string name of a type.
STDMETHOD(GetTypeName)( STDMETHOD(GetTypeName)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
// Returns the ID for a type name. // Returns the ID for a type name.
STDMETHOD(GetTypeId)( STDMETHOD(GetTypeId)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in PCSTR Name, _In_ PCSTR Name,
__out PULONG TypeId _Out_ PULONG TypeId
) PURE; ) PURE;
STDMETHOD(GetTypeSize)( STDMETHOD(GetTypeSize)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__out PULONG Size _Out_ PULONG Size
) PURE; ) PURE;
// Given a type which can contain members // Given a type which can contain members
// this method returns the offset of a // this method returns the offset of a
// particular member within the type. // particular member within the type.
// TypeId should give the container type ID // TypeId should give the container type ID
// and Field gives the dot-separated path // and Field gives the dot-separated path
// to the field of interest. // to the field of interest.
STDMETHOD(GetFieldOffset)( STDMETHOD(GetFieldOffset)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in PCSTR Field, _In_ PCSTR Field,
__out PULONG Offset _Out_ PULONG Offset
) PURE; ) PURE;
STDMETHOD(GetSymbolTypeId)( STDMETHOD(GetSymbolTypeId)(
THIS_ THIS_
__in PCSTR Symbol, _In_ PCSTR Symbol,
__out PULONG TypeId, _Out_ PULONG TypeId,
__out_opt PULONG64 Module _Out_opt_ PULONG64 Module
) PURE; ) PURE;
// As with GetOffsetByName a symbol's // As with GetOffsetByName a symbol's
// name may be ambiguous. GetOffsetTypeId // name may be ambiguous. GetOffsetTypeId
// returns the type for the symbol closest // returns the type for the symbol closest
// to the given offset and can be used // to the given offset and can be used
// to avoid ambiguity. // to avoid ambiguity.
STDMETHOD(GetOffsetTypeId)( STDMETHOD(GetOffsetTypeId)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG TypeId, _Out_ PULONG TypeId,
__out_opt PULONG64 Module _Out_opt_ PULONG64 Module
) PURE; ) PURE;
// Helpers for virtual and physical data // Helpers for virtual and physical data
// which combine creation of a location with // which combine creation of a location with
// the actual operation. // the actual operation.
STDMETHOD(ReadTypedDataVirtual)( STDMETHOD(ReadTypedDataVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteTypedDataVirtual)( STDMETHOD(WriteTypedDataVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(OutputTypedDataVirtual)( STDMETHOD(OutputTypedDataVirtual)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
STDMETHOD(ReadTypedDataPhysical)( STDMETHOD(ReadTypedDataPhysical)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteTypedDataPhysical)( STDMETHOD(WriteTypedDataPhysical)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(OutputTypedDataPhysical)( STDMETHOD(OutputTypedDataPhysical)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Function arguments and scope block symbols // Function arguments and scope block symbols
// can be retrieved relative to currently // can be retrieved relative to currently
// executing code. A caller can provide just // executing code. A caller can provide just
// a code offset for scoping purposes and look // a code offset for scoping purposes and look
// up names or the caller can provide a full frame // up names or the caller can provide a full frame
// and look up actual values. The values for // and look up actual values. The values for
// scoped symbols are best-guess and may or may not // scoped symbols are best-guess and may or may not
// be accurate depending on program optimizations, // be accurate depending on program optimizations,
// the machine architecture, the current point // the machine architecture, the current point
// in the programs execution and so on. // in the programs execution and so on.
// A caller can also provide a complete register // A caller can also provide a complete register
// context for setting a scope to a previous // context for setting a scope to a previous
// machine state such as a context saved for // machine state such as a context saved for
// an exception. Usually this isnt necessary // an exception. Usually this isnt necessary
// and the current register context is used. // and the current register context is used.
STDMETHOD(GetScope)( STDMETHOD(GetScope)(
THIS_ THIS_
__out_opt PULONG64 InstructionOffset, _Out_opt_ PULONG64 InstructionOffset,
__out_opt PDEBUG_STACK_FRAME ScopeFrame, _Out_opt_ PDEBUG_STACK_FRAME ScopeFrame,
__out_bcount_opt(ScopeContextSize) PVOID ScopeContext, _Out_writes_bytes_opt_(ScopeContextSize) PVOID ScopeContext,
__in ULONG ScopeContextSize _In_ ULONG ScopeContextSize
) PURE; ) PURE;
// If ScopeFrame or ScopeContext is non-NULL then // If ScopeFrame or ScopeContext is non-NULL then
// InstructionOffset is ignored. // InstructionOffset is ignored.
// If ScopeContext is NULL the current // If ScopeContext is NULL the current
// register context is used. // register context is used.
// If the scope identified by the given // If the scope identified by the given
// information is the same as before // information is the same as before
// SetScope returns S_OK. If the scope // SetScope returns S_OK. If the scope
// information changes, such as when the // information changes, such as when the
// scope moves between functions or scope // scope moves between functions or scope
// blocks, SetScope returns S_FALSE. // blocks, SetScope returns S_FALSE.
STDMETHOD(SetScope)( STDMETHOD(SetScope)(
THIS_ THIS_
__in ULONG64 InstructionOffset, _In_ ULONG64 InstructionOffset,
__in_opt PDEBUG_STACK_FRAME ScopeFrame, _In_opt_ PDEBUG_STACK_FRAME ScopeFrame,
__in_bcount_opt(ScopeContextSize) PVOID ScopeContext, _In_reads_bytes_opt_(ScopeContextSize) PVOID ScopeContext,
__in ULONG ScopeContextSize _In_ ULONG ScopeContextSize
) PURE; ) PURE;
// ResetScope clears the scope information // ResetScope clears the scope information
// for situations where scoped symbols // for situations where scoped symbols
// mask global symbols or when resetting // mask global symbols or when resetting
// from explicit information to the current // from explicit information to the current
// information. // information.
STDMETHOD(ResetScope)( STDMETHOD(ResetScope)(
THIS THIS
) PURE; ) PURE;
// A scope symbol is tied to its particular // A scope symbol is tied to its particular
// scope and only is meaningful within the scope. // scope and only is meaningful within the scope.
// The returned group can be updated by passing it back // The returned group can be updated by passing it back
// into the method for lower-cost // into the method for lower-cost
// incremental updates when stepping. // incremental updates when stepping.
STDMETHOD(GetScopeSymbolGroup)( STDMETHOD(GetScopeSymbolGroup)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in_opt PDEBUG_SYMBOL_GROUP Update, _In_opt_ PDEBUG_SYMBOL_GROUP Update,
__out PDEBUG_SYMBOL_GROUP* Symbols _Out_ PDEBUG_SYMBOL_GROUP* Symbols
) PURE; ) PURE;
// Create a new symbol group. // Create a new symbol group.
STDMETHOD(CreateSymbolGroup)( STDMETHOD(CreateSymbolGroup)(
THIS_ THIS_
__out PDEBUG_SYMBOL_GROUP* Group _Out_ PDEBUG_SYMBOL_GROUP* Group
) PURE; ) PURE;
// StartSymbolMatch matches symbol names // StartSymbolMatch matches symbol names
// against the given pattern using simple // against the given pattern using simple
// regular expressions. The search results // regular expressions. The search results
// are iterated through using GetNextSymbolMatch. // are iterated through using GetNextSymbolMatch.
// When the caller is done examining results // When the caller is done examining results
// the match should be freed via EndSymbolMatch. // the match should be freed via EndSymbolMatch.
// If the match pattern contains a module name // If the match pattern contains a module name
// the search is restricted to a single module. // the search is restricted to a single module.
// Pattern matching is only done on symbol names, // Pattern matching is only done on symbol names,
// not module names. // not module names.
// All active symbol match handles are invalidated // All active symbol match handles are invalidated
// when the set of loaded symbols changes. // when the set of loaded symbols changes.
STDMETHOD(StartSymbolMatch)( STDMETHOD(StartSymbolMatch)(
THIS_ THIS_
__in PCSTR Pattern, _In_ PCSTR Pattern,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
// If Buffer is NULL the match does not // If Buffer is NULL the match does not
// advance. // advance.
STDMETHOD(GetNextSymbolMatch)( STDMETHOD(GetNextSymbolMatch)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG MatchSize, _Out_opt_ PULONG MatchSize,
__out_opt PULONG64 Offset _Out_opt_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(EndSymbolMatch)( STDMETHOD(EndSymbolMatch)(
THIS_ THIS_
__in ULONG64 Handle _In_ ULONG64 Handle
) PURE; ) PURE;
STDMETHOD(Reload)( STDMETHOD(Reload)(
THIS_ THIS_
__in PCSTR Module _In_ PCSTR Module
) PURE; ) PURE;
STDMETHOD(GetSymbolPath)( STDMETHOD(GetSymbolPath)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PathSize _Out_opt_ PULONG PathSize
) PURE; ) PURE;
STDMETHOD(SetSymbolPath)( STDMETHOD(SetSymbolPath)(
THIS_ THIS_
__in PCSTR Path _In_ PCSTR Path
) PURE; ) PURE;
STDMETHOD(AppendSymbolPath)( STDMETHOD(AppendSymbolPath)(
THIS_ THIS_
__in PCSTR Addition _In_ PCSTR Addition
) PURE; ) PURE;
// Manipulate the path for executable images. // Manipulate the path for executable images.
// Some dump files need to load executable images // Some dump files need to load executable images
// in order to resolve dump information. This // in order to resolve dump information. This
// path controls where the engine looks for // path controls where the engine looks for
// images. // images.
STDMETHOD(GetImagePath)( STDMETHOD(GetImagePath)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PathSize _Out_opt_ PULONG PathSize
) PURE; ) PURE;
STDMETHOD(SetImagePath)( STDMETHOD(SetImagePath)(
THIS_ THIS_
__in PCSTR Path _In_ PCSTR Path
) PURE; ) PURE;
STDMETHOD(AppendImagePath)( STDMETHOD(AppendImagePath)(
THIS_ THIS_
__in PCSTR Addition _In_ PCSTR Addition
) PURE; ) PURE;
// Path routines for source file location // Path routines for source file location
// methods. // methods.
STDMETHOD(GetSourcePath)( STDMETHOD(GetSourcePath)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PathSize _Out_opt_ PULONG PathSize
) PURE; ) PURE;
// Gets the nth part of the source path. // Gets the nth part of the source path.
STDMETHOD(GetSourcePathElement)( STDMETHOD(GetSourcePathElement)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ElementSize _Out_opt_ PULONG ElementSize
) PURE; ) PURE;
STDMETHOD(SetSourcePath)( STDMETHOD(SetSourcePath)(
THIS_ THIS_
__in PCSTR Path _In_ PCSTR Path
) PURE; ) PURE;
STDMETHOD(AppendSourcePath)( STDMETHOD(AppendSourcePath)(
THIS_ THIS_
__in PCSTR Addition _In_ PCSTR Addition
) PURE; ) PURE;
// Uses the given file path and the source path // Uses the given file path and the source path
// information to try and locate an existing file. // information to try and locate an existing file.
// The given file path is merged with elements // The given file path is merged with elements
// of the source path and checked for existence. // of the source path and checked for existence.
// If a match is found the element used is returned. // If a match is found the element used is returned.
// A starting element can be specified to restrict // A starting element can be specified to restrict
// the search to a subset of the path elements; // the search to a subset of the path elements;
// this can be useful when checking for multiple // this can be useful when checking for multiple
// matches along the source path. // matches along the source path.
// The returned element can be 1, indicating // The returned element can be 1, indicating
// the file was found directly and not on the path. // the file was found directly and not on the path.
STDMETHOD(FindSourceFile)( STDMETHOD(FindSourceFile)(
THIS_ THIS_
__in ULONG StartElement, _In_ ULONG StartElement,
__in PCSTR File, _In_ PCSTR File,
__in ULONG Flags, _In_ ULONG Flags,
__out_opt PULONG FoundElement, _Out_opt_ PULONG FoundElement,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG FoundSize _Out_opt_ PULONG FoundSize
) PURE; ) PURE;
// Retrieves all the line offset information // Retrieves all the line offset information
// for a particular source file. Buffer is // for a particular source file. Buffer is
// first intialized to DEBUG_INVALID_OFFSET for // first intialized to DEBUG_INVALID_OFFSET for
// every entry. Then for each piece of line // every entry. Then for each piece of line
// symbol information Buffer[Line] set to // symbol information Buffer[Line] set to
// Lines offset. This produces a per-line // Lines offset. This produces a per-line
// map of the offsets for the lines of the // map of the offsets for the lines of the
// given file. Line numbers are decremented // given file. Line numbers are decremented
// for the map so Buffer[0] contains the offset // for the map so Buffer[0] contains the offset
// for line number 1. // for line number 1.
// If there is no line information at all for // If there is no line information at all for
// the given file the method fails rather // the given file the method fails rather
// than returning a map of invalid offsets. // than returning a map of invalid offsets.
STDMETHOD(GetSourceFileLineOffsets)( STDMETHOD(GetSourceFileLineOffsets)(
THIS_ THIS_
__in PCSTR File, _In_ PCSTR File,
__out_ecount_opt(BufferLines) PULONG64 Buffer, _Out_writes_opt_(BufferLines) PULONG64 Buffer,
__in ULONG BufferLines, _In_ ULONG BufferLines,
__out_opt PULONG FileLines _Out_opt_ PULONG FileLines
) PURE; ) PURE;
// IDebugSymbols2. // IDebugSymbols2.
// If Index is DEBUG_ANY_ID the base address // If Index is DEBUG_ANY_ID the base address
// is used to look up the module instead. // is used to look up the module instead.
// Item is specified as in VerQueryValue. // Item is specified as in VerQueryValue.
// Module version information is only // Module version information is only
// available for loaded modules and may // available for loaded modules and may
// not be available in all debug sessions. // not be available in all debug sessions.
STDMETHOD(GetModuleVersionInformation)( STDMETHOD(GetModuleVersionInformation)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in ULONG64 Base, _In_ ULONG64 Base,
__in PCSTR Item, _In_ PCSTR Item,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG VerInfoSize _Out_opt_ PULONG VerInfoSize
) PURE; ) PURE;
// Retrieves any available module name string // Retrieves any available module name string
// such as module name or symbol file name. // such as module name or symbol file name.
// If Index is DEBUG_ANY_ID the base address // If Index is DEBUG_ANY_ID the base address
// is used to look up the module instead. // is used to look up the module instead.
// If symbols are deferred an error will // If symbols are deferred an error will
// be returned. // be returned.
// E_NOINTERFACE may be returned, indicating // E_NOINTERFACE may be returned, indicating
// no information exists. // no information exists.
STDMETHOD(GetModuleNameString)( STDMETHOD(GetModuleNameString)(
THIS_ THIS_
__in ULONG Which, _In_ ULONG Which,
__in ULONG Index, _In_ ULONG Index,
__in ULONG64 Base, _In_ ULONG64 Base,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
// Returns the string name of a constant type. // Returns the string name of a constant type.
STDMETHOD(GetConstantName)( STDMETHOD(GetConstantName)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in ULONG64 Value, _In_ ULONG64 Value,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
// Gets name of a field in a struct // Gets name of a field in a struct
// FieldNumber is 0 based index of field in a struct // FieldNumber is 0 based index of field in a struct
STDMETHOD(GetFieldName)( STDMETHOD(GetFieldName)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in ULONG FieldIndex, _In_ ULONG FieldIndex,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
// Control options for typed values. // Control options for typed values.
STDMETHOD(GetTypeOptions)( STDMETHOD(GetTypeOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddTypeOptions)( STDMETHOD(AddTypeOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveTypeOptions)( STDMETHOD(RemoveTypeOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetTypeOptions)( STDMETHOD(SetTypeOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
}; };
// //
// GetModuleBy* flags. // GetModuleBy* flags.
// //
// Scan all modules, loaded and unloaded. // Scan all modules, loaded and unloaded.
#define DEBUG_GETMOD_DEFAULT 0x00000000 #define DEBUG_GETMOD_DEFAULT 0x00000000
// Do not scan loaded modules. // Do not scan loaded modules.
#define DEBUG_GETMOD_NO_LOADED_MODULES 0x00000001 #define DEBUG_GETMOD_NO_LOADED_MODULES 0x00000001
// Do not scan unloaded modules. // Do not scan unloaded modules.
#define DEBUG_GETMOD_NO_UNLOADED_MODULES 0x00000002 #define DEBUG_GETMOD_NO_UNLOADED_MODULES 0x00000002
// //
// AddSyntheticModule flags. // AddSyntheticModule flags.
// //
#define DEBUG_ADDSYNTHMOD_DEFAULT 0x00000000
#define DEBUG_ADDSYNTHMOD_DEFAULT 0x00000000 #define DEBUG_ADDSYNTHMOD_ZEROBASE 0x00000001
// //
// AddSyntheticSymbol flags. // AddSyntheticSymbol flags.
// //
#define DEBUG_ADDSYNTHSYM_DEFAULT 0x00000000 #define DEBUG_ADDSYNTHSYM_DEFAULT 0x00000000
// //
// OutputSymbolByOffset flags. // OutputSymbolByOffset flags.
// //
skipping to change at line 12891 skipping to change at line 19348
#define DEBUG_GSEL_DEFAULT 0x00000000 #define DEBUG_GSEL_DEFAULT 0x00000000
// Do not allow any extra symbols to load during the search. // Do not allow any extra symbols to load during the search.
#define DEBUG_GSEL_NO_SYMBOL_LOADS 0x00000001 #define DEBUG_GSEL_NO_SYMBOL_LOADS 0x00000001
// Allow source hits with lower line numbers. // Allow source hits with lower line numbers.
#define DEBUG_GSEL_ALLOW_LOWER 0x00000002 #define DEBUG_GSEL_ALLOW_LOWER 0x00000002
// Allow source hits with higher line numbers. // Allow source hits with higher line numbers.
#define DEBUG_GSEL_ALLOW_HIGHER 0x00000004 #define DEBUG_GSEL_ALLOW_HIGHER 0x00000004
// Only return the nearest hits. // Only return the nearest hits.
#define DEBUG_GSEL_NEAREST_ONLY 0x00000008 #define DEBUG_GSEL_NEAREST_ONLY 0x00000008
// Only return caller sites of the inline function
#define DEBUG_GSEL_INLINE_CALLSITE 0x00000010
typedef struct _DEBUG_SYMBOL_SOURCE_ENTRY typedef struct _DEBUG_SYMBOL_SOURCE_ENTRY
{ {
ULONG64 ModuleBase; ULONG64 ModuleBase;
ULONG64 Offset; ULONG64 Offset;
ULONG64 FileNameId; ULONG64 FileNameId;
ULONG64 EngineInternal; ULONG64 EngineInternal;
ULONG Size; ULONG Size;
ULONG Flags; ULONG Flags;
ULONG FileNameSize; ULONG FileNameSize;
skipping to change at line 12919 skipping to change at line 19378
ULONG Reserved; ULONG Reserved;
} DEBUG_SYMBOL_SOURCE_ENTRY, *PDEBUG_SYMBOL_SOURCE_ENTRY; } DEBUG_SYMBOL_SOURCE_ENTRY, *PDEBUG_SYMBOL_SOURCE_ENTRY;
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugSymbols3 #define INTERFACE IDebugSymbols3
DECLARE_INTERFACE_(IDebugSymbols3, IUnknown) DECLARE_INTERFACE_(IDebugSymbols3, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugSymbols. // IDebugSymbols.
// Controls the symbol options used during // Controls the symbol options used during
// symbol operations. // symbol operations.
// Uses the same flags as dbghelps SymSetOptions. // Uses the same flags as dbghelps SymSetOptions.
STDMETHOD(GetSymbolOptions)( STDMETHOD(GetSymbolOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddSymbolOptions)( STDMETHOD(AddSymbolOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveSymbolOptions)( STDMETHOD(RemoveSymbolOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetSymbolOptions)( STDMETHOD(SetSymbolOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(GetNameByOffset)( STDMETHOD(GetNameByOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PULONG64 Displacement _Out_opt_ PULONG64 Displacement
) PURE; ) PURE;
// A symbol name may not be unique, particularly // A symbol name may not be unique, particularly
// when overloaded functions exist which all // when overloaded functions exist which all
// have the same name. If GetOffsetByName // have the same name. If GetOffsetByName
// finds multiple matches for the name it // finds multiple matches for the name it
// can return any one of them. In that // can return any one of them. In that
// case it will return S_FALSE to indicate // case it will return S_FALSE to indicate
// that ambiguity was arbitrarily resolved. // that ambiguity was arbitrarily resolved.
// A caller can then use SearchSymbols to // A caller can then use SearchSymbols to
// find all of the matches if it wishes to // find all of the matches if it wishes to
// perform different disambiguation. // perform different disambiguation.
STDMETHOD(GetOffsetByName)( STDMETHOD(GetOffsetByName)(
THIS_ THIS_
__in PCSTR Symbol, _In_ PCSTR Symbol,
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// GetNearNameByOffset returns symbols // GetNearNameByOffset returns symbols
// located near the symbol closest to // located near the symbol closest to
// to the offset, such as the previous // to the offset, such as the previous
// or next symbol. If Delta is zero it // or next symbol. If Delta is zero it
// operates identically to GetNameByOffset. // operates identically to GetNameByOffset.
// If Delta is nonzero and such a symbol // If Delta is nonzero and such a symbol
// does not exist an error is returned. // does not exist an error is returned.
// The next symbol, if one exists, will // The next symbol, if one exists, will
// always have a higher offset than the // always have a higher offset than the
// input offset so the displacement is // input offset so the displacement is
// always negative. The situation is // always negative. The situation is
// reversed for the previous symbol. // reversed for the previous symbol.
STDMETHOD(GetNearNameByOffset)( STDMETHOD(GetNearNameByOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in LONG Delta, _In_ LONG Delta,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PULONG64 Displacement _Out_opt_ PULONG64 Displacement
) PURE; ) PURE;
STDMETHOD(GetLineByOffset)( STDMETHOD(GetLineByOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_opt PULONG Line, _Out_opt_ PULONG Line,
__out_ecount_opt(FileBufferSize) PSTR FileBuffer, _Out_writes_opt_(FileBufferSize) PSTR FileBuffer,
__in ULONG FileBufferSize, _In_ ULONG FileBufferSize,
__out_opt PULONG FileSize, _Out_opt_ PULONG FileSize,
__out_opt PULONG64 Displacement _Out_opt_ PULONG64 Displacement
) PURE; ) PURE;
STDMETHOD(GetOffsetByLine)( STDMETHOD(GetOffsetByLine)(
THIS_ THIS_
__in ULONG Line, _In_ ULONG Line,
__in PCSTR File, _In_ PCSTR File,
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Enumerates the engines list of modules // Enumerates the engines list of modules
// loaded for the current process. This may // loaded for the current process. This may
// or may not match the system module list // or may not match the system module list
// for the process. Reload can be used to // for the process. Reload can be used to
// synchronize the engines list with the system // synchronize the engines list with the system
// if necessary. // if necessary.
// Some sessions also track recently unloaded // Some sessions also track recently unloaded
// code modules for help in analyzing failures // code modules for help in analyzing failures
// where an attempt is made to call unloaded code. // where an attempt is made to call unloaded code.
// These modules are indexed after the loaded // These modules are indexed after the loaded
// modules. // modules.
STDMETHOD(GetNumberModules)( STDMETHOD(GetNumberModules)(
THIS_ THIS_
__out PULONG Loaded, _Out_ PULONG Loaded,
__out PULONG Unloaded _Out_ PULONG Unloaded
) PURE; ) PURE;
STDMETHOD(GetModuleByIndex)( STDMETHOD(GetModuleByIndex)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out PULONG64 Base _Out_ PULONG64 Base
) PURE; ) PURE;
// The module name may not be unique. // The module name may not be unique.
// This method returns the first match. // This method returns the first match.
STDMETHOD(GetModuleByModuleName)( STDMETHOD(GetModuleByModuleName)(
THIS_ THIS_
__in PCSTR Name, _In_ PCSTR Name,
__in ULONG StartIndex, _In_ ULONG StartIndex,
__out_opt PULONG Index, _Out_opt_ PULONG Index,
__out_opt PULONG64 Base _Out_opt_ PULONG64 Base
) PURE; ) PURE;
// Offset can be any offset within // Offset can be any offset within
// the module extent. Extents may // the module extent. Extents may
// not be unique when including unloaded // not be unique when including unloaded
// drivers. This method returns the // drivers. This method returns the
// first match. // first match.
STDMETHOD(GetModuleByOffset)( STDMETHOD(GetModuleByOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG StartIndex, _In_ ULONG StartIndex,
__out_opt PULONG Index, _Out_opt_ PULONG Index,
__out_opt PULONG64 Base _Out_opt_ PULONG64 Base
) PURE; ) PURE;
// If Index is DEBUG_ANY_ID the base address // If Index is DEBUG_ANY_ID the base address
// is used to look up the module instead. // is used to look up the module instead.
STDMETHOD(GetModuleNames)( STDMETHOD(GetModuleNames)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in ULONG64 Base, _In_ ULONG64 Base,
__out_ecount_opt(ImageNameBufferSize) PSTR ImageNameBuffer, _Out_writes_opt_(ImageNameBufferSize) PSTR ImageNameBuffer,
__in ULONG ImageNameBufferSize, _In_ ULONG ImageNameBufferSize,
__out_opt PULONG ImageNameSize, _Out_opt_ PULONG ImageNameSize,
__out_ecount_opt(ModuleNameBufferSize) PSTR ModuleNameBuffer, _Out_writes_opt_(ModuleNameBufferSize) PSTR ModuleNameBuffer,
__in ULONG ModuleNameBufferSize, _In_ ULONG ModuleNameBufferSize,
__out_opt PULONG ModuleNameSize, _Out_opt_ PULONG ModuleNameSize,
__out_ecount_opt(LoadedImageNameBufferSize) PSTR LoadedImageNameBuffer, _Out_writes_opt_(LoadedImageNameBufferSize) PSTR LoadedImageNameBuffer,
__in ULONG LoadedImageNameBufferSize, _In_ ULONG LoadedImageNameBufferSize,
__out_opt PULONG LoadedImageNameSize _Out_opt_ PULONG LoadedImageNameSize
) PURE; ) PURE;
STDMETHOD(GetModuleParameters)( STDMETHOD(GetModuleParameters)(
THIS_ THIS_
__in ULONG Count, _In_ ULONG Count,
__in_ecount_opt(Count) PULONG64 Bases, _In_reads_opt_(Count) PULONG64 Bases,
__in ULONG Start, _In_ ULONG Start,
__out_ecount(Count) PDEBUG_MODULE_PARAMETERS Params _Out_writes_(Count) PDEBUG_MODULE_PARAMETERS Params
) PURE; ) PURE;
// Looks up the module from a <Module>!<Symbol> // Looks up the module from a <Module>!<Symbol>
// string. // string.
STDMETHOD(GetSymbolModule)( STDMETHOD(GetSymbolModule)(
THIS_ THIS_
__in PCSTR Symbol, _In_ PCSTR Symbol,
__out PULONG64 Base _Out_ PULONG64 Base
) PURE; ) PURE;
// Returns the string name of a type. // Returns the string name of a type.
STDMETHOD(GetTypeName)( STDMETHOD(GetTypeName)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
// Returns the ID for a type name. // Returns the ID for a type name.
STDMETHOD(GetTypeId)( STDMETHOD(GetTypeId)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in PCSTR Name, _In_ PCSTR Name,
__out PULONG TypeId _Out_ PULONG TypeId
) PURE; ) PURE;
STDMETHOD(GetTypeSize)( STDMETHOD(GetTypeSize)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__out PULONG Size _Out_ PULONG Size
) PURE; ) PURE;
// Given a type which can contain members // Given a type which can contain members
// this method returns the offset of a // this method returns the offset of a
// particular member within the type. // particular member within the type.
// TypeId should give the container type ID // TypeId should give the container type ID
// and Field gives the dot-separated path // and Field gives the dot-separated path
// to the field of interest. // to the field of interest.
STDMETHOD(GetFieldOffset)( STDMETHOD(GetFieldOffset)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in PCSTR Field, _In_ PCSTR Field,
__out PULONG Offset _Out_ PULONG Offset
) PURE; ) PURE;
STDMETHOD(GetSymbolTypeId)( STDMETHOD(GetSymbolTypeId)(
THIS_ THIS_
__in PCSTR Symbol, _In_ PCSTR Symbol,
__out PULONG TypeId, _Out_ PULONG TypeId,
__out_opt PULONG64 Module _Out_opt_ PULONG64 Module
) PURE; ) PURE;
// As with GetOffsetByName a symbol's // As with GetOffsetByName a symbol's
// name may be ambiguous. GetOffsetTypeId // name may be ambiguous. GetOffsetTypeId
// returns the type for the symbol closest // returns the type for the symbol closest
// to the given offset and can be used // to the given offset and can be used
// to avoid ambiguity. // to avoid ambiguity.
STDMETHOD(GetOffsetTypeId)( STDMETHOD(GetOffsetTypeId)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG TypeId, _Out_ PULONG TypeId,
__out_opt PULONG64 Module _Out_opt_ PULONG64 Module
) PURE; ) PURE;
// Helpers for virtual and physical data // Helpers for virtual and physical data
// which combine creation of a location with // which combine creation of a location with
// the actual operation. // the actual operation.
STDMETHOD(ReadTypedDataVirtual)( STDMETHOD(ReadTypedDataVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteTypedDataVirtual)( STDMETHOD(WriteTypedDataVirtual)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(OutputTypedDataVirtual)( STDMETHOD(OutputTypedDataVirtual)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
STDMETHOD(ReadTypedDataPhysical)( STDMETHOD(ReadTypedDataPhysical)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__out_bcount(BufferSize) PVOID Buffer, _Out_writes_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesRead _Out_opt_ PULONG BytesRead
) PURE; ) PURE;
STDMETHOD(WriteTypedDataPhysical)( STDMETHOD(WriteTypedDataPhysical)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in_bcount(BufferSize) PVOID Buffer, _In_reads_bytes_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BytesWritten _Out_opt_ PULONG BytesWritten
) PURE; ) PURE;
STDMETHOD(OutputTypedDataPhysical)( STDMETHOD(OutputTypedDataPhysical)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
// Function arguments and scope block symbols // Function arguments and scope block symbols
// can be retrieved relative to currently // can be retrieved relative to currently
// executing code. A caller can provide just // executing code. A caller can provide just
// a code offset for scoping purposes and look // a code offset for scoping purposes and look
// up names or the caller can provide a full frame // up names or the caller can provide a full frame
// and look up actual values. The values for // and look up actual values. The values for
// scoped symbols are best-guess and may or may not // scoped symbols are best-guess and may or may not
// be accurate depending on program optimizations, // be accurate depending on program optimizations,
// the machine architecture, the current point // the machine architecture, the current point
// in the programs execution and so on. // in the programs execution and so on.
// A caller can also provide a complete register // A caller can also provide a complete register
// context for setting a scope to a previous // context for setting a scope to a previous
// machine state such as a context saved for // machine state such as a context saved for
// an exception. Usually this isnt necessary // an exception. Usually this isnt necessary
// and the current register context is used. // and the current register context is used.
STDMETHOD(GetScope)( STDMETHOD(GetScope)(
THIS_ THIS_
__out_opt PULONG64 InstructionOffset, _Out_opt_ PULONG64 InstructionOffset,
__out_opt PDEBUG_STACK_FRAME ScopeFrame, _Out_opt_ PDEBUG_STACK_FRAME ScopeFrame,
__out_bcount_opt(ScopeContextSize) PVOID ScopeContext, _Out_writes_bytes_opt_(ScopeContextSize) PVOID ScopeContext,
__in ULONG ScopeContextSize _In_ ULONG ScopeContextSize
) PURE; ) PURE;
// If ScopeFrame or ScopeContext is non-NULL then // If ScopeFrame or ScopeContext is non-NULL then
// InstructionOffset is ignored. // InstructionOffset is ignored.
// If ScopeContext is NULL the current // If ScopeContext is NULL the current
// register context is used. // register context is used.
// If the scope identified by the given // If the scope identified by the given
// information is the same as before // information is the same as before
// SetScope returns S_OK. If the scope // SetScope returns S_OK. If the scope
// information changes, such as when the // information changes, such as when the
// scope moves between functions or scope // scope moves between functions or scope
// blocks, SetScope returns S_FALSE. // blocks, SetScope returns S_FALSE.
STDMETHOD(SetScope)( STDMETHOD(SetScope)(
THIS_ THIS_
__in ULONG64 InstructionOffset, _In_ ULONG64 InstructionOffset,
__in_opt PDEBUG_STACK_FRAME ScopeFrame, _In_opt_ PDEBUG_STACK_FRAME ScopeFrame,
__in_bcount_opt(ScopeContextSize) PVOID ScopeContext, _In_reads_bytes_opt_(ScopeContextSize) PVOID ScopeContext,
__in ULONG ScopeContextSize _In_ ULONG ScopeContextSize
) PURE; ) PURE;
// ResetScope clears the scope information // ResetScope clears the scope information
// for situations where scoped symbols // for situations where scoped symbols
// mask global symbols or when resetting // mask global symbols or when resetting
// from explicit information to the current // from explicit information to the current
// information. // information.
STDMETHOD(ResetScope)( STDMETHOD(ResetScope)(
THIS THIS
) PURE; ) PURE;
// A scope symbol is tied to its particular // A scope symbol is tied to its particular
// scope and only is meaningful within the scope. // scope and only is meaningful within the scope.
// The returned group can be updated by passing it back // The returned group can be updated by passing it back
// into the method for lower-cost // into the method for lower-cost
// incremental updates when stepping. // incremental updates when stepping.
STDMETHOD(GetScopeSymbolGroup)( STDMETHOD(GetScopeSymbolGroup)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in_opt PDEBUG_SYMBOL_GROUP Update, _In_opt_ PDEBUG_SYMBOL_GROUP Update,
__out PDEBUG_SYMBOL_GROUP* Symbols _Out_ PDEBUG_SYMBOL_GROUP* Symbols
) PURE; ) PURE;
// Create a new symbol group. // Create a new symbol group.
STDMETHOD(CreateSymbolGroup)( STDMETHOD(CreateSymbolGroup)(
THIS_ THIS_
__out PDEBUG_SYMBOL_GROUP* Group _Out_ PDEBUG_SYMBOL_GROUP* Group
) PURE; ) PURE;
// StartSymbolMatch matches symbol names // StartSymbolMatch matches symbol names
// against the given pattern using simple // against the given pattern using simple
// regular expressions. The search results // regular expressions. The search results
// are iterated through using GetNextSymbolMatch. // are iterated through using GetNextSymbolMatch.
// When the caller is done examining results // When the caller is done examining results
// the match should be freed via EndSymbolMatch. // the match should be freed via EndSymbolMatch.
// If the match pattern contains a module name // If the match pattern contains a module name
// the search is restricted to a single module. // the search is restricted to a single module.
// Pattern matching is only done on symbol names, // Pattern matching is only done on symbol names,
// not module names. // not module names.
// All active symbol match handles are invalidated // All active symbol match handles are invalidated
// when the set of loaded symbols changes. // when the set of loaded symbols changes.
STDMETHOD(StartSymbolMatch)( STDMETHOD(StartSymbolMatch)(
THIS_ THIS_
__in PCSTR Pattern, _In_ PCSTR Pattern,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
// If Buffer is NULL the match does not // If Buffer is NULL the match does not
// advance. // advance.
STDMETHOD(GetNextSymbolMatch)( STDMETHOD(GetNextSymbolMatch)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG MatchSize, _Out_opt_ PULONG MatchSize,
__out_opt PULONG64 Offset _Out_opt_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(EndSymbolMatch)( STDMETHOD(EndSymbolMatch)(
THIS_ THIS_
__in ULONG64 Handle _In_ ULONG64 Handle
) PURE; ) PURE;
STDMETHOD(Reload)( STDMETHOD(Reload)(
THIS_ THIS_
__in PCSTR Module _In_ PCSTR Module
) PURE; ) PURE;
STDMETHOD(GetSymbolPath)( STDMETHOD(GetSymbolPath)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PathSize _Out_opt_ PULONG PathSize
) PURE; ) PURE;
STDMETHOD(SetSymbolPath)( STDMETHOD(SetSymbolPath)(
THIS_ THIS_
__in PCSTR Path _In_ PCSTR Path
) PURE; ) PURE;
STDMETHOD(AppendSymbolPath)( STDMETHOD(AppendSymbolPath)(
THIS_ THIS_
__in PCSTR Addition _In_ PCSTR Addition
) PURE; ) PURE;
// Manipulate the path for executable images. // Manipulate the path for executable images.
// Some dump files need to load executable images // Some dump files need to load executable images
// in order to resolve dump information. This // in order to resolve dump information. This
// path controls where the engine looks for // path controls where the engine looks for
// images. // images.
STDMETHOD(GetImagePath)( STDMETHOD(GetImagePath)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PathSize _Out_opt_ PULONG PathSize
) PURE; ) PURE;
STDMETHOD(SetImagePath)( STDMETHOD(SetImagePath)(
THIS_ THIS_
__in PCSTR Path _In_ PCSTR Path
) PURE; ) PURE;
STDMETHOD(AppendImagePath)( STDMETHOD(AppendImagePath)(
THIS_ THIS_
__in PCSTR Addition _In_ PCSTR Addition
) PURE; ) PURE;
// Path routines for source file location // Path routines for source file location
// methods. // methods.
STDMETHOD(GetSourcePath)( STDMETHOD(GetSourcePath)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PathSize _Out_opt_ PULONG PathSize
) PURE; ) PURE;
// Gets the nth part of the source path. // Gets the nth part of the source path.
STDMETHOD(GetSourcePathElement)( STDMETHOD(GetSourcePathElement)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ElementSize _Out_opt_ PULONG ElementSize
) PURE; ) PURE;
STDMETHOD(SetSourcePath)( STDMETHOD(SetSourcePath)(
THIS_ THIS_
__in PCSTR Path _In_ PCSTR Path
) PURE; ) PURE;
STDMETHOD(AppendSourcePath)( STDMETHOD(AppendSourcePath)(
THIS_ THIS_
__in PCSTR Addition _In_ PCSTR Addition
) PURE; ) PURE;
// Uses the given file path and the source path // Uses the given file path and the source path
// information to try and locate an existing file. // information to try and locate an existing file.
// The given file path is merged with elements // The given file path is merged with elements
// of the source path and checked for existence. // of the source path and checked for existence.
// If a match is found the element used is returned. // If a match is found the element used is returned.
// A starting element can be specified to restrict // A starting element can be specified to restrict
// the search to a subset of the path elements; // the search to a subset of the path elements;
// this can be useful when checking for multiple // this can be useful when checking for multiple
// matches along the source path. // matches along the source path.
// The returned element can be 1, indicating // The returned element can be 1, indicating
// the file was found directly and not on the path. // the file was found directly and not on the path.
STDMETHOD(FindSourceFile)( STDMETHOD(FindSourceFile)(
THIS_ THIS_
__in ULONG StartElement, _In_ ULONG StartElement,
__in PCSTR File, _In_ PCSTR File,
__in ULONG Flags, _In_ ULONG Flags,
__out_opt PULONG FoundElement, _Out_opt_ PULONG FoundElement,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG FoundSize _Out_opt_ PULONG FoundSize
) PURE; ) PURE;
// Retrieves all the line offset information // Retrieves all the line offset information
// for a particular source file. Buffer is // for a particular source file. Buffer is
// first intialized to DEBUG_INVALID_OFFSET for // first intialized to DEBUG_INVALID_OFFSET for
// every entry. Then for each piece of line // every entry. Then for each piece of line
// symbol information Buffer[Line] set to // symbol information Buffer[Line] set to
// Lines offset. This produces a per-line // Lines offset. This produces a per-line
// map of the offsets for the lines of the // map of the offsets for the lines of the
// given file. Line numbers are decremented // given file. Line numbers are decremented
// for the map so Buffer[0] contains the offset // for the map so Buffer[0] contains the offset
// for line number 1. // for line number 1.
// If there is no line information at all for // If there is no line information at all for
// the given file the method fails rather // the given file the method fails rather
// than returning a map of invalid offsets. // than returning a map of invalid offsets.
STDMETHOD(GetSourceFileLineOffsets)( STDMETHOD(GetSourceFileLineOffsets)(
THIS_ THIS_
__in PCSTR File, _In_ PCSTR File,
__out_ecount_opt(BufferLines) PULONG64 Buffer, _Out_writes_opt_(BufferLines) PULONG64 Buffer,
__in ULONG BufferLines, _In_ ULONG BufferLines,
__out_opt PULONG FileLines _Out_opt_ PULONG FileLines
) PURE; ) PURE;
// IDebugSymbols2. // IDebugSymbols2.
// If Index is DEBUG_ANY_ID the base address // If Index is DEBUG_ANY_ID the base address
// is used to look up the module instead. // is used to look up the module instead.
// Item is specified as in VerQueryValue. // Item is specified as in VerQueryValue.
// Module version information is only // Module version information is only
// available for loaded modules and may // available for loaded modules and may
// not be available in all debug sessions. // not be available in all debug sessions.
STDMETHOD(GetModuleVersionInformation)( STDMETHOD(GetModuleVersionInformation)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in ULONG64 Base, _In_ ULONG64 Base,
__in PCSTR Item, _In_ PCSTR Item,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG VerInfoSize _Out_opt_ PULONG VerInfoSize
) PURE; ) PURE;
// Retrieves any available module name string // Retrieves any available module name string
// such as module name or symbol file name. // such as module name or symbol file name.
// If Index is DEBUG_ANY_ID the base address // If Index is DEBUG_ANY_ID the base address
// is used to look up the module instead. // is used to look up the module instead.
// If symbols are deferred an error will // If symbols are deferred an error will
// be returned. // be returned.
// E_NOINTERFACE may be returned, indicating // E_NOINTERFACE may be returned, indicating
// no information exists. // no information exists.
STDMETHOD(GetModuleNameString)( STDMETHOD(GetModuleNameString)(
THIS_ THIS_
__in ULONG Which, _In_ ULONG Which,
__in ULONG Index, _In_ ULONG Index,
__in ULONG64 Base, _In_ ULONG64 Base,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
// Returns the string name of a constant type. // Returns the string name of a constant type.
STDMETHOD(GetConstantName)( STDMETHOD(GetConstantName)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in ULONG64 Value, _In_ ULONG64 Value,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
// Gets name of a field in a struct // Gets name of a field in a struct
// FieldNumber is 0 based index of field in a struct // FieldNumber is 0 based index of field in a struct
STDMETHOD(GetFieldName)( STDMETHOD(GetFieldName)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in ULONG FieldIndex, _In_ ULONG FieldIndex,
__out_ecount_opt(NameBufferSize) PSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
// Control options for typed values. // Control options for typed values.
STDMETHOD(GetTypeOptions)( STDMETHOD(GetTypeOptions)(
THIS_ THIS_
__out PULONG Options _Out_ PULONG Options
) PURE; ) PURE;
STDMETHOD(AddTypeOptions)( STDMETHOD(AddTypeOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(RemoveTypeOptions)( STDMETHOD(RemoveTypeOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
STDMETHOD(SetTypeOptions)( STDMETHOD(SetTypeOptions)(
THIS_ THIS_
__in ULONG Options _In_ ULONG Options
) PURE; ) PURE;
// IDebugSymbols3. // IDebugSymbols3.
STDMETHOD(GetNameByOffsetWide)( STDMETHOD(GetNameByOffsetWide)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_ecount_opt(NameBufferSize) PWSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PULONG64 Displacement _Out_opt_ PULONG64 Displacement
) PURE; ) PURE;
STDMETHOD(GetOffsetByNameWide)( STDMETHOD(GetOffsetByNameWide)(
THIS_ THIS_
__in PCWSTR Symbol, _In_ PCWSTR Symbol,
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(GetNearNameByOffsetWide)( STDMETHOD(GetNearNameByOffsetWide)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in LONG Delta, _In_ LONG Delta,
__out_ecount_opt(NameBufferSize) PWSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize, _Out_opt_ PULONG NameSize,
__out_opt PULONG64 Displacement _Out_opt_ PULONG64 Displacement
) PURE; ) PURE;
STDMETHOD(GetLineByOffsetWide)( STDMETHOD(GetLineByOffsetWide)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out_opt PULONG Line, _Out_opt_ PULONG Line,
__out_ecount_opt(FileBufferSize) PWSTR FileBuffer, _Out_writes_opt_(FileBufferSize) PWSTR FileBuffer,
__in ULONG FileBufferSize, _In_ ULONG FileBufferSize,
__out_opt PULONG FileSize, _Out_opt_ PULONG FileSize,
__out_opt PULONG64 Displacement _Out_opt_ PULONG64 Displacement
) PURE; ) PURE;
STDMETHOD(GetOffsetByLineWide)( STDMETHOD(GetOffsetByLineWide)(
THIS_ THIS_
__in ULONG Line, _In_ ULONG Line,
__in PCWSTR File, _In_ PCWSTR File,
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(GetModuleByModuleNameWide)( STDMETHOD(GetModuleByModuleNameWide)(
THIS_ THIS_
__in PCWSTR Name, _In_ PCWSTR Name,
__in ULONG StartIndex, _In_ ULONG StartIndex,
__out_opt PULONG Index, _Out_opt_ PULONG Index,
__out_opt PULONG64 Base _Out_opt_ PULONG64 Base
) PURE; ) PURE;
STDMETHOD(GetSymbolModuleWide)( STDMETHOD(GetSymbolModuleWide)(
THIS_ THIS_
__in PCWSTR Symbol, _In_ PCWSTR Symbol,
__out PULONG64 Base _Out_ PULONG64 Base
) PURE; ) PURE;
STDMETHOD(GetTypeNameWide)( STDMETHOD(GetTypeNameWide)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__out_ecount_opt(NameBufferSize) PWSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
// Returns the ID for a type name. // Returns the ID for a type name.
STDMETHOD(GetTypeIdWide)( STDMETHOD(GetTypeIdWide)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in PCWSTR Name, _In_ PCWSTR Name,
__out PULONG TypeId _Out_ PULONG TypeId
) PURE; ) PURE;
STDMETHOD(GetFieldOffsetWide)( STDMETHOD(GetFieldOffsetWide)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in PCWSTR Field, _In_ PCWSTR Field,
__out PULONG Offset _Out_ PULONG Offset
) PURE; ) PURE;
STDMETHOD(GetSymbolTypeIdWide)( STDMETHOD(GetSymbolTypeIdWide)(
THIS_ THIS_
__in PCWSTR Symbol, _In_ PCWSTR Symbol,
__out PULONG TypeId, _Out_ PULONG TypeId,
__out_opt PULONG64 Module _Out_opt_ PULONG64 Module
) PURE; ) PURE;
STDMETHOD(GetScopeSymbolGroup2)( STDMETHOD(GetScopeSymbolGroup2)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in_opt PDEBUG_SYMBOL_GROUP2 Update, _In_opt_ PDEBUG_SYMBOL_GROUP2 Update,
__out PDEBUG_SYMBOL_GROUP2* Symbols _Out_ PDEBUG_SYMBOL_GROUP2* Symbols
) PURE; ) PURE;
STDMETHOD(CreateSymbolGroup2)( STDMETHOD(CreateSymbolGroup2)(
THIS_ THIS_
__out PDEBUG_SYMBOL_GROUP2* Group _Out_ PDEBUG_SYMBOL_GROUP2* Group
) PURE; ) PURE;
STDMETHOD(StartSymbolMatchWide)( STDMETHOD(StartSymbolMatchWide)(
THIS_ THIS_
__in PCWSTR Pattern, _In_ PCWSTR Pattern,
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
STDMETHOD(GetNextSymbolMatchWide)( STDMETHOD(GetNextSymbolMatchWide)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG MatchSize, _Out_opt_ PULONG MatchSize,
__out_opt PULONG64 Offset _Out_opt_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(ReloadWide)( STDMETHOD(ReloadWide)(
THIS_ THIS_
__in PCWSTR Module _In_ PCWSTR Module
) PURE; ) PURE;
STDMETHOD(GetSymbolPathWide)( STDMETHOD(GetSymbolPathWide)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PathSize _Out_opt_ PULONG PathSize
) PURE; ) PURE;
STDMETHOD(SetSymbolPathWide)( STDMETHOD(SetSymbolPathWide)(
THIS_ THIS_
__in PCWSTR Path _In_ PCWSTR Path
) PURE; ) PURE;
STDMETHOD(AppendSymbolPathWide)( STDMETHOD(AppendSymbolPathWide)(
THIS_ THIS_
__in PCWSTR Addition _In_ PCWSTR Addition
) PURE; ) PURE;
STDMETHOD(GetImagePathWide)( STDMETHOD(GetImagePathWide)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PathSize _Out_opt_ PULONG PathSize
) PURE; ) PURE;
STDMETHOD(SetImagePathWide)( STDMETHOD(SetImagePathWide)(
THIS_ THIS_
__in PCWSTR Path _In_ PCWSTR Path
) PURE; ) PURE;
STDMETHOD(AppendImagePathWide)( STDMETHOD(AppendImagePathWide)(
THIS_ THIS_
__in PCWSTR Addition _In_ PCWSTR Addition
) PURE; ) PURE;
STDMETHOD(GetSourcePathWide)( STDMETHOD(GetSourcePathWide)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG PathSize _Out_opt_ PULONG PathSize
) PURE; ) PURE;
STDMETHOD(GetSourcePathElementWide)( STDMETHOD(GetSourcePathElementWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ElementSize _Out_opt_ PULONG ElementSize
) PURE; ) PURE;
STDMETHOD(SetSourcePathWide)( STDMETHOD(SetSourcePathWide)(
THIS_ THIS_
__in PCWSTR Path _In_ PCWSTR Path
) PURE; ) PURE;
STDMETHOD(AppendSourcePathWide)( STDMETHOD(AppendSourcePathWide)(
THIS_ THIS_
__in PCWSTR Addition _In_ PCWSTR Addition
) PURE; ) PURE;
STDMETHOD(FindSourceFileWide)( STDMETHOD(FindSourceFileWide)(
THIS_ THIS_
__in ULONG StartElement, _In_ ULONG StartElement,
__in PCWSTR File, _In_ PCWSTR File,
__in ULONG Flags, _In_ ULONG Flags,
__out_opt PULONG FoundElement, _Out_opt_ PULONG FoundElement,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG FoundSize _Out_opt_ PULONG FoundSize
) PURE; ) PURE;
STDMETHOD(GetSourceFileLineOffsetsWide)( STDMETHOD(GetSourceFileLineOffsetsWide)(
THIS_ THIS_
__in PCWSTR File, _In_ PCWSTR File,
__out_ecount_opt(BufferLines) PULONG64 Buffer, _Out_writes_opt_(BufferLines) PULONG64 Buffer,
__in ULONG BufferLines, _In_ ULONG BufferLines,
__out_opt PULONG FileLines _Out_opt_ PULONG FileLines
) PURE; ) PURE;
STDMETHOD(GetModuleVersionInformationWide)( STDMETHOD(GetModuleVersionInformationWide)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in ULONG64 Base, _In_ ULONG64 Base,
__in PCWSTR Item, _In_ PCWSTR Item,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG VerInfoSize _Out_opt_ PULONG VerInfoSize
) PURE; ) PURE;
STDMETHOD(GetModuleNameStringWide)( STDMETHOD(GetModuleNameStringWide)(
THIS_ THIS_
__in ULONG Which, _In_ ULONG Which,
__in ULONG Index, _In_ ULONG Index,
__in ULONG64 Base, _In_ ULONG64 Base,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
STDMETHOD(GetConstantNameWide)( STDMETHOD(GetConstantNameWide)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in ULONG64 Value, _In_ ULONG64 Value,
__out_ecount_opt(NameBufferSize) PWSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
STDMETHOD(GetFieldNameWide)( STDMETHOD(GetFieldNameWide)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG TypeId, _In_ ULONG TypeId,
__in ULONG FieldIndex, _In_ ULONG FieldIndex,
__out_ecount_opt(NameBufferSize) PWSTR NameBuffer, _Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
__in ULONG NameBufferSize, _In_ ULONG NameBufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
// Returns S_OK if the engine is using managed // Returns S_OK if the engine is using managed
// debugging support when retriving information // debugging support when retriving information
// for the given module. This can be expensive // for the given module. This can be expensive
// to check. // to check.
STDMETHOD(IsManagedModule)( STDMETHOD(IsManagedModule)(
THIS_ THIS_
__in ULONG Index, _In_ ULONG Index,
__in ULONG64 Base _In_ ULONG64 Base
) PURE; ) PURE;
// The module name may not be unique. // The module name may not be unique.
// This method returns the first match. // This method returns the first match.
STDMETHOD(GetModuleByModuleName2)( STDMETHOD(GetModuleByModuleName2)(
THIS_ THIS_
__in PCSTR Name, _In_ PCSTR Name,
__in ULONG StartIndex, _In_ ULONG StartIndex,
__in ULONG Flags, _In_ ULONG Flags,
__out_opt PULONG Index, _Out_opt_ PULONG Index,
__out_opt PULONG64 Base _Out_opt_ PULONG64 Base
) PURE; ) PURE;
STDMETHOD(GetModuleByModuleName2Wide)( STDMETHOD(GetModuleByModuleName2Wide)(
THIS_ THIS_
__in PCWSTR Name, _In_ PCWSTR Name,
__in ULONG StartIndex, _In_ ULONG StartIndex,
__in ULONG Flags, _In_ ULONG Flags,
__out_opt PULONG Index, _Out_opt_ PULONG Index,
__out_opt PULONG64 Base _Out_opt_ PULONG64 Base
) PURE; ) PURE;
// Offset can be any offset within // Offset can be any offset within
// the module extent. Extents may // the module extent. Extents may
// not be unique when including unloaded // not be unique when including unloaded
// drivers. This method returns the // drivers. This method returns the
// first match. // first match.
STDMETHOD(GetModuleByOffset2)( STDMETHOD(GetModuleByOffset2)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG StartIndex, _In_ ULONG StartIndex,
__in ULONG Flags, _In_ ULONG Flags,
__out_opt PULONG Index, _Out_opt_ PULONG Index,
__out_opt PULONG64 Base _Out_opt_ PULONG64 Base
) PURE; ) PURE;
// A caller can create artificial loaded modules in // A caller can create artificial loaded modules in
// the engine's module list if desired. // the engine's module list if desired.
// These modules only serve as names for // These modules only serve as names for
// a region of addresses. They cannot have // a region of addresses. They cannot have
// real symbols loaded for them; if that // real symbols loaded for them; if that
// is desired Reload can be used with explicit // is desired Reload can be used with explicit
// parameters to create a true module entry. // parameters to create a true module entry.
// The region must not be in use by any other // The region must not be in use by any other
// module. // module.
// A general reload will discard any synthetic modules. // A general reload will discard any synthetic modules.
STDMETHOD(AddSyntheticModule)( STDMETHOD(AddSyntheticModule)(
THIS_ THIS_
__in ULONG64 Base, _In_ ULONG64 Base,
__in ULONG Size, _In_ ULONG Size,
__in PCSTR ImagePath, _In_ PCSTR ImagePath,
__in PCSTR ModuleName, _In_ PCSTR ModuleName,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
STDMETHOD(AddSyntheticModuleWide)( STDMETHOD(AddSyntheticModuleWide)(
THIS_ THIS_
__in ULONG64 Base, _In_ ULONG64 Base,
__in ULONG Size, _In_ ULONG Size,
__in PCWSTR ImagePath, _In_ PCWSTR ImagePath,
__in PCWSTR ModuleName, _In_ PCWSTR ModuleName,
__in ULONG Flags _In_ ULONG Flags
) PURE; ) PURE;
STDMETHOD(RemoveSyntheticModule)( STDMETHOD(RemoveSyntheticModule)(
THIS_ THIS_
__in ULONG64 Base _In_ ULONG64 Base
) PURE; ) PURE;
// Modify the current frame used for scoping. // Modify the current frame used for scoping.
// This is equivalent to the '.frame' command. // This is equivalent to the '.frame' command.
STDMETHOD(GetCurrentScopeFrameIndex)( STDMETHOD(GetCurrentScopeFrameIndex)(
THIS_ THIS_
__out PULONG Index _Out_ PULONG Index
) PURE; ) PURE;
STDMETHOD(SetScopeFrameByIndex)( STDMETHOD(SetScopeFrameByIndex)(
THIS_ THIS_
__in ULONG Index _In_ ULONG Index
) PURE; ) PURE;
// Recovers JIT_DEBUG_INFO information at the given // Recovers JIT_DEBUG_INFO information at the given
// address from the debuggee and sets current // address from the debuggee and sets current
// debugger scope context from it. // debugger scope context from it.
// Equivalent to '.jdinfo' command. // Equivalent to '.jdinfo' command.
STDMETHOD(SetScopeFromJitDebugInfo)( STDMETHOD(SetScopeFromJitDebugInfo)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG64 InfoOffset _In_ ULONG64 InfoOffset
) PURE; ) PURE;
// Switches the current debugger scope to // Switches the current debugger scope to
// the stored event information. // the stored event information.
// Equivalent to the '.ecxr' command. // Equivalent to the '.ecxr' command.
STDMETHOD(SetScopeFromStoredEvent)( STDMETHOD(SetScopeFromStoredEvent)(
THIS THIS
) PURE; ) PURE;
// Takes the first symbol hit and outputs it. // Takes the first symbol hit and outputs it.
// Controlled with DEBUG_OUTSYM_* flags. // Controlled with DEBUG_OUTSYM_* flags.
STDMETHOD(OutputSymbolByOffset)( STDMETHOD(OutputSymbolByOffset)(
THIS_ THIS_
__in ULONG OutputControl, _In_ ULONG OutputControl,
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG64 Offset _In_ ULONG64 Offset
) PURE; ) PURE;
// Function entry information for a particular // Function entry information for a particular
// piece of code can be retrieved by this method. // piece of code can be retrieved by this method.
// The actual data returned is system-dependent. // The actual data returned is system-dependent.
STDMETHOD(GetFunctionEntryByOffset)( STDMETHOD(GetFunctionEntryByOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out_bcount_opt(BufferSize) PVOID Buffer, _Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG BufferNeeded _Out_opt_ PULONG BufferNeeded
) PURE; ) PURE;
// Given a type which can contain members // Given a type which can contain members
// this method returns the type ID and offset of a // this method returns the type ID and offset of a
// particular member within the type. // particular member within the type.
// Field gives the dot-separated path // Field gives the dot-separated path
// to the field of interest. // to the field of interest.
STDMETHOD(GetFieldTypeAndOffset)( STDMETHOD(GetFieldTypeAndOffset)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG ContainerTypeId, _In_ ULONG ContainerTypeId,
__in PCSTR Field, _In_ PCSTR Field,
__out_opt PULONG FieldTypeId, _Out_opt_ PULONG FieldTypeId,
__out_opt PULONG Offset _Out_opt_ PULONG Offset
) PURE; ) PURE;
STDMETHOD(GetFieldTypeAndOffsetWide)( STDMETHOD(GetFieldTypeAndOffsetWide)(
THIS_ THIS_
__in ULONG64 Module, _In_ ULONG64 Module,
__in ULONG ContainerTypeId, _In_ ULONG ContainerTypeId,
__in PCWSTR Field, _In_ PCWSTR Field,
__out_opt PULONG FieldTypeId, _Out_opt_ PULONG FieldTypeId,
__out_opt PULONG Offset _Out_opt_ PULONG Offset
) PURE; ) PURE;
// Artificial symbols can be created in any // Artificial symbols can be created in any
// existing module as a way to name an address. // existing module as a way to name an address.
// The address must not already have symbol // The address must not already have symbol
// information. // information.
// A reload will discard synthetic symbols // A reload will discard synthetic symbols
// for all address regions reloaded. // for all address regions reloaded.
STDMETHOD(AddSyntheticSymbol)( STDMETHOD(AddSyntheticSymbol)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Size, _In_ ULONG Size,
__in PCSTR Name, _In_ PCSTR Name,
__in ULONG Flags, _In_ ULONG Flags,
__out_opt PDEBUG_MODULE_AND_ID Id _Out_opt_ PDEBUG_MODULE_AND_ID Id
) PURE; ) PURE;
STDMETHOD(AddSyntheticSymbolWide)( STDMETHOD(AddSyntheticSymbolWide)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Size, _In_ ULONG Size,
__in PCWSTR Name, _In_ PCWSTR Name,
__in ULONG Flags, _In_ ULONG Flags,
__out_opt PDEBUG_MODULE_AND_ID Id _Out_opt_ PDEBUG_MODULE_AND_ID Id
) PURE; ) PURE;
STDMETHOD(RemoveSyntheticSymbol)( STDMETHOD(RemoveSyntheticSymbol)(
THIS_ THIS_
__in PDEBUG_MODULE_AND_ID Id _In_ PDEBUG_MODULE_AND_ID Id
) PURE; ) PURE;
// The following methods can return multiple // The following methods can return multiple
// hits for symbol lookups to allow for all // hits for symbol lookups to allow for all
// possible hits to be returned. // possible hits to be returned.
STDMETHOD(GetSymbolEntriesByOffset)( STDMETHOD(GetSymbolEntriesByOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(IdsCount) PDEBUG_MODULE_AND_ID Ids, _Out_writes_opt_(IdsCount) PDEBUG_MODULE_AND_ID Ids,
__out_ecount_opt(IdsCount) PULONG64 Displacements, _Out_writes_opt_(IdsCount) PULONG64 Displacements,
__in ULONG IdsCount, _In_ ULONG IdsCount,
__out_opt PULONG Entries _Out_opt_ PULONG Entries
) PURE; ) PURE;
STDMETHOD(GetSymbolEntriesByName)( STDMETHOD(GetSymbolEntriesByName)(
THIS_ THIS_
__in PCSTR Symbol, _In_ PCSTR Symbol,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(IdsCount) PDEBUG_MODULE_AND_ID Ids, _Out_writes_opt_(IdsCount) PDEBUG_MODULE_AND_ID Ids,
__in ULONG IdsCount, _In_ ULONG IdsCount,
__out_opt PULONG Entries _Out_opt_ PULONG Entries
) PURE; ) PURE;
STDMETHOD(GetSymbolEntriesByNameWide)( STDMETHOD(GetSymbolEntriesByNameWide)(
THIS_ THIS_
__in PCWSTR Symbol, _In_ PCWSTR Symbol,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(IdsCount) PDEBUG_MODULE_AND_ID Ids, _Out_writes_opt_(IdsCount) PDEBUG_MODULE_AND_ID Ids,
__in ULONG IdsCount, _In_ ULONG IdsCount,
__out_opt PULONG Entries _Out_opt_ PULONG Entries
) PURE; ) PURE;
// Symbol lookup by managed metadata token. // Symbol lookup by managed metadata token.
STDMETHOD(GetSymbolEntryByToken)( STDMETHOD(GetSymbolEntryByToken)(
THIS_ THIS_
__in ULONG64 ModuleBase, _In_ ULONG64 ModuleBase,
__in ULONG Token, _In_ ULONG Token,
__out PDEBUG_MODULE_AND_ID Id _Out_ PDEBUG_MODULE_AND_ID Id
) PURE; ) PURE;
// Retrieves full symbol entry information from an ID. // Retrieves full symbol entry information from an ID.
STDMETHOD(GetSymbolEntryInformation)( STDMETHOD(GetSymbolEntryInformation)(
THIS_ THIS_
__in PDEBUG_MODULE_AND_ID Id, _In_ PDEBUG_MODULE_AND_ID Id,
__out PDEBUG_SYMBOL_ENTRY Info _Out_ PDEBUG_SYMBOL_ENTRY Info
) PURE; ) PURE;
STDMETHOD(GetSymbolEntryString)( STDMETHOD(GetSymbolEntryString)(
THIS_ THIS_
__in PDEBUG_MODULE_AND_ID Id, _In_ PDEBUG_MODULE_AND_ID Id,
__in ULONG Which, _In_ ULONG Which,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG StringSize _Out_opt_ PULONG StringSize
) PURE; ) PURE;
STDMETHOD(GetSymbolEntryStringWide)( STDMETHOD(GetSymbolEntryStringWide)(
THIS_ THIS_
__in PDEBUG_MODULE_AND_ID Id, _In_ PDEBUG_MODULE_AND_ID Id,
__in ULONG Which, _In_ ULONG Which,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG StringSize _Out_opt_ PULONG StringSize
) PURE; ) PURE;
// Returns all known memory regions associated // Returns all known memory regions associated
// with the given symbol. Simple symbols will // with the given symbol. Simple symbols will
// have a single region starting from their base. // have a single region starting from their base.
// More complicated regions, such as functions // More complicated regions, such as functions
// with multiple code areas, can have an arbitrarily // with multiple code areas, can have an arbitrarily
// large number of regions. // large number of regions.
// The quality of information returned is highly // The quality of information returned is highly
// dependent on the symbolic information availble. // dependent on the symbolic information availble.
STDMETHOD(GetSymbolEntryOffsetRegions)( STDMETHOD(GetSymbolEntryOffsetRegions)(
THIS_ THIS_
__in PDEBUG_MODULE_AND_ID Id, _In_ PDEBUG_MODULE_AND_ID Id,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(RegionsCount) PDEBUG_OFFSET_REGION Regions, _Out_writes_opt_(RegionsCount) PDEBUG_OFFSET_REGION Regions,
__in ULONG RegionsCount, _In_ ULONG RegionsCount,
__out_opt PULONG RegionsAvail _Out_opt_ PULONG RegionsAvail
) PURE; ) PURE;
// This method allows navigating within the // This method allows navigating within the
// symbol entry hierarchy. // symbol entry hierarchy.
STDMETHOD(GetSymbolEntryBySymbolEntry)( STDMETHOD(GetSymbolEntryBySymbolEntry)(
THIS_ THIS_
__in PDEBUG_MODULE_AND_ID FromId, _In_ PDEBUG_MODULE_AND_ID FromId,
__in ULONG Flags, _In_ ULONG Flags,
__out PDEBUG_MODULE_AND_ID ToId _Out_ PDEBUG_MODULE_AND_ID ToId
) PURE; ) PURE;
// The following methods can return multiple // The following methods can return multiple
// hits for source lookups to allow for all // hits for source lookups to allow for all
// possible hits to be returned. // possible hits to be returned.
STDMETHOD(GetSourceEntriesByOffset)( STDMETHOD(GetSourceEntriesByOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(EntriesCount) PDEBUG_SYMBOL_SOURCE_ENTRY Entries, _Out_writes_opt_(EntriesCount) PDEBUG_SYMBOL_SOURCE_ENTRY Entries,
__in ULONG EntriesCount, _In_ ULONG EntriesCount,
__out_opt PULONG EntriesAvail _Out_opt_ PULONG EntriesAvail
) PURE; ) PURE;
STDMETHOD(GetSourceEntriesByLine)( STDMETHOD(GetSourceEntriesByLine)(
THIS_ THIS_
__in ULONG Line, _In_ ULONG Line,
__in PCSTR File, _In_ PCSTR File,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(EntriesCount) PDEBUG_SYMBOL_SOURCE_ENTRY Entries, _Out_writes_opt_(EntriesCount) PDEBUG_SYMBOL_SOURCE_ENTRY Entries,
__in ULONG EntriesCount, _In_ ULONG EntriesCount,
__out_opt PULONG EntriesAvail _Out_opt_ PULONG EntriesAvail
) PURE; ) PURE;
STDMETHOD(GetSourceEntriesByLineWide)( STDMETHOD(GetSourceEntriesByLineWide)(
THIS_ THIS_
__in ULONG Line, _In_ ULONG Line,
__in PCWSTR File, _In_ PCWSTR File,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(EntriesCount) PDEBUG_SYMBOL_SOURCE_ENTRY Entries, _Out_writes_opt_(EntriesCount) PDEBUG_SYMBOL_SOURCE_ENTRY Entries,
__in ULONG EntriesCount, _In_ ULONG EntriesCount,
__out_opt PULONG EntriesAvail _Out_opt_ PULONG EntriesAvail
) PURE; ) PURE;
STDMETHOD(GetSourceEntryString)( STDMETHOD(GetSourceEntryString)(
THIS_ THIS_
__in PDEBUG_SYMBOL_SOURCE_ENTRY Entry, _In_ PDEBUG_SYMBOL_SOURCE_ENTRY Entry,
__in ULONG Which, _In_ ULONG Which,
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG StringSize _Out_opt_ PULONG StringSize
) PURE; ) PURE;
STDMETHOD(GetSourceEntryStringWide)( STDMETHOD(GetSourceEntryStringWide)(
THIS_ THIS_
__in PDEBUG_SYMBOL_SOURCE_ENTRY Entry, _In_ PDEBUG_SYMBOL_SOURCE_ENTRY Entry,
__in ULONG Which, _In_ ULONG Which,
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG StringSize _Out_opt_ PULONG StringSize
) PURE; ) PURE;
// Returns all known memory regions associated // Returns all known memory regions associated
// with the given source entry. As with // with the given source entry. As with
// GetSymbolEntryOffsetRegions the regions available // GetSymbolEntryOffsetRegions the regions available
// are variable. // are variable.
STDMETHOD(GetSourceEntryOffsetRegions)( STDMETHOD(GetSourceEntryOffsetRegions)(
THIS_ THIS_
__in PDEBUG_SYMBOL_SOURCE_ENTRY Entry, _In_ PDEBUG_SYMBOL_SOURCE_ENTRY Entry,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount_opt(RegionsCount) PDEBUG_OFFSET_REGION Regions, _Out_writes_opt_(RegionsCount) PDEBUG_OFFSET_REGION Regions,
__in ULONG RegionsCount, _In_ ULONG RegionsCount,
__out_opt PULONG RegionsAvail _Out_opt_ PULONG RegionsAvail
) PURE; ) PURE;
// This method allows navigating within the // This method allows navigating within the
// source entries. // source entries.
STDMETHOD(GetSourceEntryBySourceEntry)( STDMETHOD(GetSourceEntryBySourceEntry)(
THIS_ THIS_
__in PDEBUG_SYMBOL_SOURCE_ENTRY FromEntry, _In_ PDEBUG_SYMBOL_SOURCE_ENTRY FromEntry,
__in ULONG Flags, _In_ ULONG Flags,
__out PDEBUG_SYMBOL_SOURCE_ENTRY ToEntry _Out_ PDEBUG_SYMBOL_SOURCE_ENTRY ToEntry
) PURE;
};
#undef INTERFACE
#define INTERFACE IDebugSymbols4
DECLARE_INTERFACE_(IDebugSymbols4, IUnknown)
{
// IUnknown.
STDMETHOD(QueryInterface)(
THIS_
_In_ REFIID InterfaceId,
_Out_ PVOID* Interface
) PURE;
STDMETHOD_(ULONG, AddRef)(
THIS
) PURE;
STDMETHOD_(ULONG, Release)(
THIS
) PURE;
// IDebugSymbols.
// Controls the symbol options used during
// symbol operations.
// Uses the same flags as dbghelps SymSetOptions.
STDMETHOD(GetSymbolOptions)(
THIS_
_Out_ PULONG Options
) PURE;
STDMETHOD(AddSymbolOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(RemoveSymbolOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(SetSymbolOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(GetNameByOffset)(
THIS_
_In_ ULONG64 Offset,
_Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Displacement
) PURE;
// A symbol name may not be unique, particularly
// when overloaded functions exist which all
// have the same name. If GetOffsetByName
// finds multiple matches for the name it
// can return any one of them. In that
// case it will return S_FALSE to indicate
// that ambiguity was arbitrarily resolved.
// A caller can then use SearchSymbols to
// find all of the matches if it wishes to
// perform different disambiguation.
STDMETHOD(GetOffsetByName)(
THIS_
_In_ PCSTR Symbol,
_Out_ PULONG64 Offset
) PURE;
// GetNearNameByOffset returns symbols
// located near the symbol closest to
// to the offset, such as the previous
// or next symbol. If Delta is zero it
// operates identically to GetNameByOffset.
// If Delta is nonzero and such a symbol
// does not exist an error is returned.
// The next symbol, if one exists, will
// always have a higher offset than the
// input offset so the displacement is
// always negative. The situation is
// reversed for the previous symbol.
STDMETHOD(GetNearNameByOffset)(
THIS_
_In_ ULONG64 Offset,
_In_ LONG Delta,
_Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetLineByOffset)(
THIS_
_In_ ULONG64 Offset,
_Out_opt_ PULONG Line,
_Out_writes_opt_(FileBufferSize) PSTR FileBuffer,
_In_ ULONG FileBufferSize,
_Out_opt_ PULONG FileSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetOffsetByLine)(
THIS_
_In_ ULONG Line,
_In_ PCSTR File,
_Out_ PULONG64 Offset
) PURE;
// Enumerates the engines list of modules
// loaded for the current process. This may
// or may not match the system module list
// for the process. Reload can be used to
// synchronize the engines list with the system
// if necessary.
// Some sessions also track recently unloaded
// code modules for help in analyzing failures
// where an attempt is made to call unloaded code.
// These modules are indexed after the loaded
// modules.
STDMETHOD(GetNumberModules)(
THIS_
_Out_ PULONG Loaded,
_Out_ PULONG Unloaded
) PURE;
STDMETHOD(GetModuleByIndex)(
THIS_
_In_ ULONG Index,
_Out_ PULONG64 Base
) PURE;
// The module name may not be unique.
// This method returns the first match.
STDMETHOD(GetModuleByModuleName)(
THIS_
_In_ PCSTR Name,
_In_ ULONG StartIndex,
_Out_opt_ PULONG Index,
_Out_opt_ PULONG64 Base
) PURE;
// Offset can be any offset within
// the module extent. Extents may
// not be unique when including unloaded
// drivers. This method returns the
// first match.
STDMETHOD(GetModuleByOffset)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG StartIndex,
_Out_opt_ PULONG Index,
_Out_opt_ PULONG64 Base
) PURE;
// If Index is DEBUG_ANY_ID the base address
// is used to look up the module instead.
STDMETHOD(GetModuleNames)(
THIS_
_In_ ULONG Index,
_In_ ULONG64 Base,
_Out_writes_opt_(ImageNameBufferSize) PSTR ImageNameBuffer,
_In_ ULONG ImageNameBufferSize,
_Out_opt_ PULONG ImageNameSize,
_Out_writes_opt_(ModuleNameBufferSize) PSTR ModuleNameBuffer,
_In_ ULONG ModuleNameBufferSize,
_Out_opt_ PULONG ModuleNameSize,
_Out_writes_opt_(LoadedImageNameBufferSize) PSTR LoadedImageNameBuffer,
_In_ ULONG LoadedImageNameBufferSize,
_Out_opt_ PULONG LoadedImageNameSize
) PURE;
STDMETHOD(GetModuleParameters)(
THIS_
_In_ ULONG Count,
_In_reads_opt_(Count) PULONG64 Bases,
_In_ ULONG Start,
_Out_writes_(Count) PDEBUG_MODULE_PARAMETERS Params
) PURE;
// Looks up the module from a <Module>!<Symbol>
// string.
STDMETHOD(GetSymbolModule)(
THIS_
_In_ PCSTR Symbol,
_Out_ PULONG64 Base
) PURE;
// Returns the string name of a type.
STDMETHOD(GetTypeName)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize
) PURE;
// Returns the ID for a type name.
STDMETHOD(GetTypeId)(
THIS_
_In_ ULONG64 Module,
_In_ PCSTR Name,
_Out_ PULONG TypeId
) PURE;
STDMETHOD(GetTypeSize)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_Out_ PULONG Size
) PURE;
// Given a type which can contain members
// this method returns the offset of a
// particular member within the type.
// TypeId should give the container type ID
// and Field gives the dot-separated path
// to the field of interest.
STDMETHOD(GetFieldOffset)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ PCSTR Field,
_Out_ PULONG Offset
) PURE;
STDMETHOD(GetSymbolTypeId)(
THIS_
_In_ PCSTR Symbol,
_Out_ PULONG TypeId,
_Out_opt_ PULONG64 Module
) PURE;
// As with GetOffsetByName a symbol's
// name may be ambiguous. GetOffsetTypeId
// returns the type for the symbol closest
// to the given offset and can be used
// to avoid ambiguity.
STDMETHOD(GetOffsetTypeId)(
THIS_
_In_ ULONG64 Offset,
_Out_ PULONG TypeId,
_Out_opt_ PULONG64 Module
) PURE;
// Helpers for virtual and physical data
// which combine creation of a location with
// the actual operation.
STDMETHOD(ReadTypedDataVirtual)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_Out_writes_bytes_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG BytesRead
) PURE;
STDMETHOD(WriteTypedDataVirtual)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_reads_bytes_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG BytesWritten
) PURE;
STDMETHOD(OutputTypedDataVirtual)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG64 Offset,
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ ULONG Flags
) PURE;
STDMETHOD(ReadTypedDataPhysical)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_Out_writes_bytes_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG BytesRead
) PURE;
STDMETHOD(WriteTypedDataPhysical)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_reads_bytes_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG BytesWritten
) PURE;
STDMETHOD(OutputTypedDataPhysical)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG64 Offset,
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ ULONG Flags
) PURE;
// Function arguments and scope block symbols
// can be retrieved relative to currently
// executing code. A caller can provide just
// a code offset for scoping purposes and look
// up names or the caller can provide a full frame
// and look up actual values. The values for
// scoped symbols are best-guess and may or may not
// be accurate depending on program optimizations,
// the machine architecture, the current point
// in the programs execution and so on.
// A caller can also provide a complete register
// context for setting a scope to a previous
// machine state such as a context saved for
// an exception. Usually this isnt necessary
// and the current register context is used.
STDMETHOD(GetScope)(
THIS_
_Out_opt_ PULONG64 InstructionOffset,
_Out_opt_ PDEBUG_STACK_FRAME ScopeFrame,
_Out_writes_bytes_opt_(ScopeContextSize) PVOID ScopeContext,
_In_ ULONG ScopeContextSize
) PURE;
// If ScopeFrame or ScopeContext is non-NULL then
// InstructionOffset is ignored.
// If ScopeContext is NULL the current
// register context is used.
// If the scope identified by the given
// information is the same as before
// SetScope returns S_OK. If the scope
// information changes, such as when the
// scope moves between functions or scope
// blocks, SetScope returns S_FALSE.
STDMETHOD(SetScope)(
THIS_
_In_ ULONG64 InstructionOffset,
_In_opt_ PDEBUG_STACK_FRAME ScopeFrame,
_In_reads_bytes_opt_(ScopeContextSize) PVOID ScopeContext,
_In_ ULONG ScopeContextSize
) PURE;
// ResetScope clears the scope information
// for situations where scoped symbols
// mask global symbols or when resetting
// from explicit information to the current
// information.
STDMETHOD(ResetScope)(
THIS
) PURE;
// A scope symbol is tied to its particular
// scope and only is meaningful within the scope.
// The returned group can be updated by passing it back
// into the method for lower-cost
// incremental updates when stepping.
STDMETHOD(GetScopeSymbolGroup)(
THIS_
_In_ ULONG Flags,
_In_opt_ PDEBUG_SYMBOL_GROUP Update,
_Out_ PDEBUG_SYMBOL_GROUP* Symbols
) PURE;
// Create a new symbol group.
STDMETHOD(CreateSymbolGroup)(
THIS_
_Out_ PDEBUG_SYMBOL_GROUP* Group
) PURE;
// StartSymbolMatch matches symbol names
// against the given pattern using simple
// regular expressions. The search results
// are iterated through using GetNextSymbolMatch.
// When the caller is done examining results
// the match should be freed via EndSymbolMatch.
// If the match pattern contains a module name
// the search is restricted to a single module.
// Pattern matching is only done on symbol names,
// not module names.
// All active symbol match handles are invalidated
// when the set of loaded symbols changes.
STDMETHOD(StartSymbolMatch)(
THIS_
_In_ PCSTR Pattern,
_Out_ PULONG64 Handle
) PURE;
// If Buffer is NULL the match does not
// advance.
STDMETHOD(GetNextSymbolMatch)(
THIS_
_In_ ULONG64 Handle,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG MatchSize,
_Out_opt_ PULONG64 Offset
) PURE;
STDMETHOD(EndSymbolMatch)(
THIS_
_In_ ULONG64 Handle
) PURE;
STDMETHOD(Reload)(
THIS_
_In_ PCSTR Module
) PURE;
STDMETHOD(GetSymbolPath)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PathSize
) PURE;
STDMETHOD(SetSymbolPath)(
THIS_
_In_ PCSTR Path
) PURE;
STDMETHOD(AppendSymbolPath)(
THIS_
_In_ PCSTR Addition
) PURE;
// Manipulate the path for executable images.
// Some dump files need to load executable images
// in order to resolve dump information. This
// path controls where the engine looks for
// images.
STDMETHOD(GetImagePath)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PathSize
) PURE;
STDMETHOD(SetImagePath)(
THIS_
_In_ PCSTR Path
) PURE;
STDMETHOD(AppendImagePath)(
THIS_
_In_ PCSTR Addition
) PURE;
// Path routines for source file location
// methods.
STDMETHOD(GetSourcePath)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PathSize
) PURE;
// Gets the nth part of the source path.
STDMETHOD(GetSourcePathElement)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG ElementSize
) PURE;
STDMETHOD(SetSourcePath)(
THIS_
_In_ PCSTR Path
) PURE;
STDMETHOD(AppendSourcePath)(
THIS_
_In_ PCSTR Addition
) PURE;
// Uses the given file path and the source path
// information to try and locate an existing file.
// The given file path is merged with elements
// of the source path and checked for existence.
// If a match is found the element used is returned.
// A starting element can be specified to restrict
// the search to a subset of the path elements;
// this can be useful when checking for multiple
// matches along the source path.
// The returned element can be 1, indicating
// the file was found directly and not on the path.
STDMETHOD(FindSourceFile)(
THIS_
_In_ ULONG StartElement,
_In_ PCSTR File,
_In_ ULONG Flags,
_Out_opt_ PULONG FoundElement,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FoundSize
) PURE;
// Retrieves all the line offset information
// for a particular source file. Buffer is
// first intialized to DEBUG_INVALID_OFFSET for
// every entry. Then for each piece of line
// symbol information Buffer[Line] set to
// Lines offset. This produces a per-line
// map of the offsets for the lines of the
// given file. Line numbers are decremented
// for the map so Buffer[0] contains the offset
// for line number 1.
// If there is no line information at all for
// the given file the method fails rather
// than returning a map of invalid offsets.
STDMETHOD(GetSourceFileLineOffsets)(
THIS_
_In_ PCSTR File,
_Out_writes_opt_(BufferLines) PULONG64 Buffer,
_In_ ULONG BufferLines,
_Out_opt_ PULONG FileLines
) PURE;
// IDebugSymbols2.
// If Index is DEBUG_ANY_ID the base address
// is used to look up the module instead.
// Item is specified as in VerQueryValue.
// Module version information is only
// available for loaded modules and may
// not be available in all debug sessions.
STDMETHOD(GetModuleVersionInformation)(
THIS_
_In_ ULONG Index,
_In_ ULONG64 Base,
_In_ PCSTR Item,
_Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG VerInfoSize
) PURE;
// Retrieves any available module name string
// such as module name or symbol file name.
// If Index is DEBUG_ANY_ID the base address
// is used to look up the module instead.
// If symbols are deferred an error will
// be returned.
// E_NOINTERFACE may be returned, indicating
// no information exists.
STDMETHOD(GetModuleNameString)(
THIS_
_In_ ULONG Which,
_In_ ULONG Index,
_In_ ULONG64 Base,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG NameSize
) PURE;
// Returns the string name of a constant type.
STDMETHOD(GetConstantName)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ ULONG64 Value,
_Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize
) PURE;
// Gets name of a field in a struct
// FieldNumber is 0 based index of field in a struct
STDMETHOD(GetFieldName)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ ULONG FieldIndex,
_Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize
) PURE;
// Control options for typed values.
STDMETHOD(GetTypeOptions)(
THIS_
_Out_ PULONG Options
) PURE;
STDMETHOD(AddTypeOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(RemoveTypeOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(SetTypeOptions)(
THIS_
_In_ ULONG Options
) PURE;
// IDebugSymbols3.
STDMETHOD(GetNameByOffsetWide)(
THIS_
_In_ ULONG64 Offset,
_Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetOffsetByNameWide)(
THIS_
_In_ PCWSTR Symbol,
_Out_ PULONG64 Offset
) PURE;
STDMETHOD(GetNearNameByOffsetWide)(
THIS_
_In_ ULONG64 Offset,
_In_ LONG Delta,
_Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetLineByOffsetWide)(
THIS_
_In_ ULONG64 Offset,
_Out_opt_ PULONG Line,
_Out_writes_opt_(FileBufferSize) PWSTR FileBuffer,
_In_ ULONG FileBufferSize,
_Out_opt_ PULONG FileSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetOffsetByLineWide)(
THIS_
_In_ ULONG Line,
_In_ PCWSTR File,
_Out_ PULONG64 Offset
) PURE;
STDMETHOD(GetModuleByModuleNameWide)(
THIS_
_In_ PCWSTR Name,
_In_ ULONG StartIndex,
_Out_opt_ PULONG Index,
_Out_opt_ PULONG64 Base
) PURE;
STDMETHOD(GetSymbolModuleWide)(
THIS_
_In_ PCWSTR Symbol,
_Out_ PULONG64 Base
) PURE;
STDMETHOD(GetTypeNameWide)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize
) PURE;
// Returns the ID for a type name.
STDMETHOD(GetTypeIdWide)(
THIS_
_In_ ULONG64 Module,
_In_ PCWSTR Name,
_Out_ PULONG TypeId
) PURE;
STDMETHOD(GetFieldOffsetWide)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ PCWSTR Field,
_Out_ PULONG Offset
) PURE;
STDMETHOD(GetSymbolTypeIdWide)(
THIS_
_In_ PCWSTR Symbol,
_Out_ PULONG TypeId,
_Out_opt_ PULONG64 Module
) PURE;
STDMETHOD(GetScopeSymbolGroup2)(
THIS_
_In_ ULONG Flags,
_In_opt_ PDEBUG_SYMBOL_GROUP2 Update,
_Out_ PDEBUG_SYMBOL_GROUP2* Symbols
) PURE;
STDMETHOD(CreateSymbolGroup2)(
THIS_
_Out_ PDEBUG_SYMBOL_GROUP2* Group
) PURE;
STDMETHOD(StartSymbolMatchWide)(
THIS_
_In_ PCWSTR Pattern,
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(GetNextSymbolMatchWide)(
THIS_
_In_ ULONG64 Handle,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG MatchSize,
_Out_opt_ PULONG64 Offset
) PURE;
STDMETHOD(ReloadWide)(
THIS_
_In_ PCWSTR Module
) PURE;
STDMETHOD(GetSymbolPathWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PathSize
) PURE;
STDMETHOD(SetSymbolPathWide)(
THIS_
_In_ PCWSTR Path
) PURE;
STDMETHOD(AppendSymbolPathWide)(
THIS_
_In_ PCWSTR Addition
) PURE;
STDMETHOD(GetImagePathWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PathSize
) PURE;
STDMETHOD(SetImagePathWide)(
THIS_
_In_ PCWSTR Path
) PURE;
STDMETHOD(AppendImagePathWide)(
THIS_
_In_ PCWSTR Addition
) PURE;
STDMETHOD(GetSourcePathWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PathSize
) PURE;
STDMETHOD(GetSourcePathElementWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG ElementSize
) PURE;
STDMETHOD(SetSourcePathWide)(
THIS_
_In_ PCWSTR Path
) PURE;
STDMETHOD(AppendSourcePathWide)(
THIS_
_In_ PCWSTR Addition
) PURE;
STDMETHOD(FindSourceFileWide)(
THIS_
_In_ ULONG StartElement,
_In_ PCWSTR File,
_In_ ULONG Flags,
_Out_opt_ PULONG FoundElement,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FoundSize
) PURE;
STDMETHOD(GetSourceFileLineOffsetsWide)(
THIS_
_In_ PCWSTR File,
_Out_writes_opt_(BufferLines) PULONG64 Buffer,
_In_ ULONG BufferLines,
_Out_opt_ PULONG FileLines
) PURE;
STDMETHOD(GetModuleVersionInformationWide)(
THIS_
_In_ ULONG Index,
_In_ ULONG64 Base,
_In_ PCWSTR Item,
_Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG VerInfoSize
) PURE;
STDMETHOD(GetModuleNameStringWide)(
THIS_
_In_ ULONG Which,
_In_ ULONG Index,
_In_ ULONG64 Base,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG NameSize
) PURE;
STDMETHOD(GetConstantNameWide)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ ULONG64 Value,
_Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize
) PURE;
STDMETHOD(GetFieldNameWide)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ ULONG FieldIndex,
_Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize
) PURE;
// Returns S_OK if the engine is using managed
// debugging support when retriving information
// for the given module. This can be expensive
// to check.
STDMETHOD(IsManagedModule)(
THIS_
_In_ ULONG Index,
_In_ ULONG64 Base
) PURE;
// The module name may not be unique.
// This method returns the first match.
STDMETHOD(GetModuleByModuleName2)(
THIS_
_In_ PCSTR Name,
_In_ ULONG StartIndex,
_In_ ULONG Flags,
_Out_opt_ PULONG Index,
_Out_opt_ PULONG64 Base
) PURE;
STDMETHOD(GetModuleByModuleName2Wide)(
THIS_
_In_ PCWSTR Name,
_In_ ULONG StartIndex,
_In_ ULONG Flags,
_Out_opt_ PULONG Index,
_Out_opt_ PULONG64 Base
) PURE;
// Offset can be any offset within
// the module extent. Extents may
// not be unique when including unloaded
// drivers. This method returns the
// first match.
STDMETHOD(GetModuleByOffset2)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG StartIndex,
_In_ ULONG Flags,
_Out_opt_ PULONG Index,
_Out_opt_ PULONG64 Base
) PURE;
// A caller can create artificial loaded modules in
// the engine's module list if desired.
// These modules only serve as names for
// a region of addresses. They cannot have
// real symbols loaded for them; if that
// is desired Reload can be used with explicit
// parameters to create a true module entry.
// The region must not be in use by any other
// module.
// A general reload will discard any synthetic modules.
STDMETHOD(AddSyntheticModule)(
THIS_
_In_ ULONG64 Base,
_In_ ULONG Size,
_In_ PCSTR ImagePath,
_In_ PCSTR ModuleName,
_In_ ULONG Flags
) PURE;
STDMETHOD(AddSyntheticModuleWide)(
THIS_
_In_ ULONG64 Base,
_In_ ULONG Size,
_In_ PCWSTR ImagePath,
_In_ PCWSTR ModuleName,
_In_ ULONG Flags
) PURE;
STDMETHOD(RemoveSyntheticModule)(
THIS_
_In_ ULONG64 Base
) PURE;
// Modify the current frame used for scoping.
// This is equivalent to the '.frame' command.
STDMETHOD(GetCurrentScopeFrameIndex)(
THIS_
_Out_ PULONG Index
) PURE;
STDMETHOD(SetScopeFrameByIndex)(
THIS_
_In_ ULONG Index
) PURE;
// Recovers JIT_DEBUG_INFO information at the given
// address from the debuggee and sets current
// debugger scope context from it.
// Equivalent to '.jdinfo' command.
STDMETHOD(SetScopeFromJitDebugInfo)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG64 InfoOffset
) PURE;
// Switches the current debugger scope to
// the stored event information.
// Equivalent to the '.ecxr' command.
STDMETHOD(SetScopeFromStoredEvent)(
THIS
) PURE;
// Takes the first symbol hit and outputs it.
// Controlled with DEBUG_OUTSYM_* flags.
STDMETHOD(OutputSymbolByOffset)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Flags,
_In_ ULONG64 Offset
) PURE;
// Function entry information for a particular
// piece of code can be retrieved by this method.
// The actual data returned is system-dependent.
STDMETHOD(GetFunctionEntryByOffset)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG BufferNeeded
) PURE;
// Given a type which can contain members
// this method returns the type ID and offset of a
// particular member within the type.
// Field gives the dot-separated path
// to the field of interest.
STDMETHOD(GetFieldTypeAndOffset)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG ContainerTypeId,
_In_ PCSTR Field,
_Out_opt_ PULONG FieldTypeId,
_Out_opt_ PULONG Offset
) PURE;
STDMETHOD(GetFieldTypeAndOffsetWide)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG ContainerTypeId,
_In_ PCWSTR Field,
_Out_opt_ PULONG FieldTypeId,
_Out_opt_ PULONG Offset
) PURE;
// Artificial symbols can be created in any
// existing module as a way to name an address.
// The address must not already have symbol
// information.
// A reload will discard synthetic symbols
// for all address regions reloaded.
STDMETHOD(AddSyntheticSymbol)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Size,
_In_ PCSTR Name,
_In_ ULONG Flags,
_Out_opt_ PDEBUG_MODULE_AND_ID Id
) PURE;
STDMETHOD(AddSyntheticSymbolWide)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Size,
_In_ PCWSTR Name,
_In_ ULONG Flags,
_Out_opt_ PDEBUG_MODULE_AND_ID Id
) PURE;
STDMETHOD(RemoveSyntheticSymbol)(
THIS_
_In_ PDEBUG_MODULE_AND_ID Id
) PURE;
// The following methods can return multiple
// hits for symbol lookups to allow for all
// possible hits to be returned.
STDMETHOD(GetSymbolEntriesByOffset)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_writes_opt_(IdsCount) PDEBUG_MODULE_AND_ID Ids,
_Out_writes_opt_(IdsCount) PULONG64 Displacements,
_In_ ULONG IdsCount,
_Out_opt_ PULONG Entries
) PURE;
STDMETHOD(GetSymbolEntriesByName)(
THIS_
_In_ PCSTR Symbol,
_In_ ULONG Flags,
_Out_writes_opt_(IdsCount) PDEBUG_MODULE_AND_ID Ids,
_In_ ULONG IdsCount,
_Out_opt_ PULONG Entries
) PURE;
STDMETHOD(GetSymbolEntriesByNameWide)(
THIS_
_In_ PCWSTR Symbol,
_In_ ULONG Flags,
_Out_writes_opt_(IdsCount) PDEBUG_MODULE_AND_ID Ids,
_In_ ULONG IdsCount,
_Out_opt_ PULONG Entries
) PURE;
// Symbol lookup by managed metadata token.
STDMETHOD(GetSymbolEntryByToken)(
THIS_
_In_ ULONG64 ModuleBase,
_In_ ULONG Token,
_Out_ PDEBUG_MODULE_AND_ID Id
) PURE;
// Retrieves full symbol entry information from an ID.
STDMETHOD(GetSymbolEntryInformation)(
THIS_
_In_ PDEBUG_MODULE_AND_ID Id,
_Out_ PDEBUG_SYMBOL_ENTRY Info
) PURE;
STDMETHOD(GetSymbolEntryString)(
THIS_
_In_ PDEBUG_MODULE_AND_ID Id,
_In_ ULONG Which,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
STDMETHOD(GetSymbolEntryStringWide)(
THIS_
_In_ PDEBUG_MODULE_AND_ID Id,
_In_ ULONG Which,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
// Returns all known memory regions associated
// with the given symbol. Simple symbols will
// have a single region starting from their base.
// More complicated regions, such as functions
// with multiple code areas, can have an arbitrarily
// large number of regions.
// The quality of information returned is highly
// dependent on the symbolic information availble.
STDMETHOD(GetSymbolEntryOffsetRegions)(
THIS_
_In_ PDEBUG_MODULE_AND_ID Id,
_In_ ULONG Flags,
_Out_writes_opt_(RegionsCount) PDEBUG_OFFSET_REGION Regions,
_In_ ULONG RegionsCount,
_Out_opt_ PULONG RegionsAvail
) PURE;
// This method allows navigating within the
// symbol entry hierarchy.
STDMETHOD(GetSymbolEntryBySymbolEntry)(
THIS_
_In_ PDEBUG_MODULE_AND_ID FromId,
_In_ ULONG Flags,
_Out_ PDEBUG_MODULE_AND_ID ToId
) PURE;
// The following methods can return multiple
// hits for source lookups to allow for all
// possible hits to be returned.
STDMETHOD(GetSourceEntriesByOffset)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_writes_opt_(EntriesCount) PDEBUG_SYMBOL_SOURCE_ENTRY Entries,
_In_ ULONG EntriesCount,
_Out_opt_ PULONG EntriesAvail
) PURE;
STDMETHOD(GetSourceEntriesByLine)(
THIS_
_In_ ULONG Line,
_In_ PCSTR File,
_In_ ULONG Flags,
_Out_writes_opt_(EntriesCount) PDEBUG_SYMBOL_SOURCE_ENTRY Entries,
_In_ ULONG EntriesCount,
_Out_opt_ PULONG EntriesAvail
) PURE;
STDMETHOD(GetSourceEntriesByLineWide)(
THIS_
_In_ ULONG Line,
_In_ PCWSTR File,
_In_ ULONG Flags,
_Out_writes_opt_(EntriesCount) PDEBUG_SYMBOL_SOURCE_ENTRY Entries,
_In_ ULONG EntriesCount,
_Out_opt_ PULONG EntriesAvail
) PURE;
STDMETHOD(GetSourceEntryString)(
THIS_
_In_ PDEBUG_SYMBOL_SOURCE_ENTRY Entry,
_In_ ULONG Which,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
STDMETHOD(GetSourceEntryStringWide)(
THIS_
_In_ PDEBUG_SYMBOL_SOURCE_ENTRY Entry,
_In_ ULONG Which,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
// Returns all known memory regions associated
// with the given source entry. As with
// GetSymbolEntryOffsetRegions the regions available
// are variable.
STDMETHOD(GetSourceEntryOffsetRegions)(
THIS_
_In_ PDEBUG_SYMBOL_SOURCE_ENTRY Entry,
_In_ ULONG Flags,
_Out_writes_opt_(RegionsCount) PDEBUG_OFFSET_REGION Regions,
_In_ ULONG RegionsCount,
_Out_opt_ PULONG RegionsAvail
) PURE;
// This method allows navigating within the
// source entries.
STDMETHOD(GetSourceEntryBySourceEntry)(
THIS_
_In_ PDEBUG_SYMBOL_SOURCE_ENTRY FromEntry,
_In_ ULONG Flags,
_Out_ PDEBUG_SYMBOL_SOURCE_ENTRY ToEntry
) PURE;
// IDebugSymbols4
STDMETHOD(GetScopeEx)(
THIS_
_Out_opt_ PULONG64 InstructionOffset,
_Out_opt_ PDEBUG_STACK_FRAME_EX ScopeFrame,
_Out_writes_bytes_opt_(ScopeContextSize) PVOID ScopeContext,
_In_ ULONG ScopeContextSize
) PURE;
STDMETHOD(SetScopeEx)(
THIS_
_In_ ULONG64 InstructionOffset,
_In_opt_ PDEBUG_STACK_FRAME_EX ScopeFrame,
_In_reads_bytes_opt_(ScopeContextSize) PVOID ScopeContext,
_In_ ULONG ScopeContextSize
) PURE;
STDMETHOD(GetNameByInlineContext)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG InlineContext,
_Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetNameByInlineContextWide)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG InlineContext,
_Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetLineByInlineContext)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG InlineContext,
_Out_opt_ PULONG Line,
_Out_writes_opt_(FileBufferSize) PSTR FileBuffer,
_In_ ULONG FileBufferSize,
_Out_opt_ PULONG FileSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetLineByInlineContextWide)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG InlineContext,
_Out_opt_ PULONG Line,
_Out_writes_opt_(FileBufferSize) PWSTR FileBuffer,
_In_ ULONG FileBufferSize,
_Out_opt_ PULONG FileSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(OutputSymbolByInlineContext)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Flags,
_In_ ULONG64 Offset,
_In_ ULONG InlineContext
) PURE;
};
#define DEBUG_FRAME_DEFAULT 0
#define DEBUG_FRAME_IGNORE_INLINE 0x00000001
#undef INTERFACE
#define INTERFACE IDebugSymbols5
DECLARE_INTERFACE_(IDebugSymbols5, IUnknown)
{
// IUnknown.
STDMETHOD(QueryInterface)(
THIS_
_In_ REFIID InterfaceId,
_Out_ PVOID* Interface
) PURE;
STDMETHOD_(ULONG, AddRef)(
THIS
) PURE;
STDMETHOD_(ULONG, Release)(
THIS
) PURE;
// IDebugSymbols.
// Controls the symbol options used during
// symbol operations.
// Uses the same flags as dbghelps SymSetOptions.
STDMETHOD(GetSymbolOptions)(
THIS_
_Out_ PULONG Options
) PURE;
STDMETHOD(AddSymbolOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(RemoveSymbolOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(SetSymbolOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(GetNameByOffset)(
THIS_
_In_ ULONG64 Offset,
_Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Displacement
) PURE;
// A symbol name may not be unique, particularly
// when overloaded functions exist which all
// have the same name. If GetOffsetByName
// finds multiple matches for the name it
// can return any one of them. In that
// case it will return S_FALSE to indicate
// that ambiguity was arbitrarily resolved.
// A caller can then use SearchSymbols to
// find all of the matches if it wishes to
// perform different disambiguation.
STDMETHOD(GetOffsetByName)(
THIS_
_In_ PCSTR Symbol,
_Out_ PULONG64 Offset
) PURE;
// GetNearNameByOffset returns symbols
// located near the symbol closest to
// to the offset, such as the previous
// or next symbol. If Delta is zero it
// operates identically to GetNameByOffset.
// If Delta is nonzero and such a symbol
// does not exist an error is returned.
// The next symbol, if one exists, will
// always have a higher offset than the
// input offset so the displacement is
// always negative. The situation is
// reversed for the previous symbol.
STDMETHOD(GetNearNameByOffset)(
THIS_
_In_ ULONG64 Offset,
_In_ LONG Delta,
_Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetLineByOffset)(
THIS_
_In_ ULONG64 Offset,
_Out_opt_ PULONG Line,
_Out_writes_opt_(FileBufferSize) PSTR FileBuffer,
_In_ ULONG FileBufferSize,
_Out_opt_ PULONG FileSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetOffsetByLine)(
THIS_
_In_ ULONG Line,
_In_ PCSTR File,
_Out_ PULONG64 Offset
) PURE;
// Enumerates the engines list of modules
// loaded for the current process. This may
// or may not match the system module list
// for the process. Reload can be used to
// synchronize the engines list with the system
// if necessary.
// Some sessions also track recently unloaded
// code modules for help in analyzing failures
// where an attempt is made to call unloaded code.
// These modules are indexed after the loaded
// modules.
STDMETHOD(GetNumberModules)(
THIS_
_Out_ PULONG Loaded,
_Out_ PULONG Unloaded
) PURE;
STDMETHOD(GetModuleByIndex)(
THIS_
_In_ ULONG Index,
_Out_ PULONG64 Base
) PURE;
// The module name may not be unique.
// This method returns the first match.
STDMETHOD(GetModuleByModuleName)(
THIS_
_In_ PCSTR Name,
_In_ ULONG StartIndex,
_Out_opt_ PULONG Index,
_Out_opt_ PULONG64 Base
) PURE;
// Offset can be any offset within
// the module extent. Extents may
// not be unique when including unloaded
// drivers. This method returns the
// first match.
STDMETHOD(GetModuleByOffset)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG StartIndex,
_Out_opt_ PULONG Index,
_Out_opt_ PULONG64 Base
) PURE;
// If Index is DEBUG_ANY_ID the base address
// is used to look up the module instead.
STDMETHOD(GetModuleNames)(
THIS_
_In_ ULONG Index,
_In_ ULONG64 Base,
_Out_writes_opt_(ImageNameBufferSize) PSTR ImageNameBuffer,
_In_ ULONG ImageNameBufferSize,
_Out_opt_ PULONG ImageNameSize,
_Out_writes_opt_(ModuleNameBufferSize) PSTR ModuleNameBuffer,
_In_ ULONG ModuleNameBufferSize,
_Out_opt_ PULONG ModuleNameSize,
_Out_writes_opt_(LoadedImageNameBufferSize) PSTR LoadedImageNameBuffer,
_In_ ULONG LoadedImageNameBufferSize,
_Out_opt_ PULONG LoadedImageNameSize
) PURE;
STDMETHOD(GetModuleParameters)(
THIS_
_In_ ULONG Count,
_In_reads_opt_(Count) PULONG64 Bases,
_In_ ULONG Start,
_Out_writes_(Count) PDEBUG_MODULE_PARAMETERS Params
) PURE;
// Looks up the module from a <Module>!<Symbol>
// string.
STDMETHOD(GetSymbolModule)(
THIS_
_In_ PCSTR Symbol,
_Out_ PULONG64 Base
) PURE;
// Returns the string name of a type.
STDMETHOD(GetTypeName)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize
) PURE;
// Returns the ID for a type name.
STDMETHOD(GetTypeId)(
THIS_
_In_ ULONG64 Module,
_In_ PCSTR Name,
_Out_ PULONG TypeId
) PURE;
STDMETHOD(GetTypeSize)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_Out_ PULONG Size
) PURE;
// Given a type which can contain members
// this method returns the offset of a
// particular member within the type.
// TypeId should give the container type ID
// and Field gives the dot-separated path
// to the field of interest.
STDMETHOD(GetFieldOffset)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ PCSTR Field,
_Out_ PULONG Offset
) PURE;
STDMETHOD(GetSymbolTypeId)(
THIS_
_In_ PCSTR Symbol,
_Out_ PULONG TypeId,
_Out_opt_ PULONG64 Module
) PURE;
// As with GetOffsetByName a symbol's
// name may be ambiguous. GetOffsetTypeId
// returns the type for the symbol closest
// to the given offset and can be used
// to avoid ambiguity.
STDMETHOD(GetOffsetTypeId)(
THIS_
_In_ ULONG64 Offset,
_Out_ PULONG TypeId,
_Out_opt_ PULONG64 Module
) PURE;
// Helpers for virtual and physical data
// which combine creation of a location with
// the actual operation.
STDMETHOD(ReadTypedDataVirtual)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_Out_writes_bytes_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG BytesRead
) PURE;
STDMETHOD(WriteTypedDataVirtual)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_reads_bytes_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG BytesWritten
) PURE;
STDMETHOD(OutputTypedDataVirtual)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG64 Offset,
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ ULONG Flags
) PURE;
STDMETHOD(ReadTypedDataPhysical)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_Out_writes_bytes_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG BytesRead
) PURE;
STDMETHOD(WriteTypedDataPhysical)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_reads_bytes_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG BytesWritten
) PURE;
STDMETHOD(OutputTypedDataPhysical)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG64 Offset,
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ ULONG Flags
) PURE;
// Function arguments and scope block symbols
// can be retrieved relative to currently
// executing code. A caller can provide just
// a code offset for scoping purposes and look
// up names or the caller can provide a full frame
// and look up actual values. The values for
// scoped symbols are best-guess and may or may not
// be accurate depending on program optimizations,
// the machine architecture, the current point
// in the programs execution and so on.
// A caller can also provide a complete register
// context for setting a scope to a previous
// machine state such as a context saved for
// an exception. Usually this isnt necessary
// and the current register context is used.
STDMETHOD(GetScope)(
THIS_
_Out_opt_ PULONG64 InstructionOffset,
_Out_opt_ PDEBUG_STACK_FRAME ScopeFrame,
_Out_writes_bytes_opt_(ScopeContextSize) PVOID ScopeContext,
_In_ ULONG ScopeContextSize
) PURE;
// If ScopeFrame or ScopeContext is non-NULL then
// InstructionOffset is ignored.
// If ScopeContext is NULL the current
// register context is used.
// If the scope identified by the given
// information is the same as before
// SetScope returns S_OK. If the scope
// information changes, such as when the
// scope moves between functions or scope
// blocks, SetScope returns S_FALSE.
STDMETHOD(SetScope)(
THIS_
_In_ ULONG64 InstructionOffset,
_In_opt_ PDEBUG_STACK_FRAME ScopeFrame,
_In_reads_bytes_opt_(ScopeContextSize) PVOID ScopeContext,
_In_ ULONG ScopeContextSize
) PURE;
// ResetScope clears the scope information
// for situations where scoped symbols
// mask global symbols or when resetting
// from explicit information to the current
// information.
STDMETHOD(ResetScope)(
THIS
) PURE;
// A scope symbol is tied to its particular
// scope and only is meaningful within the scope.
// The returned group can be updated by passing it back
// into the method for lower-cost
// incremental updates when stepping.
STDMETHOD(GetScopeSymbolGroup)(
THIS_
_In_ ULONG Flags,
_In_opt_ PDEBUG_SYMBOL_GROUP Update,
_Out_ PDEBUG_SYMBOL_GROUP* Symbols
) PURE;
// Create a new symbol group.
STDMETHOD(CreateSymbolGroup)(
THIS_
_Out_ PDEBUG_SYMBOL_GROUP* Group
) PURE;
// StartSymbolMatch matches symbol names
// against the given pattern using simple
// regular expressions. The search results
// are iterated through using GetNextSymbolMatch.
// When the caller is done examining results
// the match should be freed via EndSymbolMatch.
// If the match pattern contains a module name
// the search is restricted to a single module.
// Pattern matching is only done on symbol names,
// not module names.
// All active symbol match handles are invalidated
// when the set of loaded symbols changes.
STDMETHOD(StartSymbolMatch)(
THIS_
_In_ PCSTR Pattern,
_Out_ PULONG64 Handle
) PURE;
// If Buffer is NULL the match does not
// advance.
STDMETHOD(GetNextSymbolMatch)(
THIS_
_In_ ULONG64 Handle,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG MatchSize,
_Out_opt_ PULONG64 Offset
) PURE;
STDMETHOD(EndSymbolMatch)(
THIS_
_In_ ULONG64 Handle
) PURE;
STDMETHOD(Reload)(
THIS_
_In_ PCSTR Module
) PURE;
STDMETHOD(GetSymbolPath)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PathSize
) PURE;
STDMETHOD(SetSymbolPath)(
THIS_
_In_ PCSTR Path
) PURE;
STDMETHOD(AppendSymbolPath)(
THIS_
_In_ PCSTR Addition
) PURE;
// Manipulate the path for executable images.
// Some dump files need to load executable images
// in order to resolve dump information. This
// path controls where the engine looks for
// images.
STDMETHOD(GetImagePath)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PathSize
) PURE;
STDMETHOD(SetImagePath)(
THIS_
_In_ PCSTR Path
) PURE;
STDMETHOD(AppendImagePath)(
THIS_
_In_ PCSTR Addition
) PURE;
// Path routines for source file location
// methods.
STDMETHOD(GetSourcePath)(
THIS_
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PathSize
) PURE;
// Gets the nth part of the source path.
STDMETHOD(GetSourcePathElement)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG ElementSize
) PURE;
STDMETHOD(SetSourcePath)(
THIS_
_In_ PCSTR Path
) PURE;
STDMETHOD(AppendSourcePath)(
THIS_
_In_ PCSTR Addition
) PURE;
// Uses the given file path and the source path
// information to try and locate an existing file.
// The given file path is merged with elements
// of the source path and checked for existence.
// If a match is found the element used is returned.
// A starting element can be specified to restrict
// the search to a subset of the path elements;
// this can be useful when checking for multiple
// matches along the source path.
// The returned element can be 1, indicating
// the file was found directly and not on the path.
STDMETHOD(FindSourceFile)(
THIS_
_In_ ULONG StartElement,
_In_ PCSTR File,
_In_ ULONG Flags,
_Out_opt_ PULONG FoundElement,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FoundSize
) PURE;
// Retrieves all the line offset information
// for a particular source file. Buffer is
// first intialized to DEBUG_INVALID_OFFSET for
// every entry. Then for each piece of line
// symbol information Buffer[Line] set to
// Lines offset. This produces a per-line
// map of the offsets for the lines of the
// given file. Line numbers are decremented
// for the map so Buffer[0] contains the offset
// for line number 1.
// If there is no line information at all for
// the given file the method fails rather
// than returning a map of invalid offsets.
STDMETHOD(GetSourceFileLineOffsets)(
THIS_
_In_ PCSTR File,
_Out_writes_opt_(BufferLines) PULONG64 Buffer,
_In_ ULONG BufferLines,
_Out_opt_ PULONG FileLines
) PURE;
// IDebugSymbols2.
// If Index is DEBUG_ANY_ID the base address
// is used to look up the module instead.
// Item is specified as in VerQueryValue.
// Module version information is only
// available for loaded modules and may
// not be available in all debug sessions.
STDMETHOD(GetModuleVersionInformation)(
THIS_
_In_ ULONG Index,
_In_ ULONG64 Base,
_In_ PCSTR Item,
_Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG VerInfoSize
) PURE;
// Retrieves any available module name string
// such as module name or symbol file name.
// If Index is DEBUG_ANY_ID the base address
// is used to look up the module instead.
// If symbols are deferred an error will
// be returned.
// E_NOINTERFACE may be returned, indicating
// no information exists.
STDMETHOD(GetModuleNameString)(
THIS_
_In_ ULONG Which,
_In_ ULONG Index,
_In_ ULONG64 Base,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG NameSize
) PURE;
// Returns the string name of a constant type.
STDMETHOD(GetConstantName)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ ULONG64 Value,
_Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize
) PURE;
// Gets name of a field in a struct
// FieldNumber is 0 based index of field in a struct
STDMETHOD(GetFieldName)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ ULONG FieldIndex,
_Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize
) PURE;
// Control options for typed values.
STDMETHOD(GetTypeOptions)(
THIS_
_Out_ PULONG Options
) PURE;
STDMETHOD(AddTypeOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(RemoveTypeOptions)(
THIS_
_In_ ULONG Options
) PURE;
STDMETHOD(SetTypeOptions)(
THIS_
_In_ ULONG Options
) PURE;
// IDebugSymbols3.
STDMETHOD(GetNameByOffsetWide)(
THIS_
_In_ ULONG64 Offset,
_Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetOffsetByNameWide)(
THIS_
_In_ PCWSTR Symbol,
_Out_ PULONG64 Offset
) PURE;
STDMETHOD(GetNearNameByOffsetWide)(
THIS_
_In_ ULONG64 Offset,
_In_ LONG Delta,
_Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetLineByOffsetWide)(
THIS_
_In_ ULONG64 Offset,
_Out_opt_ PULONG Line,
_Out_writes_opt_(FileBufferSize) PWSTR FileBuffer,
_In_ ULONG FileBufferSize,
_Out_opt_ PULONG FileSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetOffsetByLineWide)(
THIS_
_In_ ULONG Line,
_In_ PCWSTR File,
_Out_ PULONG64 Offset
) PURE;
STDMETHOD(GetModuleByModuleNameWide)(
THIS_
_In_ PCWSTR Name,
_In_ ULONG StartIndex,
_Out_opt_ PULONG Index,
_Out_opt_ PULONG64 Base
) PURE;
STDMETHOD(GetSymbolModuleWide)(
THIS_
_In_ PCWSTR Symbol,
_Out_ PULONG64 Base
) PURE;
STDMETHOD(GetTypeNameWide)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize
) PURE;
// Returns the ID for a type name.
STDMETHOD(GetTypeIdWide)(
THIS_
_In_ ULONG64 Module,
_In_ PCWSTR Name,
_Out_ PULONG TypeId
) PURE;
STDMETHOD(GetFieldOffsetWide)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ PCWSTR Field,
_Out_ PULONG Offset
) PURE;
STDMETHOD(GetSymbolTypeIdWide)(
THIS_
_In_ PCWSTR Symbol,
_Out_ PULONG TypeId,
_Out_opt_ PULONG64 Module
) PURE;
STDMETHOD(GetScopeSymbolGroup2)(
THIS_
_In_ ULONG Flags,
_In_opt_ PDEBUG_SYMBOL_GROUP2 Update,
_Out_ PDEBUG_SYMBOL_GROUP2* Symbols
) PURE;
STDMETHOD(CreateSymbolGroup2)(
THIS_
_Out_ PDEBUG_SYMBOL_GROUP2* Group
) PURE;
STDMETHOD(StartSymbolMatchWide)(
THIS_
_In_ PCWSTR Pattern,
_Out_ PULONG64 Handle
) PURE;
STDMETHOD(GetNextSymbolMatchWide)(
THIS_
_In_ ULONG64 Handle,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG MatchSize,
_Out_opt_ PULONG64 Offset
) PURE;
STDMETHOD(ReloadWide)(
THIS_
_In_ PCWSTR Module
) PURE;
STDMETHOD(GetSymbolPathWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PathSize
) PURE;
STDMETHOD(SetSymbolPathWide)(
THIS_
_In_ PCWSTR Path
) PURE;
STDMETHOD(AppendSymbolPathWide)(
THIS_
_In_ PCWSTR Addition
) PURE;
STDMETHOD(GetImagePathWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PathSize
) PURE;
STDMETHOD(SetImagePathWide)(
THIS_
_In_ PCWSTR Path
) PURE;
STDMETHOD(AppendImagePathWide)(
THIS_
_In_ PCWSTR Addition
) PURE;
STDMETHOD(GetSourcePathWide)(
THIS_
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG PathSize
) PURE;
STDMETHOD(GetSourcePathElementWide)(
THIS_
_In_ ULONG Index,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG ElementSize
) PURE;
STDMETHOD(SetSourcePathWide)(
THIS_
_In_ PCWSTR Path
) PURE;
STDMETHOD(AppendSourcePathWide)(
THIS_
_In_ PCWSTR Addition
) PURE;
STDMETHOD(FindSourceFileWide)(
THIS_
_In_ ULONG StartElement,
_In_ PCWSTR File,
_In_ ULONG Flags,
_Out_opt_ PULONG FoundElement,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG FoundSize
) PURE;
STDMETHOD(GetSourceFileLineOffsetsWide)(
THIS_
_In_ PCWSTR File,
_Out_writes_opt_(BufferLines) PULONG64 Buffer,
_In_ ULONG BufferLines,
_Out_opt_ PULONG FileLines
) PURE;
STDMETHOD(GetModuleVersionInformationWide)(
THIS_
_In_ ULONG Index,
_In_ ULONG64 Base,
_In_ PCWSTR Item,
_Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG VerInfoSize
) PURE;
STDMETHOD(GetModuleNameStringWide)(
THIS_
_In_ ULONG Which,
_In_ ULONG Index,
_In_ ULONG64 Base,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG NameSize
) PURE;
STDMETHOD(GetConstantNameWide)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ ULONG64 Value,
_Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize
) PURE;
STDMETHOD(GetFieldNameWide)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG TypeId,
_In_ ULONG FieldIndex,
_Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize
) PURE;
// Returns S_OK if the engine is using managed
// debugging support when retriving information
// for the given module. This can be expensive
// to check.
STDMETHOD(IsManagedModule)(
THIS_
_In_ ULONG Index,
_In_ ULONG64 Base
) PURE;
// The module name may not be unique.
// This method returns the first match.
STDMETHOD(GetModuleByModuleName2)(
THIS_
_In_ PCSTR Name,
_In_ ULONG StartIndex,
_In_ ULONG Flags,
_Out_opt_ PULONG Index,
_Out_opt_ PULONG64 Base
) PURE;
STDMETHOD(GetModuleByModuleName2Wide)(
THIS_
_In_ PCWSTR Name,
_In_ ULONG StartIndex,
_In_ ULONG Flags,
_Out_opt_ PULONG Index,
_Out_opt_ PULONG64 Base
) PURE;
// Offset can be any offset within
// the module extent. Extents may
// not be unique when including unloaded
// drivers. This method returns the
// first match.
STDMETHOD(GetModuleByOffset2)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG StartIndex,
_In_ ULONG Flags,
_Out_opt_ PULONG Index,
_Out_opt_ PULONG64 Base
) PURE;
// A caller can create artificial loaded modules in
// the engine's module list if desired.
// These modules only serve as names for
// a region of addresses. They cannot have
// real symbols loaded for them; if that
// is desired Reload can be used with explicit
// parameters to create a true module entry.
// The region must not be in use by any other
// module.
// A general reload will discard any synthetic modules.
STDMETHOD(AddSyntheticModule)(
THIS_
_In_ ULONG64 Base,
_In_ ULONG Size,
_In_ PCSTR ImagePath,
_In_ PCSTR ModuleName,
_In_ ULONG Flags
) PURE;
STDMETHOD(AddSyntheticModuleWide)(
THIS_
_In_ ULONG64 Base,
_In_ ULONG Size,
_In_ PCWSTR ImagePath,
_In_ PCWSTR ModuleName,
_In_ ULONG Flags
) PURE;
STDMETHOD(RemoveSyntheticModule)(
THIS_
_In_ ULONG64 Base
) PURE;
// Modify the current frame used for scoping.
// This is equivalent to the '.frame' command.
STDMETHOD(GetCurrentScopeFrameIndex)(
THIS_
_Out_ PULONG Index
) PURE;
STDMETHOD(SetScopeFrameByIndex)(
THIS_
_In_ ULONG Index
) PURE;
// Recovers JIT_DEBUG_INFO information at the given
// address from the debuggee and sets current
// debugger scope context from it.
// Equivalent to '.jdinfo' command.
STDMETHOD(SetScopeFromJitDebugInfo)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG64 InfoOffset
) PURE;
// Switches the current debugger scope to
// the stored event information.
// Equivalent to the '.ecxr' command.
STDMETHOD(SetScopeFromStoredEvent)(
THIS
) PURE;
// Takes the first symbol hit and outputs it.
// Controlled with DEBUG_OUTSYM_* flags.
STDMETHOD(OutputSymbolByOffset)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Flags,
_In_ ULONG64 Offset
) PURE;
// Function entry information for a particular
// piece of code can be retrieved by this method.
// The actual data returned is system-dependent.
STDMETHOD(GetFunctionEntryByOffset)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_writes_bytes_opt_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG BufferNeeded
) PURE;
// Given a type which can contain members
// this method returns the type ID and offset of a
// particular member within the type.
// Field gives the dot-separated path
// to the field of interest.
STDMETHOD(GetFieldTypeAndOffset)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG ContainerTypeId,
_In_ PCSTR Field,
_Out_opt_ PULONG FieldTypeId,
_Out_opt_ PULONG Offset
) PURE;
STDMETHOD(GetFieldTypeAndOffsetWide)(
THIS_
_In_ ULONG64 Module,
_In_ ULONG ContainerTypeId,
_In_ PCWSTR Field,
_Out_opt_ PULONG FieldTypeId,
_Out_opt_ PULONG Offset
) PURE;
// Artificial symbols can be created in any
// existing module as a way to name an address.
// The address must not already have symbol
// information.
// A reload will discard synthetic symbols
// for all address regions reloaded.
STDMETHOD(AddSyntheticSymbol)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Size,
_In_ PCSTR Name,
_In_ ULONG Flags,
_Out_opt_ PDEBUG_MODULE_AND_ID Id
) PURE;
STDMETHOD(AddSyntheticSymbolWide)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Size,
_In_ PCWSTR Name,
_In_ ULONG Flags,
_Out_opt_ PDEBUG_MODULE_AND_ID Id
) PURE;
STDMETHOD(RemoveSyntheticSymbol)(
THIS_
_In_ PDEBUG_MODULE_AND_ID Id
) PURE;
// The following methods can return multiple
// hits for symbol lookups to allow for all
// possible hits to be returned.
STDMETHOD(GetSymbolEntriesByOffset)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_writes_opt_(IdsCount) PDEBUG_MODULE_AND_ID Ids,
_Out_writes_opt_(IdsCount) PULONG64 Displacements,
_In_ ULONG IdsCount,
_Out_opt_ PULONG Entries
) PURE;
STDMETHOD(GetSymbolEntriesByName)(
THIS_
_In_ PCSTR Symbol,
_In_ ULONG Flags,
_Out_writes_opt_(IdsCount) PDEBUG_MODULE_AND_ID Ids,
_In_ ULONG IdsCount,
_Out_opt_ PULONG Entries
) PURE;
STDMETHOD(GetSymbolEntriesByNameWide)(
THIS_
_In_ PCWSTR Symbol,
_In_ ULONG Flags,
_Out_writes_opt_(IdsCount) PDEBUG_MODULE_AND_ID Ids,
_In_ ULONG IdsCount,
_Out_opt_ PULONG Entries
) PURE;
// Symbol lookup by managed metadata token.
STDMETHOD(GetSymbolEntryByToken)(
THIS_
_In_ ULONG64 ModuleBase,
_In_ ULONG Token,
_Out_ PDEBUG_MODULE_AND_ID Id
) PURE;
// Retrieves full symbol entry information from an ID.
STDMETHOD(GetSymbolEntryInformation)(
THIS_
_In_ PDEBUG_MODULE_AND_ID Id,
_Out_ PDEBUG_SYMBOL_ENTRY Info
) PURE;
STDMETHOD(GetSymbolEntryString)(
THIS_
_In_ PDEBUG_MODULE_AND_ID Id,
_In_ ULONG Which,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
STDMETHOD(GetSymbolEntryStringWide)(
THIS_
_In_ PDEBUG_MODULE_AND_ID Id,
_In_ ULONG Which,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
// Returns all known memory regions associated
// with the given symbol. Simple symbols will
// have a single region starting from their base.
// More complicated regions, such as functions
// with multiple code areas, can have an arbitrarily
// large number of regions.
// The quality of information returned is highly
// dependent on the symbolic information availble.
STDMETHOD(GetSymbolEntryOffsetRegions)(
THIS_
_In_ PDEBUG_MODULE_AND_ID Id,
_In_ ULONG Flags,
_Out_writes_opt_(RegionsCount) PDEBUG_OFFSET_REGION Regions,
_In_ ULONG RegionsCount,
_Out_opt_ PULONG RegionsAvail
) PURE;
// This method allows navigating within the
// symbol entry hierarchy.
STDMETHOD(GetSymbolEntryBySymbolEntry)(
THIS_
_In_ PDEBUG_MODULE_AND_ID FromId,
_In_ ULONG Flags,
_Out_ PDEBUG_MODULE_AND_ID ToId
) PURE;
// The following methods can return multiple
// hits for source lookups to allow for all
// possible hits to be returned.
STDMETHOD(GetSourceEntriesByOffset)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG Flags,
_Out_writes_opt_(EntriesCount) PDEBUG_SYMBOL_SOURCE_ENTRY Entries,
_In_ ULONG EntriesCount,
_Out_opt_ PULONG EntriesAvail
) PURE;
STDMETHOD(GetSourceEntriesByLine)(
THIS_
_In_ ULONG Line,
_In_ PCSTR File,
_In_ ULONG Flags,
_Out_writes_opt_(EntriesCount) PDEBUG_SYMBOL_SOURCE_ENTRY Entries,
_In_ ULONG EntriesCount,
_Out_opt_ PULONG EntriesAvail
) PURE;
STDMETHOD(GetSourceEntriesByLineWide)(
THIS_
_In_ ULONG Line,
_In_ PCWSTR File,
_In_ ULONG Flags,
_Out_writes_opt_(EntriesCount) PDEBUG_SYMBOL_SOURCE_ENTRY Entries,
_In_ ULONG EntriesCount,
_Out_opt_ PULONG EntriesAvail
) PURE;
STDMETHOD(GetSourceEntryString)(
THIS_
_In_ PDEBUG_SYMBOL_SOURCE_ENTRY Entry,
_In_ ULONG Which,
_Out_writes_opt_(BufferSize) PSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
STDMETHOD(GetSourceEntryStringWide)(
THIS_
_In_ PDEBUG_SYMBOL_SOURCE_ENTRY Entry,
_In_ ULONG Which,
_Out_writes_opt_(BufferSize) PWSTR Buffer,
_In_ ULONG BufferSize,
_Out_opt_ PULONG StringSize
) PURE;
// Returns all known memory regions associated
// with the given source entry. As with
// GetSymbolEntryOffsetRegions the regions available
// are variable.
STDMETHOD(GetSourceEntryOffsetRegions)(
THIS_
_In_ PDEBUG_SYMBOL_SOURCE_ENTRY Entry,
_In_ ULONG Flags,
_Out_writes_opt_(RegionsCount) PDEBUG_OFFSET_REGION Regions,
_In_ ULONG RegionsCount,
_Out_opt_ PULONG RegionsAvail
) PURE;
// This method allows navigating within the
// source entries.
STDMETHOD(GetSourceEntryBySourceEntry)(
THIS_
_In_ PDEBUG_SYMBOL_SOURCE_ENTRY FromEntry,
_In_ ULONG Flags,
_Out_ PDEBUG_SYMBOL_SOURCE_ENTRY ToEntry
) PURE;
// IDebugSymbols4
STDMETHOD(GetScopeEx)(
THIS_
_Out_opt_ PULONG64 InstructionOffset,
_Out_opt_ PDEBUG_STACK_FRAME_EX ScopeFrame,
_Out_writes_bytes_opt_(ScopeContextSize) PVOID ScopeContext,
_In_ ULONG ScopeContextSize
) PURE;
STDMETHOD(SetScopeEx)(
THIS_
_In_ ULONG64 InstructionOffset,
_In_opt_ PDEBUG_STACK_FRAME_EX ScopeFrame,
_In_reads_bytes_opt_(ScopeContextSize) PVOID ScopeContext,
_In_ ULONG ScopeContextSize
) PURE;
STDMETHOD(GetNameByInlineContext)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG InlineContext,
_Out_writes_opt_(NameBufferSize) PSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetNameByInlineContextWide)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG InlineContext,
_Out_writes_opt_(NameBufferSize) PWSTR NameBuffer,
_In_ ULONG NameBufferSize,
_Out_opt_ PULONG NameSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetLineByInlineContext)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG InlineContext,
_Out_opt_ PULONG Line,
_Out_writes_opt_(FileBufferSize) PSTR FileBuffer,
_In_ ULONG FileBufferSize,
_Out_opt_ PULONG FileSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(GetLineByInlineContextWide)(
THIS_
_In_ ULONG64 Offset,
_In_ ULONG InlineContext,
_Out_opt_ PULONG Line,
_Out_writes_opt_(FileBufferSize) PWSTR FileBuffer,
_In_ ULONG FileBufferSize,
_Out_opt_ PULONG FileSize,
_Out_opt_ PULONG64 Displacement
) PURE;
STDMETHOD(OutputSymbolByInlineContext)(
THIS_
_In_ ULONG OutputControl,
_In_ ULONG Flags,
_In_ ULONG64 Offset,
_In_ ULONG InlineContext
) PURE;
// IDebugSymbols5
STDMETHOD(GetCurrentScopeFrameIndexEx)(
THIS_
_In_ ULONG Flags,
_Out_ PULONG Index
) PURE;
STDMETHOD(SetScopeFrameByIndexEx)(
THIS_
_In_ ULONG Flags,
_In_ ULONG Index
) PURE; ) PURE;
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// IDebugSystemObjects // IDebugSystemObjects
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugSystemObjects #define INTERFACE IDebugSystemObjects
DECLARE_INTERFACE_(IDebugSystemObjects, IUnknown) DECLARE_INTERFACE_(IDebugSystemObjects, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugSystemObjects. // IDebugSystemObjects.
skipping to change at line 14063 skipping to change at line 22889
// limited to enumerating only the threads // limited to enumerating only the threads
// assigned to processors, not all of // assigned to processors, not all of
// the threads in the system. Process // the threads in the system. Process
// enumeration is limited to a single // enumeration is limited to a single
// virtual process representing kernel space. // virtual process representing kernel space.
// Returns the ID of the thread on which // Returns the ID of the thread on which
// the last event occurred. // the last event occurred.
STDMETHOD(GetEventThread)( STDMETHOD(GetEventThread)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetEventProcess)( STDMETHOD(GetEventProcess)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Controls implicit thread used by the // Controls implicit thread used by the
// debug engine. The debuggers current // debug engine. The debuggers current
// thread is just a piece of data held // thread is just a piece of data held
// by the debugger for calls which use // by the debugger for calls which use
// thread-specific information. In those // thread-specific information. In those
// calls the debuggers current thread is used. // calls the debuggers current thread is used.
// The debuggers current thread is not related // The debuggers current thread is not related
// to any system thread attribute. // to any system thread attribute.
// IDs for threads are small integer IDs // IDs for threads are small integer IDs
// maintained by the engine. They are not // maintained by the engine. They are not
// related to system thread IDs. // related to system thread IDs.
STDMETHOD(GetCurrentThreadId)( STDMETHOD(GetCurrentThreadId)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(SetCurrentThreadId)( STDMETHOD(SetCurrentThreadId)(
THIS_ THIS_
__in ULONG Id _In_ ULONG Id
) PURE; ) PURE;
// The current process is the process // The current process is the process
// that owns the current thread. // that owns the current thread.
STDMETHOD(GetCurrentProcessId)( STDMETHOD(GetCurrentProcessId)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Setting the current process automatically // Setting the current process automatically
// sets the current thread to the thread that // sets the current thread to the thread that
// was last current in that process. // was last current in that process.
STDMETHOD(SetCurrentProcessId)( STDMETHOD(SetCurrentProcessId)(
THIS_ THIS_
__in ULONG Id _In_ ULONG Id
) PURE; ) PURE;
// Gets the number of threads in the current process. // Gets the number of threads in the current process.
STDMETHOD(GetNumberThreads)( STDMETHOD(GetNumberThreads)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
// Gets thread count information for all processes // Gets thread count information for all processes
// and the largest number of threads in a single process. // and the largest number of threads in a single process.
STDMETHOD(GetTotalNumberThreads)( STDMETHOD(GetTotalNumberThreads)(
THIS_ THIS_
__out PULONG Total, _Out_ PULONG Total,
__out PULONG LargestProcess _Out_ PULONG LargestProcess
) PURE; ) PURE;
STDMETHOD(GetThreadIdsByIndex)( STDMETHOD(GetThreadIdsByIndex)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount_opt(Count) PULONG Ids, _Out_writes_opt_(Count) PULONG Ids,
__out_ecount_opt(Count) PULONG SysIds _Out_writes_opt_(Count) PULONG SysIds
) PURE; ) PURE;
// Gets the debugger ID for the thread // Gets the debugger ID for the thread
// currently running on the given // currently running on the given
// processor. Only works in kernel // processor. Only works in kernel
// debugging. // debugging.
STDMETHOD(GetThreadIdByProcessor)( STDMETHOD(GetThreadIdByProcessor)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the offset of the current threads // Returns the offset of the current threads
// system data structure. When kernel debugging // system data structure. When kernel debugging
// this is the offset of the KTHREAD. // this is the offset of the KTHREAD.
// When user debugging it is the offset // When user debugging it is the offset
// of the current TEB. // of the current TEB.
STDMETHOD(GetCurrentThreadDataOffset)( STDMETHOD(GetCurrentThreadDataOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger thread ID for the given // Looks up a debugger thread ID for the given
// system thread data structure. // system thread data structure.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdByDataOffset)( STDMETHOD(GetThreadIdByDataOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the offset of the current threads // Returns the offset of the current threads
// TEB. In user mode this is equivalent to // TEB. In user mode this is equivalent to
// the threads data offset. // the threads data offset.
STDMETHOD(GetCurrentThreadTeb)( STDMETHOD(GetCurrentThreadTeb)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger thread ID for the given TEB. // Looks up a debugger thread ID for the given TEB.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdByTeb)( STDMETHOD(GetThreadIdByTeb)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the system unique ID for the current thread. // Returns the system unique ID for the current thread.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetCurrentThreadSystemId)( STDMETHOD(GetCurrentThreadSystemId)(
THIS_ THIS_
__out PULONG SysId _Out_ PULONG SysId
) PURE; ) PURE;
// Looks up a debugger thread ID for the given // Looks up a debugger thread ID for the given
// system thread ID. // system thread ID.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdBySystemId)( STDMETHOD(GetThreadIdBySystemId)(
THIS_ THIS_
__in ULONG SysId, _In_ ULONG SysId,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the handle of the current thread. // Returns the handle of the current thread.
// In kernel mode the value returned is the // In kernel mode the value returned is the
// index of the processor the thread is // index of the processor the thread is
// executing on plus one. // executing on plus one.
STDMETHOD(GetCurrentThreadHandle)( STDMETHOD(GetCurrentThreadHandle)(
THIS_ THIS_
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
// Looks up a debugger thread ID for the given handle. // Looks up a debugger thread ID for the given handle.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdByHandle)( STDMETHOD(GetThreadIdByHandle)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Currently kernel mode sessions will only have // Currently kernel mode sessions will only have
// a single process representing kernel space. // a single process representing kernel space.
STDMETHOD(GetNumberProcesses)( STDMETHOD(GetNumberProcesses)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetProcessIdsByIndex)( STDMETHOD(GetProcessIdsByIndex)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount_opt(Count) PULONG Ids, _Out_writes_opt_(Count) PULONG Ids,
__out_ecount_opt(Count) PULONG SysIds _Out_writes_opt_(Count) PULONG SysIds
) PURE; ) PURE;
// Returns the offset of the current processs // Returns the offset of the current processs
// system data structure. When kernel debugging // system data structure. When kernel debugging
// this is the offset of the KPROCESS of // this is the offset of the KPROCESS of
// the process that owns the current thread. // the process that owns the current thread.
// When user debugging it is the offset // When user debugging it is the offset
// of the current PEB. // of the current PEB.
STDMETHOD(GetCurrentProcessDataOffset)( STDMETHOD(GetCurrentProcessDataOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger process ID for the given // Looks up a debugger process ID for the given
// system process data structure. // system process data structure.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetProcessIdByDataOffset)( STDMETHOD(GetProcessIdByDataOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the offset of the current processs // Returns the offset of the current processs
// PEB. In user mode this is equivalent to // PEB. In user mode this is equivalent to
// the processs data offset. // the processs data offset.
STDMETHOD(GetCurrentProcessPeb)( STDMETHOD(GetCurrentProcessPeb)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger process ID for the given PEB. // Looks up a debugger process ID for the given PEB.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetProcessIdByPeb)( STDMETHOD(GetProcessIdByPeb)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the system unique ID for the current process. // Returns the system unique ID for the current process.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetCurrentProcessSystemId)( STDMETHOD(GetCurrentProcessSystemId)(
THIS_ THIS_
__out PULONG SysId _Out_ PULONG SysId
) PURE; ) PURE;
// Looks up a debugger process ID for the given // Looks up a debugger process ID for the given
// system process ID. // system process ID.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetProcessIdBySystemId)( STDMETHOD(GetProcessIdBySystemId)(
THIS_ THIS_
__in ULONG SysId, _In_ ULONG SysId,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the handle of the current process. // Returns the handle of the current process.
// In kernel mode this is the kernel processs // In kernel mode this is the kernel processs
// artificial handle used for symbol operations // artificial handle used for symbol operations
// and so can only be used with dbghelp APIs. // and so can only be used with dbghelp APIs.
STDMETHOD(GetCurrentProcessHandle)( STDMETHOD(GetCurrentProcessHandle)(
THIS_ THIS_
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
// Looks up a debugger process ID for the given handle. // Looks up a debugger process ID for the given handle.
STDMETHOD(GetProcessIdByHandle)( STDMETHOD(GetProcessIdByHandle)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Retrieve the name of the executable loaded // Retrieve the name of the executable loaded
// in the process. This may fail if no executable // in the process. This may fail if no executable
// was identified. // was identified.
STDMETHOD(GetCurrentProcessExecutableName)( STDMETHOD(GetCurrentProcessExecutableName)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ExeSize _Out_opt_ PULONG ExeSize
) PURE; ) PURE;
}; };
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugSystemObjects2 #define INTERFACE IDebugSystemObjects2
DECLARE_INTERFACE_(IDebugSystemObjects2, IUnknown) DECLARE_INTERFACE_(IDebugSystemObjects2, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugSystemObjects. // IDebugSystemObjects.
skipping to change at line 14316 skipping to change at line 23142
// limited to enumerating only the threads // limited to enumerating only the threads
// assigned to processors, not all of // assigned to processors, not all of
// the threads in the system. Process // the threads in the system. Process
// enumeration is limited to a single // enumeration is limited to a single
// virtual process representing kernel space. // virtual process representing kernel space.
// Returns the ID of the thread on which // Returns the ID of the thread on which
// the last event occurred. // the last event occurred.
STDMETHOD(GetEventThread)( STDMETHOD(GetEventThread)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetEventProcess)( STDMETHOD(GetEventProcess)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Controls implicit thread used by the // Controls implicit thread used by the
// debug engine. The debuggers current // debug engine. The debuggers current
// thread is just a piece of data held // thread is just a piece of data held
// by the debugger for calls which use // by the debugger for calls which use
// thread-specific information. In those // thread-specific information. In those
// calls the debuggers current thread is used. // calls the debuggers current thread is used.
// The debuggers current thread is not related // The debuggers current thread is not related
// to any system thread attribute. // to any system thread attribute.
// IDs for threads are small integer IDs // IDs for threads are small integer IDs
// maintained by the engine. They are not // maintained by the engine. They are not
// related to system thread IDs. // related to system thread IDs.
STDMETHOD(GetCurrentThreadId)( STDMETHOD(GetCurrentThreadId)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(SetCurrentThreadId)( STDMETHOD(SetCurrentThreadId)(
THIS_ THIS_
__in ULONG Id _In_ ULONG Id
) PURE; ) PURE;
// The current process is the process // The current process is the process
// that owns the current thread. // that owns the current thread.
STDMETHOD(GetCurrentProcessId)( STDMETHOD(GetCurrentProcessId)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Setting the current process automatically // Setting the current process automatically
// sets the current thread to the thread that // sets the current thread to the thread that
// was last current in that process. // was last current in that process.
STDMETHOD(SetCurrentProcessId)( STDMETHOD(SetCurrentProcessId)(
THIS_ THIS_
__in ULONG Id _In_ ULONG Id
) PURE; ) PURE;
// Gets the number of threads in the current process. // Gets the number of threads in the current process.
STDMETHOD(GetNumberThreads)( STDMETHOD(GetNumberThreads)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
// Gets thread count information for all processes // Gets thread count information for all processes
// and the largest number of threads in a single process. // and the largest number of threads in a single process.
STDMETHOD(GetTotalNumberThreads)( STDMETHOD(GetTotalNumberThreads)(
THIS_ THIS_
__out PULONG Total, _Out_ PULONG Total,
__out PULONG LargestProcess _Out_ PULONG LargestProcess
) PURE; ) PURE;
STDMETHOD(GetThreadIdsByIndex)( STDMETHOD(GetThreadIdsByIndex)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount_opt(Count) PULONG Ids, _Out_writes_opt_(Count) PULONG Ids,
__out_ecount_opt(Count) PULONG SysIds _Out_writes_opt_(Count) PULONG SysIds
) PURE; ) PURE;
// Gets the debugger ID for the thread // Gets the debugger ID for the thread
// currently running on the given // currently running on the given
// processor. Only works in kernel // processor. Only works in kernel
// debugging. // debugging.
STDMETHOD(GetThreadIdByProcessor)( STDMETHOD(GetThreadIdByProcessor)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the offset of the current threads // Returns the offset of the current threads
// system data structure. When kernel debugging // system data structure. When kernel debugging
// this is the offset of the KTHREAD. // this is the offset of the KTHREAD.
// When user debugging it is the offset // When user debugging it is the offset
// of the current TEB. // of the current TEB.
STDMETHOD(GetCurrentThreadDataOffset)( STDMETHOD(GetCurrentThreadDataOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger thread ID for the given // Looks up a debugger thread ID for the given
// system thread data structure. // system thread data structure.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdByDataOffset)( STDMETHOD(GetThreadIdByDataOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the offset of the current threads // Returns the offset of the current threads
// TEB. In user mode this is equivalent to // TEB. In user mode this is equivalent to
// the threads data offset. // the threads data offset.
STDMETHOD(GetCurrentThreadTeb)( STDMETHOD(GetCurrentThreadTeb)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger thread ID for the given TEB. // Looks up a debugger thread ID for the given TEB.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdByTeb)( STDMETHOD(GetThreadIdByTeb)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the system unique ID for the current thread. // Returns the system unique ID for the current thread.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetCurrentThreadSystemId)( STDMETHOD(GetCurrentThreadSystemId)(
THIS_ THIS_
__out PULONG SysId _Out_ PULONG SysId
) PURE; ) PURE;
// Looks up a debugger thread ID for the given // Looks up a debugger thread ID for the given
// system thread ID. // system thread ID.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdBySystemId)( STDMETHOD(GetThreadIdBySystemId)(
THIS_ THIS_
__in ULONG SysId, _In_ ULONG SysId,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the handle of the current thread. // Returns the handle of the current thread.
// In kernel mode the value returned is the // In kernel mode the value returned is the
// index of the processor the thread is // index of the processor the thread is
// executing on plus one. // executing on plus one.
STDMETHOD(GetCurrentThreadHandle)( STDMETHOD(GetCurrentThreadHandle)(
THIS_ THIS_
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
// Looks up a debugger thread ID for the given handle. // Looks up a debugger thread ID for the given handle.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdByHandle)( STDMETHOD(GetThreadIdByHandle)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Currently kernel mode sessions will only have // Currently kernel mode sessions will only have
// a single process representing kernel space. // a single process representing kernel space.
STDMETHOD(GetNumberProcesses)( STDMETHOD(GetNumberProcesses)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetProcessIdsByIndex)( STDMETHOD(GetProcessIdsByIndex)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount_opt(Count) PULONG Ids, _Out_writes_opt_(Count) PULONG Ids,
__out_ecount_opt(Count) PULONG SysIds _Out_writes_opt_(Count) PULONG SysIds
) PURE; ) PURE;
// Returns the offset of the current processs // Returns the offset of the current processs
// system data structure. When kernel debugging // system data structure. When kernel debugging
// this is the offset of the KPROCESS of // this is the offset of the KPROCESS of
// the process that owns the current thread. // the process that owns the current thread.
// When user debugging it is the offset // When user debugging it is the offset
// of the current PEB. // of the current PEB.
STDMETHOD(GetCurrentProcessDataOffset)( STDMETHOD(GetCurrentProcessDataOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger process ID for the given // Looks up a debugger process ID for the given
// system process data structure. // system process data structure.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetProcessIdByDataOffset)( STDMETHOD(GetProcessIdByDataOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the offset of the current processs // Returns the offset of the current processs
// PEB. In user mode this is equivalent to // PEB. In user mode this is equivalent to
// the processs data offset. // the processs data offset.
STDMETHOD(GetCurrentProcessPeb)( STDMETHOD(GetCurrentProcessPeb)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger process ID for the given PEB. // Looks up a debugger process ID for the given PEB.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetProcessIdByPeb)( STDMETHOD(GetProcessIdByPeb)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the system unique ID for the current process. // Returns the system unique ID for the current process.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetCurrentProcessSystemId)( STDMETHOD(GetCurrentProcessSystemId)(
THIS_ THIS_
__out PULONG SysId _Out_ PULONG SysId
) PURE; ) PURE;
// Looks up a debugger process ID for the given // Looks up a debugger process ID for the given
// system process ID. // system process ID.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetProcessIdBySystemId)( STDMETHOD(GetProcessIdBySystemId)(
THIS_ THIS_
__in ULONG SysId, _In_ ULONG SysId,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the handle of the current process. // Returns the handle of the current process.
// In kernel mode this is the kernel processs // In kernel mode this is the kernel processs
// artificial handle used for symbol operations // artificial handle used for symbol operations
// and so can only be used with dbghelp APIs. // and so can only be used with dbghelp APIs.
STDMETHOD(GetCurrentProcessHandle)( STDMETHOD(GetCurrentProcessHandle)(
THIS_ THIS_
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
// Looks up a debugger process ID for the given handle. // Looks up a debugger process ID for the given handle.
STDMETHOD(GetProcessIdByHandle)( STDMETHOD(GetProcessIdByHandle)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Retrieve the name of the executable loaded // Retrieve the name of the executable loaded
// in the process. This may fail if no executable // in the process. This may fail if no executable
// was identified. // was identified.
STDMETHOD(GetCurrentProcessExecutableName)( STDMETHOD(GetCurrentProcessExecutableName)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ExeSize _Out_opt_ PULONG ExeSize
) PURE; ) PURE;
// IDebugSystemObjects2. // IDebugSystemObjects2.
// Return the number of seconds that the current // Return the number of seconds that the current
// process has been running. // process has been running.
STDMETHOD(GetCurrentProcessUpTime)( STDMETHOD(GetCurrentProcessUpTime)(
THIS_ THIS_
__out PULONG UpTime _Out_ PULONG UpTime
) PURE; ) PURE;
// During kernel sessions the debugger retrieves // During kernel sessions the debugger retrieves
// some information from the system thread and process // some information from the system thread and process
// running on the current processor. For example, // running on the current processor. For example,
// the debugger will retrieve virtual memory translation // the debugger will retrieve virtual memory translation
// information for when the debugger needs to // information for when the debugger needs to
// carry out its own virtual to physical translations. // carry out its own virtual to physical translations.
// Occasionally it can be interesting to perform // Occasionally it can be interesting to perform
// similar operations but on a process which isnt // similar operations but on a process which isnt
skipping to change at line 14563 skipping to change at line 23389
// the thread and process running on the current // the thread and process running on the current
// processor each time the debuggee executes or // processor each time the debuggee executes or
// the current processor changes. // the current processor changes.
// The thread and process settings are independent so // The thread and process settings are independent so
// it is possible to refer to a thread in a process // it is possible to refer to a thread in a process
// other than the current process and vice versa. // other than the current process and vice versa.
// Setting an offset of zero will reload the // Setting an offset of zero will reload the
// default value. // default value.
STDMETHOD(GetImplicitThreadDataOffset)( STDMETHOD(GetImplicitThreadDataOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(SetImplicitThreadDataOffset)( STDMETHOD(SetImplicitThreadDataOffset)(
THIS_ THIS_
__in ULONG64 Offset _In_ ULONG64 Offset
) PURE; ) PURE;
STDMETHOD(GetImplicitProcessDataOffset)( STDMETHOD(GetImplicitProcessDataOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(SetImplicitProcessDataOffset)( STDMETHOD(SetImplicitProcessDataOffset)(
THIS_ THIS_
__in ULONG64 Offset _In_ ULONG64 Offset
) PURE; ) PURE;
}; };
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugSystemObjects3 #define INTERFACE IDebugSystemObjects3
DECLARE_INTERFACE_(IDebugSystemObjects3, IUnknown) DECLARE_INTERFACE_(IDebugSystemObjects3, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugSystemObjects. // IDebugSystemObjects.
skipping to change at line 14615 skipping to change at line 23441
// limited to enumerating only the threads // limited to enumerating only the threads
// assigned to processors, not all of // assigned to processors, not all of
// the threads in the system. Process // the threads in the system. Process
// enumeration is limited to a single // enumeration is limited to a single
// virtual process representing kernel space. // virtual process representing kernel space.
// Returns the ID of the thread on which // Returns the ID of the thread on which
// the last event occurred. // the last event occurred.
STDMETHOD(GetEventThread)( STDMETHOD(GetEventThread)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetEventProcess)( STDMETHOD(GetEventProcess)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Controls implicit thread used by the // Controls implicit thread used by the
// debug engine. The debuggers current // debug engine. The debuggers current
// thread is just a piece of data held // thread is just a piece of data held
// by the debugger for calls which use // by the debugger for calls which use
// thread-specific information. In those // thread-specific information. In those
// calls the debuggers current thread is used. // calls the debuggers current thread is used.
// The debuggers current thread is not related // The debuggers current thread is not related
// to any system thread attribute. // to any system thread attribute.
// IDs for threads are small integer IDs // IDs for threads are small integer IDs
// maintained by the engine. They are not // maintained by the engine. They are not
// related to system thread IDs. // related to system thread IDs.
STDMETHOD(GetCurrentThreadId)( STDMETHOD(GetCurrentThreadId)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(SetCurrentThreadId)( STDMETHOD(SetCurrentThreadId)(
THIS_ THIS_
__in ULONG Id _In_ ULONG Id
) PURE; ) PURE;
// The current process is the process // The current process is the process
// that owns the current thread. // that owns the current thread.
STDMETHOD(GetCurrentProcessId)( STDMETHOD(GetCurrentProcessId)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Setting the current process automatically // Setting the current process automatically
// sets the current thread to the thread that // sets the current thread to the thread that
// was last current in that process. // was last current in that process.
STDMETHOD(SetCurrentProcessId)( STDMETHOD(SetCurrentProcessId)(
THIS_ THIS_
__in ULONG Id _In_ ULONG Id
) PURE; ) PURE;
// Gets the number of threads in the current process. // Gets the number of threads in the current process.
STDMETHOD(GetNumberThreads)( STDMETHOD(GetNumberThreads)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
// Gets thread count information for all processes // Gets thread count information for all processes
// and the largest number of threads in a single process. // and the largest number of threads in a single process.
STDMETHOD(GetTotalNumberThreads)( STDMETHOD(GetTotalNumberThreads)(
THIS_ THIS_
__out PULONG Total, _Out_ PULONG Total,
__out PULONG LargestProcess _Out_ PULONG LargestProcess
) PURE; ) PURE;
STDMETHOD(GetThreadIdsByIndex)( STDMETHOD(GetThreadIdsByIndex)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount_opt(Count) PULONG Ids, _Out_writes_opt_(Count) PULONG Ids,
__out_ecount_opt(Count) PULONG SysIds _Out_writes_opt_(Count) PULONG SysIds
) PURE; ) PURE;
// Gets the debugger ID for the thread // Gets the debugger ID for the thread
// currently running on the given // currently running on the given
// processor. Only works in kernel // processor. Only works in kernel
// debugging. // debugging.
STDMETHOD(GetThreadIdByProcessor)( STDMETHOD(GetThreadIdByProcessor)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the offset of the current threads // Returns the offset of the current threads
// system data structure. When kernel debugging // system data structure. When kernel debugging
// this is the offset of the KTHREAD. // this is the offset of the KTHREAD.
// When user debugging it is the offset // When user debugging it is the offset
// of the current TEB. // of the current TEB.
STDMETHOD(GetCurrentThreadDataOffset)( STDMETHOD(GetCurrentThreadDataOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger thread ID for the given // Looks up a debugger thread ID for the given
// system thread data structure. // system thread data structure.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdByDataOffset)( STDMETHOD(GetThreadIdByDataOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the offset of the current threads // Returns the offset of the current threads
// TEB. In user mode this is equivalent to // TEB. In user mode this is equivalent to
// the threads data offset. // the threads data offset.
STDMETHOD(GetCurrentThreadTeb)( STDMETHOD(GetCurrentThreadTeb)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger thread ID for the given TEB. // Looks up a debugger thread ID for the given TEB.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdByTeb)( STDMETHOD(GetThreadIdByTeb)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the system unique ID for the current thread. // Returns the system unique ID for the current thread.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetCurrentThreadSystemId)( STDMETHOD(GetCurrentThreadSystemId)(
THIS_ THIS_
__out PULONG SysId _Out_ PULONG SysId
) PURE; ) PURE;
// Looks up a debugger thread ID for the given // Looks up a debugger thread ID for the given
// system thread ID. // system thread ID.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdBySystemId)( STDMETHOD(GetThreadIdBySystemId)(
THIS_ THIS_
__in ULONG SysId, _In_ ULONG SysId,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the handle of the current thread. // Returns the handle of the current thread.
// In kernel mode the value returned is the // In kernel mode the value returned is the
// index of the processor the thread is // index of the processor the thread is
// executing on plus one. // executing on plus one.
STDMETHOD(GetCurrentThreadHandle)( STDMETHOD(GetCurrentThreadHandle)(
THIS_ THIS_
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
// Looks up a debugger thread ID for the given handle. // Looks up a debugger thread ID for the given handle.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdByHandle)( STDMETHOD(GetThreadIdByHandle)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Currently kernel mode sessions will only have // Currently kernel mode sessions will only have
// a single process representing kernel space. // a single process representing kernel space.
STDMETHOD(GetNumberProcesses)( STDMETHOD(GetNumberProcesses)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetProcessIdsByIndex)( STDMETHOD(GetProcessIdsByIndex)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount_opt(Count) PULONG Ids, _Out_writes_opt_(Count) PULONG Ids,
__out_ecount_opt(Count) PULONG SysIds _Out_writes_opt_(Count) PULONG SysIds
) PURE; ) PURE;
// Returns the offset of the current processs // Returns the offset of the current processs
// system data structure. When kernel debugging // system data structure. When kernel debugging
// this is the offset of the KPROCESS of // this is the offset of the KPROCESS of
// the process that owns the current thread. // the process that owns the current thread.
// When user debugging it is the offset // When user debugging it is the offset
// of the current PEB. // of the current PEB.
STDMETHOD(GetCurrentProcessDataOffset)( STDMETHOD(GetCurrentProcessDataOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger process ID for the given // Looks up a debugger process ID for the given
// system process data structure. // system process data structure.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetProcessIdByDataOffset)( STDMETHOD(GetProcessIdByDataOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the offset of the current processs // Returns the offset of the current processs
// PEB. In user mode this is equivalent to // PEB. In user mode this is equivalent to
// the processs data offset. // the processs data offset.
STDMETHOD(GetCurrentProcessPeb)( STDMETHOD(GetCurrentProcessPeb)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger process ID for the given PEB. // Looks up a debugger process ID for the given PEB.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetProcessIdByPeb)( STDMETHOD(GetProcessIdByPeb)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the system unique ID for the current process. // Returns the system unique ID for the current process.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetCurrentProcessSystemId)( STDMETHOD(GetCurrentProcessSystemId)(
THIS_ THIS_
__out PULONG SysId _Out_ PULONG SysId
) PURE; ) PURE;
// Looks up a debugger process ID for the given // Looks up a debugger process ID for the given
// system process ID. // system process ID.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetProcessIdBySystemId)( STDMETHOD(GetProcessIdBySystemId)(
THIS_ THIS_
__in ULONG SysId, _In_ ULONG SysId,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the handle of the current process. // Returns the handle of the current process.
// In kernel mode this is the kernel processs // In kernel mode this is the kernel processs
// artificial handle used for symbol operations // artificial handle used for symbol operations
// and so can only be used with dbghelp APIs. // and so can only be used with dbghelp APIs.
STDMETHOD(GetCurrentProcessHandle)( STDMETHOD(GetCurrentProcessHandle)(
THIS_ THIS_
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
// Looks up a debugger process ID for the given handle. // Looks up a debugger process ID for the given handle.
STDMETHOD(GetProcessIdByHandle)( STDMETHOD(GetProcessIdByHandle)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Retrieve the name of the executable loaded // Retrieve the name of the executable loaded
// in the process. This may fail if no executable // in the process. This may fail if no executable
// was identified. // was identified.
STDMETHOD(GetCurrentProcessExecutableName)( STDMETHOD(GetCurrentProcessExecutableName)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ExeSize _Out_opt_ PULONG ExeSize
) PURE; ) PURE;
// IDebugSystemObjects2. // IDebugSystemObjects2.
// Return the number of seconds that the current // Return the number of seconds that the current
// process has been running. // process has been running.
STDMETHOD(GetCurrentProcessUpTime)( STDMETHOD(GetCurrentProcessUpTime)(
THIS_ THIS_
__out PULONG UpTime _Out_ PULONG UpTime
) PURE; ) PURE;
// During kernel sessions the debugger retrieves // During kernel sessions the debugger retrieves
// some information from the system thread and process // some information from the system thread and process
// running on the current processor. For example, // running on the current processor. For example,
// the debugger will retrieve virtual memory translation // the debugger will retrieve virtual memory translation
// information for when the debugger needs to // information for when the debugger needs to
// carry out its own virtual to physical translations. // carry out its own virtual to physical translations.
// Occasionally it can be interesting to perform // Occasionally it can be interesting to perform
// similar operations but on a process which isnt // similar operations but on a process which isnt
skipping to change at line 14862 skipping to change at line 23688
// the thread and process running on the current // the thread and process running on the current
// processor each time the debuggee executes or // processor each time the debuggee executes or
// the current processor changes. // the current processor changes.
// The thread and process settings are independent so // The thread and process settings are independent so
// it is possible to refer to a thread in a process // it is possible to refer to a thread in a process
// other than the current process and vice versa. // other than the current process and vice versa.
// Setting an offset of zero will reload the // Setting an offset of zero will reload the
// default value. // default value.
STDMETHOD(GetImplicitThreadDataOffset)( STDMETHOD(GetImplicitThreadDataOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(SetImplicitThreadDataOffset)( STDMETHOD(SetImplicitThreadDataOffset)(
THIS_ THIS_
__in ULONG64 Offset _In_ ULONG64 Offset
) PURE; ) PURE;
STDMETHOD(GetImplicitProcessDataOffset)( STDMETHOD(GetImplicitProcessDataOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(SetImplicitProcessDataOffset)( STDMETHOD(SetImplicitProcessDataOffset)(
THIS_ THIS_
__in ULONG64 Offset _In_ ULONG64 Offset
) PURE; ) PURE;
// IDebugSystemObjects3. // IDebugSystemObjects3.
STDMETHOD(GetEventSystem)( STDMETHOD(GetEventSystem)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetCurrentSystemId)( STDMETHOD(GetCurrentSystemId)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(SetCurrentSystemId)( STDMETHOD(SetCurrentSystemId)(
THIS_ THIS_
__in ULONG Id _In_ ULONG Id
) PURE; ) PURE;
STDMETHOD(GetNumberSystems)( STDMETHOD(GetNumberSystems)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetSystemIdsByIndex)( STDMETHOD(GetSystemIdsByIndex)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PULONG Ids _Out_writes_(Count) PULONG Ids
) PURE; ) PURE;
STDMETHOD(GetTotalNumberThreadsAndProcesses)( STDMETHOD(GetTotalNumberThreadsAndProcesses)(
THIS_ THIS_
__out PULONG TotalThreads, _Out_ PULONG TotalThreads,
__out PULONG TotalProcesses, _Out_ PULONG TotalProcesses,
__out PULONG LargestProcessThreads, _Out_ PULONG LargestProcessThreads,
__out PULONG LargestSystemThreads, _Out_ PULONG LargestSystemThreads,
__out PULONG LargestSystemProcesses _Out_ PULONG LargestSystemProcesses
) PURE; ) PURE;
STDMETHOD(GetCurrentSystemServer)( STDMETHOD(GetCurrentSystemServer)(
THIS_ THIS_
__out PULONG64 Server _Out_ PULONG64 Server
) PURE; ) PURE;
STDMETHOD(GetSystemByServer)( STDMETHOD(GetSystemByServer)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetCurrentSystemServerName)( STDMETHOD(GetCurrentSystemServerName)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
}; };
#undef INTERFACE #undef INTERFACE
#define INTERFACE IDebugSystemObjects4 #define INTERFACE IDebugSystemObjects4
DECLARE_INTERFACE_(IDebugSystemObjects4, IUnknown) DECLARE_INTERFACE_(IDebugSystemObjects4, IUnknown)
{ {
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) PURE; ) PURE;
STDMETHOD_(ULONG, AddRef)( STDMETHOD_(ULONG, AddRef)(
THIS THIS
) PURE; ) PURE;
STDMETHOD_(ULONG, Release)( STDMETHOD_(ULONG, Release)(
THIS THIS
) PURE; ) PURE;
// IDebugSystemObjects. // IDebugSystemObjects.
skipping to change at line 14964 skipping to change at line 23790
// limited to enumerating only the threads // limited to enumerating only the threads
// assigned to processors, not all of // assigned to processors, not all of
// the threads in the system. Process // the threads in the system. Process
// enumeration is limited to a single // enumeration is limited to a single
// virtual process representing kernel space. // virtual process representing kernel space.
// Returns the ID of the thread on which // Returns the ID of the thread on which
// the last event occurred. // the last event occurred.
STDMETHOD(GetEventThread)( STDMETHOD(GetEventThread)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetEventProcess)( STDMETHOD(GetEventProcess)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Controls implicit thread used by the // Controls implicit thread used by the
// debug engine. The debuggers current // debug engine. The debuggers current
// thread is just a piece of data held // thread is just a piece of data held
// by the debugger for calls which use // by the debugger for calls which use
// thread-specific information. In those // thread-specific information. In those
// calls the debuggers current thread is used. // calls the debuggers current thread is used.
// The debuggers current thread is not related // The debuggers current thread is not related
// to any system thread attribute. // to any system thread attribute.
// IDs for threads are small integer IDs // IDs for threads are small integer IDs
// maintained by the engine. They are not // maintained by the engine. They are not
// related to system thread IDs. // related to system thread IDs.
STDMETHOD(GetCurrentThreadId)( STDMETHOD(GetCurrentThreadId)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(SetCurrentThreadId)( STDMETHOD(SetCurrentThreadId)(
THIS_ THIS_
__in ULONG Id _In_ ULONG Id
) PURE; ) PURE;
// The current process is the process // The current process is the process
// that owns the current thread. // that owns the current thread.
STDMETHOD(GetCurrentProcessId)( STDMETHOD(GetCurrentProcessId)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Setting the current process automatically // Setting the current process automatically
// sets the current thread to the thread that // sets the current thread to the thread that
// was last current in that process. // was last current in that process.
STDMETHOD(SetCurrentProcessId)( STDMETHOD(SetCurrentProcessId)(
THIS_ THIS_
__in ULONG Id _In_ ULONG Id
) PURE; ) PURE;
// Gets the number of threads in the current process. // Gets the number of threads in the current process.
STDMETHOD(GetNumberThreads)( STDMETHOD(GetNumberThreads)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
// Gets thread count information for all processes // Gets thread count information for all processes
// and the largest number of threads in a single process. // and the largest number of threads in a single process.
STDMETHOD(GetTotalNumberThreads)( STDMETHOD(GetTotalNumberThreads)(
THIS_ THIS_
__out PULONG Total, _Out_ PULONG Total,
__out PULONG LargestProcess _Out_ PULONG LargestProcess
) PURE; ) PURE;
STDMETHOD(GetThreadIdsByIndex)( STDMETHOD(GetThreadIdsByIndex)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount_opt(Count) PULONG Ids, _Out_writes_opt_(Count) PULONG Ids,
__out_ecount_opt(Count) PULONG SysIds _Out_writes_opt_(Count) PULONG SysIds
) PURE; ) PURE;
// Gets the debugger ID for the thread // Gets the debugger ID for the thread
// currently running on the given // currently running on the given
// processor. Only works in kernel // processor. Only works in kernel
// debugging. // debugging.
STDMETHOD(GetThreadIdByProcessor)( STDMETHOD(GetThreadIdByProcessor)(
THIS_ THIS_
__in ULONG Processor, _In_ ULONG Processor,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the offset of the current threads // Returns the offset of the current threads
// system data structure. When kernel debugging // system data structure. When kernel debugging
// this is the offset of the KTHREAD. // this is the offset of the KTHREAD.
// When user debugging it is the offset // When user debugging it is the offset
// of the current TEB. // of the current TEB.
STDMETHOD(GetCurrentThreadDataOffset)( STDMETHOD(GetCurrentThreadDataOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger thread ID for the given // Looks up a debugger thread ID for the given
// system thread data structure. // system thread data structure.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdByDataOffset)( STDMETHOD(GetThreadIdByDataOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the offset of the current threads // Returns the offset of the current threads
// TEB. In user mode this is equivalent to // TEB. In user mode this is equivalent to
// the threads data offset. // the threads data offset.
STDMETHOD(GetCurrentThreadTeb)( STDMETHOD(GetCurrentThreadTeb)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger thread ID for the given TEB. // Looks up a debugger thread ID for the given TEB.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdByTeb)( STDMETHOD(GetThreadIdByTeb)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the system unique ID for the current thread. // Returns the system unique ID for the current thread.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetCurrentThreadSystemId)( STDMETHOD(GetCurrentThreadSystemId)(
THIS_ THIS_
__out PULONG SysId _Out_ PULONG SysId
) PURE; ) PURE;
// Looks up a debugger thread ID for the given // Looks up a debugger thread ID for the given
// system thread ID. // system thread ID.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdBySystemId)( STDMETHOD(GetThreadIdBySystemId)(
THIS_ THIS_
__in ULONG SysId, _In_ ULONG SysId,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the handle of the current thread. // Returns the handle of the current thread.
// In kernel mode the value returned is the // In kernel mode the value returned is the
// index of the processor the thread is // index of the processor the thread is
// executing on plus one. // executing on plus one.
STDMETHOD(GetCurrentThreadHandle)( STDMETHOD(GetCurrentThreadHandle)(
THIS_ THIS_
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
// Looks up a debugger thread ID for the given handle. // Looks up a debugger thread ID for the given handle.
// Currently when kernel debugging this will fail // Currently when kernel debugging this will fail
// if the thread is not executing on a processor. // if the thread is not executing on a processor.
STDMETHOD(GetThreadIdByHandle)( STDMETHOD(GetThreadIdByHandle)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Currently kernel mode sessions will only have // Currently kernel mode sessions will only have
// a single process representing kernel space. // a single process representing kernel space.
STDMETHOD(GetNumberProcesses)( STDMETHOD(GetNumberProcesses)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetProcessIdsByIndex)( STDMETHOD(GetProcessIdsByIndex)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount_opt(Count) PULONG Ids, _Out_writes_opt_(Count) PULONG Ids,
__out_ecount_opt(Count) PULONG SysIds _Out_writes_opt_(Count) PULONG SysIds
) PURE; ) PURE;
// Returns the offset of the current processs // Returns the offset of the current processs
// system data structure. When kernel debugging // system data structure. When kernel debugging
// this is the offset of the KPROCESS of // this is the offset of the KPROCESS of
// the process that owns the current thread. // the process that owns the current thread.
// When user debugging it is the offset // When user debugging it is the offset
// of the current PEB. // of the current PEB.
STDMETHOD(GetCurrentProcessDataOffset)( STDMETHOD(GetCurrentProcessDataOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger process ID for the given // Looks up a debugger process ID for the given
// system process data structure. // system process data structure.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetProcessIdByDataOffset)( STDMETHOD(GetProcessIdByDataOffset)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the offset of the current processs // Returns the offset of the current processs
// PEB. In user mode this is equivalent to // PEB. In user mode this is equivalent to
// the processs data offset. // the processs data offset.
STDMETHOD(GetCurrentProcessPeb)( STDMETHOD(GetCurrentProcessPeb)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
// Looks up a debugger process ID for the given PEB. // Looks up a debugger process ID for the given PEB.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetProcessIdByPeb)( STDMETHOD(GetProcessIdByPeb)(
THIS_ THIS_
__in ULONG64 Offset, _In_ ULONG64 Offset,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the system unique ID for the current process. // Returns the system unique ID for the current process.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetCurrentProcessSystemId)( STDMETHOD(GetCurrentProcessSystemId)(
THIS_ THIS_
__out PULONG SysId _Out_ PULONG SysId
) PURE; ) PURE;
// Looks up a debugger process ID for the given // Looks up a debugger process ID for the given
// system process ID. // system process ID.
// Not currently supported when kernel debugging. // Not currently supported when kernel debugging.
STDMETHOD(GetProcessIdBySystemId)( STDMETHOD(GetProcessIdBySystemId)(
THIS_ THIS_
__in ULONG SysId, _In_ ULONG SysId,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Returns the handle of the current process. // Returns the handle of the current process.
// In kernel mode this is the kernel processs // In kernel mode this is the kernel processs
// artificial handle used for symbol operations // artificial handle used for symbol operations
// and so can only be used with dbghelp APIs. // and so can only be used with dbghelp APIs.
STDMETHOD(GetCurrentProcessHandle)( STDMETHOD(GetCurrentProcessHandle)(
THIS_ THIS_
__out PULONG64 Handle _Out_ PULONG64 Handle
) PURE; ) PURE;
// Looks up a debugger process ID for the given handle. // Looks up a debugger process ID for the given handle.
STDMETHOD(GetProcessIdByHandle)( STDMETHOD(GetProcessIdByHandle)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
// Retrieve the name of the executable loaded // Retrieve the name of the executable loaded
// in the process. This may fail if no executable // in the process. This may fail if no executable
// was identified. // was identified.
STDMETHOD(GetCurrentProcessExecutableName)( STDMETHOD(GetCurrentProcessExecutableName)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ExeSize _Out_opt_ PULONG ExeSize
) PURE; ) PURE;
// IDebugSystemObjects2. // IDebugSystemObjects2.
// Return the number of seconds that the current // Return the number of seconds that the current
// process has been running. // process has been running.
STDMETHOD(GetCurrentProcessUpTime)( STDMETHOD(GetCurrentProcessUpTime)(
THIS_ THIS_
__out PULONG UpTime _Out_ PULONG UpTime
) PURE; ) PURE;
// During kernel sessions the debugger retrieves // During kernel sessions the debugger retrieves
// some information from the system thread and process // some information from the system thread and process
// running on the current processor. For example, // running on the current processor. For example,
// the debugger will retrieve virtual memory translation // the debugger will retrieve virtual memory translation
// information for when the debugger needs to // information for when the debugger needs to
// carry out its own virtual to physical translations. // carry out its own virtual to physical translations.
// Occasionally it can be interesting to perform // Occasionally it can be interesting to perform
// similar operations but on a process which isnt // similar operations but on a process which isnt
skipping to change at line 15211 skipping to change at line 24037
// the thread and process running on the current // the thread and process running on the current
// processor each time the debuggee executes or // processor each time the debuggee executes or
// the current processor changes. // the current processor changes.
// The thread and process settings are independent so // The thread and process settings are independent so
// it is possible to refer to a thread in a process // it is possible to refer to a thread in a process
// other than the current process and vice versa. // other than the current process and vice versa.
// Setting an offset of zero will reload the // Setting an offset of zero will reload the
// default value. // default value.
STDMETHOD(GetImplicitThreadDataOffset)( STDMETHOD(GetImplicitThreadDataOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(SetImplicitThreadDataOffset)( STDMETHOD(SetImplicitThreadDataOffset)(
THIS_ THIS_
__in ULONG64 Offset _In_ ULONG64 Offset
) PURE; ) PURE;
STDMETHOD(GetImplicitProcessDataOffset)( STDMETHOD(GetImplicitProcessDataOffset)(
THIS_ THIS_
__out PULONG64 Offset _Out_ PULONG64 Offset
) PURE; ) PURE;
STDMETHOD(SetImplicitProcessDataOffset)( STDMETHOD(SetImplicitProcessDataOffset)(
THIS_ THIS_
__in ULONG64 Offset _In_ ULONG64 Offset
) PURE; ) PURE;
// IDebugSystemObjects3. // IDebugSystemObjects3.
STDMETHOD(GetEventSystem)( STDMETHOD(GetEventSystem)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetCurrentSystemId)( STDMETHOD(GetCurrentSystemId)(
THIS_ THIS_
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(SetCurrentSystemId)( STDMETHOD(SetCurrentSystemId)(
THIS_ THIS_
__in ULONG Id _In_ ULONG Id
) PURE; ) PURE;
STDMETHOD(GetNumberSystems)( STDMETHOD(GetNumberSystems)(
THIS_ THIS_
__out PULONG Number _Out_ PULONG Number
) PURE; ) PURE;
STDMETHOD(GetSystemIdsByIndex)( STDMETHOD(GetSystemIdsByIndex)(
THIS_ THIS_
__in ULONG Start, _In_ ULONG Start,
__in ULONG Count, _In_ ULONG Count,
__out_ecount(Count) PULONG Ids _Out_writes_(Count) PULONG Ids
) PURE; ) PURE;
STDMETHOD(GetTotalNumberThreadsAndProcesses)( STDMETHOD(GetTotalNumberThreadsAndProcesses)(
THIS_ THIS_
__out PULONG TotalThreads, _Out_ PULONG TotalThreads,
__out PULONG TotalProcesses, _Out_ PULONG TotalProcesses,
__out PULONG LargestProcessThreads, _Out_ PULONG LargestProcessThreads,
__out PULONG LargestSystemThreads, _Out_ PULONG LargestSystemThreads,
__out PULONG LargestSystemProcesses _Out_ PULONG LargestSystemProcesses
) PURE; ) PURE;
STDMETHOD(GetCurrentSystemServer)( STDMETHOD(GetCurrentSystemServer)(
THIS_ THIS_
__out PULONG64 Server _Out_ PULONG64 Server
) PURE; ) PURE;
STDMETHOD(GetSystemByServer)( STDMETHOD(GetSystemByServer)(
THIS_ THIS_
__in ULONG64 Server, _In_ ULONG64 Server,
__out PULONG Id _Out_ PULONG Id
) PURE; ) PURE;
STDMETHOD(GetCurrentSystemServerName)( STDMETHOD(GetCurrentSystemServerName)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PSTR Buffer, _Out_writes_opt_(BufferSize) PSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
// IDebugSystemObjects4. // IDebugSystemObjects4.
STDMETHOD(GetCurrentProcessExecutableNameWide)( STDMETHOD(GetCurrentProcessExecutableNameWide)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG ExeSize _Out_opt_ PULONG ExeSize
) PURE; ) PURE;
STDMETHOD(GetCurrentSystemServerNameWide)( STDMETHOD(GetCurrentSystemServerNameWide)(
THIS_ THIS_
__out_ecount_opt(BufferSize) PWSTR Buffer, _Out_writes_opt_(BufferSize) PWSTR Buffer,
__in ULONG BufferSize, _In_ ULONG BufferSize,
__out_opt PULONG NameSize _Out_opt_ PULONG NameSize
) PURE; ) PURE;
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// Debugger/debuggee communication. // Debugger/debuggee communication.
// //
// A distinguished exception, DBG_COMMAND_EXCEPTION (0x40010009), // A distinguished exception, DBG_COMMAND_EXCEPTION (0x40010009),
// can be used by a debuggee to communicate with the debugger. // can be used by a debuggee to communicate with the debugger.
// The arguments of the exception must be: // The arguments of the exception must be:
skipping to change at line 15370 skipping to change at line 24196
// per-command help. // per-command help.
#define DEBUG_EXTINIT_HAS_COMMAND_HELP 0x00000001 #define DEBUG_EXTINIT_HAS_COMMAND_HELP 0x00000001
// Initialization routine. Called once when the extension DLL // Initialization routine. Called once when the extension DLL
// is loaded. Returns a version and returns flags detailing // is loaded. Returns a version and returns flags detailing
// overall qualities of the extension DLL. // overall qualities of the extension DLL.
// A session may or may not be active at the time the DLL // A session may or may not be active at the time the DLL
// is loaded so initialization routines should not expect // is loaded so initialization routines should not expect
// to be able to query session information. // to be able to query session information.
typedef HRESULT (CALLBACK* PDEBUG_EXTENSION_INITIALIZE) typedef HRESULT (CALLBACK* PDEBUG_EXTENSION_INITIALIZE)
(__out PULONG Version, __out PULONG Flags); (_Out_ PULONG Version, _Out_ PULONG Flags);
// Exit routine. Called once just before the extension DLL is // Exit routine. Called once just before the extension DLL is
// unloaded. As with initialization, a session may or // unloaded. As with initialization, a session may or
// may not be active at the time of the call. // may not be active at the time of the call.
typedef void (CALLBACK* PDEBUG_EXTENSION_UNINITIALIZE) typedef void (CALLBACK* PDEBUG_EXTENSION_UNINITIALIZE)
(void); (void);
// A debuggee has been discovered for the session. It // A debuggee has been discovered for the session. It
// is not necessarily halted. // is not necessarily halted.
#define DEBUG_NOTIFY_SESSION_ACTIVE 0x00000000 #define DEBUG_NOTIFY_SESSION_ACTIVE 0x00000000
// The session no longer has a debuggee. // The session no longer has a debuggee.
#define DEBUG_NOTIFY_SESSION_INACTIVE 0x00000001 #define DEBUG_NOTIFY_SESSION_INACTIVE 0x00000001
// The debuggee is halted and accessible. // The debuggee is halted and accessible.
#define DEBUG_NOTIFY_SESSION_ACCESSIBLE 0x00000002 #define DEBUG_NOTIFY_SESSION_ACCESSIBLE 0x00000002
// The debuggee is running or inaccessible. // The debuggee is running or inaccessible.
#define DEBUG_NOTIFY_SESSION_INACCESSIBLE 0x00000003 #define DEBUG_NOTIFY_SESSION_INACCESSIBLE 0x00000003
typedef void (CALLBACK* PDEBUG_EXTENSION_NOTIFY) typedef void (CALLBACK* PDEBUG_EXTENSION_NOTIFY)
(__in ULONG Notify, __in ULONG64 Argument); (_In_ ULONG Notify, _In_ ULONG64 Argument);
// A PDEBUG_EXTENSION_CALL function can return this code // A PDEBUG_EXTENSION_CALL function can return this code
// to indicate that it was unable to handle the request // to indicate that it was unable to handle the request
// and that the search for an extension function should // and that the search for an extension function should
// continue down the extension DLL chain. // continue down the extension DLL chain.
// Taken from STATUS_VALIDATE_CONTINUE. // Taken from STATUS_VALIDATE_CONTINUE.
#define DEBUG_EXTENSION_CONTINUE_SEARCH \ #define DEBUG_EXTENSION_CONTINUE_SEARCH \
HRESULT_FROM_NT(0xC0000271L) HRESULT_FROM_NT(0xC0000271L)
// A PDEBUG_EXTENSION_CALL function can return this code // A PDEBUG_EXTENSION_CALL function can return this code
// to indicate that the engine should unload and reload // to indicate that the engine should unload and reload
// the extension binary. This allows extensions to implement // the extension binary. This allows extensions to implement
// auto-update functionality. // auto-update functionality.
#define DEBUG_EXTENSION_RELOAD_EXTENSION \ #define DEBUG_EXTENSION_RELOAD_EXTENSION \
HRESULT_FROM_NT(0xC00000EEL) HRESULT_FROM_NT(0xC00000EEL)
// Every routine in an extension DLL has the following prototype. // Every routine in an extension DLL has the following prototype.
// The extension may be called from multiple clients so it // The extension may be called from multiple clients so it
// should not cache the client value between calls. // should not cache the client value between calls.
typedef HRESULT (CALLBACK* PDEBUG_EXTENSION_CALL) typedef HRESULT (CALLBACK* PDEBUG_EXTENSION_CALL)
(__in PDEBUG_CLIENT Client, __in_opt PCSTR Args); (_In_ PDEBUG_CLIENT Client, _In_opt_ PCSTR Args);
// //
// KnownStructOutput[Ex] flags // KnownStructOutput[Ex] flags
// //
// Return names of supported structs. // Return names of supported structs.
#define DEBUG_KNOWN_STRUCT_GET_NAMES 1 #define DEBUG_KNOWN_STRUCT_GET_NAMES 1
// Return value output for type. // Return value output for type.
#define DEBUG_KNOWN_STRUCT_GET_SINGLE_LINE_OUTPUT 2 #define DEBUG_KNOWN_STRUCT_GET_SINGLE_LINE_OUTPUT 2
// Return S_OK if suppressing type name. // Return S_OK if suppressing type name.
#define DEBUG_KNOWN_STRUCT_SUPPRESS_TYPE_NAME 3 #define DEBUG_KNOWN_STRUCT_SUPPRESS_TYPE_NAME 3
// Extensions may export this callback in order to dump structs that // Extensions may export this callback in order to dump structs that
// are well known to them. The engine calls this to inject extension // are well known to them. The engine calls this to inject extension
// output into dt's struct dump. // output into dt's struct dump.
typedef HRESULT (CALLBACK* PDEBUG_EXTENSION_KNOWN_STRUCT) typedef HRESULT (CALLBACK* PDEBUG_EXTENSION_KNOWN_STRUCT)
(__in ULONG Flags, (_In_ ULONG Flags,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_opt PSTR TypeName, _In_opt_ PSTR TypeName,
__out_ecount_opt(*BufferChars) PSTR Buffer, _Out_writes_opt_(*BufferChars) PSTR Buffer,
__inout_opt PULONG BufferChars); _Inout_opt_ PULONG BufferChars);
typedef HRESULT (CALLBACK* PDEBUG_EXTENSION_KNOWN_STRUCT_EX) typedef HRESULT (CALLBACK* PDEBUG_EXTENSION_KNOWN_STRUCT_EX)
(__in PDEBUG_CLIENT Client, (_In_ PDEBUG_CLIENT Client,
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG64 Offset, _In_ ULONG64 Offset,
__in_opt PCSTR TypeName, _In_opt_ PCSTR TypeName,
__out_ecount_opt(*BufferChars) PSTR Buffer, _Out_writes_opt_(*BufferChars) PSTR Buffer,
__inout_opt PULONG BufferChars); _Inout_opt_ PULONG BufferChars);
// Backwards compatibility with old, incorrect name. // Backwards compatibility with old, incorrect name.
typedef PDEBUG_EXTENSION_KNOWN_STRUCT PDEBUG_ENTENSION_KNOWNSTRUCT; typedef PDEBUG_EXTENSION_KNOWN_STRUCT PDEBUG_ENTENSION_KNOWNSTRUCT;
// //
// Extensions can provide pseudo-register values that // Extensions can provide pseudo-register values that
// operate similiarly to the debugger's built-in $teb, etc. // operate similiarly to the debugger's built-in $teb, etc.
// //
#define DEBUG_EXT_QVALUE_DEFAULT 0x00000000 #define DEBUG_EXT_QVALUE_DEFAULT 0x00000000
typedef HRESULT (CALLBACK* PDEBUG_EXTENSION_QUERY_VALUE_NAMES) typedef HRESULT (CALLBACK* PDEBUG_EXTENSION_QUERY_VALUE_NAMES)
(__in PDEBUG_CLIENT Client, (_In_ PDEBUG_CLIENT Client,
__in ULONG Flags, _In_ ULONG Flags,
__out_ecount(BufferChars) PWSTR Buffer, _Out_writes_(BufferChars) PWSTR Buffer,
__in ULONG BufferChars, _In_ ULONG BufferChars,
__out PULONG BufferNeeded); _Out_ PULONG BufferNeeded);
#define DEBUG_EXT_PVALUE_DEFAULT 0x00000000 #define DEBUG_EXT_PVALUE_DEFAULT 0x00000000
#define DEBUG_EXT_PVTYPE_IS_VALUE 0x00000000 #define DEBUG_EXT_PVTYPE_IS_VALUE 0x00000000
#define DEBUG_EXT_PVTYPE_IS_POINTER 0x00000001 #define DEBUG_EXT_PVTYPE_IS_POINTER 0x00000001
typedef HRESULT (CALLBACK* PDEBUG_EXTENSION_PROVIDE_VALUE) typedef HRESULT (CALLBACK* PDEBUG_EXTENSION_PROVIDE_VALUE)
(__in PDEBUG_CLIENT Client, (_In_ PDEBUG_CLIENT Client,
__in ULONG Flags, _In_ ULONG Flags,
__in PCWSTR Name, _In_ PCWSTR Name,
__out PULONG64 Value, _Out_ PULONG64 Value,
__out PULONG64 TypeModBase, _Out_ PULONG64 TypeModBase,
__out PULONG TypeId, _Out_ PULONG TypeId,
__out PULONG TypeFlags); _Out_ PULONG TypeFlags);
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// Extension functions. // Extension functions.
// //
// Extension functions differ from extension callbacks in that // Extension functions differ from extension callbacks in that
// they are arbitrary functions exported from an extension DLL // they are arbitrary functions exported from an extension DLL
// for other code callers instead of for human invocation from // for other code callers instead of for human invocation from
// debugger commands. Extension function pointers are retrieved // debugger commands. Extension function pointers are retrieved
// for an extension DLL with IDebugControl::GetExtensionFunction. // for an extension DLL with IDebugControl::GetExtensionFunction.
skipping to change at line 15501 skipping to change at line 24327
// directly between the caller and the extension function and // directly between the caller and the extension function and
// are not mediated by the engine. // are not mediated by the engine.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#ifdef __cplusplus #ifdef __cplusplus
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //
// Dump stack provider callbacks
//
//----------------------------------------------------------------------------
// If a specific dump stream type is present,
// dbgeng will pass the stream to dump stack
// provider prior to thread enumeration.
// Implemented by dump stack provider
// BeginThreadStackReconstruction
typedef HRESULT (CALLBACK* PDEBUG_STACK_PROVIDER_BEGINTHREADSTACKRECONSTRUCTION)
(
_In_ ULONG StreamType,
_In_reads_(BufferSize) PVOID MiniDumpStreamBuffer,
_In_ ULONG BufferSize);
// Queries dump stream provider per-thread
// Stack frames and symbolic data are returned
// New inline frames may be provided
// stackdmpprovider must be enabled
// ReconstructStack
typedef HRESULT (CALLBACK* PDEBUG_STACK_PROVIDER_RECONSTRUCTSTACK)
(
_In_ ULONG SystemThreadId,
_In_reads_(CountNativeFrames) PDEBUG_STACK_FRAME_EX NativeFrames,
_In_ ULONG CountNativeFrames,
_Outptr_result_buffer_(*StackSymFramesFilled) PSTACK_SYM_FRAME_INFO *StackSy
mFrames,
_Out_ PULONG StackSymFramesFilled);
//After ReconstructStack is called and used dbgeng will call the stack provider
to free memory
// FreeStackSymFrames
typedef HRESULT (CALLBACK* PDEBUG_STACK_PROVIDER_FREESTACKSYMFRAMES)
(
_In_opt_ PSTACK_SYM_FRAME_INFO StackSymFrames);
// Dbgeng is done with thread stack reconstruction
// Dump stack provider may clean up state
// EndThreadStackReconstruction
typedef HRESULT (CALLBACK* PDEBUG_STACK_PROVIDER_ENDTHREADSTACKRECONSTRUCTION)
(void);
//----------------------------------------------------------------------------
//
// C++ implementation helper classes. // C++ implementation helper classes.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#if !defined(DEBUG_NO_IMPLEMENTATION) && !defined(_M_CEE_PURE) #if !defined(DEBUG_NO_IMPLEMENTATION) && !defined(_M_CEE_PURE)
// //
// DebugBaseEventCallbacks provides a do-nothing base implementation // DebugBaseEventCallbacks provides a do-nothing base implementation
// of IDebugEventCallbacks. A program can derive their own // of IDebugEventCallbacks. A program can derive their own
// event callbacks class from DebugBaseEventCallbacks and implement // event callbacks class from DebugBaseEventCallbacks and implement
// only the methods they are interested in. Programs must be // only the methods they are interested in. Programs must be
// careful to implement GetInterestMask appropriately. // careful to implement GetInterestMask appropriately.
// //
class DebugBaseEventCallbacks : public IDebugEventCallbacks class DebugBaseEventCallbacks : public IDebugEventCallbacks
{ {
public: public:
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) )
{ {
*Interface = NULL; *Interface = NULL;
#if _MSC_VER >= 1100 #if _MSC_VER >= 1100
if (IsEqualIID(InterfaceId, __uuidof(IUnknown)) || if (IsEqualIID(InterfaceId, __uuidof(IUnknown)) ||
IsEqualIID(InterfaceId, __uuidof(IDebugEventCallbacks))) IsEqualIID(InterfaceId, __uuidof(IDebugEventCallbacks)))
#else #else
if (IsEqualIID(InterfaceId, IID_IUnknown) || if (IsEqualIID(InterfaceId, IID_IUnknown) ||
IsEqualIID(InterfaceId, IID_IDebugEventCallbacks)) IsEqualIID(InterfaceId, IID_IDebugEventCallbacks))
skipping to change at line 15548 skipping to change at line 24416
else else
{ {
return E_NOINTERFACE; return E_NOINTERFACE;
} }
} }
// IDebugEventCallbacks. // IDebugEventCallbacks.
STDMETHOD(Breakpoint)( STDMETHOD(Breakpoint)(
THIS_ THIS_
__in PDEBUG_BREAKPOINT Bp _In_ PDEBUG_BREAKPOINT Bp
) )
{ {
UNREFERENCED_PARAMETER(Bp); UNREFERENCED_PARAMETER(Bp);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(Exception)( STDMETHOD(Exception)(
THIS_ THIS_
__in PEXCEPTION_RECORD64 Exception, _In_ PEXCEPTION_RECORD64 Exception,
__in ULONG FirstChance _In_ ULONG FirstChance
) )
{ {
UNREFERENCED_PARAMETER(Exception); UNREFERENCED_PARAMETER(Exception);
UNREFERENCED_PARAMETER(FirstChance); UNREFERENCED_PARAMETER(FirstChance);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(CreateThread)( STDMETHOD(CreateThread)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in ULONG64 DataOffset, _In_ ULONG64 DataOffset,
__in ULONG64 StartOffset _In_ ULONG64 StartOffset
) )
{ {
UNREFERENCED_PARAMETER(Handle); UNREFERENCED_PARAMETER(Handle);
UNREFERENCED_PARAMETER(DataOffset); UNREFERENCED_PARAMETER(DataOffset);
UNREFERENCED_PARAMETER(StartOffset); UNREFERENCED_PARAMETER(StartOffset);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(ExitThread)( STDMETHOD(ExitThread)(
THIS_ THIS_
__in ULONG ExitCode _In_ ULONG ExitCode
) )
{ {
UNREFERENCED_PARAMETER(ExitCode); UNREFERENCED_PARAMETER(ExitCode);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(CreateProcess)( STDMETHOD(CreateProcess)(
THIS_ THIS_
__in ULONG64 ImageFileHandle, _In_ ULONG64 ImageFileHandle,
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in ULONG64 BaseOffset, _In_ ULONG64 BaseOffset,
__in ULONG ModuleSize, _In_ ULONG ModuleSize,
__in PCSTR ModuleName, _In_ PCSTR ModuleName,
__in PCSTR ImageName, _In_ PCSTR ImageName,
__in ULONG CheckSum, _In_ ULONG CheckSum,
__in ULONG TimeDateStamp, _In_ ULONG TimeDateStamp,
__in ULONG64 InitialThreadHandle, _In_ ULONG64 InitialThreadHandle,
__in ULONG64 ThreadDataOffset, _In_ ULONG64 ThreadDataOffset,
__in ULONG64 StartOffset _In_ ULONG64 StartOffset
) )
{ {
UNREFERENCED_PARAMETER(ImageFileHandle); UNREFERENCED_PARAMETER(ImageFileHandle);
UNREFERENCED_PARAMETER(Handle); UNREFERENCED_PARAMETER(Handle);
UNREFERENCED_PARAMETER(BaseOffset); UNREFERENCED_PARAMETER(BaseOffset);
UNREFERENCED_PARAMETER(ModuleSize); UNREFERENCED_PARAMETER(ModuleSize);
UNREFERENCED_PARAMETER(ModuleName); UNREFERENCED_PARAMETER(ModuleName);
UNREFERENCED_PARAMETER(ImageName); UNREFERENCED_PARAMETER(ImageName);
UNREFERENCED_PARAMETER(CheckSum); UNREFERENCED_PARAMETER(CheckSum);
UNREFERENCED_PARAMETER(TimeDateStamp); UNREFERENCED_PARAMETER(TimeDateStamp);
UNREFERENCED_PARAMETER(InitialThreadHandle); UNREFERENCED_PARAMETER(InitialThreadHandle);
UNREFERENCED_PARAMETER(ThreadDataOffset); UNREFERENCED_PARAMETER(ThreadDataOffset);
UNREFERENCED_PARAMETER(StartOffset); UNREFERENCED_PARAMETER(StartOffset);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(ExitProcess)( STDMETHOD(ExitProcess)(
THIS_ THIS_
__in ULONG ExitCode _In_ ULONG ExitCode
) )
{ {
UNREFERENCED_PARAMETER(ExitCode); UNREFERENCED_PARAMETER(ExitCode);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(LoadModule)( STDMETHOD(LoadModule)(
THIS_ THIS_
__in ULONG64 ImageFileHandle, _In_ ULONG64 ImageFileHandle,
__in ULONG64 BaseOffset, _In_ ULONG64 BaseOffset,
__in ULONG ModuleSize, _In_ ULONG ModuleSize,
__in PCSTR ModuleName, _In_ PCSTR ModuleName,
__in PCSTR ImageName, _In_ PCSTR ImageName,
__in ULONG CheckSum, _In_ ULONG CheckSum,
__in ULONG TimeDateStamp _In_ ULONG TimeDateStamp
) )
{ {
UNREFERENCED_PARAMETER(ImageFileHandle); UNREFERENCED_PARAMETER(ImageFileHandle);
UNREFERENCED_PARAMETER(BaseOffset); UNREFERENCED_PARAMETER(BaseOffset);
UNREFERENCED_PARAMETER(ModuleSize); UNREFERENCED_PARAMETER(ModuleSize);
UNREFERENCED_PARAMETER(ModuleName); UNREFERENCED_PARAMETER(ModuleName);
UNREFERENCED_PARAMETER(ImageName); UNREFERENCED_PARAMETER(ImageName);
UNREFERENCED_PARAMETER(CheckSum); UNREFERENCED_PARAMETER(CheckSum);
UNREFERENCED_PARAMETER(TimeDateStamp); UNREFERENCED_PARAMETER(TimeDateStamp);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(UnloadModule)( STDMETHOD(UnloadModule)(
THIS_ THIS_
__in PCSTR ImageBaseName, _In_ PCSTR ImageBaseName,
__in ULONG64 BaseOffset _In_ ULONG64 BaseOffset
) )
{ {
UNREFERENCED_PARAMETER(ImageBaseName); UNREFERENCED_PARAMETER(ImageBaseName);
UNREFERENCED_PARAMETER(BaseOffset); UNREFERENCED_PARAMETER(BaseOffset);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(SystemError)( STDMETHOD(SystemError)(
THIS_ THIS_
__in ULONG Error, _In_ ULONG Error,
__in ULONG Level _In_ ULONG Level
) )
{ {
UNREFERENCED_PARAMETER(Error); UNREFERENCED_PARAMETER(Error);
UNREFERENCED_PARAMETER(Level); UNREFERENCED_PARAMETER(Level);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(SessionStatus)( STDMETHOD(SessionStatus)(
THIS_ THIS_
__in ULONG Status _In_ ULONG Status
) )
{ {
UNREFERENCED_PARAMETER(Status); UNREFERENCED_PARAMETER(Status);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(ChangeDebuggeeState)( STDMETHOD(ChangeDebuggeeState)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG64 Argument _In_ ULONG64 Argument
) )
{ {
UNREFERENCED_PARAMETER(Flags); UNREFERENCED_PARAMETER(Flags);
UNREFERENCED_PARAMETER(Argument); UNREFERENCED_PARAMETER(Argument);
return S_OK; return S_OK;
} }
STDMETHOD(ChangeEngineState)( STDMETHOD(ChangeEngineState)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG64 Argument _In_ ULONG64 Argument
) )
{ {
UNREFERENCED_PARAMETER(Flags); UNREFERENCED_PARAMETER(Flags);
UNREFERENCED_PARAMETER(Argument); UNREFERENCED_PARAMETER(Argument);
return S_OK; return S_OK;
} }
STDMETHOD(ChangeSymbolState)( STDMETHOD(ChangeSymbolState)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG64 Argument _In_ ULONG64 Argument
) )
{ {
UNREFERENCED_PARAMETER(Flags); UNREFERENCED_PARAMETER(Flags);
UNREFERENCED_PARAMETER(Argument); UNREFERENCED_PARAMETER(Argument);
return S_OK; return S_OK;
} }
}; };
class DebugBaseEventCallbacksWide : public IDebugEventCallbacksWide class DebugBaseEventCallbacksWide : public IDebugEventCallbacksWide
{ {
public: public:
// IUnknown. // IUnknown.
STDMETHOD(QueryInterface)( STDMETHOD(QueryInterface)(
THIS_ THIS_
__in REFIID InterfaceId, _In_ REFIID InterfaceId,
__out PVOID* Interface _Out_ PVOID* Interface
) )
{ {
*Interface = NULL; *Interface = NULL;
#if _MSC_VER >= 1100 #if _MSC_VER >= 1100
if (IsEqualIID(InterfaceId, __uuidof(IUnknown)) || if (IsEqualIID(InterfaceId, __uuidof(IUnknown)) ||
IsEqualIID(InterfaceId, __uuidof(IDebugEventCallbacksWide))) IsEqualIID(InterfaceId, __uuidof(IDebugEventCallbacksWide)))
#else #else
if (IsEqualIID(InterfaceId, IID_IUnknown) || if (IsEqualIID(InterfaceId, IID_IUnknown) ||
IsEqualIID(InterfaceId, IID_IDebugEventCallbacksWide)) IsEqualIID(InterfaceId, IID_IDebugEventCallbacksWide))
skipping to change at line 15734 skipping to change at line 24602
else else
{ {
return E_NOINTERFACE; return E_NOINTERFACE;
} }
} }
// IDebugEventCallbacksWide. // IDebugEventCallbacksWide.
STDMETHOD(Breakpoint)( STDMETHOD(Breakpoint)(
THIS_ THIS_
__in PDEBUG_BREAKPOINT2 Bp _In_ PDEBUG_BREAKPOINT2 Bp
) )
{ {
UNREFERENCED_PARAMETER(Bp); UNREFERENCED_PARAMETER(Bp);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(Exception)( STDMETHOD(Exception)(
THIS_ THIS_
__in PEXCEPTION_RECORD64 Exception, _In_ PEXCEPTION_RECORD64 Exception,
__in ULONG FirstChance _In_ ULONG FirstChance
) )
{ {
UNREFERENCED_PARAMETER(Exception); UNREFERENCED_PARAMETER(Exception);
UNREFERENCED_PARAMETER(FirstChance); UNREFERENCED_PARAMETER(FirstChance);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(CreateThread)( STDMETHOD(CreateThread)(
THIS_ THIS_
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in ULONG64 DataOffset, _In_ ULONG64 DataOffset,
__in ULONG64 StartOffset _In_ ULONG64 StartOffset
) )
{ {
UNREFERENCED_PARAMETER(Handle); UNREFERENCED_PARAMETER(Handle);
UNREFERENCED_PARAMETER(DataOffset); UNREFERENCED_PARAMETER(DataOffset);
UNREFERENCED_PARAMETER(StartOffset); UNREFERENCED_PARAMETER(StartOffset);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(ExitThread)( STDMETHOD(ExitThread)(
THIS_ THIS_
__in ULONG ExitCode _In_ ULONG ExitCode
) )
{ {
UNREFERENCED_PARAMETER(ExitCode); UNREFERENCED_PARAMETER(ExitCode);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(CreateProcess)( STDMETHOD(CreateProcess)(
THIS_ THIS_
__in ULONG64 ImageFileHandle, _In_ ULONG64 ImageFileHandle,
__in ULONG64 Handle, _In_ ULONG64 Handle,
__in ULONG64 BaseOffset, _In_ ULONG64 BaseOffset,
__in ULONG ModuleSize, _In_ ULONG ModuleSize,
__in PCWSTR ModuleName, _In_ PCWSTR ModuleName,
__in PCWSTR ImageName, _In_ PCWSTR ImageName,
__in ULONG CheckSum, _In_ ULONG CheckSum,
__in ULONG TimeDateStamp, _In_ ULONG TimeDateStamp,
__in ULONG64 InitialThreadHandle, _In_ ULONG64 InitialThreadHandle,
__in ULONG64 ThreadDataOffset, _In_ ULONG64 ThreadDataOffset,
__in ULONG64 StartOffset _In_ ULONG64 StartOffset
) )
{ {
UNREFERENCED_PARAMETER(ImageFileHandle); UNREFERENCED_PARAMETER(ImageFileHandle);
UNREFERENCED_PARAMETER(Handle); UNREFERENCED_PARAMETER(Handle);
UNREFERENCED_PARAMETER(BaseOffset); UNREFERENCED_PARAMETER(BaseOffset);
UNREFERENCED_PARAMETER(ModuleSize); UNREFERENCED_PARAMETER(ModuleSize);
UNREFERENCED_PARAMETER(ModuleName); UNREFERENCED_PARAMETER(ModuleName);
UNREFERENCED_PARAMETER(ImageName); UNREFERENCED_PARAMETER(ImageName);
UNREFERENCED_PARAMETER(CheckSum); UNREFERENCED_PARAMETER(CheckSum);
UNREFERENCED_PARAMETER(TimeDateStamp); UNREFERENCED_PARAMETER(TimeDateStamp);
UNREFERENCED_PARAMETER(InitialThreadHandle); UNREFERENCED_PARAMETER(InitialThreadHandle);
UNREFERENCED_PARAMETER(ThreadDataOffset); UNREFERENCED_PARAMETER(ThreadDataOffset);
UNREFERENCED_PARAMETER(StartOffset); UNREFERENCED_PARAMETER(StartOffset);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(ExitProcess)( STDMETHOD(ExitProcess)(
THIS_ THIS_
__in ULONG ExitCode _In_ ULONG ExitCode
) )
{ {
UNREFERENCED_PARAMETER(ExitCode); UNREFERENCED_PARAMETER(ExitCode);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(LoadModule)( STDMETHOD(LoadModule)(
THIS_ THIS_
__in ULONG64 ImageFileHandle, _In_ ULONG64 ImageFileHandle,
__in ULONG64 BaseOffset, _In_ ULONG64 BaseOffset,
__in ULONG ModuleSize, _In_ ULONG ModuleSize,
__in PCWSTR ModuleName, _In_ PCWSTR ModuleName,
__in PCWSTR ImageName, _In_ PCWSTR ImageName,
__in ULONG CheckSum, _In_ ULONG CheckSum,
__in ULONG TimeDateStamp _In_ ULONG TimeDateStamp
) )
{ {
UNREFERENCED_PARAMETER(ImageFileHandle); UNREFERENCED_PARAMETER(ImageFileHandle);
UNREFERENCED_PARAMETER(BaseOffset); UNREFERENCED_PARAMETER(BaseOffset);
UNREFERENCED_PARAMETER(ModuleSize); UNREFERENCED_PARAMETER(ModuleSize);
UNREFERENCED_PARAMETER(ModuleName); UNREFERENCED_PARAMETER(ModuleName);
UNREFERENCED_PARAMETER(ImageName); UNREFERENCED_PARAMETER(ImageName);
UNREFERENCED_PARAMETER(CheckSum); UNREFERENCED_PARAMETER(CheckSum);
UNREFERENCED_PARAMETER(TimeDateStamp); UNREFERENCED_PARAMETER(TimeDateStamp);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(UnloadModule)( STDMETHOD(UnloadModule)(
THIS_ THIS_
__in PCWSTR ImageBaseName, _In_ PCWSTR ImageBaseName,
__in ULONG64 BaseOffset _In_ ULONG64 BaseOffset
) )
{ {
UNREFERENCED_PARAMETER(ImageBaseName); UNREFERENCED_PARAMETER(ImageBaseName);
UNREFERENCED_PARAMETER(BaseOffset); UNREFERENCED_PARAMETER(BaseOffset);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(SystemError)( STDMETHOD(SystemError)(
THIS_ THIS_
__in ULONG Error, _In_ ULONG Error,
__in ULONG Level _In_ ULONG Level
) )
{ {
UNREFERENCED_PARAMETER(Error); UNREFERENCED_PARAMETER(Error);
UNREFERENCED_PARAMETER(Level); UNREFERENCED_PARAMETER(Level);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(SessionStatus)( STDMETHOD(SessionStatus)(
THIS_ THIS_
__in ULONG Status _In_ ULONG Status
) )
{ {
UNREFERENCED_PARAMETER(Status); UNREFERENCED_PARAMETER(Status);
return DEBUG_STATUS_NO_CHANGE; return DEBUG_STATUS_NO_CHANGE;
} }
STDMETHOD(ChangeDebuggeeState)( STDMETHOD(ChangeDebuggeeState)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG64 Argument _In_ ULONG64 Argument
) )
{ {
UNREFERENCED_PARAMETER(Flags); UNREFERENCED_PARAMETER(Flags);
UNREFERENCED_PARAMETER(Argument); UNREFERENCED_PARAMETER(Argument);
return S_OK; return S_OK;
} }
STDMETHOD(ChangeEngineState)( STDMETHOD(ChangeEngineState)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG64 Argument _In_ ULONG64 Argument
) )
{ {
UNREFERENCED_PARAMETER(Flags); UNREFERENCED_PARAMETER(Flags);
UNREFERENCED_PARAMETER(Argument); UNREFERENCED_PARAMETER(Argument);
return S_OK; return S_OK;
} }
STDMETHOD(ChangeSymbolState)( STDMETHOD(ChangeSymbolState)(
THIS_ THIS_
__in ULONG Flags, _In_ ULONG Flags,
__in ULONG64 Argument _In_ ULONG64 Argument
) )
{ {
UNREFERENCED_PARAMETER(Flags); UNREFERENCED_PARAMETER(Flags);
UNREFERENCED_PARAMETER(Argument); UNREFERENCED_PARAMETER(Argument);
return S_OK; return S_OK;
} }
}; };
#endif // #ifndef DEBUG_NO_IMPLEMENTATION #endif // #ifndef DEBUG_NO_IMPLEMENTATION
skipping to change at line 15985 skipping to change at line 24853
#define GetPseudoDescriptionT GetPseudoDescriptionWide #define GetPseudoDescriptionT GetPseudoDescriptionWide
#define GetPseudoIndexByNameT GetPseudoIndexByNameWide #define GetPseudoIndexByNameT GetPseudoIndexByNameWide
#define AddSymbolT AddSymbolWide #define AddSymbolT AddSymbolWide
#define RemoveSymbolByNameT RemoveSymbolByNameWide #define RemoveSymbolByNameT RemoveSymbolByNameWide
#define GetSymbolNameT GetSymbolNameWide #define GetSymbolNameT GetSymbolNameWide
#define WriteSymbolT WriteSymbolWide #define WriteSymbolT WriteSymbolWide
#define OutputAsTypeT OutputAsTypeWide #define OutputAsTypeT OutputAsTypeWide
#define GetSymbolTypeNameT GetSymbolTypeNameWide #define GetSymbolTypeNameT GetSymbolTypeNameWide
#define GetSymbolValueTextT GetSymbolValueTextWide #define GetSymbolValueTextT GetSymbolValueTextWide
#define GetNameByOffsetT GetNameByOffsetWide #define GetNameByOffsetT GetNameByOffsetWide
#define GetNameByInlineContextT GetNameByInlineContextWide
#define GetOffsetByNameT GetOffsetByNameWide #define GetOffsetByNameT GetOffsetByNameWide
#define GetNearNameByOffsetT GetNearNameByOffsetWide #define GetNearNameByOffsetT GetNearNameByOffsetWide
#define GetLineByOffsetT GetLineByOffsetWide #define GetLineByOffsetT GetLineByOffsetWide
#define GetLineByInlineContextT GetLineByInlineContextWide
#define GetOffsetByLineT GetOffsetByLineWide #define GetOffsetByLineT GetOffsetByLineWide
#define GetModuleByModuleNameT GetModuleByModuleNameWide #define GetModuleByModuleNameT GetModuleByModuleNameWide
#define GetModuleByModuleName2T GetModuleByModuleName2Wide #define GetModuleByModuleName2T GetModuleByModuleName2Wide
#define GetSymbolModuleT GetSymbolModuleWide #define GetSymbolModuleT GetSymbolModuleWide
#define GetTypeNameT GetTypeNameWide #define GetTypeNameT GetTypeNameWide
#define GetTypeIdT GetTypeIdWide #define GetTypeIdT GetTypeIdWide
#define GetFieldOffsetT GetFieldOffsetWide #define GetFieldOffsetT GetFieldOffsetWide
#define GetSymbolTypeIdT GetSymbolTypeIdWide #define GetSymbolTypeIdT GetSymbolTypeIdWide
#define StartSymbolMatchT StartSymbolMatchWide #define StartSymbolMatchT StartSymbolMatchWide
#define GetNextSymbolMatchT GetNextSymbolMatchWide #define GetNextSymbolMatchT GetNextSymbolMatchWide
skipping to change at line 16118 skipping to change at line 24988
#define GetPseudoDescriptionT GetPseudoDescription #define GetPseudoDescriptionT GetPseudoDescription
#define GetPseudoIndexByNameT GetPseudoIndexByName #define GetPseudoIndexByNameT GetPseudoIndexByName
#define AddSymbolT AddSymbol #define AddSymbolT AddSymbol
#define RemoveSymbolByNameT RemoveSymbolByName #define RemoveSymbolByNameT RemoveSymbolByName
#define GetSymbolNameT GetSymbolName #define GetSymbolNameT GetSymbolName
#define WriteSymbolT WriteSymbol #define WriteSymbolT WriteSymbol
#define OutputAsTypeT OutputAsType #define OutputAsTypeT OutputAsType
#define GetSymbolTypeNameT GetSymbolTypeName #define GetSymbolTypeNameT GetSymbolTypeName
#define GetSymbolValueTextT GetSymbolValueText #define GetSymbolValueTextT GetSymbolValueText
#define GetNameByOffsetT GetNameByOffset #define GetNameByOffsetT GetNameByOffset
#define GetNameByInlineContextT GetNameByInlineContext
#define GetOffsetByNameT GetOffsetByName #define GetOffsetByNameT GetOffsetByName
#define GetNearNameByOffsetT GetNearNameByOffset #define GetNearNameByOffsetT GetNearNameByOffset
#define GetLineByOffsetT GetLineByOffset #define GetLineByOffsetT GetLineByOffset
#define GetLineByInlineContextT GetLineByInlineContext
#define GetOffsetByLineT GetOffsetByLine #define GetOffsetByLineT GetOffsetByLine
#define GetModuleByModuleNameT GetModuleByModuleName #define GetModuleByModuleNameT GetModuleByModuleName
#define GetModuleByModuleName2T GetModuleByModuleName2 #define GetModuleByModuleName2T GetModuleByModuleName2
#define GetSymbolModuleT GetSymbolModule #define GetSymbolModuleT GetSymbolModule
#define GetTypeNameT GetTypeName #define GetTypeNameT GetTypeName
#define GetTypeIdT GetTypeId #define GetTypeIdT GetTypeId
#define GetFieldOffsetT GetFieldOffset #define GetFieldOffsetT GetFieldOffset
#define GetSymbolTypeIdT GetSymbolTypeId #define GetSymbolTypeIdT GetSymbolTypeId
#define StartSymbolMatchT StartSymbolMatch #define StartSymbolMatchT StartSymbolMatch
#define GetNextSymbolMatchT GetNextSymbolMatch #define GetNextSymbolMatchT GetNextSymbolMatch
skipping to change at line 16162 skipping to change at line 25034
#define GetSourceEntryStringT GetSourceEntryString #define GetSourceEntryStringT GetSourceEntryString
#define GetCurrentProcessExecutableNameT GetCurrentProcessExecutableName #define GetCurrentProcessExecutableNameT GetCurrentProcessExecutableName
#define GetCurrentSystemServerNameT GetCurrentSystemServerName #define GetCurrentSystemServerNameT GetCurrentSystemServerName
#endif // #ifdef UNICODE #endif // #ifdef UNICODE
#endif // #ifdef DEBUG_UNICODE_MACROS #endif // #ifdef DEBUG_UNICODE_MACROS
#endif // #ifdef __cplusplus #endif // #ifdef __cplusplus
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif // #ifndef __DBGENG_H__ #endif // #ifndef __DBGENG_H__
 End of changes. 1507 change blocks. 
4005 lines changed or deleted 12892 lines changed or added

This html diff was produced by rfcdiff 1.41.