• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# AD_PROCESS_ID类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AD_PROCESS_ID的典型用法代码示例。如果您正苦于以下问题:C# AD_PROCESS_ID类的具体用法?C# AD_PROCESS_ID怎么用?C# AD_PROCESS_ID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AD_PROCESS_ID类属于命名空间,在下文中一共展示了AD_PROCESS_ID类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetProviderProgramNode

 public int GetProviderProgramNode(enum_PROVIDER_FLAGS Flags, IDebugDefaultPort2 pPort, AD_PROCESS_ID ProcessId,
     ref Guid guidEngine, ulong programId, out IDebugProgramNode2 ppProgramNode)
 {
     DebugHelper.TraceEnteringMethod();
     ppProgramNode = null;
     return VSConstants.S_OK;
 }
开发者ID:aluitink,项目名称:aspnet-debug2,代码行数:7,代码来源:AD7ProgramProvider.cs


示例2: GetHostPid

 public int GetHostPid(AD_PROCESS_ID[] pHostProcessId)
 {
     DebugHelper.TraceEnteringMethod();
     pHostProcessId[0].ProcessIdType = (uint)enum_AD_PROCESS_ID.AD_PROCESS_ID_GUID;
     pHostProcessId[0].guidProcessId = _processId;
     return VSConstants.S_OK;
 }
开发者ID:aluitink,项目名称:aspnet-debug2,代码行数:7,代码来源:AD7ProgramNode.cs


示例3: typeof

    // Obtains information about programs running, filtered in a variety of ways.
    int IDebugProgramProvider2.GetProviderProcessData(enum_PROVIDER_FLAGS Flags, IDebugDefaultPort2 port, AD_PROCESS_ID ProcessId, CONST_GUID_ARRAY EngineFilter, PROVIDER_PROCESS_DATA[] processArray) {
      processArray[0] = new PROVIDER_PROCESS_DATA();

      if (Flags.HasFlag(enum_PROVIDER_FLAGS.PFLAG_GET_PROGRAM_NODES)) {
        // The debugger is asking the engine to return the program nodes it can debug. The 
        // sample engine claims that it can debug all processes, and returns exsactly one
        // program node for each process. A full-featured debugger may wish to examine the
        // target process and determine if it understands how to debug it.

        var node = (IDebugProgramNode2)(new AD7ProgramNode(ProcessId.guidProcessId));

        IntPtr[] programNodes = { Marshal.GetComInterfaceForObject(node, typeof(IDebugProgramNode2)) };

        IntPtr destinationArray = Marshal.AllocCoTaskMem(IntPtr.Size * programNodes.Length);
        Marshal.Copy(programNodes, 0, destinationArray, programNodes.Length);

        processArray[0].Fields = enum_PROVIDER_FIELDS.PFIELD_PROGRAM_NODES;
        processArray[0].ProgramNodes.Members = destinationArray;
        processArray[0].ProgramNodes.dwCount = (uint)programNodes.Length;

        return VSConstants.S_OK;
      }

      return VSConstants.S_FALSE;
    }
开发者ID:Orvid,项目名称:Cosmos,代码行数:26,代码来源:AD7ProgramProvider.cs


示例4: GetProcess

        public int GetProcess(AD_PROCESS_ID ProcessId, out IDebugProcess2 ppProcess) {
            ppProcess = null;

            if (ProcessId.ProcessIdType != (uint)enum_AD_PROCESS_ID.AD_PROCESS_ID_SYSTEM) {
                return VSConstants.E_FAIL;
            }

            IEnumDebugProcesses2 processEnum;
            int hr = EnumProcesses(out processEnum);
            if (ErrorHandler.Failed(hr)) {
                return hr;
            }

            var processes = new IDebugProcess2[1];
            var pids = new AD_PROCESS_ID[1];
            uint fetched = 0;
            while (true) {
                hr = processEnum.Next(1, processes, ref fetched);
                if (ErrorHandler.Failed(hr)) {
                    return hr;
                } else if (fetched == 0) {
                    return VSConstants.E_FAIL;
                }

                if (ErrorHandler.Succeeded(processes[0].GetPhysicalProcessId(pids)) && ProcessId.dwProcessId == pids[0].dwProcessId) {
                    ppProcess = processes[0];
                    return VSConstants.S_OK;
                }
            }
        }
开发者ID:lioaphy,项目名称:nodejstools,代码行数:30,代码来源:NodeRemoteDebugPort.cs


示例5: GetProviderProcessData

        public int GetProviderProcessData(enum_PROVIDER_FLAGS Flags, IDebugDefaultPort2 pPort, AD_PROCESS_ID ProcessId, CONST_GUID_ARRAY EngineFilter, PROVIDER_PROCESS_DATA[] pProcess)
        {
            Log.Debug("ProgramProvider: GetProviderProcessData");

            if (Flags.HasFlag(enum_PROVIDER_FLAGS.PFLAG_GET_PROGRAM_NODES))
            {
                var process = Process.GetProcessById((int) ProcessId.dwProcessId);
                foreach (ProcessModule module in process.Modules)
                {
                    if (module.ModuleName.StartsWith("System.Management.Automation", StringComparison.OrdinalIgnoreCase))
                    {
                        var node = new ScriptProgramNode(new ScriptDebugProcess(pPort, ProcessId.dwProcessId));

                        var programNodes = new[] { Marshal.GetComInterfaceForObject(node, typeof(IDebugProgramNode2)) };

                        var destinationArray = Marshal.AllocCoTaskMem(IntPtr.Size * programNodes.Length);
                        Marshal.Copy(programNodes, 0, destinationArray, programNodes.Length);

                        pProcess[0].Fields = enum_PROVIDER_FIELDS.PFIELD_PROGRAM_NODES;
                        pProcess[0].ProgramNodes.Members = destinationArray;
                        pProcess[0].ProgramNodes.dwCount = (uint)programNodes.Length;

                        return VSConstants.S_OK;
                    }
                }
            }

            return VSConstants.S_FALSE;
        }
开发者ID:vairam-svs,项目名称:poshtools,代码行数:29,代码来源:ScriptProgramProvider.cs


示例6:

        // Gets the system process identifier for the process hosting a program.
        int IDebugProgramNode2.GetHostPid(AD_PROCESS_ID[] pHostProcessId)
        {
            // Return the process id of the debugged process
            pHostProcessId[0] = _processId;

            return Constants.S_OK;
        }
开发者ID:lsgxeva,项目名称:MIEngine,代码行数:8,代码来源:AD7ProgramNode.cs


示例7:

    // Gets the system process identifier for the process hosting a program.
    int IDebugProgramNode2.GetHostPid(AD_PROCESS_ID[] pHostProcessId) {
      // Return the process id of the debugged process
      pHostProcessId[0].ProcessIdType = (uint)enum_AD_PROCESS_ID.AD_PROCESS_ID_GUID;
      pHostProcessId[0].guidProcessId = mProcessID;

      return VSConstants.S_OK;
    }
开发者ID:ChrisJamesSadler,项目名称:Cosmos,代码行数:8,代码来源:AD7ProgramNode.cs


示例8:

        // Gets the system process identifier for the process hosting a program.
        int IDebugProgramNode2.GetHostPid(AD_PROCESS_ID[] pHostProcessId) {
            // Return the process id of the debugged process
            pHostProcessId[0].ProcessIdType = (uint)enum_AD_PROCESS_ID.AD_PROCESS_ID_SYSTEM;
            pHostProcessId[0].dwProcessId = (uint)m_processId;

            return VSConstants.S_OK;
        }
开发者ID:lioaphy,项目名称:nodejstools,代码行数:8,代码来源:AD7ProgramNode.cs


示例9: GetPhysicalProcessId

        public static AD_PROCESS_ID GetPhysicalProcessId(this IDebugProcess2 process)
        {
            Contract.Requires<ArgumentNullException>(process != null, "process");

            AD_PROCESS_ID[] processId = new AD_PROCESS_ID[1];
            ErrorHandler.ThrowOnFailure(process.GetPhysicalProcessId(processId));
            return processId[0];
        }
开发者ID:fjnogueira,项目名称:JavaForVS,代码行数:8,代码来源:DebugProcessExtensions.cs


示例10: GetHostPid

        /// <summary>
        /// Gets the system process identifier for the process hosting the program.
        /// </summary>
        /// <param name="pHostProcessId">Returns the system process identifier for the hosting process.</param>
        /// <returns>
        /// If successful, returns S_OK; otherwise, returns an error code.
        /// </returns>
        public override int GetHostPid( AD_PROCESS_ID[] pHostProcessId )
        {
            Logger.Debug( string.Empty );
            pHostProcessId[0].ProcessIdType = (uint) enum_AD_PROCESS_ID.AD_PROCESS_ID_GUID;
            pHostProcessId[0].guidProcessId = Process.Id;

            return VSConstants.S_OK;
        }
开发者ID:IntelliTect,项目名称:PowerStudio,代码行数:15,代码来源:PowerShellProgramNode.cs


示例11: GetProcess

        public static IDebugProcess2 GetProcess(this IDebugPort2 port, AD_PROCESS_ID processId)
        {
            Contract.Requires<ArgumentNullException>(port != null, "port");

            IDebugProcess2 process;
            ErrorHandler.ThrowOnFailure(port.GetProcess(processId, out process));
            return process;
        }
开发者ID:fjnogueira,项目名称:JavaForVS,代码行数:8,代码来源:DebugPortExtensions.cs


示例12: GetProviderProcessData

 /// <summary>
 /// Retrieves a list of running programs from a specified process.
 /// </summary>
 /// <param name="Flags">
 /// A combination of flags from the PROVIDER_FLAGS enumeration. The following flags are typical for this call:
 /// 
 /// Flag                         Description
 /// PFLAG_REMOTE_PORT            Caller is running on remote machine. 
 /// PFLAG_DEBUGGEE               Caller is currently being debugged (additional information about marshalling will be returned for each node).
 /// PFLAG_ATTACHED_TO_DEBUGGEE   Caller was attached to but not launched by the debugger.
 /// PFLAG_GET_PROGRAM_NODES      Caller is asking for a list of program nodes to be returned.
 /// </param>
 /// <param name="pPort">The port the calling process is running on.</param>
 /// <param name="ProcessId">An AD_PROCESS_ID structure holding the ID of the process that contains the program in question.</param>
 /// <param name="EngineFilter">An array of GUIDs for debug engines assigned to debug this process (these will be used to filter the programs that are actually returned based on what the supplied engines support; if no engines are specified, then all programs will be returned).</param>
 /// <param name="pProcess">A PROVIDER_PROCESS_DATA structure that is filled in with the requested information.</param>
 /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns>
 /// <remarks>This method is normally called by a process to obtain a list of programs running in that process. The returned information is a list of IDebugProgramNode2 objects.</remarks>
 public virtual int GetProviderProcessData( enum_PROVIDER_FLAGS Flags,
     IDebugDefaultPort2 pPort,
     AD_PROCESS_ID ProcessId,
     CONST_GUID_ARRAY EngineFilter,
     PROVIDER_PROCESS_DATA[] pProcess)
 {
     Logger.Debug( string.Empty );
     return VSConstants.E_NOTIMPL;
 }
开发者ID:IntelliTect,项目名称:PowerStudio,代码行数:27,代码来源:DebugProgramProvider.cs


示例13:

        // Gets the system process identifier for the process hosting a program.
        int IDebugProgramNode2.GetHostPid(AD_PROCESS_ID[] pHostProcessId)
        {
            Log.Debug("ScriptProgramNode: Entering GetHostPid");
            // Return the process id of the debugged process
            pHostProcessId[0].ProcessIdType = (uint)enum_AD_PROCESS_ID.AD_PROCESS_ID_GUID;
            pHostProcessId[0].guidProcessId = Process.Id;

            return VSConstants.S_OK;
        }
开发者ID:vairam-svs,项目名称:poshtools,代码行数:10,代码来源:ScirptProgramNode.cs


示例14: GetProcessId

 public static int GetProcessId(this IDebugProcess2 process)
 {
     if (process == null)
         return 0;
     var id = new AD_PROCESS_ID[1];
     if (process.GetPhysicalProcessId(id) != VSConstants.S_OK)
         return 0;
     return (int)id[0].dwProcessId;
 }
开发者ID:pakrym,项目名称:ReAttach,代码行数:9,代码来源:DebugProcessExtensions.cs


示例15: GetProcess

            public int GetProcess(AD_PROCESS_ID ProcessId, out IDebugProcess2 ppProcess) {
                ppProcess = null;

                if (ProcessId.ProcessIdType != (uint)enum_AD_PROCESS_ID.AD_PROCESS_ID_SYSTEM) {
                    return VSConstants.E_FAIL;
                }

                ppProcess = GetProcesses().FirstOrDefault(p => p.ProcessId == ProcessId.dwProcessId);
                return ppProcess != null ? VSConstants.S_OK : VSConstants.E_FAIL;
            }
开发者ID:Microsoft,项目名称:RTVS,代码行数:10,代码来源:RDebugPortSupplier.DebugPort.cs


示例16: GetProcessId

        public static int GetProcessId(IDebugProcess2 process) {
            AD_PROCESS_ID[] pid = new AD_PROCESS_ID[1];
            EngineUtils.RequireOk(process.GetPhysicalProcessId(pid));

            if (pid[0].ProcessIdType != (uint)enum_AD_PROCESS_ID.AD_PROCESS_ID_SYSTEM) {
                return 0;
            }

            return (int)pid[0].dwProcessId;
        }
开发者ID:RussBaz,项目名称:PTVS,代码行数:10,代码来源:EngineUtils.cs


示例17: GetProviderProgramNode

 /// <summary>
 /// Retrieves the program node for a specific program.
 /// </summary>
 /// <param name="Flags">
 /// A combination of flags from the PROVIDER_FLAGS enumeration. The following flags are typical for this call:
 /// 
 /// Flag                         Description
 /// PFLAG_REMOTE_PORT            Caller is running on remote machine.
 /// PFLAG_DEBUGGEE               Caller is currently being debugged (additional information about marshalling will be returned for each node).
 /// PFLAG_ATTACHED_TO_DEBUGGEE   Caller was attached to but not launched by the debugger.
 /// </param>
 /// <param name="pPort">The port the calling process is running on.</param>
 /// <param name="ProcessId">An AD_PROCESS_ID structure holding the ID of the process that contains the program in question.</param>
 /// <param name="guidEngine">GUID of the debug engine that the program is attached to (if any).</param>
 /// <param name="programId">ID of the program for which to get the program node.</param>
 /// <param name="ppProgramNode">An IDebugProgramNode2 object representing the requested program node.</param>
 /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns>
 public virtual int GetProviderProgramNode( enum_PROVIDER_FLAGS Flags,
     IDebugDefaultPort2 pPort,
     AD_PROCESS_ID ProcessId,
     ref Guid guidEngine,
     ulong programId,
     out IDebugProgramNode2 ppProgramNode)
 {
     Logger.Debug( string.Empty );
     ppProgramNode = null;
     return VSConstants.E_NOTIMPL;
 }
开发者ID:IntelliTect,项目名称:PowerStudio,代码行数:28,代码来源:DebugProgramProvider.cs


示例18: typeof

        // Obtains information about programs running, filtered in a variety of ways.
        int IDebugProgramProvider2.GetProviderProcessData(enum_PROVIDER_FLAGS Flags, IDebugDefaultPort2 port, AD_PROCESS_ID ProcessId, CONST_GUID_ARRAY EngineFilter, PROVIDER_PROCESS_DATA[] processArray) {

            processArray[0] = new PROVIDER_PROCESS_DATA();

            // we handle creation of the remote program provider ourselves.  This is because we always load our program provider locally which keeps
            // attach working when developing Python Tools and running/debugging from within VS and in the experimental hive.  When we are installed
            // we install into the GAC so these types are available to create and then remote debugging works as well.  When we're running in the
            // experimental hive we are not in the GAC so if we're created outside of VS (e.g. in msvsmon on the local machine) then we can't get
            // at our program provider and debug->attach doesn't work.
            if (port != null && port.QueryIsLocal() == VSConstants.S_FALSE) {
                IDebugCoreServer3 server;
                if (ErrorHandler.Succeeded(port.GetServer(out server))) {
                    IDebugCoreServer90 dbgServer = server as IDebugCoreServer90;
                    if (dbgServer != null) {
                        Guid g = typeof(IDebugProgramProvider2).GUID;
                        IntPtr remoteProviderPunk;

                        int hr = dbgServer.CreateManagedInstanceInServer(typeof(AD7ProgramProvider).FullName, typeof(AD7ProgramProvider).Assembly.FullName, 0, ref g, out remoteProviderPunk);
                        try {
                            if (ErrorHandler.Succeeded(hr)) {
                                var remoteProvider = (IDebugProgramProvider2)Marshal.GetObjectForIUnknown(remoteProviderPunk);
                                return remoteProvider.GetProviderProcessData(Flags, null, ProcessId, EngineFilter, processArray);
                            }
                        } finally {
                            if (remoteProviderPunk != IntPtr.Zero) {
                                Marshal.Release(remoteProviderPunk);
                            }
                        }
                    }
                }
            } else if ((Flags & enum_PROVIDER_FLAGS.PFLAG_GET_PROGRAM_NODES) != 0 ) {
                // The debugger is asking the engine to return the program nodes it can debug. We check
                // each process if it has a python##.dll or python##_d.dll loaded and if it does
                // then we report the program as being a Python process.

                if (DebugAttach.IsPythonProcess((int)ProcessId.dwProcessId)) {
                    IDebugProgramNode2 node = new AD7ProgramNode((int)ProcessId.dwProcessId);

                    IntPtr[] programNodes = { Marshal.GetComInterfaceForObject(node, typeof(IDebugProgramNode2)) };

                    IntPtr destinationArray = Marshal.AllocCoTaskMem(IntPtr.Size * programNodes.Length);
                    Marshal.Copy(programNodes, 0, destinationArray, programNodes.Length);

                    processArray[0].Fields = enum_PROVIDER_FIELDS.PFIELD_PROGRAM_NODES;
                    processArray[0].ProgramNodes.Members = destinationArray;
                    processArray[0].ProgramNodes.dwCount = (uint)programNodes.Length;

                    return VSConstants.S_OK;
                }
            }

            return VSConstants.S_FALSE;
        }
开发者ID:wenh123,项目名称:PTVS,代码行数:54,代码来源:AD7ProgramProvider.cs


示例19:

    // Establishes a callback to watch for provider events associated with specific kinds of processes
    int IDebugProgramProvider2.WatchForProviderEvents(enum_PROVIDER_FLAGS Flags, IDebugDefaultPort2 port, AD_PROCESS_ID ProcessId, CONST_GUID_ARRAY EngineFilter, ref Guid guidLaunchingEngine, IDebugPortNotify2 ad7EventCallback) {
      // The sample debug engine is a native debugger, and can therefore always provide a program node
      // in GetProviderProcessData. Non-native debuggers may wish to implement this method as a way
      // of monitoring the process before code for their runtime starts. For example, if implementing a 
      // 'foo script' debug engine, one could attach to a process which might eventually run 'foo script'
      // before this 'foo script' started.
      //
      // To implement this method, an engine would monitor the target process and call AddProgramNode
      // when the target process started running code which was debuggable by the engine. The 
      // enum_PROVIDER_FLAGS.PFLAG_ATTACHED_TO_DEBUGGEE flag indicates if the request is to start
      // or stop watching the process.

      return VSConstants.S_OK;
    }
开发者ID:Orvid,项目名称:Cosmos,代码行数:15,代码来源:AD7ProgramProvider.cs


示例20: DebuggedProcess

        public DebuggedProcess(AD7Engine engine, IPAddress ipAddress, EngineCallback callback)
        {
            _engine = engine;
            _ipAddress = ipAddress;
            Instance = this;

            // we do NOT have real Win32 process IDs, so we use a guid
            AD_PROCESS_ID pid = new AD_PROCESS_ID();
            pid.ProcessIdType = (int)enum_AD_PROCESS_ID.AD_PROCESS_ID_GUID;
            pid.guidProcessId = Guid.NewGuid();
            this.Id = pid;

            _callback = callback;
        }
开发者ID:Staticlabs,项目名称:MonoRemoteDebugger,代码行数:14,代码来源:DebuggedProcess.cs



注:本文中的AD_PROCESS_ID类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AGLContext类代码示例发布时间:2022-05-24
下一篇:
C# ADODB.Recordset类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap