We are building with Unicode which means that GetShortPathName should be defined to GetShortPathNameW. But on the other hand, in that case, the masks wouldn't be needed.