Year: 2011

For obvious reasons, Microsoft employees are asked to refrain from bashing other teams or products in their blog posts. But with the dismantling of the Money product line a couple years ago, I feel the statute of limitations has expired and I can share a useful lesson. At one point, I changed the password for…

A handful of people on my team are working with the Windows code base to ensure we don’t break them with compiler changes, and since some of them were new to kernel debugging, I put together a rather quick introduction to windbg/i386kd. The slide deck can be found here.

In Windows land, if you want to print out colored text to a console, you will probably end up calling SetConsoleTextAttribute to set the desired color, then calling it again to restore the original settings. Unfortunately the documentation doesn’t make it very clear how to change just the foreground color; which, in my experience, is…

With the emphasis on SDETs and generic Engineering teams, I’ve seen a growing disparity in how products are being tested versus how users actually use a product. Because it is often very easy to crank out more test cases (especially ones which just iterate on existing tests), testers often lose focus of what is actually…

Occasionally, when something bad happens, an application will return an exception code (which is occasionally an NTSTATUS value). Unfortunately dumping out %ERRORLEVEL% can give you a negative value which makes looking up the error a little harder. Since I was in batch-land, I had the desire to take the value and print it out in…

When your application does something the OS (or the application itself) doesn’t like, often the floor gets yanked out and the process is terminated in an abrupt manner. If you don’t happen to be running with a debugger, often the easiest way to get an idea of what went wrong is to look at the…

The SET command has some nice extensions that let you do various manipulation operations on environment variables. One said operation is the string substitution feature, which is often used to perform basic pattern replacements such as stripping out quotes around filenames: set ABC=”c:\foo.txt”set ABC=%ABC:”=%echo %ABC% In the above sample, the quotes around the filename are…

People that know me know I hate useless error codes. During code reviews if I see someone attempting to return E_FAIL I will often launch into a blistering remark about how they are being lazy and making other developer’s lifes harder all at the same time. The problem with E_FAIL is that it is completely…