-
Notifications
You must be signed in to change notification settings - Fork 255
/
IDebugControl.cs
524 lines (427 loc) · 16.2 KB
/
IDebugControl.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Text;
using System.Runtime.InteropServices;
#pragma warning disable 1591
namespace Microsoft.Diagnostics.Runtime.Interop
{
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("5182e668-105e-416e-ad92-24ef800424ba")]
public interface IDebugControl
{
/* IDebugControl */
[PreserveSig]
int GetInterrupt();
[PreserveSig]
int SetInterrupt(
[In] DEBUG_INTERRUPT Flags);
[PreserveSig]
int GetInterruptTimeout(
[Out] out UInt32 Seconds);
[PreserveSig]
int SetInterruptTimeout(
[In] UInt32 Seconds);
[PreserveSig]
int GetLogFile(
[Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder Buffer,
[In] Int32 BufferSize,
[Out] out UInt32 FileSize,
[Out, MarshalAs(UnmanagedType.Bool)] out bool Append);
[PreserveSig]
int OpenLogFile(
[In, MarshalAs(UnmanagedType.LPStr)] string File,
[In, MarshalAs(UnmanagedType.Bool)] bool Append);
[PreserveSig]
int CloseLogFile();
[PreserveSig]
int GetLogMask(
[Out] out DEBUG_OUTPUT Mask);
[PreserveSig]
int SetLogMask(
[In] DEBUG_OUTPUT Mask);
[PreserveSig]
int Input(
[Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder Buffer,
[In] Int32 BufferSize,
[Out] out UInt32 InputSize);
[PreserveSig]
int ReturnInput(
[In, MarshalAs(UnmanagedType.LPStr)] string Buffer);
[PreserveSig]
int Output(
[In] DEBUG_OUTPUT Mask,
[In, MarshalAs(UnmanagedType.LPStr)] string Format);
[PreserveSig]
int OutputVaList( /* THIS SHOULD NEVER BE CALLED FROM C# */
[In] DEBUG_OUTPUT Mask,
[In, MarshalAs(UnmanagedType.LPStr)] string Format,
[In] IntPtr va_list_Args);
[PreserveSig]
int ControlledOutput(
[In] DEBUG_OUTCTL OutputControl,
[In] DEBUG_OUTPUT Mask,
[In, MarshalAs(UnmanagedType.LPStr)] string Format);
[PreserveSig]
int ControlledOutputVaList( /* THIS SHOULD NEVER BE CALLED FROM C# */
[In] DEBUG_OUTCTL OutputControl,
[In] DEBUG_OUTPUT Mask,
[In, MarshalAs(UnmanagedType.LPStr)] string Format,
[In] IntPtr va_list_Args);
[PreserveSig]
int OutputPrompt(
[In] DEBUG_OUTCTL OutputControl,
[In, MarshalAs(UnmanagedType.LPStr)] string Format);
[PreserveSig]
int OutputPromptVaList( /* THIS SHOULD NEVER BE CALLED FROM C# */
[In] DEBUG_OUTCTL OutputControl,
[In, MarshalAs(UnmanagedType.LPStr)] string Format,
[In] IntPtr va_list_Args);
[PreserveSig]
int GetPromptText(
[Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder Buffer,
[In] Int32 BufferSize,
[Out] out UInt32 TextSize);
[PreserveSig]
int OutputCurrentState(
[In] DEBUG_OUTCTL OutputControl,
[In] DEBUG_CURRENT Flags);
[PreserveSig]
int OutputVersionInformation(
[In] DEBUG_OUTCTL OutputControl);
[PreserveSig]
int GetNotifyEventHandle(
[Out] out UInt64 Handle);
[PreserveSig]
int SetNotifyEventHandle(
[In] UInt64 Handle);
[PreserveSig]
int Assemble(
[In] UInt64 Offset,
[In, MarshalAs(UnmanagedType.LPStr)] string Instr,
[Out] out UInt64 EndOffset);
[PreserveSig]
int Disassemble(
[In] UInt64 Offset,
[In] DEBUG_DISASM Flags,
[Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder Buffer,
[In] Int32 BufferSize,
[Out] out UInt32 DisassemblySize,
[Out] out UInt64 EndOffset);
[PreserveSig]
int GetDisassembleEffectiveOffset(
[Out] out UInt64 Offset);
[PreserveSig]
int OutputDisassembly(
[In] DEBUG_OUTCTL OutputControl,
[In] UInt64 Offset,
[In] DEBUG_DISASM Flags,
[Out] out UInt64 EndOffset);
[PreserveSig]
int OutputDisassemblyLines(
[In] DEBUG_OUTCTL OutputControl,
[In] UInt32 PreviousLines,
[In] UInt32 TotalLines,
[In] UInt64 Offset,
[In] DEBUG_DISASM Flags,
[Out] out UInt32 OffsetLine,
[Out] out UInt64 StartOffset,
[Out] out UInt64 EndOffset,
[Out, MarshalAs(UnmanagedType.LPArray)] UInt64[] LineOffsets);
[PreserveSig]
int GetNearInstruction(
[In] UInt64 Offset,
[In] int Delta,
[Out] out UInt64 NearOffset);
[PreserveSig]
int GetStackTrace(
[In] UInt64 FrameOffset,
[In] UInt64 StackOffset,
[In] UInt64 InstructionOffset,
[Out, MarshalAs(UnmanagedType.LPArray)] DEBUG_STACK_FRAME[] Frames,
[In] Int32 FrameSize,
[Out] out UInt32 FramesFilled);
[PreserveSig]
int GetReturnOffset(
[Out] out UInt64 Offset);
[PreserveSig]
int OutputStackTrace(
[In] DEBUG_OUTCTL OutputControl,
[In, MarshalAs(UnmanagedType.LPArray)] DEBUG_STACK_FRAME[] Frames,
[In] Int32 FramesSize,
[In] DEBUG_STACK Flags);
[PreserveSig]
int GetDebuggeeType(
[Out] out DEBUG_CLASS Class,
[Out] out DEBUG_CLASS_QUALIFIER Qualifier);
[PreserveSig]
int GetActualProcessorType(
[Out] out IMAGE_FILE_MACHINE Type);
[PreserveSig]
int GetExecutingProcessorType(
[Out] out IMAGE_FILE_MACHINE Type);
[PreserveSig]
int GetNumberPossibleExecutingProcessorTypes(
[Out] out UInt32 Number);
[PreserveSig]
int GetPossibleExecutingProcessorTypes(
[In] UInt32 Start,
[In] UInt32 Count,
[Out, MarshalAs(UnmanagedType.LPArray)] IMAGE_FILE_MACHINE[] Types);
[PreserveSig]
int GetNumberProcessors(
[Out] out UInt32 Number);
[PreserveSig]
int GetSystemVersion(
[Out] out UInt32 PlatformId,
[Out] out UInt32 Major,
[Out] out UInt32 Minor,
[Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder ServicePackString,
[In] Int32 ServicePackStringSize,
[Out] out UInt32 ServicePackStringUsed,
[Out] out UInt32 ServicePackNumber,
[Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder BuildString,
[In] Int32 BuildStringSize,
[Out] out UInt32 BuildStringUsed);
[PreserveSig]
int GetPageSize(
[Out] out UInt32 Size);
[PreserveSig]
int IsPointer64Bit();
[PreserveSig]
int ReadBugCheckData(
[Out] out UInt32 Code,
[Out] out UInt64 Arg1,
[Out] out UInt64 Arg2,
[Out] out UInt64 Arg3,
[Out] out UInt64 Arg4);
[PreserveSig]
int GetNumberSupportedProcessorTypes(
[Out] out UInt32 Number);
[PreserveSig]
int GetSupportedProcessorTypes(
[In] UInt32 Start,
[In] UInt32 Count,
[Out, MarshalAs(UnmanagedType.LPArray)] IMAGE_FILE_MACHINE[] Types);
[PreserveSig]
int GetProcessorTypeNames(
[In] IMAGE_FILE_MACHINE Type,
[Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder FullNameBuffer,
[In] Int32 FullNameBufferSize,
[Out] out UInt32 FullNameSize,
[Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder AbbrevNameBuffer,
[In] Int32 AbbrevNameBufferSize,
[Out] out UInt32 AbbrevNameSize);
[PreserveSig]
int GetEffectiveProcessorType(
[Out] out IMAGE_FILE_MACHINE Type);
[PreserveSig]
int SetEffectiveProcessorType(
[In] IMAGE_FILE_MACHINE Type);
[PreserveSig]
int GetExecutionStatus(
[Out] out DEBUG_STATUS Status);
[PreserveSig]
int SetExecutionStatus(
[In] DEBUG_STATUS Status);
[PreserveSig]
int GetCodeLevel(
[Out] out DEBUG_LEVEL Level);
[PreserveSig]
int SetCodeLevel(
[In] DEBUG_LEVEL Level);
[PreserveSig]
int GetEngineOptions(
[Out] out DEBUG_ENGOPT Options);
[PreserveSig]
int AddEngineOptions(
[In] DEBUG_ENGOPT Options);
[PreserveSig]
int RemoveEngineOptions(
[In] DEBUG_ENGOPT Options);
[PreserveSig]
int SetEngineOptions(
[In] DEBUG_ENGOPT Options);
[PreserveSig]
int GetSystemErrorControl(
[Out] out ERROR_LEVEL OutputLevel,
[Out] out ERROR_LEVEL BreakLevel);
[PreserveSig]
int SetSystemErrorControl(
[In] ERROR_LEVEL OutputLevel,
[In] ERROR_LEVEL BreakLevel);
[PreserveSig]
int GetTextMacro(
[In] UInt32 Slot,
[Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder Buffer,
[In] Int32 BufferSize,
[Out] out UInt32 MacroSize);
[PreserveSig]
int SetTextMacro(
[In] UInt32 Slot,
[In, MarshalAs(UnmanagedType.LPStr)] string Macro);
[PreserveSig]
int GetRadix(
[Out] out UInt32 Radix);
[PreserveSig]
int SetRadix(
[In] UInt32 Radix);
[PreserveSig]
int Evaluate(
[In, MarshalAs(UnmanagedType.LPStr)] string Expression,
[In] DEBUG_VALUE_TYPE DesiredType,
[Out] out DEBUG_VALUE Value,
[Out] out UInt32 RemainderIndex);
[PreserveSig]
int CoerceValue(
[In] DEBUG_VALUE In,
[In] DEBUG_VALUE_TYPE OutType,
[Out] out DEBUG_VALUE Out);
[PreserveSig]
int CoerceValues(
[In] UInt32 Count,
[In, MarshalAs(UnmanagedType.LPArray)] DEBUG_VALUE[] In,
[In, MarshalAs(UnmanagedType.LPArray)] DEBUG_VALUE_TYPE[] OutType,
[Out, MarshalAs(UnmanagedType.LPArray)] DEBUG_VALUE[] Out);
[PreserveSig]
int Execute(
[In] DEBUG_OUTCTL OutputControl,
[In, MarshalAs(UnmanagedType.LPStr)] string Command,
[In] DEBUG_EXECUTE Flags);
[PreserveSig]
int ExecuteCommandFile(
[In] DEBUG_OUTCTL OutputControl,
[In, MarshalAs(UnmanagedType.LPStr)] string CommandFile,
[In] DEBUG_EXECUTE Flags);
[PreserveSig]
int GetNumberBreakpoints(
[Out] out UInt32 Number);
[PreserveSig]
int GetBreakpointByIndex(
[In] UInt32 Index,
[Out, MarshalAs(UnmanagedType.Interface)] out IDebugBreakpoint bp);
[PreserveSig]
int GetBreakpointById(
[In] UInt32 Id,
[Out, MarshalAs(UnmanagedType.Interface)] out IDebugBreakpoint bp);
[PreserveSig]
int GetBreakpointParameters(
[In] UInt32 Count,
[In, MarshalAs(UnmanagedType.LPArray)] UInt32[] Ids,
[In] UInt32 Start,
[Out, MarshalAs(UnmanagedType.LPArray)] DEBUG_BREAKPOINT_PARAMETERS[] Params);
[PreserveSig]
int AddBreakpoint(
[In] DEBUG_BREAKPOINT_TYPE Type,
[In] UInt32 DesiredId,
[Out, MarshalAs(UnmanagedType.Interface)] out IDebugBreakpoint Bp);
[PreserveSig]
int RemoveBreakpoint(
[In, MarshalAs(UnmanagedType.Interface)] IDebugBreakpoint Bp);
[PreserveSig]
int AddExtension(
[In, MarshalAs(UnmanagedType.LPStr)] string Path,
[In] UInt32 Flags,
[Out] out UInt64 Handle);
[PreserveSig]
int RemoveExtension(
[In] UInt64 Handle);
[PreserveSig]
int GetExtensionByPath(
[In, MarshalAs(UnmanagedType.LPStr)] string Path,
[Out] out UInt64 Handle);
[PreserveSig]
int CallExtension(
[In] UInt64 Handle,
[In, MarshalAs(UnmanagedType.LPStr)] string Function,
[In, MarshalAs(UnmanagedType.LPStr)] string Arguments);
[PreserveSig]
int GetExtensionFunction(
[In] UInt64 Handle,
[In, MarshalAs(UnmanagedType.LPStr)] string FuncName,
[Out] out IntPtr Function);
[PreserveSig]
int GetWindbgExtensionApis32(
[In, Out] ref WINDBG_EXTENSION_APIS Api);
/* Must be In and Out as the nSize member has to be initialized */
[PreserveSig]
int GetWindbgExtensionApis64(
[In, Out] ref WINDBG_EXTENSION_APIS Api);
/* Must be In and Out as the nSize member has to be initialized */
[PreserveSig]
int GetNumberEventFilters(
[Out] out UInt32 SpecificEvents,
[Out] out UInt32 SpecificExceptions,
[Out] out UInt32 ArbitraryExceptions);
[PreserveSig]
int GetEventFilterText(
[In] UInt32 Index,
[Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder Buffer,
[In] Int32 BufferSize,
[Out] out UInt32 TextSize);
[PreserveSig]
int GetEventFilterCommand(
[In] UInt32 Index,
[Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder Buffer,
[In] Int32 BufferSize,
[Out] out UInt32 CommandSize);
[PreserveSig]
int SetEventFilterCommand(
[In] UInt32 Index,
[In, MarshalAs(UnmanagedType.LPStr)] string Command);
[PreserveSig]
int GetSpecificFilterParameters(
[In] UInt32 Start,
[In] UInt32 Count,
[Out, MarshalAs(UnmanagedType.LPArray)] DEBUG_SPECIFIC_FILTER_PARAMETERS[] Params);
[PreserveSig]
int SetSpecificFilterParameters(
[In] UInt32 Start,
[In] UInt32 Count,
[In, MarshalAs(UnmanagedType.LPArray)] DEBUG_SPECIFIC_FILTER_PARAMETERS[] Params);
[PreserveSig]
int GetSpecificEventFilterArgument(
[In] UInt32 Index,
[Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder Buffer,
[In] Int32 BufferSize,
[Out] out UInt32 ArgumentSize);
[PreserveSig]
int SetSpecificEventFilterArgument(
[In] UInt32 Index,
[In, MarshalAs(UnmanagedType.LPStr)] string Argument);
[PreserveSig]
int GetExceptionFilterParameters(
[In] UInt32 Count,
[In, MarshalAs(UnmanagedType.LPArray)] UInt32[] Codes,
[In] UInt32 Start,
[Out, MarshalAs(UnmanagedType.LPArray)] DEBUG_EXCEPTION_FILTER_PARAMETERS[] Params);
[PreserveSig]
int SetExceptionFilterParameters(
[In] UInt32 Count,
[In, MarshalAs(UnmanagedType.LPArray)] DEBUG_EXCEPTION_FILTER_PARAMETERS[] Params);
[PreserveSig]
int GetExceptionFilterSecondCommand(
[In] UInt32 Index,
[Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder Buffer,
[In] Int32 BufferSize,
[Out] out UInt32 CommandSize);
[PreserveSig]
int SetExceptionFilterSecondCommand(
[In] UInt32 Index,
[In, MarshalAs(UnmanagedType.LPStr)] string Command);
[PreserveSig]
int WaitForEvent(
[In] DEBUG_WAIT Flags,
[In] UInt32 Timeout);
[PreserveSig]
int GetLastEventInformation(
[Out] out DEBUG_EVENT Type,
[Out] out UInt32 ProcessId,
[Out] out UInt32 ThreadId,
[In] IntPtr ExtraInformation,
[In] UInt32 ExtraInformationSize,
[Out] out UInt32 ExtraInformationUsed,
[Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder Description,
[In] Int32 DescriptionSize,
[Out] out UInt32 DescriptionUsed);
}
}