Rebase against 2d6b0b67d91b6433744ec859b10b8ee8eb4a37b3.

This commit is contained in:
Zebediah Figura
2021-02-10 19:09:42 -06:00
parent 6347bdd1fc
commit 41e15516bd
36 changed files with 318 additions and 1419 deletions

View File

@@ -1,15 +1,15 @@
From ee7a43bf36722acba4c870409fc15ea5bdf4a80b Mon Sep 17 00:00:00 2001
From 6147ac6f68fe96fd53d52b11e16dafbec37b128d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 26 May 2017 05:17:17 +0200
Subject: [PATCH] ntdll: Implement opening files through nt device paths.
---
dlls/ntdll/tests/file.c | 25 +++++++-
dlls/ntdll/unix/file.c | 122 +++++++++++++++++++++++++++++++++++++++-
2 files changed, 145 insertions(+), 2 deletions(-)
dlls/ntdll/unix/file.c | 124 +++++++++++++++++++++++++++++++++++++++-
2 files changed, 146 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 6164b0c4bde..6610edbd042 100644
index 839046a7488..8756c18c9e8 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -135,18 +135,22 @@ static void WINAPI apc( void *arg, IO_STATUS_BLOCK *iosb, ULONG reserved )
@@ -36,7 +36,7 @@ index 6164b0c4bde..6610edbd042 100644
OBJECT_ATTRIBUTES attr;
IO_STATUS_BLOCK io;
UNICODE_STRING nameW;
@@ -327,6 +331,25 @@ static void create_file_test(void)
@@ -326,6 +330,25 @@ static void create_file_test(void)
status = pNtQueryFullAttributesFile( &attr, &info );
ok( status == STATUS_OBJECT_NAME_INVALID,
"query %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status );
@@ -63,19 +63,21 @@ index 6164b0c4bde..6610edbd042 100644
static void open_file_test(void)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index b6529241739..74f3f707444 100644
index 5ab24e2c334..5ad856dbebf 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -3250,7 +3250,7 @@ static NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, char *
@@ -3282,8 +3282,8 @@ static NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, char *
* element doesn't have to exist; in that case STATUS_NO_SUCH_FILE is
* returned, but the unix name is still filled in properly.
*/
-NTSTATUS nt_to_unix_file_name( const UNICODE_STRING *nameW, char **unix_name_ret, UINT disposition )
+static NTSTATUS nt_to_unix_file_name_internal( const UNICODE_STRING *nameW, char **unix_name_ret, UINT disposition )
-NTSTATUS nt_to_unix_file_name( const UNICODE_STRING *nameW, char **unix_name_ret,
- UNICODE_STRING *nt_name, UINT disposition )
+static NTSTATUS nt_to_unix_file_name_internal( const UNICODE_STRING *nameW, char **unix_name_ret,
+ UNICODE_STRING *nt_name, UINT disposition )
{
static const WCHAR unixW[] = {'u','n','i','x'};
static const WCHAR pipeW[] = {'p','i','p','e'};
@@ -3387,6 +3387,126 @@ NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, char *nam
@@ -3421,6 +3421,126 @@ NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, char *nam
return status;
}
@@ -154,7 +156,7 @@ index b6529241739..74f3f707444 100644
+ * returned, but the unix name is still filled in properly.
+ */
+NTSTATUS nt_to_unix_file_name( const UNICODE_STRING *nameW, char **unix_name_ret,
+ UINT disposition )
+ UNICODE_STRING *nt_name, UINT disposition )
+{
+ static const WCHAR systemrootW[] = {'\\','S','y','s','t','e','m','R','o','o','t','\\',0};
+ static const WCHAR dosprefixW[] = {'\\','?','?','\\'};
@@ -177,7 +179,7 @@ index b6529241739..74f3f707444 100644
+ prefix = user_shared_data->NtSystemRoot;
+ }
+ else
+ return nt_to_unix_file_name_internal( nameW, unix_name_ret, disposition );
+ return nt_to_unix_file_name_internal( nameW, unix_name_ret, nt_name, disposition );
+
+ name_len = sizeof(dosprefixW) + wcslen(prefix) * sizeof(WCHAR) +
+ nameW->Length - offset * sizeof(WCHAR) + sizeof(WCHAR);
@@ -194,7 +196,7 @@ index b6529241739..74f3f707444 100644
+
+ dospathW.Buffer = name;
+ dospathW.Length = wcslen( name ) * sizeof(WCHAR);
+ status = nt_to_unix_file_name_internal( &dospathW, unix_name_ret, disposition );
+ status = nt_to_unix_file_name_internal( &dospathW, unix_name_ret, nt_name, disposition );
+
+ free( name );
+ return status;
@@ -203,5 +205,5 @@ index b6529241739..74f3f707444 100644
/******************************************************************
* unix_to_nt_file_name
--
2.27.0
2.20.1