Advanced Windows Debugging got me hooked onto Detours and that led me to experiment with it a bit more. It resulted in this. Over the past three days, I have been working on using Detours to build a memory leak detection tool. MemAnalysis is finally done (v1, that is) and can track memory allocation and release when done using the following APIs: VirtualAlloc VirtualFree HeapAlloc HeapFree HeapDestroy Once the application being analyzed exits, MemAnalysis produces a report with details on how many ......
Detours is a very interesting library from Microsoft Research that allows you to intercept Windows API calls that an application makes and redirect them to your code that can then: do some pre-and-post processing work around the call to the original API, and/or customize what is returned to the caller of the API This does not involve accessing original application source code and can be done at runtime! For an example, check the screenshot below for a sample that intercepts calls to GetVersionEx ......
The book is a must have for every serious Windows developer!
For one of my pet projects I am writing, I was contemplating how to integrate Windows Live Authentication with my standalone application, similar to Windows Live Messenger. Turns out, it is really easy! Below are the three steps that were needed for the integration: Download the Windows Live Client SDK from here and install it. Create a new project and add reference to Microsoft.WindowsLive.Id.Cl... assembly Write code similar to the one below: using System; using Microsoft.WindowsLive.Id.Cl... ......
One always strives to write exception safe application but there are times when an exception can go unhandled. In the .NET Framework, the AppDomain class exposes the UnhandledException event that can be used by by the managed application to know when an exception has gone unhandled. In the writeup, AppDomains and Unhandled Exception Notifications, I discuss the specifics of when and how this notification is made, what is the relationship between the thread that had unhandled exception and the AppDomain(s) ......