lsteamclient: Add traces to path conversion helpers.

CW-Bug-Id: #22729
This commit is contained in:
Rémi Bernon 2023-10-05 14:06:38 +02:00 committed by Arkadiusz Hiler
parent 1e8d243065
commit 38573d2875

View File

@ -237,6 +237,8 @@ char *steamclient_dos_to_unix_path( const char *src, int is_url )
char buffer[4096], *dst = buffer; char buffer[4096], *dst = buffer;
uint32_t len; uint32_t len;
TRACE( "src %s, is_url %u\n", debugstr_a(src), is_url );
if (!src) return NULL; if (!src) return NULL;
*dst = 0; *dst = 0;
@ -295,6 +297,7 @@ done:
if (!(dst = (char *)HeapAlloc( GetProcessHeap(), 0, len ))) return NULL; if (!(dst = (char *)HeapAlloc( GetProcessHeap(), 0, len ))) return NULL;
memcpy( dst, buffer, len ); memcpy( dst, buffer, len );
TRACE( "-> %s\n", debugstr_a(dst) );
return dst; return dst;
} }
@ -310,6 +313,8 @@ const char **steamclient_dos_to_unix_path_array( const char **src )
char **out, **o; char **out, **o;
WCHAR scratch[PATH_MAX] = {0}; WCHAR scratch[PATH_MAX] = {0};
TRACE( "src %p\n", src );
if (!src) return NULL; if (!src) return NULL;
len = sizeof(char *); /* NUL */ len = sizeof(char *); /* NUL */
@ -319,6 +324,7 @@ const char **steamclient_dos_to_unix_path_array( const char **src )
for (s = src, o = out; *s; ++s, ++o) for (s = src, o = out; *s; ++s, ++o)
{ {
TRACE( " src[%zu] %s\n", s - src, debugstr_a(*s) );
if (IS_ABSOLUTE( *s )) if (IS_ABSOLUTE( *s ))
{ {
MultiByteToWideChar( CP_UNIXCP, 0, *s, -1, scratch, PATH_MAX ); MultiByteToWideChar( CP_UNIXCP, 0, *s, -1, scratch, PATH_MAX );
@ -336,10 +342,12 @@ const char **steamclient_dos_to_unix_path_array( const char **src )
} }
*l = 0; *l = 0;
} }
TRACE( " -> %s\n", debugstr_a(*o) );
} }
*o = NULL; *o = NULL;
TRACE( " -> %p\n", out );
return (const char **)out; return (const char **)out;
} }
@ -361,6 +369,8 @@ unsigned int steamclient_unix_path_to_dos_path( bool api_result, const char *src
WCHAR *dosW; WCHAR *dosW;
uint32_t r; uint32_t r;
TRACE( "api_result %u, src %s, dst %p, dst_bytes %u is_url %u\n", api_result, debugstr_a(src), dst, dst_bytes, is_url );
if (!src || !*src || !api_result || !dst || !dst_bytes) if (!src || !*src || !api_result || !dst || !dst_bytes)
{ {
if (dst && dst_bytes) *dst = 0; if (dst && dst_bytes) *dst = 0;
@ -404,5 +414,6 @@ unsigned int steamclient_unix_path_to_dos_path( bool api_result, const char *src
} }
HeapFree( GetProcessHeap(), 0, dosW ); HeapFree( GetProcessHeap(), 0, dosW );
TRACE( "-> dst %s, r %u\n", debugstr_a(dst), r );
return r; return r;
} }