Skip to content

Commit

Permalink
ntdll: HACK: Add WINE_DISABLE_SFN option.
Browse files Browse the repository at this point in the history
  • Loading branch information
NishiyamaPedro committed Mar 6, 2024
1 parent 34bbb1a commit b013c03
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
22 changes: 13 additions & 9 deletions dlls/ntdll/unix/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1502,16 +1502,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 );
Expand Down
7 changes: 7 additions & 0 deletions dlls/ntdll/unix/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -2020,6 +2020,7 @@ static ULONG_PTR get_image_address(void)
return 0;
}

BOOL disable_sfn;
BOOL ac_odyssey;
BOOL fsync_simulate_sched_quantum;
BOOL alert_simulate_sched_quantum;
Expand All @@ -2041,6 +2042,12 @@ static void hacks_init(void)
ERR( "HACK: ram_reporting_bias %lldMB.\n", ram_reporting_bias / (1024 * 1024) );
}

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)
ac_odyssey = !!atoi(env_str);
Expand Down
1 change: 1 addition & 0 deletions dlls/ntdll/unix/unix_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ extern SYSTEM_CPU_INFORMATION cpu_info;
extern struct ldt_copy __wine_ldt_copy;
#endif

extern BOOL disable_sfn;
extern BOOL ac_odyssey;
extern BOOL fsync_simulate_sched_quantum;
extern BOOL alert_simulate_sched_quantum;
Expand Down

0 comments on commit b013c03

Please sign in to comment.