Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
bcc34107
Commit
bcc34107
authored
Jul 10, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Avoid using RtlDosPathNameToNtPathName_U() in the Unix library.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0357d2ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
process.c
dlls/ntdll/unix/process.c
+21
-3
No files found.
dlls/ntdll/unix/process.c
View file @
bcc34107
...
...
@@ -476,6 +476,10 @@ static ULONG get_env_size( const RTL_USER_PROCESS_PARAMETERS *params, char **win
*/
static
int
get_unix_curdir
(
const
RTL_USER_PROCESS_PARAMETERS
*
params
)
{
static
const
WCHAR
ntprefixW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
0
};
static
const
WCHAR
uncprefixW
[]
=
{
'U'
,
'N'
,
'C'
,
'\\'
,
0
};
const
UNICODE_STRING
*
curdir
=
&
params
->
CurrentDirectory
.
DosPath
;
const
WCHAR
*
dir
=
curdir
->
Buffer
;
UNICODE_STRING
nt_name
;
OBJECT_ATTRIBUTES
attr
;
IO_STATUS_BLOCK
io
;
...
...
@@ -483,13 +487,27 @@ static int get_unix_curdir( const RTL_USER_PROCESS_PARAMETERS *params )
HANDLE
handle
;
int
fd
=
-
1
;
if
(
!
RtlDosPathNameToNtPathName_U
(
params
->
CurrentDirectory
.
DosPath
.
Buffer
,
&
nt_name
,
NULL
,
NULL
))
return
-
1
;
if
(
!
(
nt_name
.
Buffer
=
malloc
(
curdir
->
Length
+
8
*
sizeof
(
WCHAR
)
)))
return
-
1
;
/* simplified version of RtlDosPathNameToNtPathName_U */
wcscpy
(
nt_name
.
Buffer
,
ntprefixW
);
if
(
dir
[
0
]
==
'\\'
&&
dir
[
1
]
==
'\\'
)
{
if
((
dir
[
2
]
==
'.'
||
dir
[
2
]
==
'?'
)
&&
dir
[
3
]
==
'\\'
)
dir
+=
4
;
else
{
wcscat
(
nt_name
.
Buffer
,
uncprefixW
);
dir
+=
2
;
}
}
wcscat
(
nt_name
.
Buffer
,
dir
);
nt_name
.
Length
=
wcslen
(
nt_name
.
Buffer
)
*
sizeof
(
WCHAR
);
InitializeObjectAttributes
(
&
attr
,
&
nt_name
,
OBJ_CASE_INSENSITIVE
,
0
,
NULL
);
status
=
NtOpenFile
(
&
handle
,
FILE_TRAVERSE
|
SYNCHRONIZE
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
);
RtlFreeUnicodeString
(
&
nt_name
);
free
(
nt_name
.
Buffer
);
if
(
status
)
return
-
1
;
server_handle_to_fd
(
handle
,
FILE_TRAVERSE
,
&
fd
,
NULL
);
NtClose
(
handle
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment