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 Nov 20, 2023
1 parent 66cd5c1 commit e335c57
Show file tree
Hide file tree
Showing 3 changed files with 20 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 @@ -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 );
Expand Down
6 changes: 6 additions & 0 deletions dlls/ntdll/unix/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
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 @@ -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;
Expand Down

0 comments on commit e335c57

Please sign in to comment.