Converting Win32 API results to std::wstring (or std::string)

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…

2

Recursively Deleting a directory–with long filename support.

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…

9