An attempt to understand technology better...
Stack walking is second nature to debuggers. But if you had more interest in it than just debugging and either: wanted to know what stack walking is about, or wanted to know how stack walking is implemented, or wanted to know how a custom stack walker can be authored for your application then you might find the article, Authoring a Stack Walker for X86, useful. Its my attempt to help clarify the basics of stack walking and explain key concepts and show how it can be implemented on x86 platform. The ......
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) ......
Surprisingly, enumerating AppDomains is not that straightforward. The System.AppDomain type does not expose functionality to enumerate them at all. The way to enumerate them will be to use the V1 Hosting interface, ICorRuntimeHost and then invoke the EnumDomains and NextDomain methods against it to get the list. If you are using CLR 2.0, you needn't worry as CLR 2.0 does implement the V1 interfaces as well. Below is the snippet that exemplifies the concept (note: AppDomains will only be enumerated ......
Working on the CLR's exception handling subsystem is not just challenging but also gives unique opportunities to understand how the various exception handling subsystems (e.g. SEH, C++ EH, etc) work, and in particular, how they interoperate with one another. It was such case that had me discuss one such issue with Kevin, development lead of the JIT, that he mentions here. That discussion got me exploring the interoperability aspects of EH further and resulted in the bullets listed below. Incase you ......
[Originally posted on 10th July 2006] WinToolZone.Bluetooth now has authentication support. You can use a BluetoothDevice object (which is used represent a Bluetooth device that has been detected) and use the SendPassKey method to send a pass key for authentication: . 1: bth.Devices[ i ].SendPassKey("123", null); Also, I have added OnIncomingAuthenticationReq... event handler against a BluetoothDevice object that can be used to setup an event handler, which will be invoked when the Bluetooth device ......
[Originally posted on 6th July 2006] WinToolZone.Bluetooth, the managed Bluetooth API for the desktop that I am working on, now has the support for enumerating devices as well. The snippet below exemplifies it: . 1: Bluetooth bth = new Bluetooth(); 2: 3: // EnumRadios(bth); 4: 5: if (bth.RefreshDevices(false, true, true, true, true, null) == false) 6: { 7: Console.WriteLine("Unable to enum devices"); 8: return; 9: } 10: 11: foreach (BluetoothDevice device in bth.Devices) 12: { 13: Console.WriteLine("Devicename: ......
Full Development Archive