Geeks With Blogs

WinToolZone - Spelunking Microsoft Technologies
I work as a developer on the Common Language Runtime (CLR) team, specifically in the areas of exception handling and CLR hosting.

The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Inside and Out... An attempt to understand technology better...
[Original Post Date: 5th September 2005]
Share Source CLI, better known as Rotor, is one of the best ways to understand how .NET Framework works. And with the source code availability as part of Rotor distribution, its an excellent academic/hobby interest - you can extend it by adding more functionality, or modify the existing one and see how it behaves.
Yesterday, I went about doing the same. One of the functionality which I found missing in Rotor is that of enumerating system process list. .NET Framework's System.Diagnostics.Process class has methods, like GetProcesses, that allow you to do the same.
So, I went about implementing GetProcesses method overloadsin System.Diagnostics.Process class that allow me to enumerate process list on the local machine only. This required modification in the Platform Adaptation Layer (PAL) of Rotor. Since, I just have it running on Win32 for the moment, I modified the Win32 PAL to implement the support via ToolHelp API. Now, on a Windows system, its possible to enumerate the system process list using Rotor, as exemplified by the snippet below:

using System;
using System.Diagnostics;
publicclass EnumProcess
publicstaticvoid Main()
Process[] arrProcess = Process.GetProcesses();
if (arrProcess == null)
Console.WriteLine("Unable to get process list!");
Console.WriteLine("{0} processes enumerated.",arrProcess.Length);
foreach (Process proc in arrProcess)
Console.WriteLine("Process ID {0}, Handle: {1}", proc.Id, proc.Handle);
You can download the updated source files for Rotor v1.0 from The zipped archive contains Changes for Process Enumeration.txt that indicates where the updated files need to be copied. Once done, rebuild Rotor to get the changes into effect.
Posted on Thursday, January 5, 2006 9:44 AM .NET Framework V1.X , Rotor , 32bit , Tools/Applications | Back to top

Comments on this post: Adding process enumeration support in Rotor v1.0

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Gaurav Khanna | Powered by: