Converting an application to support long path names.

Copper Contributor

Question 1: (I think this might be an easy question - question 2 below is harder).
I am using the Long Path Name feature on Windows 10, and other platforms.

The code base supports multiple platforms and operating systems. Other platforms already support path names longer than 260 characters.

In particular, I need to know how to convert a relative path to a fully qualified path, and/or if applicable, a fully qualified path and file name.

The current directory could be either a long or short path. The relative directory, with the form:

.\some_relative_path\with_many_subdirectories\and_on_and_on\

could also either be a short path or a long path.

I know the directory names and files names can only be 255 characters maximum.

I know how to enable long path name support in the registry, and/or group policy editor, and how to make long path name manifest files for my application. I also know to put the wide character form of "\\?\" - which in C is L"\\\\\?\\" in front of an absolute path.

I am confused about how to get the fully qualified path when in a current directory.

I see the GetFullPathNameW function is supported. However, "\\?\" cannot be appended to a relative path. I'm guessing that isn't needed, because the function takes a buffer length. Is that the function I need to get a fully qualified path?

----------------------------------------
Question 2:
I do not see the Win32 function "OpenEncryptedFileRawW" listed for long path name support.  How do I modify code using that function to support long path names?


1 Reply
Use Long Path Tool, Long Path Tool can simplify and probably end your problems in unlocking, managing and renaming files that appear to have a long filename.