VBScript 调试器实现 - IActiveScriptDebug "Catastrophic failure" on 64-bit Windows

VBScript debugger implementation - IActiveScriptDebug "Catastrophic failure" on 64-bit Windows

继续我上一个关于在 64 位上实现 Microsoft Active Script 调试器接口的问题 windows。我遇到了另一个棘手的问题。

这次是 IActiveScriptDebug,它在 64 位版本中似乎不起作用。

有问题的代码是在尝试使用 MS 示例调试器代码(已转换为 Delphi)中的代码设置断点时出现的。

  Href:=FEngine.QueryInterface(IID_IActiveScriptDebug,FdebugEngine);
  Href:=FdebugEngine.EnumCodeContextsOfPosition(0,Line,LineLen,edcc);
  if IEnumDebugCodeContexts(edcc).Next(1,dcc,numFetched) = S_OK then
    Href:=dcc.SetBreakPoint(BREAKPOINT_ENABLED);

其中 Fengine 是 IactiveScript 语言引擎,FdebugEngine 是返回的 IActiveScriptDebug 对象,edcc 是一个 IEnumDebugCodeContexts;

IID_IActiveScriptDebug 设置为 64 位 windows 的 IID_IActiveScriptDebug64 GUID 和 32 位 windows 的 IID_IActiveScriptDebug32。在这两种情况下,都会返回有效的调试引擎。

为 32 windows 编译,这段代码工作正常。我可以设置断点并在中断时获取回调。

针对 64 位编译,FdebugEngine.EnumCodeContextsOfPosition returns 一个 "Catastrophic failure" Hresult。

知道 64 位代码产生此错误的原因吗?

所以在追寻我的尾巴和这个论坛缺乏回应之后,我得出的结论是 64 位版本的 Active script debugger 已经坏了,而且看起来没有修复的希望将被弃用。

所以我把这个留在这里是为了警告任何想要实现这个功能的人,让他们知道不要浪费他们的时间。