Skip to content

Commit 9e95935

Browse files
ntdll: HACK: Add WINE_DISABLE_SFN option.
1 parent 66cd5c1 commit 9e95935

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

dlls/ntdll/unix/file.c

+13-9
Original file line numberDiff line numberDiff line change
@@ -1511,16 +1511,20 @@ static BOOL append_entry( struct dir_data *data, const char *long_name,
15111511
if (long_len == ARRAY_SIZE(long_nameW)) return TRUE;
15121512
long_nameW[long_len] = 0;
15131513

1514-
if (short_name)
1515-
{
1516-
short_len = ntdll_umbstowcs( short_name, strlen(short_name),
1517-
short_nameW, ARRAY_SIZE( short_nameW ) - 1 );
1518-
}
1519-
else /* generate a short name if necessary */
1514+
short_len = 0;
1515+
1516+
if (!disable_sfn)
15201517
{
1521-
short_len = 0;
1522-
if (!is_legal_8dot3_name( long_nameW, long_len ))
1523-
short_len = hash_short_file_name( long_nameW, long_len, short_nameW );
1518+
if (short_name)
1519+
{
1520+
short_len = ntdll_umbstowcs( short_name, strlen(short_name),
1521+
short_nameW, ARRAY_SIZE( short_nameW ) - 1 );
1522+
}
1523+
else /* generate a short name if necessary */
1524+
{
1525+
if (!is_legal_8dot3_name( long_nameW, long_len ))
1526+
short_len = hash_short_file_name( long_nameW, long_len, short_nameW );
1527+
}
15241528
}
15251529
short_nameW[short_len] = 0;
15261530
wcsupr( short_nameW );

dlls/ntdll/unix/loader.c

+6
Original file line numberDiff line numberDiff line change
@@ -2275,6 +2275,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
22752275
debugstr_pc,
22762276
};
22772277

2278+
BOOL disable_sfn;
22782279
BOOL ac_odyssey;
22792280
BOOL fsync_simulate_sched_quantum;
22802281
BOOL alert_simulate_sched_quantum;
@@ -2290,6 +2291,11 @@ static void hacks_init(void)
22902291
static const char upc_exe[] = "Ubisoft Game Launcher\\upc.exe";
22912292
const char *env_str, *sgi;
22922293

2294+
env_str = getenv("WINE_DISABLE_SFN");
2295+
if (env_str)
2296+
disable_sfn = !!atoi(env_str);
2297+
else if (main_argc > 1 && (strstr(main_argv[1], "Yakuza5.exe") ))
2298+
disable_sfn = TRUE;
22932299

22942300
env_str = getenv("WINE_SIMULATE_ASYNC_READ");
22952301
if (env_str)

dlls/ntdll/unix/unix_private.h

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ extern BOOL is_wow64 DECLSPEC_HIDDEN;
151151
extern struct ldt_copy __wine_ldt_copy DECLSPEC_HIDDEN;
152152
#endif
153153

154+
extern BOOL disable_sfn DECLSPEC_HIDDEN;
154155
extern BOOL ac_odyssey DECLSPEC_HIDDEN;
155156
extern BOOL fsync_simulate_sched_quantum DECLSPEC_HIDDEN;
156157
extern BOOL alert_simulate_sched_quantum DECLSPEC_HIDDEN;

0 commit comments

Comments
 (0)