The many ways of getting process information

November 29, 2015

Processes are one of the most fundamental building blocks in Windows (and most other operating systems for that matter, even if the term is differently named). These are management objects, managing various resources such as memory and handles, to be used by actual executing threads within that process. Various tools, such as Task Manager and Process Explorer show information about processes, but how can we get that information programmatically? At first, it seems rather easy. If we’re working in .NET, then all we have to do is call the static Process.GetProcesses method and receive back an array of...
no comments

Launching Windows Store Apps Programmatically

October 24, 2015

Windows Apps (a.k.a. Store apps or Metro apps) run in a dedicated sandbox, providing “extra protection” from outside apps and OS as opposed to classic Windows applications. One consequence of this is that launching a Windows App using a classic CreateProcess call will generally fail. For example, if we run the Weather app that comes with Windows and look at the command line that was used to start the process (e.g. using Task Manager or Process Explorer), this is what we see: "C:\Program Files\WindowsApps\Microsoft.BingWeather_4.6.169.0_x86__8wekyb3d8bbwe\Microsoft.Msn.Weather.exe"      -ServerName:App.AppX2m6wj6jceb8yq7ppx1b3drf7yy51ha6f.mca Clearly, there...
no comments

RegRenameKey – Hidden registry API

September 29, 2015

While working on a pet project called Registry Explorer (yes, I know there are a bunch of those floating around, most of them pretty old) to be yet another RegEdit.exe replacement, I wanted to add the option to rename a registry key (which RegEdit.exe allows as well). However, looking at the registry APIs (both managed and native) there seems to be no function to rename a key. The closest is the ability to copy a key (with its subkeys and values) via RegCopyTree, so that I can copy the original key with the new name and delete the original...
one comment

Mandelbrot Set with Xamarin Forms (part 1)

August 11, 2015

Reader following my blog already know of my fondness of the Mandelbrot Set. I’ve written versions for WPF, Silverlight, Windows Phone Silverlight, the Windows Runtime and even C++ AMP. Missing still are the Windows 10 Universal Windows Platform and Xamarin Forms. In this post (and the next) I’ll tackle Xamarin Forms. If you’re not familiar with Xamarin Forms, it’s a cross platform library for writing mobile apps for iOS, Android and Windows Phone – all with the C# language and .NET principles. It’s based on “classic” Xamarin, where the application logic could be written just once for all...
no comments

Writing a Simple Debugger with DbgEng.Dll

July 27, 2015

In my post on using CLRMD’s debugger engine wrappers to “debug” a dump file, I’ve shown how we can take advantage of the documented API of DbgEng.Dll – the debugger engine that drives the Microsoft debuggers – CDB, NTSD, KD and WinDbg. In this post, we’ll take a step further and create a basic functioning user mode debugger that is able to attach to a process and do “normal” debugging, somewhat similar to CDB/NTSD but with some small colorful bonuses. As you may recall, I’ve taken the CLRMD project and made some enhancements to the callback interop types...
no comments

How should the Next WPF Version Look Like?

June 26, 2015

Microsoft has announced the next WPF version, as part of the new .NET 4.6. I’ve heard the news that WPF is back in development and it made me pretty happy; it was about time! A few months back, Microsoft started to talk about what to expect in this new update. Unfortunately, I was disappointed to see that there’s really nothing new. The feature list is mostly performance enhancements (which should have been done a long time ago), allowing interop with Direct3D 11/12 instead of Direct3D 9 (this was overdue as well), some improvements to the default control templates and...
one comment

Windows 10 Developer Readiness Live Session

May 31, 2015

Next week, on June 8th, I’ll be presenting a live session (with my colleague Alon Fliess) on developing with the new Windows Universal Platform on Windows 10, focusing on apps with C# and XAML. This is just one of several such sessions happening all over the world on the week of June 8-12 by MVPs. My session will be in Hebrew with Q&A interactively possible and encouraged. You are all invited! Learn about Windows 10 and the universal windows platform with Visual Studio 2015 with slides and code samples. Register for the session here. The main page for all...
no comments

Using CLRMD to replace KD/CDB/NTSD and maybe WinDbg?

May 14, 2015

I’ve been using the WinDbg low level debugger for several years now when things get hairy such as looking inside a .NET process and searching for memory leaks and other nasties. Or investigating a dump file, sometimes a kernel crash dump file (created because of the infamous “blue screen of death”), or when faced with a production system where Visual Studio does not (and will not) exist. Anyone who’s ever used WinDbg (or its equivalent console based debuggers – CDB, NTSD and KD) knows the feeling of wanting to get at some information but not always sure how...
one comment

Build 2015 Impressions

May 2, 2015

The Build 2015 conference just ended. It was one of the most important Build/PDC conferences since the Build/PDC inception. Most (if not all) sessions are available on channel 9, and even those that attended Build (myself included) were in only a fraction of the sessions since there were about 10 of them in each time slot. To get a good overview of the various announcements and get links to important downloads, you should head to this post in the Visual Studio blog. What follows are my own impressions and opinions on some of what I experienced at this year’s...
no comments

Making COM Collections Easily Consumable by .NET

April 13, 2015

In .NET, developers are accustomed to using constructs such as foreach to iterate over collections. In .NET, “Collection” refers to two types of objects: 1. Those that implement the IEnumerable or IEnumerable<T> interface.2. objects that don’t implement these interfaces, but have a method called GetEnumerator that return some object that has the following: a. Has a MoveNext method that returns a boolean and accepts nothing.b. Has a Current property that returns the type of object that the collection provides. Notice that no IEnumerator interface implementation is required. All this means that the (e.g. C#) compiler does pattern matching...
no comments