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
76f94957
Commit
76f94957
authored
Jul 08, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Avoid calling NtOpenFile() from the Unix side.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f690266c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
env.c
dlls/ntdll/unix/env.c
+5
-4
process.c
dlls/ntdll/unix/process.c
+10
-5
No files found.
dlls/ntdll/unix/env.c
View file @
76f94957
...
...
@@ -162,7 +162,6 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file )
's'
,
'o'
,
'r'
,
't'
,
'i'
,
'n'
,
'g'
,
'\\'
,
0
};
NTSTATUS
status
=
STATUS_OBJECT_NAME_NOT_FOUND
;
IO_STATUS_BLOCK
io
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
valueW
;
WCHAR
buffer
[
ARRAY_SIZE
(
sortdirW
)
+
16
];
...
...
@@ -179,10 +178,12 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file )
status
=
open_unix_file
(
file
,
path
,
GENERIC_READ
,
&
attr
,
0
,
FILE_SHARE_READ
,
FILE_OPEN
,
FILE_SYNCHRONOUS_IO_ALERT
,
NULL
,
0
);
if
(
status
==
STATUS_NO_SUCH_FILE
)
/* try to open file in system dir */
status
=
NtOpenFile
(
file
,
GENERIC_READ
,
&
attr
,
&
io
,
FILE_SHARE_READ
,
FILE_SYNCHRONOUS_IO_ALERT
);
free
(
path
);
if
(
status
!=
STATUS_NO_SUCH_FILE
)
return
status
;
if
((
status
=
nt_to_unix_file_name
(
&
attr
,
&
path
,
FILE_OPEN
)))
return
status
;
status
=
open_unix_file
(
file
,
path
,
GENERIC_READ
,
&
attr
,
0
,
FILE_SHARE_READ
,
FILE_OPEN
,
FILE_SYNCHRONOUS_IO_ALERT
,
NULL
,
0
);
free
(
path
);
return
status
;
}
...
...
dlls/ntdll/unix/process.c
View file @
76f94957
...
...
@@ -353,21 +353,26 @@ static WCHAR *get_nt_pathname( const UNICODE_STRING *str )
*/
static
int
get_unix_curdir
(
const
RTL_USER_PROCESS_PARAMETERS
*
params
)
{
UNICODE_STRING
nt_name
;
UNICODE_STRING
nt_name
,
redir
;
OBJECT_ATTRIBUTES
attr
;
IO_STATUS_BLOCK
io
;
NTSTATUS
status
;
HANDLE
handle
;
int
fd
=
-
1
;
char
*
unix_name
;
if
(
!
(
nt_name
.
Buffer
=
get_nt_pathname
(
&
params
->
CurrentDirectory
.
DosPath
)))
return
-
1
;
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
);
get_redirect
(
&
attr
,
&
redir
);
status
=
nt_to_unix_file_name
(
&
attr
,
&
unix_name
,
FILE_OPEN
);
free
(
nt_name
.
Buffer
);
free
(
redir
.
Buffer
);
if
(
status
)
return
-
1
;
status
=
open_unix_file
(
&
handle
,
unix_name
,
FILE_TRAVERSE
|
SYNCHRONIZE
,
&
attr
,
0
,
FILE_SHARE_READ
|
FILE_SHARE_DELETE
,
FILE_OPEN
,
FILE_SYNCHRONOUS_IO_NONALERT
,
NULL
,
0
);
free
(
unix_name
);
if
(
status
)
return
-
1
;
wine_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