Jinoh Kang (@iamahuman) commented about dlls/ntdll/env.c:
curdir = cur_params->CurrentDirectory.DosPath; } else curdir = *CurrentDirectoryName; - curdir.MaximumLength = MAX_PATH * sizeof(WCHAR); + curdir.MaximumLength = max(curdir.Length, MAX_PATH * sizeof(WCHAR));
Hello! I see that this is the second time contributing to ntdll. Congrats! In case you're not familiar with `UNICODE_STRING`, the `MaximumLength` should be at least `Length + 2`. So I guess the correct code should read: ```suggestion:-0+0 curdir.MaximumLength = max(curdir.Length + 2, MAX_PATH * sizeof(WCHAR)); ``` However, I'm not sure if DOS paths longer than 260 characters are even valid. We need to test how Windows behaves in this case (does it truncate? does it use a short name? does it extend MaximumLength like you did?) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6535#note_82737