Commit d0a16b7d authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Return a char pointer instead of an ANSI_STRING in nt_to_unix_file_name().

parent 461fc592
......@@ -927,7 +927,7 @@ already_loaded:
static NTSTATUS CDECL load_so_dll( UNICODE_STRING *nt_name, void **module )
{
static const WCHAR soW[] = {'.','s','o',0};
ANSI_STRING unix_name;
char *unix_name;
NTSTATUS status;
DWORD len;
......@@ -937,8 +937,8 @@ static NTSTATUS CDECL load_so_dll( UNICODE_STRING *nt_name, void **module )
len = nt_name->Length / sizeof(WCHAR);
if (len > 3 && !wcsicmp( nt_name->Buffer + len - 3, soW )) nt_name->Length -= 3 * sizeof(WCHAR);
status = dlopen_dll( unix_name.Buffer, module );
RtlFreeAnsiString( &unix_name );
status = dlopen_dll( unix_name, module );
RtlFreeHeap( GetProcessHeap(), 0, unix_name );
return status;
}
......@@ -1533,7 +1533,7 @@ static struct unix_funcs unix_funcs =
server_handle_to_fd,
server_release_fd,
server_init_process_done,
nt_to_unix_file_name,
wine_nt_to_unix_file_name,
unix_to_nt_file_name,
set_show_dot_files,
load_so_dll,
......
......@@ -662,7 +662,7 @@ static NTSTATUS fork_and_exec( UNICODE_STRING *path, int unixdir,
pid_t pid;
int fd[2], stdin_fd = -1, stdout_fd = -1;
char **argv, **envp;
ANSI_STRING unix_name;
char *unix_name;
NTSTATUS status;
status = nt_to_unix_file_name( path, &unix_name, FILE_OPEN );
......@@ -712,7 +712,7 @@ static NTSTATUS fork_and_exec( UNICODE_STRING *path, int unixdir,
fchdir( unixdir );
close( unixdir );
}
execve( unix_name.Buffer, argv, envp );
execve( unix_name, argv, envp );
}
if (pid <= 0) /* grandchild if exec failed or child if fork failed */
......@@ -750,7 +750,7 @@ static NTSTATUS fork_and_exec( UNICODE_STRING *path, int unixdir,
if (stdin_fd != -1) close( stdin_fd );
if (stdout_fd != -1) close( stdout_fd );
done:
RtlFreeAnsiString( &unix_name );
RtlFreeHeap( GetProcessHeap(), 0, unix_name );
return status;
}
......
......@@ -124,8 +124,6 @@ extern NTSTATUS CDECL exec_process( UNICODE_STRING *path, UNICODE_STRING *cmdlin
extern NTSTATUS CDECL unwind_builtin_dll( ULONG type, struct _DISPATCHER_CONTEXT *dispatch,
CONTEXT *context ) DECLSPEC_HIDDEN;
extern NTSTATUS CDECL nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRING *unix_name_ret,
UINT disposition ) DECLSPEC_HIDDEN;
extern NTSTATUS CDECL unix_to_nt_file_name( const ANSI_STRING *name, UNICODE_STRING *nt ) DECLSPEC_HIDDEN;
extern void CDECL set_show_dot_files( BOOL enable ) DECLSPEC_HIDDEN;
......@@ -237,6 +235,7 @@ extern NTSTATUS tape_DeviceIoControl( HANDLE device, HANDLE event, PIO_APC_ROUTI
ULONG in_size, void *out_buffer, ULONG out_size ) DECLSPEC_HIDDEN;
extern NTSTATUS errno_to_status( int err ) DECLSPEC_HIDDEN;
extern NTSTATUS nt_to_unix_file_name( const UNICODE_STRING *nameW, char **name_ret, UINT disposition ) DECLSPEC_HIDDEN;
extern void init_files(void) DECLSPEC_HIDDEN;
extern void init_cpu_info(void) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment