I tried to install VS 2008 beta 2. First I uninstalled the beta one version, then I ran the beta 2 installer, and as usual I found myself struggle against those annoying problems. The installer tells me that I did not uninstall the MSDN for Orcas. But on "Programs & features" there was no entry for "MSDN for Orcas". Searching the web for Orcas beta 1 removal tool was just time consuming, I found nothing, so I decided to use Process Monitor. Using the right filter set and a good search I found the entry in the registry that hold the product. Another search under this key I found the uninstall command:
MsiExec.exe /X{3A89F960-5977-3419-8462-AA0BD5DEEACB}
I copied it and ran it from an admin command line. MSDN for Orcas finally removed from the system.
I restarted the VS 2008 beta 2 installer, and all worked just fine :)
A job object allows a group of processes to be managed as a unit. Job objects are namable, securable, sharable objects that control attributes of and assign limits to the processes associated with them. Operations performed on the job object affect all processes associated with the job object.
JobObjectWrapper is a .NET abstraction over the Win32 Job Object. With this library you can create job objects, create and assign a process to the job, control process and job limits, and register for the various process- and job-related notification events.
Most of the code is written in C++/CLI. This is a good example of abstracting Win32 mechanism and bringing to the managed world. You can see the power of C++ combined with the modern features of .Net.
This is a snippet from the Job event handler header file:
/// <summary>
/// Generic delegate for all Job Events
/// </summary>
generic<typename TEventArgs> // where TEventArgs : JobEventArgs ^
public delegate void jobEventHandler(System::Object ^sender, TEventArgs args);
template<typename TEventArgs>
ref class EventEntry sealed : IEventEntry
{
public:
event jobEventHandler<TEventArgs ^> ^OnJobEvent;
virtual void Invoke(JobObject ^job, unsigned int messageSpecificValue);
virtual void AddDelegate(System::MulticastDelegate ^del);
virtual void RemoveDelegate(System::MulticastDelegate ^del);
};
The EventEntry ::jobEventHandler is a generic event that takes a C++ template argument. If you dive into the source you will see that I use C++ macros to expand all Job Object events. From C#, all look very simple.
What's next?
We need a good client application that shows the power of the Job Object mechanism. The application should:
- Be a WPF based
- Allow the user to create Jobs.
- Enable assigning running processes to jobs
- Control the processes, put limits and receive events
- Save/Load the setting to a configuration file.
- Have a Windows service that watch for new processes and assign them to a job according to the user setting.
If anyone want to contribute to the project, please let me know and I'll add him to the team.
Please download the code and try it. I will be more than happy to hear your feedback.
We are currently working on a new open source project that will be published on codeplex in the near future. The project, JobObjectWrapper is a .Net wrapper of the Win32 Job Object capabilities. A job object allows groups of processes to be managed as a unit. Job objects are namable, securable, sharable objects that control attributes of the processes associated with them. Operations performed on the job object affect all processes associated with the job object. A job can enforce limits on each associated process, such as the working set size, process priority, end-of-job time limit, and so on. The job object also records basic accounting information for all its associated processes, including those that have terminated. You can also listen to events such as when a new process is created or when a timeout or memory limit has been reached.
Threre are set of security limits that can be set such as run all processes with a specific security token. In the course of implementing a wrapper to this feature I have found that I cannot get it to work. No matter what I did I got a no supported error. Since I am doing the development on a Vista based machine I decided to try it on Windows XP and 2003 server and it worked. I decided to post a documentation feedback in the MSDN and this is the answer:
Hello Alon,
Thank you for using the MSDN documentation feedback system. I am the technical writer assigned to this topic.
JOBOBJECT_SECURITY_LIMIT_INFORMATION and the JobObjectSecurityLimitInformation class were deprecated in Windows Vista, but unfortunately this change didn't make it into the SDK header files or documentation. The recommended workaround is to lock down individual processes rather than doing this through the job object.
My apologies for the inconvenience. I have placed updated documentation in the pipeline-- it should be live on MSDN in early September unless there's a snag in the publication process.
Thanks again for contacting us about this.
Regards,
Carol
Windows SDK documentation feedback team
I have also post to the MVP private newsgroup and I got someone to look in the sources. His response was:
This is very strange. The code in the kernel that performed this task in previous versions has been ripped out and replaced by code that returns STATUS_NOT_SUPPORTED.
I have no idea why they did that. I see no mention of it in the docs.
I wonder what other braking changes are no documented?