- const WCHAR fallbackpathW[] = { 'C',':','\',0 };
This doesn't look right, could we make it dynamic using actual system drive?
Same goes for tests, where you got hardcoded C:\ drive.
According to docs this function should follow symlinks, will it potentially work with this implementation? Was it tested?
I think it makes sense to submit tests first, maybe combining them a little, to have 1 tests patch instead of 4.