KhronosGroup / OpenXR-SDK-Source

Sources for OpenXR loader, basic API layers, and example code.
https://khronos.org/openxr
Apache License 2.0
679 stars 249 forks source link

Banish MAX_PATH limit #200

Open rpavlik opened 4 years ago

rpavlik commented 4 years ago

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

rpavlik-bot commented 4 years ago

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.

brycehutchings commented 4 years ago

I think PathAllocCanonicalize is ideal, which will allocate the needed space and then we just free the memory after we make a copy.

brycehutchings commented 4 years ago

Looks like the loader uses MAX_PATH in FileSysUtilsGetCurrentPath and FileSysUtilsGetAbsolutePath too, besides this new addition for FileSysUtilsGetCanonicalPath.