Akihiro Sagawa (@sgwaki) commented about dlls/kernel32/tests/path.c:
ok(length == expanded, "Expected %ld, got %ld\n", expanded, length);
+ /* Test that extended prefix is preserved in output when converting from short to long path */ + { + WCHAR short_path[MAX_PATH], long_path[MAX_PATH], ext_short_path[4 + MAX_PATH]; + DWORD short_len, long_len; + + short_path[0] = 0; + short_len = GetShortPathNameW(tempdir, short_path, ARRAY_SIZE(short_path)); + ok(short_len, "GetShortPathNameW failed: %lu\n", GetLastError()); + + lstrcpyW(ext_short_path, prefix); + lstrcatW(ext_short_path, short_path); + lstrcatW(ext_short_path, name); + lstrcatW(ext_short_path, backslash); + lstrcatW(ext_short_path, name);
Since we want to create a prefixed short path name here, I think it would be better to use `dirname` instead. `dirname` contains the long file name (see line 1280-1283). e.g. ```c length = GetShortPathNameW(dirname, shortpath2, ARRAY_SIZE(shortpath2)); ok(length, "GetShortPathNameW failed: %lu\n", GetLastError()); ok(lstrcmpiW(dirname, shortpath2) != 0, "short path name isn't created, got %s", debugstr_w(shortpath2)); ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10192#note_133719