xref: /reactos/sdk/include/psdk/activdbg.idl (revision 1734f297)
1/*
2 * Copyright 2008 Jacek Caban for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19import "ocidl.idl";
20import "activscp.idl";
21/* import "dbgprop.idl"; */
22
23interface IDebugDocumentContext;
24interface IRemoteDebugApplication;
25interface IEnumDebugCodeContexts;
26
27/* FIXME: */
28interface IEnumDebugStackFrames;
29interface IDebugStackFrame;
30interface IApplicationDebugger;
31interface IEnumRemoteDebugApplicationThreads;
32interface IDebugApplicationNode;
33interface IEnumDebugExpressionContexts;
34interface IDebugApplicationThread;
35interface IDebugSyncOperation;
36interface IDebugAsyncOperation;
37interface IDebugStackFrameSniffer;
38interface IDebugThreadCall32;
39interface IActiveScriptErrorDebug;
40interface IProvideExpressionContexts;
41
42typedef enum tagBREAKPOINT_STATE {
43    BREAKPOINT_DELETED,
44    BREAKPOINT_DISABLED,
45    BREAKPOINT_ENABLED
46} BREAKPOINT_STATE;
47
48typedef DWORD APPBREAKFLAGS;
49
50typedef enum tagBREAKREASON {
51    BREAKREASON_STEP,
52    BREAKREASON_BREAKPOINT,
53    BREAKREASON_DEBUGGER_BLOCK,
54    BREAKREASON_HOST_INITIATED,
55    BREAKREASON_LANGUAGE_INITIATED,
56    BREAKREASON_DEBUGGER_HALT,
57    BREAKREASON_ERROR,
58    BREAKREASON_JIT
59} BREAKREASON;
60
61typedef enum tagBREAKRESUME_ACTION {
62    BREAKRESUMEACTION_ABORT,
63    BREAKRESUMEACTION_CONTINUE,
64    BREAKRESUMEACTION_STEP_INTO,
65    BREAKRESUMEACTION_STEP_OVER,
66    BREAKRESUMEACTION_STEP_OUT,
67    BREAKRESUMEACTION_IGNORE
68} BREAKRESUMEACTION;
69
70typedef enum tagDOCUMENTNAMETYPE {
71    DOCUMENTNAMETYPE_APPNODE,
72    DOCUMENTNAMETYPE_TITLE,
73    DOCUMENTNAMETYPE_FILE_TAIL,
74    DOCUMENTNAMETYPE_URL
75} DOCUMENTNAMETYPE;
76
77typedef enum tagERRORRESUMEACTION {
78    ERRORRESUMEACTION_ReexecuteErrorStatement,
79    ERRORRESUMEACTION_AbortCallAndReturnErrorToCaller,
80    ERRORRESUMEACTION_SkipErrorStatement,
81} ERRORRESUMEACTION;
82
83typedef WORD SOURCE_TEXT_ATTR;
84
85#ifdef INTEROPLIB
86enum enum_SOURCE_TEXT_ATTR
87{
88    SOURCETEXT_ATTR_KEYWORD        = 0x01,
89    SOURCETEXT_ATTR_COMMENT        = 0x02,
90    SOURCETEXT_ATTR_NONSOURCE      = 0x04,
91    SOURCETEXT_ATTR_OPERATOR       = 0x08,
92    SOURCETEXT_ATTR_NUMBER         = 0x10,
93    SOURCETEXT_ATTR_STRING         = 0x20,
94    SOURCETEXT_ATTR_FUNCTION_START = 0x40
95};
96#endif
97
98const SOURCE_TEXT_ATTR SOURCETEXT_ATTR_KEYWORD         = 0x01;
99const SOURCE_TEXT_ATTR SOURCETEXT_ATTR_COMMENT         = 0x02;
100const SOURCE_TEXT_ATTR SOURCETEXT_ATTR_NONSOURCE       = 0x04;
101const SOURCE_TEXT_ATTR SOURCETEXT_ATTR_OPERATOR        = 0x08;
102const SOURCE_TEXT_ATTR SOURCETEXT_ATTR_NUMBER          = 0x10;
103const SOURCE_TEXT_ATTR SOURCETEXT_ATTR_STRING          = 0x20;
104const SOURCE_TEXT_ATTR SOURCETEXT_ATTR_FUNCTION_START  = 0x40;
105
106/************************************************************
107 *      interface IActiveScriptDebug32
108 */
109[
110    object,
111    uuid(51973c10-cb0c-11d0-b5c9-00a0244a0e7a),
112    pointer_default(unique)
113]
114interface IActiveScriptDebug32 : IUnknown
115{
116    HRESULT GetScriptTextAttributes(
117            [in, size_is(uNumCodeChars)] LPCOLESTR pstrCode,
118            [in] ULONG uNumCodeChars,
119            [in] LPCOLESTR pstrDelimiter,
120            [in] DWORD dwFlags,
121            [in, out, size_is(uNumCodeChars)] SOURCE_TEXT_ATTR *pattr);
122
123    HRESULT GetScriptletTextAttributes(
124            [in, size_is(uNumCodeChars)] LPCOLESTR pstrCode,
125            [in] ULONG uNumCodeChars,
126            [in] LPCOLESTR pstrDelimiter,
127            [in] DWORD dwFlags,
128            [in, out, size_is(uNumCodeChars)] SOURCE_TEXT_ATTR *pattr);
129
130    HRESULT EnumCodeContextsOfPosition(
131            [in] DWORD dwSourceContext,
132            [in] ULONG uCharacterOffset,
133            [in] ULONG uNumChars,
134            [out] IEnumDebugCodeContexts **ppescc);
135}
136
137[
138    object,
139    uuid(bc437e23-f5b8-47f4-bb79-7d1ce5483b86),
140    pointer_default(unique)
141]
142interface IActiveScriptDebug64 : IUnknown
143{
144    HRESULT GetScriptTextAttributes(
145            [in, size_is(uNumCodeChars)] LPCOLESTR pstrCode,
146            [in] ULONG uNumCodeChars,
147            [in] LPCOLESTR pstrDelimiter,
148            [in] DWORD dwFlags,
149            [in, out, size_is(uNumCodeChars)] SOURCE_TEXT_ATTR *pattr);
150
151    HRESULT GetScriptletTextAttributes(
152            [in, size_is(uNumCodeChars)] LPCOLESTR pstrCode,
153            [in] ULONG uNumCodeChars,
154            [in] LPCOLESTR pstrDelimiter,
155            [in] DWORD dwFlags,
156            [in, out, size_is(uNumCodeChars)] SOURCE_TEXT_ATTR *pattr);
157
158    HRESULT EnumCodeContextsOfPosition(
159           [in] DWORDLONG dwSourceContext,
160           [in] ULONG uCharacterOffset,
161           [in] ULONG uNumChars,
162           [out] IEnumDebugCodeContexts **ppescc);
163}
164
165/************************************************************
166 *      interface IDebugDocumentInfo
167 */
168[
169    object,
170    uuid(51973c1f-cb0c-11d0-b5c9-00a0244a0e7a),
171    pointer_default(unique)
172]
173interface IDebugDocumentInfo : IUnknown
174{
175    HRESULT GetName(
176            [in]  DOCUMENTNAMETYPE dnt,
177            [out] BSTR *pbstrName);
178
179    HRESULT GetDocumentClassId(
180            [out] CLSID *pclsidDocument);
181}
182
183/************************************************************
184 *      interface IDebugDocument
185 */
186[
187    object,
188    uuid(51973c21-cb0c-11d0-b5c9-00a0244a0e7a),
189    pointer_default(unique)
190]
191interface IDebugDocument : IDebugDocumentInfo
192{
193}
194
195/************************************************************
196 *      interface IDebugCodeContext
197 */
198[
199    object,
200    uuid(51973c13-cb0c-11d0-b5c9-00a0244a0e7a),
201    pointer_default(unique)
202]
203interface IDebugCodeContext : IUnknown
204{
205    HRESULT GetDocumentContext(
206            [out] IDebugDocumentContext **ppsc);
207
208    HRESULT SetBreakPoint(
209            [in]  BREAKPOINT_STATE bps);
210}
211
212/************************************************************
213 *      interface IEnumDebugCodeContexts
214 */
215[
216    object,
217    uuid(51973c1d-cb0c-11d0-b5c9-00a0244a0e7a),
218    pointer_default(unique)
219]
220interface IEnumDebugCodeContexts : IUnknown
221{
222    HRESULT Next(
223            [in]  ULONG celt,
224            [out] IDebugCodeContext **pscc,
225            [out] ULONG *pceltFetched);
226
227    HRESULT Skip(
228            [in]  ULONG celt);
229
230    HRESULT Reset();
231
232    HRESULT Clone(
233            [out] IEnumDebugCodeContexts **ppescc);
234}
235
236/************************************************************
237 *      interface IDebugDocumentContext
238 */
239[
240    object,
241    uuid(51973c28-cb0c-11d0-b5c9-00a0244a0e7a),
242    pointer_default(unique)
243]
244interface IDebugDocumentContext : IUnknown
245{
246    HRESULT GetDocument(
247            [out] IDebugDocument **ppsd);
248
249    HRESULT EnumCodeContexts(
250            [out] IEnumDebugCodeContexts **ppescc);
251}
252
253/************************************************************
254 *      interface IRemoteDebugApplicationThread
255 */
256[
257    object,
258    uuid(51973c37-cb0c-11d0-b5c9-00a0244a0e7a),
259    pointer_default(unique)
260]
261interface IRemoteDebugApplicationThread : IUnknown
262{
263    HRESULT GetSystemThreadId(
264            [out] DWORD *dwThreadId);
265
266    HRESULT GetApplication(
267            [out] IRemoteDebugApplication **pprda);
268
269    HRESULT EnumStackFrames(
270            [out] IEnumDebugStackFrames **ppedsf);
271
272    HRESULT GetDescription(
273            [out] BSTR *pbstrDescription,
274            [out] BSTR *pbstrState);
275
276    HRESULT SetNextStatement(
277            [in]  IDebugStackFrame *pStackFrame,
278            [in]  IDebugCodeContext *pCodeContext);
279
280    HRESULT GetState(
281            [out] DWORD *pState);
282
283    HRESULT Suspend(
284            [out] DWORD *pdwCount);
285
286    HRESULT Resume(
287            [out] DWORD *pdwCount);
288
289    HRESULT GetSuspendCount(
290            [out] DWORD *pdwCount);
291}
292
293/************************************************************
294 *      interface IRemoteDebugApplication
295 */
296[
297    object,
298    uuid(51973c30-cb0c-11d0-b5c9-00a0244Aae7a),
299    pointer_default(unique)
300]
301interface IRemoteDebugApplication : IUnknown
302{
303    HRESULT ResumeFromBreakPoint(
304            [in]  IRemoteDebugApplicationThread *prptFocus,
305            [in]  BREAKRESUMEACTION bra,
306            [in]  ERRORRESUMEACTION era);
307
308    HRESULT CauseBreak();
309
310    HRESULT ConnectDebugger(
311            [in]  IApplicationDebugger *pad);
312
313    HRESULT DisconnectDebugger();
314
315    HRESULT GetDebugger(
316            [out] IApplicationDebugger **pad);
317
318    HRESULT CreateInstanceAtApplication(
319            [in]  REFCLSID rclsid,
320            [in]  IUnknown *pUnkOuter,
321            [in]  DWORD dwClsContext,
322            [in]  REFIID riid,
323            [out, iid_is(riid)] IUnknown **ppvObject);
324
325    HRESULT QueryAlive();
326
327    HRESULT EnumThreads(
328            [out] IEnumRemoteDebugApplicationThreads **pperdat);
329
330    HRESULT GetName(
331            [out] BSTR *pbstrName);
332
333    HRESULT GetRootNode(
334            [out] IDebugApplicationNode **ppdanRoot);
335
336    HRESULT EnumGlobalExpressionContexts(
337            [out] IEnumDebugExpressionContexts **ppedec);
338}
339
340/************************************************************
341 *      interface IDebugApplication32
342 */
343[
344    object,
345    uuid(51973c32-cb0c-11d0-b5c9-00a0244a0e7a),
346    pointer_default(unique),
347    local
348]
349interface IDebugApplication32 : IRemoteDebugApplication
350{
351    HRESULT SetName(
352            [in] LPCOLESTR pstrName);
353
354    HRESULT StepOutComplete();
355
356    HRESULT DebugOutput(
357            [in] LPCOLESTR pstr);
358
359    HRESULT StartDebugSession();
360
361    HRESULT HandleBreakPoint(
362            [in]  BREAKREASON br,
363            [out] BREAKRESUMEACTION *pbra);
364
365    HRESULT Close();
366
367    HRESULT GetBreakFlags(
368            [out] APPBREAKFLAGS *pabf,
369            [out] IRemoteDebugApplicationThread **pprdatSteppingThread);
370
371    HRESULT GetCurrentThread(
372            [out] IDebugApplicationThread **pat);
373
374    HRESULT CreateAsyncDebugOperation(
375            [in]  IDebugSyncOperation *psdo,
376            [out] IDebugAsyncOperation **ppado);
377
378    HRESULT AddStackFrameSniffer(
379            [in]  IDebugStackFrameSniffer *pdsfs,
380            [out] DWORD *pdwCookie);
381
382    HRESULT RemoveStackFrameSniffer(
383            [in]  DWORD dwCookie);
384
385    HRESULT QueryCurrentThreadIsDebuggerThread();
386
387    HRESULT SynchronousCallInDebuggerThread(
388            [in]  IDebugThreadCall32 *pptc,
389            [in]  DWORD dwParam1,
390            [in]  DWORD dwParam2,
391            [in]  DWORD dwParam3);
392
393    HRESULT CreateApplicationNode(
394            [out] IDebugApplicationNode **ppdanNew);
395
396    HRESULT FireDebuggerEvent(
397            [in]  REFGUID riid,
398            [in]  IUnknown *punk);
399
400    HRESULT HandleRuntimeError(
401            [in]  IActiveScriptErrorDebug *pErrorDebug,
402            [in]  IActiveScriptSite *pScriptSite,
403            [out] BREAKRESUMEACTION *pbra,
404            [out] ERRORRESUMEACTION *perra,
405            [out] BOOL *pfCallOnScriptError);
406
407    BOOL FCanJitDebug();
408
409    BOOL FIsAutoJitDebugEnabled();
410
411    HRESULT AddGlobalExpressionContextProvider(
412            [in]  IProvideExpressionContexts *pdsfs,
413            [out] DWORD *pdwCookie);
414
415    HRESULT RemoveGlobalExpressionContextProvider(
416            [in]  DWORD dwCookie);
417}
418
419/************************************************************
420 *      interface IDebugApplication64
421 */
422[
423    object,
424    uuid(4dedc754-04c7-4f10-9e60-16a390fe6e62),
425    pointer_default(unique),
426    local
427]
428interface IDebugApplication64 : IRemoteDebugApplication
429{
430    HRESULT SetName(
431            [in] LPCOLESTR pstrName);
432
433    HRESULT StepOutComplete();
434
435    HRESULT DebugOutput(
436            [in] LPCOLESTR pstr);
437
438    HRESULT StartDebugSession();
439
440    HRESULT HandleBreakPoint(
441            [in]  BREAKREASON br,
442            [out] BREAKRESUMEACTION *pbra);
443
444    HRESULT Close();
445
446    HRESULT GetBreakFlags(
447            [out] APPBREAKFLAGS *pabf,
448            [out] IRemoteDebugApplicationThread **pprdatSteppingThread);
449
450    HRESULT GetCurrentThread(
451            [out] IDebugApplicationThread **pat);
452
453    HRESULT CreateAsyncDebugOperation(
454            [in]  IDebugSyncOperation *psdo,
455            [out] IDebugAsyncOperation **ppado);
456
457    HRESULT AddStackFrameSniffer(
458            [in]  IDebugStackFrameSniffer *pdsfs,
459            [out] DWORD *pdwCookie);
460
461    HRESULT RemoveStackFrameSniffer(
462            [in]  DWORD dwCookie);
463
464    HRESULT QueryCurrentThreadIsDebuggerThread();
465
466    HRESULT SynchronousCallInDebuggerThread(
467            [in]  IDebugThreadCall32 *pptc,
468            [in]  DWORDLONG dwParam1,
469            [in]  DWORDLONG dwParam2,
470            [in]  DWORDLONG dwParam3);
471
472    HRESULT CreateApplicationNode(
473            [out] IDebugApplicationNode **ppdanNew);
474
475    HRESULT FireDebuggerEvent(
476            [in]  REFGUID riid,
477            [in]  IUnknown *punk);
478
479    HRESULT HandleRuntimeError(
480            [in]  IActiveScriptErrorDebug *pErrorDebug,
481            [in]  IActiveScriptSite *pScriptSite,
482            [out] BREAKRESUMEACTION *pbra,
483            [out] ERRORRESUMEACTION *perra,
484            [out] BOOL *pfCallOnScriptError);
485
486    BOOL FCanJitDebug();
487
488    BOOL FIsAutoJitDebugEnabled();
489
490    HRESULT AddGlobalExpressionContextProvider(
491            [in]  IProvideExpressionContexts *pdsfs,
492            [out] DWORDLONG *pdwCookie);
493
494    HRESULT RemoveGlobalExpressionContextProvider(
495            [in]  DWORDLONG dwCookie);
496}
497
498/************************************************************
499 *      interface IActiveScriptSiteDebug32
500 */
501[
502    object,
503    uuid(51973c11-cb0c-11d0-b5c9-00a0244a0e7a),
504    pointer_default(unique),
505    local
506]
507interface IActiveScriptSiteDebug32 : IUnknown
508{
509    HRESULT GetDocumentContextFromPosition(
510            [in]  DWORD dwSourceContext,
511            [in]  ULONG uCharacterOffset,
512            [in]  ULONG uNumChars,
513            [out] IDebugDocumentContext **ppsc);
514
515    HRESULT GetApplication(
516            [out] IDebugApplication32 **ppda);
517
518    HRESULT GetRootApplicationNode(
519            [out] IDebugApplicationNode **ppdanRoot);
520
521    HRESULT OnScriptErrorDebug(
522            [in]  IActiveScriptErrorDebug *pErrorDebug,
523            [out] BOOL *pfEnterDebugger,
524            [out] BOOL *pfCallOnScriptErrorWhenContinuing);
525}
526
527/************************************************************
528 *      interface IActiveScriptSiteDebug64
529 */
530[
531    object,
532    uuid(d6b96b0a-7463-402c-92ac-89984226942f),
533    pointer_default(unique),
534    local
535]
536interface IActiveScriptSiteDebug64 : IUnknown
537{
538    HRESULT GetDocumentContextFromPosition(
539            [in]  DWORDLONG dwSourceContext,
540            [in]  ULONG uCharacterOffset,
541            [in]  ULONG uNumChars,
542            [out] IDebugDocumentContext **ppsc);
543
544    HRESULT GetApplication(
545            [out] IDebugApplication64 **ppda);
546
547    HRESULT GetRootApplicationNode(
548            [out] IDebugApplicationNode **ppdanRoot);
549
550    HRESULT OnScriptErrorDebug(
551            [in]  IActiveScriptErrorDebug *pErrorDebug,
552            [out] BOOL *pfEnterDebugger,
553            [out] BOOL *pfCallOnScriptErrorWhenContinuing);
554}
555
556[
557    object,
558    uuid(51973C17-CB0C-11d0-B5C9-00A0244A0E7A),
559    pointer_default(unique)
560]
561interface IDebugStackFrame : IUnknown
562{
563    /* FIXME: fill me! */
564}
565
566[
567    object,
568    uuid(51973C1e-CB0C-11d0-B5C9-00A0244A0E7A),
569    pointer_default(unique)
570]
571interface IEnumDebugStackFrames : IUnknown
572{
573    /* FIXME: fill me! */
574}
575
576[
577    object,
578    uuid(51973C2a-CB0C-11d0-B5C9-00A0244A0E7A),
579    pointer_default(unique)
580]
581interface IApplicationDebugger : IUnknown
582{
583    /* FIXME: fill me! */
584};
585
586[
587    object,
588    uuid(51973C3c-CB0C-11d0-B5C9-00A0244A0E7A),
589    pointer_default(unique)
590]
591interface IEnumRemoteDebugApplicationThreads : IUnknown
592{
593    /* FIXME: fill me! */
594}
595
596[
597    object,
598    uuid(51973C34-CB0C-11d0-B5C9-00A0244A0E7A),
599    pointer_default(unique)
600]
601interface IDebugApplicationNode : IUnknown
602{
603    /* FIXME: fill me! */
604}
605
606[
607    object,
608    uuid(51973C40-CB0C-11d0-B5C9-00A0244A0E7A),
609    pointer_default(unique)
610]
611interface IEnumDebugExpressionContexts : IUnknown
612{
613    /* FIXME: fill me! */
614}
615
616[
617    object,
618    uuid(51973c38-cb0c-11d0-b5c9-00a0244a0e7a),
619    pointer_default(unique),
620    local
621]
622interface IDebugApplicationThread : IRemoteDebugApplicationThread
623{
624    /* FIXME: fill me! */
625}
626
627[
628    object,
629    uuid(51973C1a-cb0c-11d0-b5c9-00a0244a0e7a),
630    pointer_default(unique),
631    local
632]
633interface IDebugSyncOperation : IUnknown
634{
635    /* FIXME: fill me! */
636}
637
638[
639    object,
640    uuid(51973c1b-cb0c-11d0-b5c9-00a0244a0e7a),
641    pointer_default(unique),
642    local
643]
644interface IDebugAsyncOperation : IUnknown
645{
646    /* FIXME: fill me! */
647}
648
649[
650    object,
651    uuid(51973c18-cb0c-11d0-b5c9-00a0244a0e7a),
652    pointer_default(unique)
653]
654interface IDebugStackFrameSniffer : IUnknown
655{
656    /* FIXME: fill me! */
657}
658
659[
660    object,
661    uuid(51973C36-CB0C-11d0-B5C9-00A0244A0E7A),
662    pointer_default(unique),
663    local
664]
665interface IDebugThreadCall32 : IUnknown
666{
667    /* FIXME: fill me! */
668}
669
670[
671    object,
672    uuid(51973C12-CB0C-11d0-B5C9-00A0244A0E7A),
673    pointer_default(unique)
674]
675interface IActiveScriptErrorDebug : IActiveScriptError
676{
677    /* FIXME: fill me! */
678}
679
680[
681    object,
682    uuid(51973C41-CB0C-11d0-B5C9-00A0244A0E7A),
683    pointer_default(unique)
684]
685interface IProvideExpressionContexts : IUnknown
686{
687    /* FIXME: fill me! */
688}
689
690cpp_quote("#ifndef DISABLE_ACTIVDBG_INTERFACE_WRAPPERS")
691cpp_quote("#ifdef _WIN64")
692
693cpp_quote("#define IActiveScriptDebug IActiveScriptDebug64")
694cpp_quote("#define IID_IActiveScriptDebug IID_IActiveScriptDebug64")
695
696cpp_quote("#define IActiveScriptSiteDebug IActiveScriptSiteDebug64")
697cpp_quote("#define IID_IActiveScriptSiteDebug IID_IActiveScriptSiteDebug64")
698
699cpp_quote("#define IDebugApplication IDebugApplication64")
700cpp_quote("#define IID_IDebugApplication IID_IDebugApplication64")
701
702cpp_quote("#else")
703
704cpp_quote("#define IActiveScriptDebug IActiveScriptDebug32")
705cpp_quote("#define IID_IActiveScriptDebug IID_IActiveScriptDebug32")
706
707cpp_quote("#define IActiveScriptSiteDebug IActiveScriptSiteDebug32")
708cpp_quote("#define IID_IActiveScriptSiteDebug IID_IActiveScriptSiteDebug32")
709
710cpp_quote("#define IDebugApplication IDebugApplication32")
711cpp_quote("#define IID_IDebugApplication IID_IDebugApplication32")
712
713cpp_quote("#endif")
714cpp_quote("#endif")
715