OpenXR-SDK-Source
OpenXR-SDK-Source copied to clipboard
Banish MAX_PATH limit
We can use a bigger number, but many parts of windows use MAX_PATH so it is a bit of an unfortunate de-facto limit in Windows. Another option is to use PathCchCanonicalizeEx and dynamically allocate the buffer to the length needed. What I did was a bit of a lazy but common pattern in Windows programming.
Originally posted by @brycehutchings in https://github.com/KhronosGroup/OpenXR-SDK-Source/pull/198
An issue (number 1427) has been filed to correspond to this issue in the internal Khronos GitLab.
If you have a Khronos account, you can access that issue at KHR:openxr/openxr#1427.
I think PathAllocCanonicalize is ideal, which will allocate the needed space and then we just free the memory after we make a copy.
Looks like the loader uses MAX_PATH in FileSysUtilsGetCurrentPath and FileSysUtilsGetAbsolutePath too, besides this new addition for FileSysUtilsGetCanonicalPath.