diff --git a/patches/ntdll-DOS_Attributes/0001-ntdll-Implement-retrieving-DOS-attributes-in-fd_-get.patch b/patches/ntdll-DOS_Attributes/0001-ntdll-Implement-retrieving-DOS-attributes-in-fd_-get.patch index 1b9b1b82..d408a4b0 100644 --- a/patches/ntdll-DOS_Attributes/0001-ntdll-Implement-retrieving-DOS-attributes-in-fd_-get.patch +++ b/patches/ntdll-DOS_Attributes/0001-ntdll-Implement-retrieving-DOS-attributes-in-fd_-get.patch @@ -1,4 +1,4 @@ -From 0bfc43bff3a9b53e65c82d987bb072f0ff0a3a2b Mon Sep 17 00:00:00 2001 +From f96ab0203c4119942b9d8ccc27207cc73389b375 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Tue, 19 Aug 2014 22:10:49 -0600 Subject: [PATCH] ntdll: Implement retrieving DOS attributes in @@ -14,7 +14,7 @@ Subject: [PATCH] ntdll: Implement retrieving DOS attributes in create mode 100644 libs/port/xattr.c diff --git a/configure.ac b/configure.ac -index d3bd12a6340..5e775c04449 100644 +index 4829648c3a5..cff2d4b8288 100644 --- a/configure.ac +++ b/configure.ac @@ -88,6 +88,7 @@ AC_ARG_WITH(usb, AS_HELP_STRING([--without-usb],[do not use the libusb lib @@ -44,10 +44,10 @@ index d3bd12a6340..5e775c04449 100644 AC_SUBST(DLLFLAGS,"-D_REENTRANT") diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c -index 66ce2eb5fe4..d2e783f3300 100644 +index bf435f109f1..6ac9b18da57 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c -@@ -1431,6 +1431,22 @@ static BOOL append_entry( struct dir_data *data, const char *long_name, +@@ -1448,6 +1448,22 @@ static BOOL append_entry( struct dir_data *data, const char *long_name, } @@ -70,7 +70,7 @@ index 66ce2eb5fe4..d2e783f3300 100644 /* fetch the attributes of a file */ static inline ULONG get_file_attributes( const struct stat *st ) { -@@ -1450,7 +1466,8 @@ static inline ULONG get_file_attributes( const struct stat *st ) +@@ -1491,7 +1507,8 @@ static int fd_get_file_info( int fd, unsigned int options, struct stat *st, ULON static int get_file_info( const char *path, struct stat *st, ULONG *attr ) { char *parent_path; @@ -80,8 +80,8 @@ index 66ce2eb5fe4..d2e783f3300 100644 *attr = 0; ret = lstat( path, st ); -@@ -1476,6 +1493,9 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr ) - RtlFreeHeap( GetProcessHeap(), 0, parent_path ); +@@ -1517,6 +1534,9 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr ) + free( parent_path ); } *attr |= get_file_attributes( st ); + len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 ); @@ -91,10 +91,10 @@ index 66ce2eb5fe4..d2e783f3300 100644 } diff --git a/include/wine/port.h b/include/wine/port.h -index e8434c73cca..6e81cb71a76 100644 +index 928730a41d7..4670891ae77 100644 --- a/include/wine/port.h +++ b/include/wine/port.h -@@ -361,6 +361,15 @@ int usleep (unsigned int useconds); +@@ -352,6 +352,15 @@ int usleep (unsigned int useconds); extern int mkstemps(char *template, int suffix_len); @@ -111,10 +111,10 @@ index e8434c73cca..6e81cb71a76 100644 #define __WINE_NOT_PORTABLE(func) func##_is_not_portable func##_is_not_portable diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in -index 1963afe2423..4b1ecab7516 100644 +index 7bc67fa3fee..d1de285d527 100644 --- a/libs/port/Makefile.in +++ b/libs/port/Makefile.in -@@ -22,4 +22,5 @@ C_SRCS = \ +@@ -21,4 +21,5 @@ C_SRCS = \ strnlen.c \ symlink.c \ usleep.c \ diff --git a/patches/ntdll-DOS_Attributes/0004-ntdll-Implement-storing-DOS-attributes-in-NtCreateFi.patch b/patches/ntdll-DOS_Attributes/0004-ntdll-Implement-storing-DOS-attributes-in-NtCreateFi.patch index e183e21b..3807891d 100644 --- a/patches/ntdll-DOS_Attributes/0004-ntdll-Implement-storing-DOS-attributes-in-NtCreateFi.patch +++ b/patches/ntdll-DOS_Attributes/0004-ntdll-Implement-storing-DOS-attributes-in-NtCreateFi.patch @@ -1,4 +1,4 @@ -From 5f6d3c447ef1e243de6188d8813261d991c4ffc7 Mon Sep 17 00:00:00 2001 +From 29333aaab5e4d2b62741a8321382b24f1630eb70 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Wed, 20 Aug 2014 15:28:00 -0600 Subject: [PATCH] ntdll: Implement storing DOS attributes in NtCreateFile. @@ -60,10 +60,10 @@ index 248ed99ab20..e0f4debc624 100644 } testfiles[i].nfound++; diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c -index f1176717819..5d5e4ba2892 100644 +index 7ab1c130bf2..7c737edd22c 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c -@@ -3595,6 +3595,20 @@ void CDECL set_show_dot_files( BOOL enable ) +@@ -3549,6 +3549,20 @@ void CDECL set_show_dot_files( BOOL enable ) show_dot_files = enable; } @@ -84,7 +84,7 @@ index f1176717819..5d5e4ba2892 100644 /****************************************************************************** * open_unix_file -@@ -3682,13 +3696,14 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU +@@ -3636,13 +3650,14 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU io->u.Status = STATUS_SUCCESS; } @@ -93,7 +93,7 @@ index f1176717819..5d5e4ba2892 100644 { - io->u.Status = open_unix_file( handle, unix_name, access, attr, attributes, - sharing, disposition, options, ea_buffer, ea_length ); -- RtlFreeHeap( GetProcessHeap(), 0, unix_name ); +- free( unix_name ); + WARN( "%s not found (%x)\n", debugstr_us(attr->ObjectName), io->u.Status ); + return io->u.Status; } @@ -104,7 +104,7 @@ index f1176717819..5d5e4ba2892 100644 if (io->u.Status == STATUS_SUCCESS) { -@@ -3710,6 +3725,11 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU +@@ -3664,6 +3679,11 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU io->Information = FILE_OVERWRITTEN; break; } @@ -116,11 +116,11 @@ index f1176717819..5d5e4ba2892 100644 } else if (io->u.Status == STATUS_TOO_MANY_OPENED_FILES) { -@@ -3717,6 +3737,7 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU +@@ -3671,6 +3691,7 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU if (!once++) ERR_(winediag)( "Too many open files, ulimit -n probably needs to be increased\n" ); } -+ RtlFreeHeap( GetProcessHeap(), 0, unix_name ); ++ free( unix_name ); return io->u.Status; } diff --git a/patches/ntdll-DOS_Attributes/0007-ntdll-Perform-the-Unix-style-hidden-file-check-withi.patch b/patches/ntdll-DOS_Attributes/0007-ntdll-Perform-the-Unix-style-hidden-file-check-withi.patch index a972a95e..cd06918f 100644 --- a/patches/ntdll-DOS_Attributes/0007-ntdll-Perform-the-Unix-style-hidden-file-check-withi.patch +++ b/patches/ntdll-DOS_Attributes/0007-ntdll-Perform-the-Unix-style-hidden-file-check-withi.patch @@ -1,4 +1,4 @@ -From 78f53ba7362227cf5d725d6d5b70e06267597b5e Mon Sep 17 00:00:00 2001 +From 3f308239ced2e9fa2ac0b298eeb1ad5dde330840 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Wed, 20 Aug 2014 11:26:48 -0600 Subject: [PATCH] ntdll: Perform the Unix-style hidden file check within the @@ -9,10 +9,10 @@ Subject: [PATCH] ntdll: Perform the Unix-style hidden file check within the 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c -index 33fa49d0dea..a88daf1f7f3 100644 +index 7c737edd22c..c6b4928bd53 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c -@@ -1238,15 +1238,15 @@ static BOOLEAN get_dir_case_sensitivity( const char *dir ) +@@ -1213,15 +1213,15 @@ static BOOLEAN get_dir_case_sensitivity( const char *dir ) * * Check if the specified file should be hidden based on its name and the show dot files option. */ @@ -33,8 +33,8 @@ index 33fa49d0dea..a88daf1f7f3 100644 if (p == end || *p != '.') return FALSE; /* make sure it isn't '.' or '..' */ if (p + 1 == end) return FALSE; -@@ -1571,6 +1571,10 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr ) - RtlFreeHeap( GetProcessHeap(), 0, parent_path ); +@@ -1567,6 +1567,10 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr ) + free( parent_path ); } *attr |= get_file_attributes( st ); + /* convert Unix-style hidden files to a DOS hidden file attribute */ @@ -44,7 +44,7 @@ index 33fa49d0dea..a88daf1f7f3 100644 len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 ); if (len == -1) return ret; *attr |= get_file_xattr( hexattr, len ); -@@ -2081,11 +2085,6 @@ static NTSTATUS get_dir_data_entry( struct dir_data *dir_data, void *info_ptr, I +@@ -2077,11 +2081,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 */ @@ -56,15 +56,15 @@ index 33fa49d0dea..a88daf1f7f3 100644 fill_file_info( &st, attributes, info, class ); } -@@ -3857,7 +3856,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr, +@@ -3838,7 +3837,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr, info->AllocationSize = std.AllocationSize; info->EndOfFile = std.EndOfFile; info->FileAttributes = basic.FileAttributes; - if (is_hidden_file( attr->ObjectName )) info->FileAttributes |= FILE_ATTRIBUTE_HIDDEN; } - RtlFreeHeap( GetProcessHeap(), 0, unix_name ); + free( unix_name ); } -@@ -3884,10 +3882,7 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC +@@ -3865,10 +3863,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 @@ -72,7 +72,7 @@ index 33fa49d0dea..a88daf1f7f3 100644 status = fill_file_info( &st, attributes, info, FileBasicInformation ); - if (is_hidden_file( attr->ObjectName )) info->FileAttributes |= FILE_ATTRIBUTE_HIDDEN; - } - RtlFreeHeap( GetProcessHeap(), 0, unix_name ); + free( unix_name ); } else WARN( "%s not found (%x)\n", debugstr_us(attr->ObjectName), status ); -- diff --git a/patches/ntdll-DOS_Attributes/0008-ntdll-Always-store-SAMBA_XATTR_DOS_ATTRIB-when-path-.patch b/patches/ntdll-DOS_Attributes/0008-ntdll-Always-store-SAMBA_XATTR_DOS_ATTRIB-when-path-.patch index b8529c85..f87c79e8 100644 --- a/patches/ntdll-DOS_Attributes/0008-ntdll-Always-store-SAMBA_XATTR_DOS_ATTRIB-when-path-.patch +++ b/patches/ntdll-DOS_Attributes/0008-ntdll-Always-store-SAMBA_XATTR_DOS_ATTRIB-when-path-.patch @@ -1,4 +1,4 @@ -From 29e0ef12afb2651e61492a8a9f021baca4c66519 Mon Sep 17 00:00:00 2001 +From dd02380fff84cbef2a6df7b6f82b271e0e9d732f Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 14 Jan 2016 23:09:19 +0100 Subject: [PATCH] ntdll: Always store SAMBA_XATTR_DOS_ATTRIB when path could be @@ -9,11 +9,11 @@ Subject: [PATCH] ntdll: Always store SAMBA_XATTR_DOS_ATTRIB when path could be 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c -index 9636c0efe3e..444332e7baa 100644 +index c6b4928bd53..3bf82b1d45d 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c -@@ -1561,12 +1561,15 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr ) - RtlFreeHeap( GetProcessHeap(), 0, parent_path ); +@@ -1567,12 +1567,15 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr ) + free( parent_path ); } *attr |= get_file_attributes( st ); - /* convert Unix-style hidden files to a DOS hidden file attribute */ @@ -32,7 +32,7 @@ index 9636c0efe3e..444332e7baa 100644 *attr |= get_file_xattr( hexattr, len ); return ret; } -@@ -3440,7 +3443,7 @@ NTSTATUS set_file_info( const char *path, ULONG attr ) +@@ -3556,7 +3559,7 @@ NTSTATUS set_file_info( const char *path, ULONG attr ) /* Note: unix mode already set when called this way */ attr &= ~FILE_ATTRIBUTE_NORMAL; /* do not store everything, but keep everything Samba can use */ len = sprintf( hexattr, "0x%x", attr ); diff --git a/patches/ntdll-NtDevicePath/0001-ntdll-Implement-opening-files-through-nt-device-path.patch b/patches/ntdll-NtDevicePath/0001-ntdll-Implement-opening-files-through-nt-device-path.patch index 67933da1..ad814a42 100644 --- a/patches/ntdll-NtDevicePath/0001-ntdll-Implement-opening-files-through-nt-device-path.patch +++ b/patches/ntdll-NtDevicePath/0001-ntdll-Implement-opening-files-through-nt-device-path.patch @@ -1,4 +1,4 @@ -From 2ea24b967a65e0bc736625abf496fa29607d74d7 Mon Sep 17 00:00:00 2001 +From ee7a43bf36722acba4c870409fc15ea5bdf4a80b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Fri, 26 May 2017 05:17:17 +0200 Subject: [PATCH] ntdll: Implement opening files through nt device paths. @@ -63,10 +63,10 @@ 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 aae715521a5..89219a88113 100644 +index b6529241739..74f3f707444 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c -@@ -3294,7 +3294,7 @@ static NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, char * +@@ -3250,7 +3250,7 @@ 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. */ @@ -75,7 +75,7 @@ index aae715521a5..89219a88113 100644 { static const WCHAR unixW[] = {'u','n','i','x'}; static const WCHAR pipeW[] = {'p','i','p','e'}; -@@ -3432,6 +3432,126 @@ NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, char *nam +@@ -3387,6 +3387,126 @@ NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, char *nam return status; } @@ -181,7 +181,7 @@ index aae715521a5..89219a88113 100644 + + name_len = sizeof(dosprefixW) + wcslen(prefix) * sizeof(WCHAR) + + nameW->Length - offset * sizeof(WCHAR) + sizeof(WCHAR); -+ if (!(name = RtlAllocateHeap( GetProcessHeap(), 0, name_len ))) ++ if (!(name = malloc( name_len ))) + return STATUS_NO_MEMORY; + + ptr = name; @@ -196,7 +196,7 @@ index aae715521a5..89219a88113 100644 + dospathW.Length = wcslen( name ) * sizeof(WCHAR); + status = nt_to_unix_file_name_internal( &dospathW, unix_name_ret, disposition ); + -+ RtlFreeHeap( GetProcessHeap(), 0, name ); ++ free( name ); + return status; +} diff --git a/patches/ntdll-NtQueryVirtualMemory/0003-ntdll-Implement-NtQueryVirtualMemory-MemorySectionNa.patch b/patches/ntdll-NtQueryVirtualMemory/0003-ntdll-Implement-NtQueryVirtualMemory-MemorySectionNa.patch index 204a29ba..0652bbcb 100644 --- a/patches/ntdll-NtQueryVirtualMemory/0003-ntdll-Implement-NtQueryVirtualMemory-MemorySectionNa.patch +++ b/patches/ntdll-NtQueryVirtualMemory/0003-ntdll-Implement-NtQueryVirtualMemory-MemorySectionNa.patch @@ -1,4 +1,4 @@ -From c1b6bc02ee2534dc2b51d8184fb0ca6717c33cf3 Mon Sep 17 00:00:00 2001 +From 2de64a6d61d01b9409ab6b61176c0a88a4838937 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Sun, 28 May 2017 05:19:30 +0200 Subject: [PATCH] ntdll: Implement NtQueryVirtualMemory(MemorySectionName). @@ -15,10 +15,10 @@ Contains several improvements by Sebastian Lackner . 6 files changed, 136 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c -index 6b0dbaa7b3d..2ac7fcaae35 100644 +index b404bceb427..dcc76846c1e 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c -@@ -1767,7 +1767,7 @@ static NTSTATUS fill_file_info( const struct stat *st, ULONG attr, void *ptr, +@@ -1763,7 +1763,7 @@ static NTSTATUS fill_file_info( const struct stat *st, ULONG attr, void *ptr, } @@ -28,7 +28,7 @@ index 6b0dbaa7b3d..2ac7fcaae35 100644 data_size_t size = 1024; NTSTATUS ret; diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h -index 711a0bed2b7..466c59da75a 100644 +index 3d56ea5d408..f24ca578ce1 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -170,6 +170,7 @@ extern unsigned int server_queue_process_apc( HANDLE process, const apc_call_t * @@ -40,10 +40,10 @@ index 711a0bed2b7..466c59da75a 100644 extern size_t server_init_thread( void *entry_point, BOOL *suspend ) DECLSPEC_HIDDEN; extern int server_pipe( int fd[2] ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c -index cd1bd162a2a..570a8a3bf49 100644 +index 91989bd569e..d1c63bdb215 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c -@@ -4013,6 +4013,98 @@ static NTSTATUS get_working_set_ex( HANDLE process, LPCVOID addr, +@@ -4009,6 +4009,98 @@ static NTSTATUS get_working_set_ex( HANDLE process, LPCVOID addr, return STATUS_SUCCESS; } @@ -78,7 +78,7 @@ index cd1bd162a2a..570a8a3bf49 100644 + if (!status) + { + status = unix_to_nt_file_name( unix_name, &nt_nameW ); -+ RtlFreeHeap( GetProcessHeap(), 0, unix_name ); ++ free( unix_name ); + } + if (!status) + { @@ -91,7 +91,7 @@ index cd1bd162a2a..570a8a3bf49 100644 + + for (;;) + { -+ if (!(name = RtlAllocateHeap( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR) ))) ++ if (!(name = malloc( (size + 1) * sizeof(WCHAR) ))) + return STATUS_NO_MEMORY; + + SERVER_START_REQ( get_dll_info ) @@ -109,14 +109,14 @@ index cd1bd162a2a..570a8a3bf49 100644 + name[size] = 0; + break; + } -+ RtlFreeHeap( GetProcessHeap(), 0, name ); ++ free( name ); + if (status == STATUS_DLL_NOT_FOUND) return STATUS_INVALID_ADDRESS; + if (status != STATUS_BUFFER_TOO_SMALL) return status; + } + + if (!RtlDosPathNameToNtPathName_U( name, &nt_name, NULL, NULL )) + { -+ RtlFreeHeap( GetProcessHeap(), 0, name ); ++ free( name ); + return STATUS_INVALID_PARAMETER; + } + @@ -133,7 +133,7 @@ index cd1bd162a2a..570a8a3bf49 100644 + else + status = (len < sizeof(MEMORY_SECTION_NAME)) ? STATUS_INFO_LENGTH_MISMATCH : STATUS_BUFFER_OVERFLOW; + -+ RtlFreeHeap( GetProcessHeap(), 0, name ); ++ free( name ); + RtlFreeUnicodeString( &nt_name ); + return status; +} @@ -142,7 +142,7 @@ index cd1bd162a2a..570a8a3bf49 100644 #define UNIMPLEMENTED_INFO_CLASS(c) \ case c: \ FIXME("(process=%p,addr=%p) Unimplemented information class: " #c "\n", process, addr); \ -@@ -4037,8 +4129,10 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr, +@@ -4033,8 +4125,10 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr, case MemoryWorkingSetExInformation: return get_working_set_ex( process, addr, buffer, len, res_len ); @@ -222,10 +222,10 @@ index db0debe0af5..6e74f5b770f 100644 DECL_HANDLER(get_mapping_committed_range) { diff --git a/server/protocol.def b/server/protocol.def -index bd6841d8000..345e0966c14 100644 +index 03e567c3dd4..3f0a68ccdcc 100644 --- a/server/protocol.def +++ b/server/protocol.def -@@ -1756,6 +1756,15 @@ enum char_info_mode +@@ -1686,6 +1686,15 @@ enum char_info_mode @END diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index b54212b6..a4b8aa58 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "fdb3d9ae320363c1bd9fa716b167a7ad313e638b" + echo "54b2a10659871032720df31ae9ca6cba2ff4acf0" } # Show version information @@ -3829,12 +3829,10 @@ fi # | tools/winebuild/import.c, tools/winebuild/spec32.c # | if test "$enable_winebuild_pe_syscall_thunks" -eq 1; then - patch_apply winebuild-pe_syscall_thunks/0001-ntdll-Always-align-stack-pointer-in-__wine_syscall_d.patch patch_apply winebuild-pe_syscall_thunks/0002-winebuild-Call-__wine_syscall_dispatcher-through-the.patch patch_apply winebuild-pe_syscall_thunks/0003-ntdll-Also-generate-syscall-thunks-for-Nt-functions-.patch patch_apply winebuild-pe_syscall_thunks/0004-ntdll-Fix-NtGetContextThread-on-i386-with-PE-syscall.patch ( - printf '%s\n' '+ { "Paul Gofman", "ntdll: Always align stack pointer in __wine_syscall_dispatcher on x64.", 1 },'; printf '%s\n' '+ { "Paul Gofman", "winebuild: Call __wine_syscall_dispatcher through the fixed address.", 1 },'; printf '%s\n' '+ { "Paul Gofman", "ntdll: Also generate syscall thunks for Nt functions not yet in the Unix part.", 1 },'; printf '%s\n' '+ { "Paul Gofman", "ntdll: Fix NtGetContextThread on i386 with PE syscall thunks.", 1 },'; diff --git a/patches/server-Object_Types/0001-ntdll-Implement-SystemExtendedHandleInformation-in-N.patch b/patches/server-Object_Types/0001-ntdll-Implement-SystemExtendedHandleInformation-in-N.patch index f88a5491..92a8471e 100644 --- a/patches/server-Object_Types/0001-ntdll-Implement-SystemExtendedHandleInformation-in-N.patch +++ b/patches/server-Object_Types/0001-ntdll-Implement-SystemExtendedHandleInformation-in-N.patch @@ -1,4 +1,4 @@ -From e57cb9c97ea1147595a9c29e236515a2be69f9bd Mon Sep 17 00:00:00 2001 +From 04ab1c6e148411f43bea8d2c71fb1bfd5b90efab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Tue, 7 Mar 2017 18:30:33 +0100 Subject: [PATCH] ntdll: Implement SystemExtendedHandleInformation in @@ -11,7 +11,7 @@ Subject: [PATCH] ntdll: Implement SystemExtendedHandleInformation in 3 files changed, 133 insertions(+) diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c -index eaf2f1a45b7..1728ab82225 100644 +index e399757b85d..d27bb06c5fe 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -662,6 +662,62 @@ done: @@ -77,7 +77,7 @@ index eaf2f1a45b7..1728ab82225 100644 static void test_query_cache(void) { NTSTATUS status; -@@ -2715,6 +2771,10 @@ START_TEST(info) +@@ -2783,6 +2839,10 @@ START_TEST(info) trace("Starting test_query_handle()\n"); test_query_handle(); @@ -89,10 +89,10 @@ index eaf2f1a45b7..1728ab82225 100644 trace("Starting test_query_cache()\n"); test_query_cache(); diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c -index 5ba9fb41156..df4e11a0f56 100644 +index abec33bb289..c3774dcdef8 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c -@@ -1985,6 +1985,58 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, +@@ -2399,6 +2399,58 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, break; } @@ -115,7 +115,7 @@ index 5ba9fb41156..df4e11a0f56 100644 + + num_handles = size - FIELD_OFFSET( SYSTEM_HANDLE_INFORMATION_EX, Handle ); + num_handles /= sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX); -+ if (!(handle_info = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*handle_info) * num_handles ))) ++ if (!(handle_info = malloc( sizeof(*handle_info) * num_handles ))) + return STATUS_NO_MEMORY; + + SERVER_START_REQ( get_system_handles ) @@ -144,7 +144,7 @@ index 5ba9fb41156..df4e11a0f56 100644 + } + SERVER_END_REQ; + -+ RtlFreeHeap( GetProcessHeap(), 0, handle_info ); ++ free( handle_info ); + break; + } + @@ -152,10 +152,10 @@ index 5ba9fb41156..df4e11a0f56 100644 { SYSTEM_CACHE_INFORMATION sci = { 0 }; diff --git a/include/winternl.h b/include/winternl.h -index 3ff15f28c15..66cd05dac15 100644 +index 091a22376f8..1266f55c6b1 100644 --- a/include/winternl.h +++ b/include/winternl.h -@@ -1531,6 +1531,27 @@ typedef struct _SYSTEM_HANDLE_INFORMATION { +@@ -1532,6 +1532,27 @@ typedef struct _SYSTEM_HANDLE_INFORMATION { SYSTEM_HANDLE_ENTRY Handle[1]; } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION; diff --git a/patches/winebuild-pe_syscall_thunks/0001-ntdll-Always-align-stack-pointer-in-__wine_syscall_d.patch b/patches/winebuild-pe_syscall_thunks/0001-ntdll-Always-align-stack-pointer-in-__wine_syscall_d.patch deleted file mode 100644 index 855e14fc..00000000 --- a/patches/winebuild-pe_syscall_thunks/0001-ntdll-Always-align-stack-pointer-in-__wine_syscall_d.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 4b84ee691550970aa6f599ca649316f20272f84a Mon Sep 17 00:00:00 2001 -From: Paul Gofman -Date: Tue, 14 Jul 2020 02:41:53 +0300 -Subject: [PATCH] ntdll: Always align stack pointer in - __wine_syscall_dispatcher on x64. - -Syscall thunks break stack alignment for dispatcher. Regardless of that, -it is probably better not to assume aligned stack in syscall thunk entry. ---- - tools/winebuild/import.c | 14 ++++++++------ - 1 file changed, 8 insertions(+), 6 deletions(-) - -diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c -index 97191ca89ec2..4f641825e367 100644 ---- a/tools/winebuild/import.c -+++ b/tools/winebuild/import.c -@@ -1497,23 +1497,25 @@ void output_syscalls( DLLSPEC *spec ) - * depends on us returning to it. Adjust the return address accordingly. */ - output( "\tsubq $0xb,0x8(%%rbp)\n" ); - output( "\tcmpq $%u,%%rax\n", count ); -- output( "\tjae 3f\n" ); -+ output( "\tjae 4f\n" ); - output( "\tleaq .Lsyscall_args(%%rip),%%rcx\n" ); - output( "\tmovzbl (%%rcx,%%rax),%%ecx\n" ); - output( "\tsubq $0x20,%%rcx\n" ); -- output( "\tjbe 1f\n" ); -- output( "\tsubq %%rcx,%%rsp\n" ); -+ output( "\tja 1f\n" ); -+ output( "\tandq $~15,%%rsp\n\t" ); -+ output( "\tjmp 2f\n" ); -+ output( "1:\tsubq %%rcx,%%rsp\n" ); - output( "\tshrq $3,%%rcx\n" ); - output( "\tleaq 0x38(%%rbp),%%rsi\n" ); - output( "\tandq $~15,%%rsp\n\t" ); - output( "\tmovq %%rsp,%%rdi\n" ); - output( "\tcld\n" ); - output( "\trep; movsq\n" ); -- output( "1:\tmovq %%r10,%%rcx\n" ); -+ output( "2:\tmovq %%r10,%%rcx\n" ); - output( "\tsubq $0x20,%%rsp\n" ); - output( "\tleaq .Lsyscall_table(%%rip),%%r10\n" ); - output( "\tcallq *(%%r10,%%rax,8)\n" ); -- output( "2:\tleaq -0x10(%%rbp),%%rsp\n" ); -+ output( "3:\tleaq -0x10(%%rbp),%%rsp\n" ); - output( "\tpopq %%rdi\n" ); - output_cfi( ".cfi_same_value %%rdi" ); - output( "\tpopq %%rsi\n" ); -@@ -1523,7 +1525,7 @@ void output_syscalls( DLLSPEC *spec ) - output_cfi( ".cfi_adjust_cfa_offset -8" ); - output_cfi( ".cfi_same_value %%rbp" ); - output( "\tret\n" ); -- output( "3:\tmovl $0x%x,%%eax\n", invalid_param ); -+ output( "4:\tmovl $0x%x,%%eax\n", invalid_param ); - output( "\tjmp 2b\n" ); - break; - case CPU_ARM: --- -2.26.2 - diff --git a/staging/upstream-commit b/staging/upstream-commit index 3ad23b40..2da62cc0 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -fdb3d9ae320363c1bd9fa716b167a7ad313e638b +54b2a10659871032720df31ae9ca6cba2ff4acf0