Skip to content

Commit b013c03

Browse files
ntdll: HACK: Add WINE_DISABLE_SFN option.
1 parent 34bbb1a commit b013c03

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

dlls/ntdll/unix/file.c

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

1505-
if (short_name)
1506-
{
1507-
short_len = ntdll_umbstowcs( short_name, strlen(short_name),
1508-
short_nameW, ARRAY_SIZE( short_nameW ) - 1 );
1509-
}
1510-
else /* generate a short name if necessary */
1505+
short_len = 0;
1506+
1507+
if (!disable_sfn)
15111508
{
1512-
short_len = 0;
1513-
if (!is_legal_8dot3_name( long_nameW, long_len ))
1514-
short_len = hash_short_file_name( long_nameW, long_len, short_nameW );
1509+
if (short_name)
1510+
{
1511+
short_len = ntdll_umbstowcs( short_name, strlen(short_name),
1512+
short_nameW, ARRAY_SIZE( short_nameW ) - 1 );
1513+
}
1514+
else /* generate a short name if necessary */
1515+
{
1516+
if (!is_legal_8dot3_name( long_nameW, long_len ))
1517+
short_len = hash_short_file_name( long_nameW, long_len, short_nameW );
1518+
}
15151519
}
15161520
short_nameW[short_len] = 0;
15171521
wcsupr( short_nameW );

dlls/ntdll/unix/loader.c

+7
Original file line numberDiff line numberDiff line change
@@ -2020,6 +2020,7 @@ static ULONG_PTR get_image_address(void)
20202020
return 0;
20212021
}
20222022

2023+
BOOL disable_sfn;
20232024
BOOL ac_odyssey;
20242025
BOOL fsync_simulate_sched_quantum;
20252026
BOOL alert_simulate_sched_quantum;
@@ -2041,6 +2042,12 @@ static void hacks_init(void)
20412042
ERR( "HACK: ram_reporting_bias %lldMB.\n", ram_reporting_bias / (1024 * 1024) );
20422043
}
20432044

2045+
env_str = getenv("WINE_DISABLE_SFN");
2046+
if (env_str)
2047+
disable_sfn = !!atoi(env_str);
2048+
else if (main_argc > 1 && (strstr(main_argv[1], "Yakuza5.exe") ))
2049+
disable_sfn = TRUE;
2050+
20442051
env_str = getenv("WINE_SIMULATE_ASYNC_READ");
20452052
if (env_str)
20462053
ac_odyssey = !!atoi(env_str);

dlls/ntdll/unix/unix_private.h

+1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ extern SYSTEM_CPU_INFORMATION cpu_info;
181181
extern struct ldt_copy __wine_ldt_copy;
182182
#endif
183183

184+
extern BOOL disable_sfn;
184185
extern BOOL ac_odyssey;
185186
extern BOOL fsync_simulate_sched_quantum;
186187
extern BOOL alert_simulate_sched_quantum;

0 commit comments

Comments
 (0)