public ReAttachTarget GetTargetFromProcess(IDebugProcess2 debugProcess) { var process = (IDebugProcess3)debugProcess; var pid = process.GetProcessId(); var target = _package.History.Items.Find(pid); if (target != null) { return(target); } var serverName = ""; IDebugCoreServer2 server; if (debugProcess.GetServer(out server) == VSConstants.S_OK) { var server3 = server as IDebugCoreServer3; var tmp = ""; if (server3 != null && server3.QueryIsLocal() == VSConstants.S_FALSE && server3.GetServerFriendlyName(out tmp) == VSConstants.S_OK) { serverName = tmp; } } var user = GetProcessUsername(pid); var path = process.GetFilename(); target = new ReAttachTarget(pid, path, user, serverName); var rawEngines = new GUID_ARRAY[1]; if (process.GetEngineFilter(rawEngines) == VSConstants.S_OK && rawEngines[0].dwCount > 0) { var pointer = rawEngines[0].Members; var engineCount = rawEngines[0].dwCount; for (var i = 0; i < engineCount; i++) { var engineId = (Guid)Marshal.PtrToStructure(pointer + (i * 16), typeof(Guid)); target.Engines.Add(engineId); } } return(target); }
public int GetEngineFilter(GUID_ARRAY[] pEngineArray) { throw new NotImplementedException(); }
public ReAttachTarget GetTargetFromProcess(IDebugProcess2 debugProcess) { var process = (IDebugProcess3)debugProcess; var pid = process.GetProcessId(); var target = _package.History.Items.Find(pid); if (target != null) return target; var serverName = ""; IDebugCoreServer2 server; if (debugProcess.GetServer(out server) == VSConstants.S_OK) { var server3 = server as IDebugCoreServer3; var tmp = ""; if (server3 != null && server3.QueryIsLocal() == VSConstants.S_FALSE && server3.GetServerFriendlyName(out tmp) == VSConstants.S_OK) { serverName = tmp; } } var user = GetProcessUsername(pid); var path = process.GetFilename(); target = new ReAttachTarget(pid, path, user, serverName); var rawEngines = new GUID_ARRAY[1]; if (process.GetEngineFilter(rawEngines) == VSConstants.S_OK && rawEngines[0].dwCount > 0) { var pointer = rawEngines[0].Members; var engineCount = rawEngines[0].dwCount; for (var i = 0; i < engineCount; i++) { var engineId = (Guid)Marshal.PtrToStructure(pointer + (i * 16), typeof(Guid)); target.Engines.Add(engineId); } } return target; }
/// <summary> /// Retrieves an array of unique identifiers for available debug engines. /// </summary> /// <param name="pEngineArray">Reference to a structure that contains unique identifiers for debug engines.</param> /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns> public virtual int GetEngineFilter( GUID_ARRAY[] pEngineArray ) { Logger.Debug( string.Empty ); return VSConstants.E_NOTIMPL; }
public int GetEngineFilter(GUID_ARRAY[] pEngineArray) { DebugHelper.TraceEnteringMethod(); throw new NotImplementedException(); }
/// <summary> /// Retrieves an array of unique identifiers for available debug engines. /// </summary> int IDebugProcess3.GetEngineFilter(GUID_ARRAY[] pEngineArray) { DLog.Debug(DContext.VSDebuggerComCall, "IDebugProcess2.GetEngineFilter"); return VSConstants.E_NOTIMPL; }