Console output with a transparent background color

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…

0

Limits of OLEDB and Access Passwords

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…

1

MiniDumps and "Bad" Stacks

A fellow reader sent a comment outlining the following problem:   I’m using the DMPSTK example from the Debugging Tools SDK. If I generate a crash dump from within Visual Studio 2005, I can see the call stack perfectly. However, if I create my own crash dump (the same as  you do in your blog),…

0

Developer Tip: Add a blank macro so testers can inject code

While I was working on writing some API tests for a module that was being integrated into the Xbox Dashboard application, there was some rework to the class that happened in the middle process. In doing so, the developer decided to make a bunch of the functionality private, causing my existing test to fail to…

0

Leave well enough alone

I was reviewing a check-in the other day, and one of the changes was to fix a line of code which resulted in one of the new “safe CRT” warnings:   warning C4996: ‘strcpy’: This function or variable may be unsafe. Consider using strcpy_s instead.   Here is the original code: HRESULT GetDefaultList(char** tests)    …

1

Automating Crash Dump Analysis: Some Final Thoughts

For a reference, here are some links to the previous parts in this series: ·         Prolific Usage of MiniDumpWriteDump ·         Opening a Crash Dump File ·         Getting the Stack from a .DMP File ·         Getting the Crash Details from a .DMP File ·         Showing the Disassembly from a .DMP File   So now the question…

0

Showing the Disassembly from a .DMP File (Automating Crash Dump Analysis Part 4)

When investigating a crash, it can often be beneficial to see the assembly leading up too, and even following the event. It turns out that generating the corresponding assembly at an address is pretty easy. The hard part is finding a good starting point for enumerating if we want to look backwards from a given…

1

Getting the Crash Details from a .DMP File (Automating Crash Dump Analysis Part 3)

Aside from a stack trace (the “where”), you probably want to know something about the crash (the “why” or the “how”). With the code below, we can query some of the basic details about what happened. From this we will at least be able to determine if the application attempted to write to a protected…

1

Getting the Stack from a .DMP File (Automating Crash Dump Analysis Part 2)

So now that we have a memory dump file, and know how to open it, we will want to pull some useful data out. To start with, we will grab the stack trace (which is arguably one of the more important pieces). And in case you’ve stumbled across the “dumpstk” sample in the WinDBG install\sdk…

2

Opening a Crash Dump File (Automating Crash Dump Analysis Part 1)

So let’s assume for the moment that you have a collection of crash dump files from your team’s application. These files may be generated from your stress tests, betas, etc. But where they come from really isn’t important, what is important is that we want some way to dig into these files and gather information,…

4