Since the \\?\
prefix can only be used with absolute paths, I need to find out a way to extend relative paths to absolute paths. For paths shorter than 260 characters, this isn't a problem because there is the GetFullPathName()
Windows API which does exactly what I want.
However, for relative paths longer than 260 characters, I cannot use GetFullPathName()
because it is limited to MAX_PATH
as well. (Of course, this limit can be overridden by using the \\?\
prefix with GetFullPathName()
but since this prefix is only allowed for absolute paths, I can't use it to make GetFullPathName()
convert a long relative path to a long absolute path.)
So the only thing that comes to my mind is to call GetCurrentDirectory()
and then manually compose the long relative path to a long absolute path. Of course, this also means that I'd have to manually handle stuff like ..
and .
which looks like quite a hassle. That's why I'd like to ask if there is an easier way to convert a long relative path to a long absolute path without doing everything manually.