Hmm. Just realized that this is a bit out of order and should have been published before the previous post . It turns out that there are a significant number of Win32 APIs that have a similar calling pattern – you call the API once to find the size of the buffer needed for the…

I was writing some ANSI-only code the other day to handle the case where an environment string expansion could return a buffer larger than MAX_PATH (the test code I was modifying assumed that it could only ever see a MAX_PATH output, I wanted to make it more resilient). The way the code worked, I defined…

So I was working on some file path parsing logic the other day and I ran into a problem – I was converting a file name passed in on the command line to a long filename acceptable path (one starting with \\?\). As I mentioned before, the Win32 APIs that accept \\?\ filenames assume that…

I recently was updating some test code to handle long filename (longer than MAX_PATH) support. My initial cut at the function was something like the following (don’t worry about the VERIFY_ macros, they’re functionally equivalent to asserts): const PCWSTR LongPathPrefix=L"\\\\?\\"; void RecursivelyDeleteDirectory(const std::wstring &strDirectory) { // Canonicalize the input path to guarantee it’s a full…

I was working on a new feature earlier today and I discovered that while the code worked just fine when run as a 32bit app, it failed miserably when run as a 64bit app. If I was writing code that used polymorphic types (like DWORD_PTR) or something that depended on platform specific differences, this wouldn’t…

A high school classmate of mine recently posted on Facebook: Message just popped up up my screen from Microsoft, I guess. “This site has insecure content.” Really? Is the content not feeling good about itself, or, perchance, did they mean “unsecured?” What the ever-lovin’ ****? I was intrigued, because it was an ambiguous message and…

A colleague and I were chatting the other day and we were talking about STL implementations (in the context of a broader discussion about template meta-programming and how difficult it is). During our discussion, I described the STL implementation as “read-only” and he instantly knew what I was talking about. As we dug in…

As many of you may know, I tend to blog about things I encounter in my day-to-day work that I think might be of general interest. And for the past two years, even though I’ve run into things that were “blog-worthy”, I couldn’t write about them in public. And thus no blog posts. But that’s…

I’m at the build conference in Anaheim this week, and I was in the platform booth when a customer asked me a question I’d not been asked before: “How do you get started with test driven development”. My answer was simply “just start – it doesn’t matter how much existing code you already have, just…

In my last post, I mentioned that someone was complaining about the name of the bowser.sys component that I wrote 20 years ago. In my post, I mentioned that he included a screen shot of the event viewer. What was also interesting thing was the contents of the screen shot. “The browser driver has received…