You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against 12c3177ed5cae39de8a9f9111a1cb450296cc8e6.
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
From ed78d7dd56fe29c5a310dc228576ce683730727a Mon Sep 17 00:00:00 2001
|
||||
From 934a7712600b45fa584386b4ada2a73af88ee072 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: ntdll: Implement opening files through nt device paths.
|
||||
|
||||
---
|
||||
dlls/ntdll/directory.c | 134 ++++++++++++++++++++++++++++++++++++++++++++----
|
||||
dlls/ntdll/tests/file.c | 25 ++++++++-
|
||||
2 files changed, 149 insertions(+), 10 deletions(-)
|
||||
dlls/ntdll/directory.c | 132 +++++++++++++++++++++++++++++++++++++---
|
||||
dlls/ntdll/tests/file.c | 25 +++++++-
|
||||
2 files changed, 147 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
|
||||
index 32699fe3cc4..97b42398bb0 100644
|
||||
index c6249dd8658..242dbd27b2f 100644
|
||||
--- a/dlls/ntdll/directory.c
|
||||
+++ b/dlls/ntdll/directory.c
|
||||
@@ -2811,16 +2811,10 @@ NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, ANSI_STRING *
|
||||
@@ -2732,16 +2732,10 @@ NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, ANSI_STRING *
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
@@ -32,7 +32,7 @@ index 32699fe3cc4..97b42398bb0 100644
|
||||
{
|
||||
static const WCHAR unixW[] = {'u','n','i','x'};
|
||||
static const WCHAR pipeW[] = {'p','i','p','e'};
|
||||
@@ -2937,6 +2931,128 @@ NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRI
|
||||
@@ -2857,6 +2851,126 @@ NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRI
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ index 32699fe3cc4..97b42398bb0 100644
|
||||
+ while (!NtQueryDirectoryObject( handle, info, sizeof(data), TRUE, FALSE, &ctx, NULL ))
|
||||
+ {
|
||||
+ if (read_nt_symlink( handle, &info->ObjectName, symlinkW, MAX_DIR_ENTRY_LEN )) continue;
|
||||
+ if (wcslen( symlinkW ) != length || memicmpW( symlinkW, name, length )) continue;
|
||||
+ if (wcsnicmp( symlinkW, name, length )) continue;
|
||||
+ if (info->ObjectName.Length != 2 * sizeof(WCHAR) || info->ObjectName.Buffer[1] != ':') continue;
|
||||
+
|
||||
+ *device_ret = info->ObjectName.Buffer[0];
|
||||
@@ -114,24 +114,22 @@ index 32699fe3cc4..97b42398bb0 100644
|
||||
+NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRING *unix_name_ret,
|
||||
+ UINT disposition, BOOLEAN check_case )
|
||||
+{
|
||||
+ static const WCHAR systemrootW[] = {'\\','S','y','s','t','e','m','R','o','o','t','\\'};
|
||||
+ static const WCHAR systemrootW[] = {'\\','S','y','s','t','e','m','R','o','o','t','\\',0};
|
||||
+ static const WCHAR dosprefixW[] = {'\\','?','?','\\'};
|
||||
+ static const WCHAR deviceW[] = {'\\','D','e','v','i','c','e','\\'};
|
||||
+ static const WCHAR deviceW[] = {'\\','D','e','v','i','c','e','\\',0};
|
||||
+ WCHAR *name, *ptr, *prefix, buffer[3] = {'c',':',0};
|
||||
+ UNICODE_STRING dospathW;
|
||||
+ size_t offset, name_len;
|
||||
+ NTSTATUS status;
|
||||
+
|
||||
+ if (nameW->Length >= sizeof(deviceW) &&
|
||||
+ !memicmpW( nameW->Buffer, deviceW, sizeof(deviceW) / sizeof(WCHAR) ))
|
||||
+ if (!wcsnicmp( nameW->Buffer, deviceW, nameW->Length / sizeof(WCHAR) ))
|
||||
+ {
|
||||
+ offset = sizeof(deviceW) / sizeof(WCHAR);
|
||||
+ while (offset * sizeof(WCHAR) < nameW->Length && nameW->Buffer[ offset ] != '\\') offset++;
|
||||
+ if ((status = nt_to_dos_device( nameW->Buffer, offset, buffer ))) return status;
|
||||
+ prefix = buffer;
|
||||
+ }
|
||||
+ else if (nameW->Length >= sizeof(systemrootW) &&
|
||||
+ !memicmpW( nameW->Buffer, systemrootW, sizeof(systemrootW) / sizeof(WCHAR) ))
|
||||
+ else if (!wcsnicmp( nameW->Buffer, systemrootW, nameW->Length / sizeof(WCHAR) ))
|
||||
+ {
|
||||
+ offset = (sizeof(systemrootW) - 1) / sizeof(WCHAR);
|
||||
+ prefix = user_shared_data->NtSystemRoot;
|
||||
@@ -162,10 +160,10 @@ index 32699fe3cc4..97b42398bb0 100644
|
||||
/******************************************************************
|
||||
* RtlWow64EnableFsRedirection (NTDLL.@)
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index 9de9009b10e..1751865a682 100644
|
||||
index 546795456a8..709698209d8 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -159,18 +159,22 @@ static void WINAPI apc( void *arg, IO_STATUS_BLOCK *iosb, ULONG reserved )
|
||||
@@ -135,18 +135,22 @@ static void WINAPI apc( void *arg, IO_STATUS_BLOCK *iosb, ULONG reserved )
|
||||
|
||||
static void create_file_test(void)
|
||||
{
|
||||
@@ -189,7 +187,7 @@ index 9de9009b10e..1751865a682 100644
|
||||
OBJECT_ATTRIBUTES attr;
|
||||
IO_STATUS_BLOCK io;
|
||||
UNICODE_STRING nameW;
|
||||
@@ -351,6 +355,25 @@ static void create_file_test(void)
|
||||
@@ -327,6 +331,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 );
|
||||
@@ -216,5 +214,5 @@ index 9de9009b10e..1751865a682 100644
|
||||
|
||||
static void open_file_test(void)
|
||||
--
|
||||
2.12.2
|
||||
2.26.0
|
||||
|
||||
|
Reference in New Issue
Block a user