ase(dbg) { } // 实现 ICorDebugUnmanagedCallback 接口 } public class Debugger : IDisposable { public void Run() { //... _dbg.SetManagedHandler(new ManagedEventHandler(this)); _dbg.SetUnmanagedHandler(new UnmanagedEventHandler(this)); //... } } } 在准备好了调试事件处理器后,就可以根据需要,创建或者附加到目标调试进程上。ICorDebug 提供了 CreateProcess 方法对 Win32 API 中 CreateProcess 函数进行了包装。 以下为引用: public abstract interface ICorDebug { public abstract new void CreateProcess ( string lpApplicationName, string lpCommandLine, _SECURITY_ATTRIBUTES lpProcessAttributes, _SECURITY_ATTRIBUTES lpThreadAttributes, int bInhe页码:[1] [2] [3] [4] [5] [6] [7] [8] [9] 第4页、共9页 |