FWIW, after this patch, it should compile successfully for windows, the later patches only fix remaining behaviours.
This does use backup semantics; see https://reviews.llvm.org/D91141 for the implementation of the WinHandle helper. The flag FILE_FLAG_BACKUP_SEMANTICS is always included, to keep the calling code terse here.
This looks like it'll work just fine, but I've added some inline questions for readability and robustness.
What's the purpose of the + sizeof(wchar_t) here?
This seems like a reasonable time to use const auto *.
I'm wondering whether it's worth doing some bounds checking on out and the offsets and lengths into PathBuffer. Is the data from DeviceIoControl trustworthy? Could somebody create a bad reparse point that would cause this code to access arbitrary data?
I think the answer is probably not.
Does libcxx have a "debug" version with assertions enabled?
const auto &?