On Fri Sep 20 10:29:27 2024 +0000, Owen Rudge wrote:
It would seem that on Windows 10, the maximum length is 32,767 characters, but that requires a registry setting plus each application having a flag present in the application manifest: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-lim... I suspect we're not interested in implementing this same behaviour at the moment. It's certainly not guaranteed that Wine will be happy with it in all places (or indeed the underlying OS - macOS having a practical limit of around 1024 characters), but the application I was testing seems to work OK with longer paths with these fixes applied. The behaviour as it stands is definitely wrong though. I'm happy to go with your suggestion regarding `+ 2`. I don't know how easy it would be to write a useful test for this; I have no idea if Windows stores the parameters in `Environment` in the same way as Wine.
A (regression) test in kernel32:process that shows that current directory longer than 260 chars is preserved should be sufficient.
1. Launch itself with new curdir as well as extra argvs (e.g., `pwdchk $NEWDIR`) 2. In main (START_TEST), if the extra argv is detected, test that GetCurrentDirectoryW() result matches the given `$NEWDIR`. 3. Call `wait_child_process()` on the process handle, and clean up appropriately.