From ddfbad3af69bba16686bd19025e32490dd5c697f Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 30 Jan 2024 07:19:00 +1100 Subject: [PATCH] Updated ntdll-Junction_Points patchset Changed header to add single structure and adjust code to use existing ddk/ntifs.h --- .../0000-include-Add-ntifs.h.patch | 90 ------------------- ...-support-for-creating-reparse-points.patch | 58 ++++++------ ...nt-CreateSymbolicLink-A-W-with-ntdll.patch | 2 +- ...se-point-target-in-directory-listing.patch | 2 +- ...Add-junction-point-support-to-mklink.patch | 2 +- 5 files changed, 34 insertions(+), 120 deletions(-) delete mode 100644 patches/ntdll-Junction_Points/0000-include-Add-ntifs.h.patch diff --git a/patches/ntdll-Junction_Points/0000-include-Add-ntifs.h.patch b/patches/ntdll-Junction_Points/0000-include-Add-ntifs.h.patch deleted file mode 100644 index 3f938bba..00000000 --- a/patches/ntdll-Junction_Points/0000-include-Add-ntifs.h.patch +++ /dev/null @@ -1,90 +0,0 @@ -From efbadece6648c4164d5e24070cb8aa2cb2440cc4 Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Tue, 25 Oct 2022 11:26:04 +1100 -Subject: [PATCH] include: Add ntifs.h - -Moved here since I forgot to add it during a rebase. ---- - include/ntifs.h | 70 +++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 70 insertions(+) - create mode 100644 include/ntifs.h - -diff --git a/include/ntifs.h b/include/ntifs.h -new file mode 100644 -index 00000000000..25af12a413a ---- /dev/null -+++ b/include/ntifs.h -@@ -0,0 +1,70 @@ -+/* -+ * Win32 definitions for Windows NT -+ * -+ * Copyright 2012 Erich E. Hoover -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#ifndef __WINE_NTIFS_H -+#define __WINE_NTIFS_H -+ -+#include -+typedef struct _REPARSE_DATA_BUFFER { -+ ULONG ReparseTag; -+ USHORT ReparseDataLength; -+ USHORT Reserved; -+ union { -+ struct { -+ USHORT SubstituteNameOffset; -+ USHORT SubstituteNameLength; -+ USHORT PrintNameOffset; -+ USHORT PrintNameLength; -+ ULONG Flags; -+ WCHAR PathBuffer[1]; -+ } SymbolicLinkReparseBuffer; -+ struct { -+ USHORT SubstituteNameOffset; -+ USHORT SubstituteNameLength; -+ USHORT PrintNameOffset; -+ USHORT PrintNameLength; -+ WCHAR PathBuffer[1]; -+ } MountPointReparseBuffer; -+ struct { -+ ULONG Version; -+ UCHAR PathBuffer[1]; -+ } LinuxSymbolicLinkReparseBuffer; -+ struct { -+ UCHAR DataBuffer[1]; -+ } GenericReparseBuffer; -+ }; -+} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; -+#include -+ -+typedef struct _REPARSE_GUID_DATA_BUFFER { -+ DWORD ReparseTag; -+ WORD ReparseDataLength; -+ WORD Reserved; -+ GUID ReparseGuid; -+ struct { -+ BYTE DataBuffer[1]; -+ } GenericReparseBuffer; -+} REPARSE_GUID_DATA_BUFFER, *PREPARSE_GUID_DATA_BUFFER; -+ -+#define REPARSE_GUID_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_GUID_DATA_BUFFER, GenericReparseBuffer) -+ -+#define SYMLINK_FLAG_RELATIVE 0x00000001 -+ -+#endif /* __WINE_NTIFS_H */ --- -2.37.2 - diff --git a/patches/ntdll-Junction_Points/0001-ntdll-Add-support-for-creating-reparse-points.patch b/patches/ntdll-Junction_Points/0001-ntdll-Add-support-for-creating-reparse-points.patch index fddb9867..54e68c71 100644 --- a/patches/ntdll-Junction_Points/0001-ntdll-Add-support-for-creating-reparse-points.patch +++ b/patches/ntdll-Junction_Points/0001-ntdll-Add-support-for-creating-reparse-points.patch @@ -1,4 +1,4 @@ -From dbd70302047bc3c592882cb6d93f6251f49e27c7 Mon Sep 17 00:00:00 2001 +From ed0b9682a8e134eeefa4186b930a92843383b8b1 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 16 Jan 2014 20:56:49 -0700 Subject: [PATCH] ntdll: Add support for creating reparse points. @@ -9,14 +9,14 @@ Signed-off-by: Erich E. Hoover dlls/ntdll/Makefile.in | 2 +- dlls/ntdll/tests/file.c | 159 ++++++++++++++++++--- dlls/ntdll/unix/file.c | 302 ++++++++++++++++++++++++++++++++++++++++ - include/Makefile.in | 1 + - 5 files changed, 447 insertions(+), 19 deletions(-) + include/ddk/ntifs.h | 5 + + 5 files changed, 451 insertions(+), 19 deletions(-) diff --git a/configure.ac b/configure.ac -index 0b57210400b..e2f8d2ddfe3 100644 +index 475743bc121..c82d6ec371b 100644 --- a/configure.ac +++ b/configure.ac -@@ -2044,6 +2044,8 @@ AC_CHECK_FUNCS(\ +@@ -2089,6 +2089,8 @@ AC_CHECK_FUNCS(\ prctl \ proc_pidinfo \ sched_yield \ @@ -26,7 +26,7 @@ index 0b57210400b..e2f8d2ddfe3 100644 setprogname \ sigprocmask \ diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in -index 2e862c68b7e..f8ca3e689ec 100644 +index d3f2a0e5523..74e6da5bb56 100644 --- a/dlls/ntdll/Makefile.in +++ b/dlls/ntdll/Makefile.in @@ -4,7 +4,7 @@ UNIXLIB = ntdll.so @@ -39,18 +39,18 @@ index 2e862c68b7e..f8ca3e689ec 100644 EXTRADLLFLAGS = -nodefaultlibs i386_EXTRADLLFLAGS = -Wl,--image-base,0x7bc00000 diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c -index d4d80efe13b..592d7815026 100644 +index da3611f74f2..5889bebace4 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -38,6 +38,7 @@ #include "winuser.h" #include "winioctl.h" #include "winnls.h" -+#include "ntifs.h" ++#include "ddk/ntifs.h" #ifndef IO_COMPLETION_ALL_ACCESS #define IO_COMPLETION_ALL_ACCESS 0x001F0003 -@@ -5574,32 +5575,154 @@ static void test_mailslot_name(void) +@@ -5803,32 +5804,154 @@ static void test_mailslot_name(void) CloseHandle( device ); } @@ -222,7 +222,7 @@ index d4d80efe13b..592d7815026 100644 } START_TEST(file) -@@ -5675,6 +5798,6 @@ START_TEST(file) +@@ -5908,6 +6031,6 @@ START_TEST(file) test_ioctl(); test_query_ea(); test_flush_buffers_file(); @@ -231,7 +231,7 @@ index d4d80efe13b..592d7815026 100644 + test_mailslot_name(); } diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c -index eef21e12ceb..fbb33442460 100644 +index ee68e4dee9b..2b5ab4e232a 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -36,6 +36,8 @@ @@ -247,7 +247,7 @@ index eef21e12ceb..fbb33442460 100644 #include "wine/list.h" #include "wine/debug.h" #include "unix_private.h" -+#include "ntifs.h" ++#include "ddk/ntifs.h" WINE_DEFAULT_DEBUG_CHANNEL(file); WINE_DECLARE_DEBUG_CHANNEL(winediag); @@ -389,7 +389,7 @@ index eef21e12ceb..fbb33442460 100644 static BOOL fd_is_mount_point( int fd, const struct stat *st ) { struct stat parent; -@@ -3339,6 +3459,181 @@ done: +@@ -3335,6 +3455,181 @@ done: } @@ -571,7 +571,7 @@ index eef21e12ceb..fbb33442460 100644 /****************************************************************************** * lookup_unix_name * -@@ -6127,6 +6422,13 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap +@@ -6153,6 +6448,13 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap break; } @@ -585,18 +585,22 @@ index eef21e12ceb..fbb33442460 100644 case FSCTL_SET_SPARSE: TRACE("FSCTL_SET_SPARSE: Ignoring request\n"); io->Information = 0; -diff --git a/include/Makefile.in b/include/Makefile.in -index 5fd20858aee..53561e66c3e 100644 ---- a/include/Makefile.in -+++ b/include/Makefile.in -@@ -576,6 +576,7 @@ SOURCES = \ - ntdef.h \ - ntdsapi.h \ - ntgdi.h \ -+ ntifs.h \ - ntioring_x.h \ - ntlsa.h \ - ntquery.h \ +diff --git a/include/ddk/ntifs.h b/include/ddk/ntifs.h +index 980235abdc9..90248b4897c 100644 +--- a/include/ddk/ntifs.h ++++ b/include/ddk/ntifs.h +@@ -166,6 +166,11 @@ typedef struct _REPARSE_DATA_BUFFER + WCHAR PathBuffer[1]; + } MountPointReparseBuffer; + ++ struct { ++ ULONG Version; ++ UCHAR PathBuffer[1]; ++ } LinuxSymbolicLinkReparseBuffer; ++ + struct + { + UCHAR DataBuffer[1]; -- -2.40.1 +2.43.0 diff --git a/patches/ntdll-Junction_Points/0019-kernel32-Implement-CreateSymbolicLink-A-W-with-ntdll.patch b/patches/ntdll-Junction_Points/0019-kernel32-Implement-CreateSymbolicLink-A-W-with-ntdll.patch index 47aab798..d1004123 100644 --- a/patches/ntdll-Junction_Points/0019-kernel32-Implement-CreateSymbolicLink-A-W-with-ntdll.patch +++ b/patches/ntdll-Junction_Points/0019-kernel32-Implement-CreateSymbolicLink-A-W-with-ntdll.patch @@ -168,7 +168,7 @@ index 2c261e0f57d..562440f4f8b 100644 #include "ddk/ntddk.h" #include "ddk/ntddser.h" #include "ioringapi.h" -+#include "ntifs.h" ++#include "ddk/ntifs.h" #include "kernelbase.h" #include "wine/exception.h" diff --git a/patches/ntdll-Junction_Points/0022-wcmd-Show-reparse-point-target-in-directory-listing.patch b/patches/ntdll-Junction_Points/0022-wcmd-Show-reparse-point-target-in-directory-listing.patch index 5f921b82..8ef45cca 100644 --- a/patches/ntdll-Junction_Points/0022-wcmd-Show-reparse-point-target-in-directory-listing.patch +++ b/patches/ntdll-Junction_Points/0022-wcmd-Show-reparse-point-target-in-directory-listing.patch @@ -17,7 +17,7 @@ index a849807c76e..5b0a19b442d 100644 #include "wcmd.h" #include "wine/debug.h" +#include "winioctl.h" -+#include "ntifs.h" ++#include "ddk/ntifs.h" WINE_DEFAULT_DEBUG_CHANNEL(cmd); diff --git a/patches/ntdll-Junction_Points/0023-wcmd-Add-junction-point-support-to-mklink.patch b/patches/ntdll-Junction_Points/0023-wcmd-Add-junction-point-support-to-mklink.patch index 102dba1d..4f346bdc 100644 --- a/patches/ntdll-Junction_Points/0023-wcmd-Add-junction-point-support-to-mklink.patch +++ b/patches/ntdll-Junction_Points/0023-wcmd-Add-junction-point-support-to-mklink.patch @@ -18,7 +18,7 @@ index dd3ae5b509b..53734b1e940 100644 #include "wine/debug.h" +#include "winternl.h" +#include "winioctl.h" -+#include "ntifs.h" ++#include "ddk/ntifs.h" WINE_DEFAULT_DEBUG_CHANNEL(cmd);