diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 7955a88b6226..f5912aef26d7 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1511,16 +1511,20 @@ static BOOL append_entry( struct dir_data *data, const char *long_name, if (long_len == ARRAY_SIZE(long_nameW)) return TRUE; long_nameW[long_len] = 0; - if (short_name) - { - short_len = ntdll_umbstowcs( short_name, strlen(short_name), - short_nameW, ARRAY_SIZE( short_nameW ) - 1 ); - } - else /* generate a short name if necessary */ + short_len = 0; + + if (!disable_sfn) { - short_len = 0; - if (!is_legal_8dot3_name( long_nameW, long_len )) - short_len = hash_short_file_name( long_nameW, long_len, short_nameW ); + if (short_name) + { + short_len = ntdll_umbstowcs( short_name, strlen(short_name), + short_nameW, ARRAY_SIZE( short_nameW ) - 1 ); + } + else /* generate a short name if necessary */ + { + if (!is_legal_8dot3_name( long_nameW, long_len )) + short_len = hash_short_file_name( long_nameW, long_len, short_nameW ); + } } short_nameW[short_len] = 0; wcsupr( short_nameW ); diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 9dc11f74fb2c..f9d3b3b85eaf 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2276,6 +2276,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] = }; BOOL ac_odyssey; +BOOL disable_sfn; BOOL fsync_simulate_sched_quantum; BOOL alert_simulate_sched_quantum; BOOL fsync_yield_to_waiters; @@ -2290,6 +2291,11 @@ static void hacks_init(void) static const char upc_exe[] = "Ubisoft Game Launcher\\upc.exe"; const char *env_str, *sgi; + env_str = getenv("WINE_DISABLE_SFN"); + if (env_str) + disable_sfn = !!atoi(env_str); + else if (main_argc > 1 && (strstr(main_argv[1], "Yakuza5.exe") )) + disable_sfn = TRUE; env_str = getenv("WINE_SIMULATE_ASYNC_READ"); if (env_str) diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index d54d802e0cbd..1611c5b215be 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -152,6 +152,7 @@ extern struct ldt_copy __wine_ldt_copy DECLSPEC_HIDDEN; #endif extern BOOL ac_odyssey DECLSPEC_HIDDEN; +extern BOOL disable_sfn DECLSPEC_HIDDEN; extern BOOL fsync_simulate_sched_quantum DECLSPEC_HIDDEN; extern BOOL alert_simulate_sched_quantum DECLSPEC_HIDDEN; extern BOOL fsync_yield_to_waiters;