Beispiel #1
0
        public Debugger(Process process)
        {
            if (process == null)
                throw new ArgumentNullException("process");

            this.process = process;
            this.thread  = this.process.Threads[0];
            this.hThread = OpenThread(0x1F03FF, false, thread.Id);

            if (this.hThread == IntPtr.Zero)
                throw new Win32Exception();
        }
Beispiel #2
0
        //constructors
        /// <summary>
        /// Initialze the StackTrace Class and create all the FrameInfo objects
        /// </summary>
        /// <param name="proc">The thread to get the stack trace of</param>
        internal ThreadInfo(CorThread thread, ProcessInfo procInfo)
        {
            if (thread == null)
            {
                throw new ArgumentNullException("thread");
            }
            if (procInfo == null)
            {
                throw new ArgumentNullException("procInfo");
            }

            this.thread = thread;
            metaImportHash = new Dictionary<string, CorMetadataImport>();
            frameStack = new List<FrameInfo>();
            threadId = thread.Id;
            processInfo = procInfo;
            //get the general thread information object
            generalThreadInfo = procInfo.GeneralThreads[threadId];
        }
 //
 // Summary:
 //     Determines whether the specified process thread exists in the collection.
 //
 // Parameters:
 //   thread:
 //     A System.Diagnostics.ProcessThread instance that indicates the thread to
 //     find in this collection.
 //
 // Returns:
 //     true if the thread exists in the collection; otherwise, false.
 public bool Contains(ProcessThread thread) {
   return default(bool);
 }
 public static void addThreadToTreeView(TreeView treeView, ProcessThread thread)
 {
     var nodeText = thread.Id.str();
     O2Forms.newTreeNode(treeView.Nodes, nodeText, 0, thread, true /*addDummyNode */);
 }
Beispiel #5
0
 public bool Contains(ProcessThread thread)
 {
     return(InnerList.Contains(thread));
 }
Beispiel #6
0
 // Get the index of a specific element in this collection.
 public int IndexOf(ProcessThread value)
 {
     return(InnerList.IndexOf(value));
 }
 public TokenSecurity(ProcessThread thread, AccessControlSections sectionsRequested)
     : this(thread.Id, sectionsRequested, false)
 {
 }
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public ProcessThreadCollection(ProcessThread[] processThreads)
 {
     InnerList.AddRange(processThreads);
 }
 private static ProcessThread[] GetThreads(Process process)
 {
     var threads = new ProcessThread[process.Threads.Count];
     for (var i = 0; i < process.Threads.Count; i++)
     {
         threads[i] = process.Threads[i];
     }
     return threads;
 }
Beispiel #10
0
 public void Insert(int index, ProcessThread thread)
 {
     throw new NotImplementedException();
 }
 //
 // Summary:
 //     Determines whether the specified process thread exists in the collection.
 //
 // Parameters:
 //   thread:
 //     A System.Diagnostics.ProcessThread instance that indicates the thread to
 //     find in this collection.
 //
 // Returns:
 //     true if the thread exists in the collection; otherwise, false.
 public bool Contains(ProcessThread thread)
 {
     return(default(bool));
 }
 // Summary:
 //     Appends a process thread to the collection.
 //
 // Parameters:
 //   thread:
 //     The thread to add to the collection.
 //
 // Returns:
 //     The zero-based index of the thread in the collection.
 public int Add(ProcessThread thread)
 {
     return(default(int));
 }
 public void Remove(ProcessThread thread)
 {
 }
 //
 // Summary:
 //     Provides the location of a specified thread within the collection.
 //
 // Parameters:
 //   thread:
 //     The System.Diagnostics.ProcessThread whose index is retrieved.
 //
 // Returns:
 //     The zero-based index that defines the location of the thread within the System.Diagnostics.ProcessThreadCollection.
 public int IndexOf(ProcessThread thread)
 {
     return(default(int));
 }
 //
 // Summary:
 //     Provides the location of a specified thread within the collection.
 //
 // Parameters:
 //   thread:
 //     The System.Diagnostics.ProcessThread whose index is retrieved.
 //
 // Returns:
 //     The zero-based index that defines the location of the thread within the System.Diagnostics.ProcessThreadCollection.
 public int IndexOf(ProcessThread thread) {
   return default(int);
 }
 public ThreadSecurity(ProcessThread thread, AccessControlSections sectionsRequired)
     : this(thread.Id, sectionsRequired)
 {
 }
Beispiel #17
0
 public int IndexOf(ProcessThread thread)
 {
     throw new NotImplementedException();
 }
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public void Remove(ProcessThread thread)
 {
     InnerList.Remove(thread);
 }
Beispiel #19
0
 public bool Contains(ProcessThread thread)
 {
     throw new NotImplementedException();
 }
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public void Insert(int index, ProcessThread thread)
 {
     InnerList.Insert(index, thread);
 }
Beispiel #21
0
 public void Remove(ProcessThread thread)
 {
     throw new NotImplementedException();
 }
Beispiel #22
0
 // Add an element to this collection.
 public int Add(ProcessThread value)
 {
     return(InnerList.Add(value));
 }
Beispiel #23
0
 private static IntPtr ThreadPointer(ProcessThread processThread)
 {
     return OpenThread(ThreadAccess.SUSPEND_RESUME, false, (uint)processThread.Id);
 }
Beispiel #24
0
 public void Remove(ProcessThread thread)
 {
     InnerList.Remove(thread);
 }
 public int BinarySearch(ProcessThread item)
 {
     throw new NotSupportedException();
 }
Beispiel #26
0
 public void Insert(int index, ProcessThread thread)
 {
     InnerList.Insert(index, thread);
 }
 public int BinarySearch(ProcessThread item, System.Collections.Generic.IComparer <ProcessThread> comparer)
 {
     throw new NotSupportedException();
 }
	// Get the index of a specific element in this collection.
	public int IndexOf(ProcessThread value)
			{
				return InnerList.IndexOf(value);
			}
 public int LastIndexOf(ProcessThread item, int index, int count)
 {
     throw new NotSupportedException();
 }
 //
 // Summary:
 //     Copies an array of System.Diagnostics.ProcessThread instances to the collection,
 //     at the specified index.
 //
 // Parameters:
 //   array:
 //     An array of System.Diagnostics.ProcessThread instances to add to the collection.
 //
 //   index:
 //     The location at which to add the new instances.
 public void CopyTo(ProcessThread[] array, int index) {
 }
Beispiel #31
0
 private static string GetThreadState(ProcessThread pt)
 {
     if (pt == null)
         return "";
     StringBuilder sb = new StringBuilder();
     sb.AppendLine("   Thread ID='" + pt.Id + "'  Start=" + pt.StartTime.ToString("s"));
     sb.Append("      System.Diagnostics.ThreadState = " + pt.ThreadState.ToString());
     if (pt.ThreadState == System.Diagnostics.ThreadState.Wait)
         sb.Append(" (ThreadWaitReason=" + pt.WaitReason.ToString() + ")");
     return sb.ToString();
 }
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public int Add(ProcessThread thread)
 {
     return(((IList)InnerList).Add(thread));
 }
		/// <summary>
		///   Retrieves the process that created the window, when available.
		/// </summary>
		/// <returns>The process when available, null otherwise.</returns>
		public Process GetProcess()
		{
			if ( _process == null )
			{
				uint processId;
				uint threadId = User32.GetWindowThreadProcessId( Handle, out processId );
				if ( threadId == 0 )
				{
					MarshalHelper.ThrowLastWin32ErrorException();
				}

				try
				{
					_process = processId == 0
						? null
						: Process.GetProcessById( (int)processId );
				}
				catch ( ArgumentException )
				{
					// The process specified by processId parameter is not running.
					// GetWindowThreadProcessId at one point returned a processId of a process which was not running. Possibly a remnant window of a crashed process?
					_process = null;
				}

				if ( _process != null )
				{
					try
					{
						_processThread = (
							from ProcessThread t in _process.Threads
							where t.Id == threadId
							select t ).First();
					}
					catch ( InvalidOperationException )
					{
						// Process has since been shut down.
						_process = null;
					}
				}
			}

			return _process;
		}
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public int Add(ProcessThread thread) {
     return InnerList.Add(thread);
 }
 public int Add(System.Diagnostics.ProcessThread thread)
 {
     throw null;
 }
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public bool Contains(ProcessThread thread)
 {
     return InnerList.Contains(thread);
 }
 public bool Contains(System.Diagnostics.ProcessThread thread)
 {
     throw null;
 }
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public void CopyTo(ProcessThread[] array, int index)
 {
     InnerList.CopyTo(array, index);
 }
 public int IndexOf(System.Diagnostics.ProcessThread thread)
 {
     throw null;
 }
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public int Add(ProcessThread thread)
 {
     return ((IList)InnerList).Add(thread);
 }
 public void Insert(int index, System.Diagnostics.ProcessThread thread)
 {
 }
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public int IndexOf(ProcessThread thread)
 {
     return InnerList.IndexOf(thread);
 }
 public void Remove(System.Diagnostics.ProcessThread thread)
 {
 }
Beispiel #44
0
 internal ProcessThreadCollection(ProcessThread module)
 {
     InnerList.Add(module);
 }
 /// <param name="thread"></param>Thread, dessen CPU-Auslastung das Programm herrausfinden soll </param>
 /// <param name="aktualisierungsintervall">gibt die Pause zwischen zwei Messungen in ms an</param>
 public ThreadListener(ProcessThread thread, int aktualisierungsintervall)
 {
     _aktualisierungsintervall = aktualisierungsintervall;
     _thread = thread;
     _id = thread.Id;
 }
Beispiel #46
0
 // Determine if an item exists in this collection.
 public bool Contains(ProcessThread value)
 {
     return(InnerList.Contains(value));
 }
 /// <param name="thread"></param>Thread, dessen CPU-Auslastung das Programm herrausfinden soll </param>
 public ThreadListener(ProcessThread thread)
 {
     _aktualisierungsintervall = 4000;
     _thread = thread;
     _id = thread.Id;
 }
Beispiel #48
0
 private void _thread_start()
 {
     _processThread = GetCurrentProcessThread();
     AllGThreads.Add(this);
     if (OnNewGThread != null) OnNewGThread(this);
     try {
         _threadStart();
     } catch (Exception ex) {
         Logging.Log.Exception("Unhandled GThread Excaption", ex, this);
         if (OnError != null)
             OnError(this, ex);
     } finally {
         if(AllGThreads.Contains(this))
             AllGThreads.Remove(this);
         if (OnEndGThread != null) OnEndGThread(this);
     }
 }
 public ThreadListener()
 {
     _aktualisierungsintervall = 4000;
     _thread = Process.GetCurrentProcess().Threads[0];
     _id = _thread.Id;
 }
Beispiel #50
0
 public int Add(ProcessThread thread)
 {
     return(InnerList.Add(thread));
 }
 //
 // Summary:
 //     Inserts a process thread at the specified location in the collection.
 //
 // Parameters:
 //   index:
 //     The zero-based index indicating the location at which to insert the thread.
 //
 //   thread:
 //     The thread to insert into the collection.
 public void Insert(int index, ProcessThread thread) {
 //
 // Summary:
 //     Deletes a process thread from the collection.
 //
 // Parameters:
 //   thread:
 //     The thread to remove from the collection.
 }
Beispiel #52
0
 public int IndexOf(ProcessThread thread)
 {
     return(InnerList.IndexOf(thread));
 }
 public void Remove(ProcessThread thread) {
 }
 public void showThreadDetailsOnTreeNode(TreeNode treeNode, ProcessThread processThread)
 {
     treeNode.Nodes.Clear();
     foreach(var property in PublicDI.reflection.getProperties(processThread))
     {
         var propertyValue = PublicDI.reflection.getProperty(property,processThread);
         var nodeText = string.Format("{0} = {1}", property.Name, propertyValue ?? "[null]");
         O2Forms.newTreeNode(treeNode.Nodes, nodeText);
     }
 }
 // Summary:
 //     Appends a process thread to the collection.
 //
 // Parameters:
 //   thread:
 //     The thread to add to the collection.
 //
 // Returns:
 //     The zero-based index of the thread in the collection.
 public int Add(ProcessThread thread) {
   return default(int);
 }
Beispiel #56
0
 internal override void Update(TreeNodeData tnd, bool allowUnsafeChanges, MainForm mf)
 {
     currentThread = ((ThreadData)tnd).Thread;
     UpdateControls();
 }
 public void Insert(int index, ProcessThread thread)
 {
 }