Rebase against 6dd6c76299f02a311e37d20a4cef3a0f917f7076.

[ntdll-FileNamesInformation]
Removed patch to implement FileNamesInformation class support for
NtQueryDirectoryFile (fixed upstream).
This commit is contained in:
Sebastian Lackner 2016-05-06 00:46:55 +02:00
parent 96068c4fe2
commit cecff04cad
7 changed files with 76 additions and 120 deletions

View File

@ -1,49 +1,72 @@
From 07791ffe43d1fda2618994f98986ab5e9cbf3c97 Mon Sep 17 00:00:00 2001
From 8a1bbc2907aee4de18948be8d3c4a8ad04ddd544 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 6 Feb 2016 18:31:25 +0100
Subject: kernel32: Strip invalid characters from mask in FindFirstFileExW.
---
dlls/kernel32/file.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
dlls/kernel32/file.c | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c
index b6dba6a..3297f4b 100644
index cc7ead1..f078a9c 100644
--- a/dlls/kernel32/file.c
+++ b/dlls/kernel32/file.c
@@ -2009,12 +2009,32 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level,
@@ -1942,6 +1942,7 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level,
WCHAR *mask;
BOOL has_wildcard = FALSE;
FIND_FIRST_INFO *info = NULL;
+ UNICODE_STRING mask_str;
UNICODE_STRING nt_name;
OBJECT_ATTRIBUTES attr;
IO_STATUS_BLOCK io;
@@ -1973,6 +1974,8 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level,
return INVALID_HANDLE_VALUE;
}
+ RtlInitUnicodeString( &mask_str, NULL );
+
if (!mask && (device = RtlIsDosDeviceName_U( filename )))
{
static const WCHAR dotW[] = {'.',0};
@@ -2007,8 +2010,27 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level,
}
else
{
+ static const WCHAR invalidW[] = { '<', '>', '\"', 0 };
+ static const WCHAR wildcardW[] = { '*', 0 };
+ DWORD mask_len;
+ DWORD mask_len = strlenW( mask );
+
if (!RtlCreateUnicodeString( &info->mask, mask ))
{
SetLastError( ERROR_NOT_ENOUGH_MEMORY );
goto error;
}
+ /* strip invalid characters from mask */
+ mask_len = info->mask.Length / sizeof(WCHAR);
+ while (mask_len && strchrW(invalidW, mask[mask_len - 1]))
+ while (mask_len && strchrW( invalidW, mask[mask_len - 1] ))
+ mask_len--;
+
+ if (!mask_len)
+ {
+ strcpyW( info->mask.Buffer, wildcardW );
+ info->mask.Length = strlenW(wildcardW) * sizeof(WCHAR);
+ has_wildcard = TRUE;
+ RtlInitUnicodeString( &mask_str, wildcardW );
+ }
+ else
+ {
+ info->mask.Buffer[mask_len] = 0;
+ info->mask.Length = mask_len * sizeof(WCHAR);
+ has_wildcard = strpbrkW( mask, wildcardsW ) != NULL;
+ RtlInitUnicodeString( &mask_str, mask );
+ mask_str.Length = mask_len * sizeof(WCHAR);
+ }
+
/* truncate dir name before mask */
*mask = 0;
nt_name.Length = (mask - nt_name.Buffer) * sizeof(WCHAR);
- has_wildcard = strpbrkW( mask, wildcardsW ) != NULL;
size = has_wildcard ? 8192 : max_entry_size;
}
@@ -2070,9 +2092,6 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level,
}
else
{
- UNICODE_STRING mask_str;
-
- RtlInitUnicodeString( &mask_str, mask );
status = NtQueryDirectoryFile( info->handle, 0, NULL, NULL, &io, info->data, info->data_size,
FileBothDirectoryInformation, FALSE, &mask_str, TRUE );
if (status)
--
2.7.0
2.8.0

View File

@ -1,4 +1,4 @@
From 2c7eba8922e51d745c46b19971e0e8764a4052b5 Mon Sep 17 00:00:00 2001
From a39228203e7fd6d24ac9cae794fc4903e2d67ad7 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 4 Jun 2015 00:02:13 +0200
Subject: ntdll: Set NamedPipeState to FILE_PIPE_CLOSING_STATE on broken pipe
@ -10,10 +10,10 @@ Subject: ntdll: Set NamedPipeState to FILE_PIPE_CLOSING_STATE on broken pipe
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 3b0a06c..62033e1 100644
index c1f5a7a..00b3ccd 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -2893,8 +2893,12 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
@@ -2625,8 +2625,12 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
if (!server_get_unix_fd( hFile, FILE_READ_DATA, &fd, &needs_close, NULL, NULL ))
{
@ -28,12 +28,12 @@ index 3b0a06c..62033e1 100644
}
}
diff --git a/include/winternl.h b/include/winternl.h
index 28b9e29..88bcdab 100644
index 0489395..41abff8 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -668,6 +668,11 @@ typedef struct _FILE_PIPE_LOCAL_INFORMATION {
ULONG NamedPipeEnd;
} FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
@@ -713,6 +713,11 @@ typedef struct _FILE_REPARSE_POINT_INFORMATION {
ULONG Tag;
} FILE_REPARSE_POINT_INFORMATION, *PFILE_REPARSE_POINT_INFORMATION;
+#define FILE_PIPE_DISCONNECTED_STATE 0x01
+#define FILE_PIPE_LISTENING_STATE 0x02
@ -44,5 +44,5 @@ index 28b9e29..88bcdab 100644
FILE_BASIC_INFORMATION BasicInformation;
FILE_STANDARD_INFORMATION StandardInformation;
--
2.4.2
2.8.0

View File

@ -1,20 +1,20 @@
From 80ea1e2a8dacb2ca57549236efb236669cc9153f Mon Sep 17 00:00:00 2001
From 0bb2c8dfad4f4f9c19660a1a1d4e6f9a678c5735 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 20 Aug 2014 11:26:48 -0600
Subject: ntdll: Perform the Unix-style hidden file check within the unified
file info grabbing routine.
---
dlls/ntdll/directory.c | 13 +++++--------
dlls/ntdll/directory.c | 15 +++++----------
dlls/ntdll/file.c | 10 ++++------
dlls/ntdll/ntdll_misc.h | 2 +-
3 files changed, 10 insertions(+), 15 deletions(-)
3 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index 223b842..8b13cdc 100644
index 4a34475..59617d6 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -1306,17 +1306,17 @@ static DWORD WINAPI init_options( RTL_RUN_ONCE *once, void *param, void **contex
@@ -1312,17 +1312,17 @@ static DWORD WINAPI init_options( RTL_RUN_ONCE *once, void *param, void **contex
*
* Check if the specified file should be hidden based on its name and the show dot files option.
*/
@ -37,18 +37,20 @@ index 223b842..8b13cdc 100644
if (p == end || *p != '.') return FALSE;
/* make sure it isn't '.' or '..' */
if (p + 1 == end) return FALSE;
@@ -1548,9 +1548,6 @@ static NTSTATUS get_dir_data_entry( struct dir_data *dir_data, void *info_ptr, I
TRACE( "ignoring file %s\n", names->unix_name );
return STATUS_SUCCESS;
@@ -1571,11 +1571,6 @@ static NTSTATUS get_dir_data_entry( struct dir_data *dir_data, void *info_ptr, I
if (class != FileNamesInformation)
{
if (st.st_dev != dir_data->id.dev) st.st_ino = 0; /* ignore inode if on a different device */
-
- if (!show_dot_files && names->long_name[0] == '.' && names->long_name[1] &&
- (names->long_name[1] != '.' || names->long_name[2]))
- attributes |= FILE_ATTRIBUTE_HIDDEN;
-
fill_file_info( &st, attributes, info, class );
}
- if (!show_dot_files && names->long_name[0] == '.' && names->long_name[1] &&
- (names->long_name[1] != '.' || names->long_name[2]))
- attributes |= FILE_ATTRIBUTE_HIDDEN;
if (st.st_dev != dir_data->id.dev) st.st_ino = 0; /* ignore inode if on a different device */
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 0b33acd..24c66bc 100644
index 7b23304..7f16a51 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -218,6 +218,10 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
@ -62,7 +64,7 @@ index 0b33acd..24c66bc 100644
len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 );
if (len == -1) return ret;
*attr |= get_file_xattr( hexattr, len );
@@ -2996,8 +3000,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
@@ -3003,8 +3007,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
info->AllocationSize = std.AllocationSize;
info->EndOfFile = std.EndOfFile;
info->FileAttributes = basic.FileAttributes;
@ -71,7 +73,7 @@ index 0b33acd..24c66bc 100644
}
RtlFreeAnsiString( &unix_name );
}
@@ -3025,11 +3027,7 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
@@ -3032,11 +3034,7 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
else if (!S_ISREG(st.st_mode) && !S_ISDIR(st.st_mode))
status = STATUS_INVALID_INFO_CLASS;
else

View File

@ -1,52 +0,0 @@
From 1332e777815c624db046e5e9ece93a789ff72870 Mon Sep 17 00:00:00 2001
From: Qian Hong <qhong@codeweavers.com>
Date: Thu, 22 Oct 2015 15:54:30 +0800
Subject: ntdll: Implement FileNamesInformation class support.
---
dlls/ntdll/directory.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index 223b842..2b54e14 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -159,6 +159,7 @@ union file_directory_info
FILE_FULL_DIRECTORY_INFORMATION full;
FILE_ID_BOTH_DIRECTORY_INFORMATION id_both;
FILE_ID_FULL_DIRECTORY_INFORMATION id_full;
+ FILE_NAMES_INFORMATION names;
};
struct dir_data_buffer
@@ -277,6 +278,8 @@ static inline unsigned int dir_info_size( FILE_INFORMATION_CLASS class, unsigned
return offsetof( FILE_ID_BOTH_DIRECTORY_INFORMATION, FileName[len] );
case FileIdFullDirectoryInformation:
return offsetof( FILE_ID_FULL_DIRECTORY_INFORMATION, FileName[len] );
+ case FileNamesInformation:
+ return offsetof( FILE_NAMES_INFORMATION, FileName[len] );
default:
assert(0);
return 0;
@@ -1600,6 +1603,10 @@ static NTSTATUS get_dir_data_entry( struct dir_data *dir_data, void *info_ptr, I
info->id_both.FileNameLength = name_len;
break;
+ case FileNamesInformation:
+ info->names.FileNameLength = name_len;
+ break;
+
default:
assert(0);
return 0;
@@ -1990,6 +1997,7 @@ NTSTATUS WINAPI NtQueryDirectoryFile( HANDLE handle, HANDLE event,
case FileFullDirectoryInformation:
case FileIdBothDirectoryInformation:
case FileIdFullDirectoryInformation:
+ case FileNamesInformation:
if (length < dir_info_align( dir_info_size( info_class, 1 ))) return STATUS_INFO_LENGTH_MISMATCH;
if (!buffer) return STATUS_ACCESS_VIOLATION;
break;
--
2.8.0

View File

@ -1 +0,0 @@
Fixes: Implement FileNamesInformation class support for NtQueryDirectoryFile

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "9eaa37249948c4d77df37cf3649ad1db59412fcb"
echo "6dd6c76299f02a311e37d20a4cef3a0f917f7076"
}
# Show version information
@ -206,7 +206,6 @@ patch_enable_all ()
enable_ntdll_FileDispositionInformation="$1"
enable_ntdll_FileFsFullSizeInformation="$1"
enable_ntdll_FileFsVolumeInformation="$1"
enable_ntdll_FileNamesInformation="$1"
enable_ntdll_Fix_Alignment="$1"
enable_ntdll_Heap_FreeLists="$1"
enable_ntdll_Hide_Wine_Exports="$1"
@ -781,9 +780,6 @@ patch_enable ()
ntdll-FileFsVolumeInformation)
enable_ntdll_FileFsVolumeInformation="$2"
;;
ntdll-FileNamesInformation)
enable_ntdll_FileNamesInformation="$2"
;;
ntdll-Fix_Alignment)
enable_ntdll_Fix_Alignment="$2"
;;
@ -4650,18 +4646,6 @@ if test "$enable_ntdll_FileFsVolumeInformation" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntdll-FileNamesInformation
# |
# | Modified files:
# | * dlls/ntdll/directory.c
# |
if test "$enable_ntdll_FileNamesInformation" -eq 1; then
patch_apply ntdll-FileNamesInformation/0001-ntdll-Implement-FileNamesInformation-class-support.patch
(
echo '+ { "Qian Hong", "ntdll: Implement FileNamesInformation class support.", 1 },';
) >> "$patchlist"
fi
# Patchset ntdll-Fix_Alignment
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,4 +1,4 @@
From 284cf431a6dc5ba77356c0103098f4009cb498eb Mon Sep 17 00:00:00 2001
From ad5209b79d6309cde4a10a6bfab6dcd3e0af518d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 15 May 2015 21:18:37 +0200
Subject: wininet/tests: Test auth credential reusage with host override.
@ -8,12 +8,12 @@ Subject: wininet/tests: Test auth credential reusage with host override.
1 file changed, 92 insertions(+)
diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c
index 16773e6..a6e860b 100644
index 64f4647..c882fc1 100644
--- a/dlls/wininet/tests/http.c
+++ b/dlls/wininet/tests/http.c
@@ -2401,6 +2401,20 @@ static DWORD CALLBACK server_thread(LPVOID param)
@@ -2408,6 +2408,20 @@ static DWORD CALLBACK server_thread(LPVOID param)
SetEvent(server_req_rec_event);
WaitForSingleObject(conn_wait_event, INFINITE);
send(c, page1_mid, page1_end - page1_mid, 0);
}
+ if (strstr(buffer, "HEAD /test_auth_host1"))
+ {
@ -32,7 +32,7 @@ index 16773e6..a6e860b 100644
shutdown(c, 2);
closesocket(c);
c = -1;
@@ -3112,6 +3126,84 @@ static void test_header_override(int port)
@@ -3119,6 +3133,84 @@ static void test_header_override(int port)
InternetCloseHandle(req);
InternetCloseHandle(con);
InternetCloseHandle(ses);