Programmatically find and set the Process Affinity mask for Windows Applications
Posted by Sudarshan Narasimhan on March 30, 2012
Well, here come my first Windows programming post. I often dabble in Win32 coding and have lots of small tools or programs written. I’m still sifting through my old code to see how many of them are useful for others. This one is quite handy to understand how Windows affinity mask can be found for any process and also set the affinity mask for running processes.
Program Details
- C#.NET(Console application)
- Visual Studio 2010
- Works on Windows 2003 and onwards
- Uses Windows API’s GetProcessAffinityMask and SetProcessAffinityMask
Screenshot
You can download the visual studio solution called “ProcessAffinity.zip” from SkyDrive below,
https://skydrive.live.com/?cid=2c5b6bdee139d310&sc=documents&uc=2&id=2C5B6BDEE139D310%21135#
Leave a Reply