From 6bb65ccf88089eb584aac14cd251becb56d865d8 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 12 Oct 2018 10:33:55 +1100 Subject: [PATCH] Rebase against b0c5a77e26c51f60b7d5e4df557f969a044b7fd4 --- ...-support-for-creating-processes-usin.patch | 54 ++++++------- ...on-nullterminated-string-as-working-.patch | 76 ------------------- patches/kernel32-Cwd_Startup_Info/definition | 1 - patches/patchinstall.sh | 18 +---- ...a-default-vulkan-driver-if-one-not-f.patch | 18 +++-- 5 files changed, 39 insertions(+), 128 deletions(-) delete mode 100644 patches/kernel32-Cwd_Startup_Info/0001-kernel32-Allow-non-nullterminated-string-as-working-.patch delete mode 100644 patches/kernel32-Cwd_Startup_Info/definition diff --git a/patches/advapi32-Token_Integrity_Level/0010-server-Implement-support-for-creating-processes-usin.patch b/patches/advapi32-Token_Integrity_Level/0010-server-Implement-support-for-creating-processes-usin.patch index 4cca79b6..3aca837b 100644 --- a/patches/advapi32-Token_Integrity_Level/0010-server-Implement-support-for-creating-processes-usin.patch +++ b/patches/advapi32-Token_Integrity_Level/0010-server-Implement-support-for-creating-processes-usin.patch @@ -1,4 +1,4 @@ -From 52012d859a9cb5d48af8832944aa0d58e950c211 Mon Sep 17 00:00:00 2001 +From 5128e0ff8263d52792c16c465869a90736ec76de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sun, 6 Aug 2017 02:08:05 +0200 Subject: [PATCH] server: Implement support for creating processes using a @@ -15,10 +15,10 @@ Subject: [PATCH] server: Implement support for creating processes using a 7 files changed, 59 insertions(+), 21 deletions(-) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c -index 5f838f3..fdaca57 100644 +index c2042b0..5e94fb0 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c -@@ -2204,7 +2204,7 @@ static NTSTATUS alloc_object_attributes( const SECURITY_ATTRIBUTES *attr, struct +@@ -2207,7 +2207,7 @@ static NTSTATUS alloc_object_attributes( const SECURITY_ATTRIBUTES *attr, struct * Create a new process. If hFile is a valid handle we have an exe * file, otherwise it is a Winelib app. */ @@ -27,15 +27,15 @@ index 5f838f3..fdaca57 100644 LPCWSTR cur_dir, LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa, BOOL inherit, DWORD flags, LPSTARTUPINFOW startup, LPPROCESS_INFORMATION info, LPCSTR unixdir, -@@ -2317,6 +2317,7 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW +@@ -2314,6 +2314,7 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW req->access = PROCESS_ALL_ACCESS; - req->cpu = cpu; + req->cpu = pe_info->cpu; req->info_size = startup_info_size; + req->token = wine_server_obj_handle( token ); wine_server_add_data( req, objattr, attr_len ); wine_server_add_data( req, startup_info, startup_info_size ); - wine_server_add_data( req, env, (env_end - env) * sizeof(WCHAR) ); -@@ -2433,7 +2434,7 @@ error: + wine_server_add_data( req, params->Environment, (env_end - params->Environment) * sizeof(WCHAR) ); +@@ -2431,7 +2432,7 @@ error: * * Create a new VDM process for a 16-bit or DOS application. */ @@ -44,16 +44,16 @@ index 5f838f3..fdaca57 100644 LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa, BOOL inherit, DWORD flags, LPSTARTUPINFOW startup, LPPROCESS_INFORMATION info, LPCSTR unixdir, int exec_only ) -@@ -2458,7 +2459,7 @@ static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, L +@@ -2456,7 +2457,7 @@ static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, L sprintfW(new_cmd_line, argsW, winevdm, buffer, cmd_line); memset( &pe_info, 0, sizeof(pe_info) ); - pe_info.machine = IMAGE_FILE_MACHINE_I386; + pe_info.cpu = CPU_x86; - ret = create_process( 0, winevdm, new_cmd_line, env, cur_dir, psa, tsa, inherit, + ret = create_process( token, 0, winevdm, new_cmd_line, env, cur_dir, psa, tsa, inherit, flags, startup, info, unixdir, &pe_info, exec_only ); HeapFree( GetProcessHeap(), 0, new_cmd_line ); return ret; -@@ -2470,7 +2471,7 @@ static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, L +@@ -2468,7 +2469,7 @@ static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, L * * Create a new cmd shell process for a .BAT file. */ @@ -62,7 +62,7 @@ index 5f838f3..fdaca57 100644 LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa, BOOL inherit, DWORD flags, LPSTARTUPINFOW startup, LPPROCESS_INFORMATION info ) -@@ -2498,8 +2499,8 @@ static BOOL create_cmd_process( LPCWSTR filename, LPWSTR cmd_line, LPVOID env, L +@@ -2496,8 +2497,8 @@ static BOOL create_cmd_process( LPCWSTR filename, LPWSTR cmd_line, LPVOID env, L strcatW( newcmdline, quotW ); strcatW( newcmdline, cmd_line ); strcatW( newcmdline, quotW ); @@ -73,7 +73,7 @@ index 5f838f3..fdaca57 100644 HeapFree( GetProcessHeap(), 0, newcmdline ); return ret; } -@@ -2611,7 +2612,9 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l +@@ -2609,7 +2610,9 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l TRACE("app %s cmdline %s\n", debugstr_w(app_name), debugstr_w(cmd_line) ); @@ -84,12 +84,12 @@ index 5f838f3..fdaca57 100644 if (new_token) FIXME("No support for returning created process token\n"); if (!(tidy_cmdline = get_file_name( app_name, cmd_line, name, ARRAY_SIZE( name ), &hFile, &is_64bit ))) -@@ -2700,18 +2703,18 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l - debugstr_w(name), is_64bit_arch(pe_info.machine) ? 64 : 32, +@@ -2696,18 +2699,18 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l + debugstr_w(name), is_64bit_arch(pe_info.cpu) ? 64 : 32, wine_dbgstr_longlong(pe_info.base), wine_dbgstr_longlong(pe_info.base + pe_info.map_size), - pe_info.machine ); + cpu_names[pe_info.cpu] ); - retv = create_process( hFile, name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr, -+ retv = create_process( token, hFile, name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr, ++ retv = create_process( NULL, hFile, name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr, inherit, flags, startup_info, info, unixdir, &pe_info, FALSE ); break; case BINARY_WIN16: @@ -100,13 +100,13 @@ index 5f838f3..fdaca57 100644 break; case BINARY_UNIX_LIB: TRACE( "starting %s as %d-bit Winelib app\n", - debugstr_w(name), is_64bit_arch(pe_info.machine) ? 64 : 32 ); + debugstr_w(name), is_64bit_arch(pe_info.cpu) ? 64 : 32 ); - retv = create_process( hFile, name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr, + retv = create_process( token, hFile, name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr, inherit, flags, startup_info, info, unixdir, &pe_info, FALSE ); break; case BINARY_UNKNOWN: -@@ -2721,14 +2724,14 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l +@@ -2717,14 +2720,14 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l if (!strcmpiW( p, comW ) || !strcmpiW( p, pifW )) { TRACE( "starting %s as DOS binary\n", debugstr_w(name) ); @@ -123,10 +123,10 @@ index 5f838f3..fdaca57 100644 inherit, flags, startup_info, info ); break; } -@@ -2844,12 +2847,12 @@ static void exec_process( LPCWSTR name ) - debugstr_w(name), is_64bit_arch(pe_info.machine) ? 64 : 32, +@@ -2840,12 +2843,12 @@ static void exec_process( LPCWSTR name ) + debugstr_w(name), is_64bit_arch(pe_info.cpu) ? 64 : 32, wine_dbgstr_longlong(pe_info.base), wine_dbgstr_longlong(pe_info.base + pe_info.map_size), - pe_info.machine ); + cpu_names[pe_info.cpu] ); - create_process( hFile, name, GetCommandLineW(), NULL, NULL, NULL, NULL, + create_process( NULL, hFile, name, GetCommandLineW(), NULL, NULL, NULL, NULL, FALSE, 0, &startup_info, &info, NULL, &pe_info, TRUE ); @@ -138,7 +138,7 @@ index 5f838f3..fdaca57 100644 FALSE, 0, &startup_info, &info, NULL, &pe_info, TRUE ); break; case BINARY_UNKNOWN: -@@ -2859,7 +2862,7 @@ static void exec_process( LPCWSTR name ) +@@ -2855,7 +2858,7 @@ static void exec_process( LPCWSTR name ) /* fall through */ case BINARY_WIN16: TRACE( "starting %s as Win16/DOS binary\n", debugstr_w(name) ); @@ -249,10 +249,10 @@ index 1128dba..ec44e02 100644 extern struct thread *get_process_first_thread( struct process *process ); extern struct process *get_process_from_id( process_id_t id ); diff --git a/server/protocol.def b/server/protocol.def -index 2ddc62f..897aa2b 100644 +index aebac70..3dc82b3 100644 --- a/server/protocol.def +++ b/server/protocol.def -@@ -743,6 +743,7 @@ struct rawinput_device +@@ -744,6 +744,7 @@ struct rawinput_device unsigned int access; /* access rights for process object */ cpu_type_t cpu; /* CPU that the new process will use */ data_size_t info_size; /* size of startup info */ @@ -287,7 +287,7 @@ index 21e90cc..32dfe5f 100644 static inline const ACE_HEADER *ace_next( const ACE_HEADER *ace ) { diff --git a/server/token.c b/server/token.c -index 1184241..5db97b4 100644 +index de1d624..2804247 100644 --- a/server/token.c +++ b/server/token.c @@ -836,6 +836,12 @@ int token_assign_label( struct token *token, PSID label ) @@ -303,7 +303,7 @@ index 1184241..5db97b4 100644 struct token *token_create_admin( void ) { struct token *token = NULL; -@@ -1262,6 +1268,11 @@ const SID *token_get_primary_group( struct token *token ) +@@ -1263,6 +1269,11 @@ const SID *token_get_primary_group( struct token *token ) return token->primary_group; } @@ -316,5 +316,5 @@ index 1184241..5db97b4 100644 { GENERIC_MAPPING mapping; -- -2.7.4 +1.9.1 diff --git a/patches/kernel32-Cwd_Startup_Info/0001-kernel32-Allow-non-nullterminated-string-as-working-.patch b/patches/kernel32-Cwd_Startup_Info/0001-kernel32-Allow-non-nullterminated-string-as-working-.patch deleted file mode 100644 index 36309ef9..00000000 --- a/patches/kernel32-Cwd_Startup_Info/0001-kernel32-Allow-non-nullterminated-string-as-working-.patch +++ /dev/null @@ -1,76 +0,0 @@ -From b47be04e640f03748edc8a5e6693c37df2a68d27 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sun, 30 Aug 2015 08:38:30 +0200 -Subject: kernel32: Allow non-nullterminated string as working directory in - create_startup_info. - ---- - dlls/kernel32/process.c | 31 ++++++++++++++++++------------- - 1 file changed, 18 insertions(+), 13 deletions(-) - -diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c -index a40f124..6622fcb 100644 ---- a/dlls/kernel32/process.c -+++ b/dlls/kernel32/process.c -@@ -1629,7 +1629,7 @@ static startup_info_t *create_startup_info( LPCWSTR filename, LPCWSTR cmdline, - const RTL_USER_PROCESS_PARAMETERS *cur_params; - const WCHAR *title; - startup_info_t *info; -- DWORD size; -+ DWORD size, cur_dir_length; - void *ptr; - UNICODE_STRING newdir; - WCHAR imagepath[MAX_PATH]; -@@ -1643,24 +1643,27 @@ static startup_info_t *create_startup_info( LPCWSTR filename, LPCWSTR cmdline, - cur_params = NtCurrentTeb()->Peb->ProcessParameters; - - newdir.Buffer = NULL; -- if (cur_dir) -+ if (cur_dir && RtlDosPathNameToNtPathName_U( cur_dir, &newdir, NULL, NULL )) - { -- if (RtlDosPathNameToNtPathName_U( cur_dir, &newdir, NULL, NULL )) -- cur_dir = newdir.Buffer + 4; /* skip \??\ prefix */ -- else -- cur_dir = NULL; -+ cur_dir = newdir.Buffer + 4; /* skip \??\ prefix */ -+ cur_dir_length = newdir.Length - 4 * sizeof(WCHAR); - } -- if (!cur_dir) -+ else if (NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ - { -- if (NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ -- cur_dir = ((WIN16_SUBSYSTEM_TIB *)NtCurrentTeb()->Tib.SubSystemTib)->curdir.DosPath.Buffer; -- else -- cur_dir = cur_params->CurrentDirectory.DosPath.Buffer; -+ const UNICODE_STRING *dir = &((WIN16_SUBSYSTEM_TIB *)NtCurrentTeb()->Tib.SubSystemTib)->curdir.DosPath; -+ cur_dir = dir->Buffer; -+ cur_dir_length = dir->Length; -+ } -+ else -+ { -+ const UNICODE_STRING *dir = &cur_params->CurrentDirectory.DosPath; -+ cur_dir = dir->Buffer; -+ cur_dir_length = dir->Length; - } - title = startup->lpTitle ? startup->lpTitle : imagepath; - - size = sizeof(*info); -- size += strlenW( cur_dir ) * sizeof(WCHAR); -+ size += cur_dir_length; - size += cur_params->DllPath.Length; - size += strlenW( imagepath ) * sizeof(WCHAR); - size += strlenW( cmdline ) * sizeof(WCHAR); -@@ -1717,7 +1720,9 @@ static startup_info_t *create_startup_info( LPCWSTR filename, LPCWSTR cmdline, - info->show = startup->wShowWindow; - - ptr = info + 1; -- info->curdir_len = append_string( &ptr, cur_dir ); -+ info->curdir_len = cur_dir_length; -+ memcpy( ptr, cur_dir, cur_dir_length ); -+ ptr = (char *)ptr + cur_dir_length; - info->dllpath_len = cur_params->DllPath.Length; - memcpy( ptr, cur_params->DllPath.Buffer, cur_params->DllPath.Length ); - ptr = (char *)ptr + cur_params->DllPath.Length; --- -2.5.0 - diff --git a/patches/kernel32-Cwd_Startup_Info/definition b/patches/kernel32-Cwd_Startup_Info/definition deleted file mode 100644 index 948dd054..00000000 --- a/patches/kernel32-Cwd_Startup_Info/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: Allow non-nullterminated string as working directory in kernel32.create_startup_info diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index b67bdf11..bc996d9e 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "9f0534301321c9192c9e3a705b2bae84a2081745" + echo "b0c5a77e26c51f60b7d5e4df557f969a044b7fd4" } # Show version information @@ -158,7 +158,6 @@ patch_enable_all () enable_iphlpapi_System_Ping="$1" enable_iphlpapi_TCP_Table="$1" enable_kernel32_CopyFileEx="$1" - enable_kernel32_Cwd_Startup_Info="$1" enable_kernel32_Debugger="$1" enable_kernel32_FindFirstFile="$1" enable_kernel32_GetShortPathName="$1" @@ -639,9 +638,6 @@ patch_enable () kernel32-CopyFileEx) enable_kernel32_CopyFileEx="$2" ;; - kernel32-Cwd_Startup_Info) - enable_kernel32_Cwd_Startup_Info="$2" - ;; kernel32-Debugger) enable_kernel32_Debugger="$2" ;; @@ -3891,18 +3887,6 @@ if test "$enable_kernel32_CopyFileEx" -eq 1; then ) >> "$patchlist" fi -# Patchset kernel32-Cwd_Startup_Info -# | -# | Modified files: -# | * dlls/kernel32/process.c -# | -if test "$enable_kernel32_Cwd_Startup_Info" -eq 1; then - patch_apply kernel32-Cwd_Startup_Info/0001-kernel32-Allow-non-nullterminated-string-as-working-.patch - ( - printf '%s\n' '+ { "Sebastian Lackner", "kernel32: Allow non-nullterminated string as working directory in create_startup_info.", 1 },'; - ) >> "$patchlist" -fi - # Patchset kernel32-Debugger # | # | Modified files: diff --git a/patches/winex11-Vulkan_support/0001-winex11-Specify-a-default-vulkan-driver-if-one-not-f.patch b/patches/winex11-Vulkan_support/0001-winex11-Specify-a-default-vulkan-driver-if-one-not-f.patch index 00a9bf37..b28c6ea7 100644 --- a/patches/winex11-Vulkan_support/0001-winex11-Specify-a-default-vulkan-driver-if-one-not-f.patch +++ b/patches/winex11-Vulkan_support/0001-winex11-Specify-a-default-vulkan-driver-if-one-not-f.patch @@ -1,4 +1,4 @@ -From ad754e544f3f9238fc93d9003b4d96f7924d0fca Mon Sep 17 00:00:00 2001 +From a6eeb7e5bf294f4ea0f9abf021f5176a4503b979 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 1 Jun 2018 14:03:26 +1000 Subject: [PATCH] winex11: Specify a default vulkan driver if one not found at @@ -7,24 +7,28 @@ Subject: [PATCH] winex11: Specify a default vulkan driver if one not found at We cannot specify it as a dependency since Debian Jessie has the vulkan library in backports and not everybody will have this mapped. --- - dlls/winex11.drv/vulkan.c | 29 +++++++++++++---------------- - 1 file changed, 13 insertions(+), 16 deletions(-) + dlls/winex11.drv/vulkan.c | 31 ++++++++++++++----------------- + 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c -index 063281d..9f51270 100644 +index 28ae1a9..9f51270 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c -@@ -43,7 +43,9 @@ +@@ -41,10 +41,12 @@ + #include "wine/vulkan_driver.h" + WINE_DEFAULT_DEBUG_CHANNEL(vulkan); +- +-#ifdef SONAME_LIBVULKAN WINE_DECLARE_DEBUG_CHANNEL(fps); --#ifdef SONAME_LIBVULKAN +#ifndef SONAME_LIBVULKAN +#define SONAME_LIBVULKAN "" +#endif - ++ static CRITICAL_SECTION context_section; static CRITICAL_SECTION_DEBUG critsect_debug = + { @@ -105,9 +107,17 @@ static void *vulkan_handle; static BOOL WINAPI wine_vk_init(INIT_ONCE *once, void *param, void **context)