lsteamclient: Set '\' in path part inside game install dir for ISteamApps::GetFileDetails().

CW-Bug-Id: #27895
(cherry picked from commit a0c7261f244ebb961259ecc8e25b7d89f039eb19)
This commit is contained in:
Paul Gofman authored and GloriousEggroll committed 2026-11-02 22:10:12 -07:00
1 parent 5471a609e6
commit 1e5f0cf58f
5 files changed
+33 -5

No files matched your search

@@ -461,7 +461,7 @@ NTSTATUS ISteamApps_STEAMAPPS_INTERFACE_VERSION008_GetFileDetails( void *args )
{
struct ISteamApps_STEAMAPPS_INTERFACE_VERSION008_GetFileDetails_params *params = (struct ISteamApps_STEAMAPPS_INTERFACE_VERSION008_GetFileDetails_params *)args;
struct u_ISteamApps_STEAMAPPS_INTERFACE_VERSION008 *iface = (struct u_ISteamApps_STEAMAPPS_INTERFACE_VERSION008 *)params->u_iface;
char *u_pszFileName = steamclient_dos_to_unix_path( params->pszFileName, 0 );
char *u_pszFileName = steamclient_dos_to_unix_path_fixup_slash( params->pszFileName, 0 );
params->_ret = iface->GetFileDetails( u_pszFileName );
steamclient_free_path( u_pszFileName );
return 0;
@@ -472,7 +472,7 @@ NTSTATUS wow64_ISteamApps_STEAMAPPS_INTERFACE_VERSION008_GetFileDetails( void *a
{
struct wow64_ISteamApps_STEAMAPPS_INTERFACE_VERSION008_GetFileDetails_params *params = (struct wow64_ISteamApps_STEAMAPPS_INTERFACE_VERSION008_GetFileDetails_params *)args;
struct u_ISteamApps_STEAMAPPS_INTERFACE_VERSION008 *iface = (struct u_ISteamApps_STEAMAPPS_INTERFACE_VERSION008 *)params->u_iface;
char *u_pszFileName = steamclient_dos_to_unix_path( params->pszFileName, 0 );
char *u_pszFileName = steamclient_dos_to_unix_path_fixup_slash( params->pszFileName, 0 );
params->_ret = iface->GetFileDetails( u_pszFileName );
steamclient_free_path( u_pszFileName );
return 0;
@@ -461,7 +461,7 @@ NTSTATUS ISteamApps_STEAMAPPS_INTERFACE_VERSION009_GetFileDetails( void *args )
{
struct ISteamApps_STEAMAPPS_INTERFACE_VERSION009_GetFileDetails_params *params = (struct ISteamApps_STEAMAPPS_INTERFACE_VERSION009_GetFileDetails_params *)args;
struct u_ISteamApps_STEAMAPPS_INTERFACE_VERSION009 *iface = (struct u_ISteamApps_STEAMAPPS_INTERFACE_VERSION009 *)params->u_iface;
char *u_pszFileName = steamclient_dos_to_unix_path( params->pszFileName, 0 );
char *u_pszFileName = steamclient_dos_to_unix_path_fixup_slash( params->pszFileName, 0 );
params->_ret = iface->GetFileDetails( u_pszFileName );
steamclient_free_path( u_pszFileName );
return 0;
@@ -472,7 +472,7 @@ NTSTATUS wow64_ISteamApps_STEAMAPPS_INTERFACE_VERSION009_GetFileDetails( void *a
{
struct wow64_ISteamApps_STEAMAPPS_INTERFACE_VERSION009_GetFileDetails_params *params = (struct wow64_ISteamApps_STEAMAPPS_INTERFACE_VERSION009_GetFileDetails_params *)args;
struct u_ISteamApps_STEAMAPPS_INTERFACE_VERSION009 *iface = (struct u_ISteamApps_STEAMAPPS_INTERFACE_VERSION009 *)params->u_iface;
char *u_pszFileName = steamclient_dos_to_unix_path( params->pszFileName, 0 );
char *u_pszFileName = steamclient_dos_to_unix_path_fixup_slash( params->pszFileName, 0 );
params->_ret = iface->GetFileDetails( u_pszFileName );
steamclient_free_path( u_pszFileName );
return 0;
+3 -1
View File
@@ -382,7 +382,7 @@ PATH_CONV_METHODS_UTOW = {
PATH_CONV_METHODS_WTOU = {
"ISteamApps_GetFileDetails": {
"pszFileName": {"array": False, "url": False},
"pszFileName": {"array": False, "url": False, "slash_in_installdir" : True},
},
### ISteamGameServer::SetModDir - "Just the folder name, not the whole path. I.e. "Spacewar"."
"ISteamHTMLSurface_LoadURL": {
@@ -1078,6 +1078,8 @@ def handle_method_cpp(method, classname, out, wow64):
for name, conv in filter(lambda x: x[0] in names, path_conv_wtou.items()):
if conv['array']:
out(f' const char **u_{name} = {prefix}steamclient_dos_to_unix_path_array( params->{name} );\n')
elif 'slash_in_installdir' in conv and conv['slash_in_installdir']:
out(f' char *u_{name} = steamclient_dos_to_unix_path_fixup_slash( params->{name}, {int(conv["url"])} );\n')
else:
out(f' char *u_{name} = steamclient_dos_to_unix_path( params->{name}, {int(conv["url"])} );\n')
+1
View File
@@ -111,6 +111,7 @@ extern NTSTATUS steamclient_networking_message_release_153a( void * );
extern NTSTATUS wow64_steamclient_networking_message_release_153a( void * );
extern char *steamclient_dos_to_unix_path( const char *src, int is_url );
extern char *steamclient_dos_to_unix_path_fixup_slash( const char *src, int is_url );
extern void steamclient_free_path( char *path_array );
extern const char **steamclient_dos_to_unix_path_array( const char **src_array );
extern const char **wow64_steamclient_dos_to_unix_path_array( ptr32< const char ** > src_array );
+25
View File
@@ -1078,6 +1078,31 @@ done:
return dst;
}
char *steamclient_dos_to_unix_path_fixup_slash( const char *src, int is_url )
{
const char *install_dir_env;
char *path, *install_path, *p;
size_t len;
if (!(path = steamclient_dos_to_unix_path( src, is_url ))) return path;
if (!(install_dir_env = getenv( "STEAM_COMPAT_INSTALL_PATH" ))) return path;
if (!(install_path = realpath( install_dir_env, NULL ))) return path;
len = strlen( install_path );
if (!memcmp( path, install_path, len ))
{
p = path + len;
if (*p == '/') ++p;
while (*p)
{
if (*p == '/') *p = '\\';
++p;
}
}
free( install_path );
TRACE( "-> %s\n", debugstr_a(path) );
return path;
}
void steamclient_free_path( char *path )
{
free( path );