當前位置: 首頁>>代碼示例>>C#>>正文


C# AD_PROCESS_ID類代碼示例

本文整理匯總了C#中AD_PROCESS_ID的典型用法代碼示例。如果您正苦於以下問題:C# AD_PROCESS_ID類的具體用法?C# AD_PROCESS_ID怎麽用?C# AD_PROCESS_ID使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AD_PROCESS_ID類屬於命名空間,在下文中一共展示了AD_PROCESS_ID類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的AD_PROCESS_ID類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。