From 8adf60dc8e0f6b6eca8a83deb9fbe032c4328e52 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 22 Oct 2015 22:57:30 +0200 Subject: [PATCH] Added patch to implement FileNamesInformation class support for NtQueryDirectoryFile. --- README.md | 3 +- debian/changelog | 2 + ...t-FileNamesInformation-class-support.patch | 53 +++++++++++++++++++ patches/ntdll-FileNamesInformation/definition | 1 + patches/patchinstall.sh | 16 ++++++ 5 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 patches/ntdll-FileNamesInformation/0001-ntdll-Implement-FileNamesInformation-class-support.patch create mode 100644 patches/ntdll-FileNamesInformation/definition diff --git a/README.md b/README.md index f4bd9818..d0da328a 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,10 @@ Wine. All those differences are also documented on the Included bug fixes and improvements ----------------------------------- -**Bug fixes and features included in the next upcoming release [2]:** +**Bug fixes and features included in the next upcoming release [3]:** * Do not allow interruption of system APC in server_select ([Wine Bug #14697](https://bugs.winehq.org/show_bug.cgi?id=14697)) +* Implement FileNamesInformation class support for NtQueryDirectoryFile * Implement stub for ProcessQuotaLimits info class diff --git a/debian/changelog b/debian/changelog index 0f99833d..5838b65c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ wine-staging (1.7.54) UNRELEASED; urgency=low * Added patch to implement stub for ProcessQuotaLimits info class. * Added patch to release capture before sending WM_COMMAND. * Added patch to block interruption of system APC in server_select. + * Added patch to implement FileNamesInformation class support for + NtQueryDirectoryFile. * Removed patch to implement kernel32.GetPhysicallyInstalledSystemMemory (accepted upstream). * Partially removed patches for ws2_32 TransmitFile (accepted upstream). diff --git a/patches/ntdll-FileNamesInformation/0001-ntdll-Implement-FileNamesInformation-class-support.patch b/patches/ntdll-FileNamesInformation/0001-ntdll-Implement-FileNamesInformation-class-support.patch new file mode 100644 index 00000000..ad41ca75 --- /dev/null +++ b/patches/ntdll-FileNamesInformation/0001-ntdll-Implement-FileNamesInformation-class-support.patch @@ -0,0 +1,53 @@ +From d9292d6db7d1096596339c6b831e7e0c405c7559 Mon Sep 17 00:00:00 2001 +From: Qian Hong +Date: Thu, 22 Oct 2015 15:54:30 +0800 +Subject: ntdll: Implement FileNamesInformation class support. + +--- + dlls/ntdll/directory.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c +index 4faafe9..39e5465 100644 +--- a/dlls/ntdll/directory.c ++++ b/dlls/ntdll/directory.c +@@ -173,6 +173,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; + }; + + static BOOL show_dot_files; +@@ -255,6 +256,8 @@ static inline unsigned int dir_info_size( FILE_INFORMATION_CLASS class, unsigned + return (FIELD_OFFSET( FILE_ID_BOTH_DIRECTORY_INFORMATION, FileName[len] ) + 7) & ~7; + case FileIdFullDirectoryInformation: + return (FIELD_OFFSET( FILE_ID_FULL_DIRECTORY_INFORMATION, FileName[len] ) + 7) & ~7; ++ case FileNamesInformation: ++ return (FIELD_OFFSET( FILE_NAMES_INFORMATION, FileName[len] ) + 7) & ~7; + default: + assert(0); + return 0; +@@ -1492,6 +1495,11 @@ static union file_directory_info *append_entry( void *info_ptr, IO_STATUS_BLOCK + filename = info->id_both.FileName; + break; + ++ case FileNamesInformation: ++ info->names.FileNameLength = long_len * sizeof(WCHAR); ++ filename = info->names.FileName; ++ break; ++ + default: + assert(0); + return NULL; +@@ -2264,6 +2272,7 @@ NTSTATUS WINAPI NtQueryDirectoryFile( HANDLE handle, HANDLE event, + case FileFullDirectoryInformation: + case FileIdBothDirectoryInformation: + case FileIdFullDirectoryInformation: ++ case FileNamesInformation: + if (length < dir_info_size( info_class, 1 )) return io->u.Status = STATUS_INFO_LENGTH_MISMATCH; + if (!buffer) return io->u.Status = STATUS_ACCESS_VIOLATION; + break; +-- +2.6.1 + diff --git a/patches/ntdll-FileNamesInformation/definition b/patches/ntdll-FileNamesInformation/definition new file mode 100644 index 00000000..b68408ff --- /dev/null +++ b/patches/ntdll-FileNamesInformation/definition @@ -0,0 +1 @@ +Fixes: Implement FileNamesInformation class support for NtQueryDirectoryFile diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 488a9da8..feef6338 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -188,6 +188,7 @@ 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_Fix_Free="$1" enable_ntdll_FreeBSD_Directory="$1" @@ -659,6 +660,9 @@ patch_enable () ntdll-FileFsVolumeInformation) enable_ntdll_FileFsVolumeInformation="$2" ;; + ntdll-FileNamesInformation) + enable_ntdll_FileNamesInformation="$2" + ;; ntdll-Fix_Alignment) enable_ntdll_Fix_Alignment="$2" ;; @@ -4061,6 +4065,18 @@ 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 has the following (direct or indirect) dependencies: