diff --git a/patches/advapi32-Token_Integrity_Level/0009-kernel32-Implement-CreateProcessInternalW.patch b/patches/advapi32-Token_Integrity_Level/0009-kernel32-Implement-CreateProcessInternalW.patch index 00cd0d1a..a21d8bf1 100644 --- a/patches/advapi32-Token_Integrity_Level/0009-kernel32-Implement-CreateProcessInternalW.patch +++ b/patches/advapi32-Token_Integrity_Level/0009-kernel32-Implement-CreateProcessInternalW.patch @@ -1,4 +1,4 @@ -From 796879e9a1840f7b893933d37821751cf1d35048 Mon Sep 17 00:00:00 2001 +From a7af0ee96959aab299e543e9d6938e2533780c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 5 Aug 2017 04:02:16 +0200 Subject: [PATCH] kernel32: Implement CreateProcessInternalW. @@ -11,7 +11,7 @@ Subject: [PATCH] kernel32: Implement CreateProcessInternalW. 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec -index 60809f4..59915f9 100644 +index e78c1ca..fde5f18 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -315,7 +315,7 @@ @@ -24,10 +24,10 @@ index 60809f4..59915f9 100644 @ stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr) @ stdcall CreateRemoteThread(long ptr long ptr long long ptr) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c -index e7f9fd9..d37003c 100644 +index 2075dfd..f9606be 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c -@@ -2432,12 +2432,13 @@ static LPWSTR get_file_name( LPCWSTR appname, LPWSTR cmdline, LPWSTR buffer, +@@ -2436,12 +2436,13 @@ static LPWSTR get_file_name( LPCWSTR appname, LPWSTR cmdline, LPWSTR buffer, return ret; } @@ -47,7 +47,7 @@ index e7f9fd9..d37003c 100644 { BOOL retv = FALSE; HANDLE hFile = 0; -@@ -2450,6 +2451,9 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A +@@ -2454,6 +2455,9 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A TRACE("app %s cmdline %s\n", debugstr_w(app_name), debugstr_w(cmd_line) ); @@ -57,7 +57,7 @@ index e7f9fd9..d37003c 100644 if (!(tidy_cmdline = get_file_name( app_name, cmd_line, name, sizeof(name)/sizeof(WCHAR), &hFile, &binary_info ))) return FALSE; -@@ -2601,8 +2605,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA( LPCSTR app_name, LPSTR cmd_line, L +@@ -2605,8 +2609,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA( LPCSTR app_name, LPSTR cmd_line, L FIXME("StartupInfo.lpReserved is used, please report (%s)\n", debugstr_a(startup_info->lpReserved)); @@ -68,7 +68,7 @@ index e7f9fd9..d37003c 100644 done: HeapFree( GetProcessHeap(), 0, app_nameW ); HeapFree( GetProcessHeap(), 0, cmd_lineW ); -@@ -2621,8 +2625,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW( LPCWSTR app_name, LPWSTR cmd_line, +@@ -2625,8 +2629,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW( LPCWSTR app_name, LPWSTR cmd_line, LPVOID env, LPCWSTR cur_dir, LPSTARTUPINFOW startup_info, LPPROCESS_INFORMATION info ) { @@ -80,7 +80,7 @@ index e7f9fd9..d37003c 100644 diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec -index 1a6f1ff..8d2b722 100644 +index 8cac67f..e8fd7aa 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -209,7 +209,7 @@ @@ -93,7 +93,7 @@ index 1a6f1ff..8d2b722 100644 @ stdcall CreateRemoteThread(long ptr long ptr long long ptr) kernel32.CreateRemoteThread @ stdcall CreateRemoteThreadEx(long ptr long ptr ptr long ptr ptr) kernel32.CreateRemoteThreadEx diff --git a/include/winbase.h b/include/winbase.h -index 8d65d78..35a2213 100644 +index 4ddc1d3..e21cf6e 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1856,6 +1856,7 @@ WINBASEAPI BOOL WINAPI CreateProcessW(LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTE 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 7e5ce1c7..8c42536f 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,7 +1,8 @@ -From 2993a76ec1711bb3ea1e889289f8d129f17ae2a3 Mon Sep 17 00:00:00 2001 +From 23181e8cbe07ac0fd3b6effd04624122a6b0024f 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: server: Implement support for creating processes using a token. +Subject: [PATCH] server: Implement support for creating processes using a + token. --- dlls/kernel32/process.c | 33 ++++++++++++++++++--------------- @@ -14,10 +15,10 @@ Subject: server: Implement support for creating processes using a token. 7 files changed, 59 insertions(+), 21 deletions(-) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c -index c3dcd1349b3..69a026d5441 100644 +index f9606be..c0b89f9 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c -@@ -2051,7 +2051,7 @@ static NTSTATUS create_struct_sd(PSECURITY_DESCRIPTOR nt_sd, struct security_des +@@ -2034,7 +2034,7 @@ static NTSTATUS create_struct_sd(PSECURITY_DESCRIPTOR nt_sd, struct security_des * Create a new process. If hFile is a valid handle we have an exe * file, otherwise it is a Winelib app. */ @@ -26,7 +27,7 @@ index c3dcd1349b3..69a026d5441 100644 LPCWSTR cur_dir, LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa, BOOL inherit, DWORD flags, LPSTARTUPINFOW startup, LPPROCESS_INFORMATION info, LPCSTR unixdir, -@@ -2197,6 +2197,7 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW +@@ -2180,6 +2180,7 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW req->info_size = startup_info_size; req->env_size = (env_end - env) * sizeof(WCHAR); req->process_sd_size = process_sd_size; @@ -34,7 +35,7 @@ index c3dcd1349b3..69a026d5441 100644 wine_server_add_data( req, startup_info, startup_info_size ); wine_server_add_data( req, env, (env_end - env) * sizeof(WCHAR) ); -@@ -2297,7 +2298,7 @@ error: +@@ -2280,7 +2281,7 @@ error: * * Create a new VDM process for a 16-bit or DOS application. */ @@ -43,7 +44,7 @@ index c3dcd1349b3..69a026d5441 100644 LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa, BOOL inherit, DWORD flags, LPSTARTUPINFOW startup, LPPROCESS_INFORMATION info, LPCSTR unixdir, -@@ -2321,7 +2322,7 @@ static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, L +@@ -2304,7 +2305,7 @@ static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, L return FALSE; } sprintfW(new_cmd_line, argsW, winevdmW, buffer, cmd_line); @@ -52,7 +53,7 @@ index c3dcd1349b3..69a026d5441 100644 flags, startup, info, unixdir, binary_info, exec_only ); HeapFree( GetProcessHeap(), 0, new_cmd_line ); return ret; -@@ -2333,7 +2334,7 @@ static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, L +@@ -2316,7 +2317,7 @@ static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, L * * Create a new cmd shell process for a .BAT file. */ @@ -61,10 +62,10 @@ index c3dcd1349b3..69a026d5441 100644 LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa, BOOL inherit, DWORD flags, LPSTARTUPINFOW startup, LPPROCESS_INFORMATION info ) -@@ -2358,8 +2359,8 @@ static BOOL create_cmd_process( LPCWSTR filename, LPWSTR cmd_line, LPVOID env, L - strcpyW( newcmdline, comspec ); - strcatW( newcmdline, slashcW ); +@@ -2344,8 +2345,8 @@ static BOOL create_cmd_process( LPCWSTR filename, LPWSTR cmd_line, LPVOID env, L + strcatW( newcmdline, quotW ); strcatW( newcmdline, cmd_line ); + strcatW( newcmdline, quotW ); - ret = CreateProcessW( comspec, newcmdline, psa, tsa, inherit, - flags, env, cur_dir, startup, info ); + ret = CreateProcessInternalW( token, comspec, newcmdline, psa, tsa, inherit, @@ -72,7 +73,7 @@ index c3dcd1349b3..69a026d5441 100644 HeapFree( GetProcessHeap(), 0, newcmdline ); return ret; } -@@ -2469,7 +2470,9 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l +@@ -2455,7 +2456,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) ); @@ -83,7 +84,7 @@ index c3dcd1349b3..69a026d5441 100644 if (new_token) FIXME("No support for returning created process token\n"); if (!(tidy_cmdline = get_file_name( app_name, cmd_line, name, sizeof(name)/sizeof(WCHAR), -@@ -2527,20 +2530,20 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l +@@ -2513,20 +2516,20 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l debugstr_w(name), (binary_info.flags & BINARY_FLAG_64BIT) ? 64 : 32, wine_dbgstr_longlong(binary_info.res_start), wine_dbgstr_longlong(binary_info.res_end), binary_info.arch, (binary_info.flags & BINARY_FLAG_FAKEDLL) ? ", fakedll" : "" ); @@ -107,7 +108,7 @@ index c3dcd1349b3..69a026d5441 100644 inherit, flags, startup_info, info, unixdir, &binary_info, FALSE ); break; case BINARY_UNKNOWN: -@@ -2552,7 +2555,7 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l +@@ -2538,7 +2541,7 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l TRACE( "starting %s as DOS binary\n", debugstr_w(name) ); binary_info.type = BINARY_DOS; binary_info.arch = IMAGE_FILE_MACHINE_I386; @@ -116,7 +117,7 @@ index c3dcd1349b3..69a026d5441 100644 inherit, flags, startup_info, info, unixdir, &binary_info, FALSE ); break; -@@ -2560,7 +2563,7 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l +@@ -2546,7 +2549,7 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l if (!strcmpiW( p, batW ) || !strcmpiW( p, cmdW ) ) { TRACE( "starting %s as batch binary\n", debugstr_w(name) ); @@ -125,7 +126,7 @@ index c3dcd1349b3..69a026d5441 100644 inherit, flags, startup_info, info ); break; } -@@ -2680,12 +2683,12 @@ static void exec_process( LPCWSTR name ) +@@ -2666,12 +2669,12 @@ static void exec_process( LPCWSTR name ) debugstr_w(name), (binary_info.flags & BINARY_FLAG_64BIT) ? 64 : 32, wine_dbgstr_longlong(binary_info.res_start), wine_dbgstr_longlong(binary_info.res_end), binary_info.arch ); @@ -140,7 +141,7 @@ index c3dcd1349b3..69a026d5441 100644 FALSE, 0, &startup_info, &info, NULL, &binary_info, TRUE ); break; case BINARY_UNKNOWN: -@@ -2699,7 +2702,7 @@ static void exec_process( LPCWSTR name ) +@@ -2685,7 +2688,7 @@ static void exec_process( LPCWSTR name ) case BINARY_WIN16: case BINARY_DOS: TRACE( "starting %s as Win16/DOS binary\n", debugstr_w(name) ); @@ -150,7 +151,7 @@ index c3dcd1349b3..69a026d5441 100644 break; default: diff --git a/server/process.c b/server/process.c -index 81cea2f1baa..7d2206f2744 100644 +index 81cea2f..7d2206f 100644 --- a/server/process.c +++ b/server/process.c @@ -496,7 +496,7 @@ static void start_sigkill_timer( struct process *process ) @@ -234,7 +235,7 @@ index 81cea2f1baa..7d2206f2744 100644 } diff --git a/server/process.h b/server/process.h -index 78e88ec350a..313c36ab241 100644 +index 78e88ec..313c36a 100644 --- a/server/process.h +++ b/server/process.h @@ -114,7 +114,7 @@ struct process_snapshot @@ -247,10 +248,10 @@ index 78e88ec350a..313c36ab241 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 1ea129fec08..95513fef6c3 100644 +index 5fb6e38..f0bc83b 100644 --- a/server/protocol.def +++ b/server/protocol.def -@@ -739,6 +739,7 @@ struct rawinput_device +@@ -748,6 +748,7 @@ struct rawinput_device data_size_t info_size; /* size of startup info */ data_size_t env_size; /* size of the environment */ data_size_t process_sd_size;/* size of the process security descriptor */ @@ -259,7 +260,7 @@ index 1ea129fec08..95513fef6c3 100644 VARARG(env,unicode_str,env_size); /* environment for new process */ VARARG(process_sd,security_descriptor,process_sd_size); /* security descriptor to set on the process */ diff --git a/server/request.c b/server/request.c -index 6120bc550ff..a648c306496 100644 +index 6120bc5..a648c30 100644 --- a/server/request.c +++ b/server/request.c @@ -570,7 +570,7 @@ static void master_socket_poll_event( struct fd *fd, int event ) @@ -272,7 +273,7 @@ index 6120bc550ff..a648c306496 100644 } diff --git a/server/security.h b/server/security.h -index 21e90ccf23f..32dfe5f8db9 100644 +index 21e90cc..32dfe5f 100644 --- a/server/security.h +++ b/server/security.h @@ -67,6 +67,8 @@ extern const ACL *token_get_default_dacl( struct token *token ); @@ -285,10 +286,10 @@ index 21e90ccf23f..32dfe5f8db9 100644 static inline const ACE_HEADER *ace_next( const ACE_HEADER *ace ) { diff --git a/server/token.c b/server/token.c -index 49e84362a83..f6b6165d7a9 100644 +index de1d624..2804247 100644 --- a/server/token.c +++ b/server/token.c -@@ -843,6 +843,12 @@ int token_assign_label( struct token *token, PSID label ) +@@ -836,6 +836,12 @@ int token_assign_label( struct token *token, PSID label ) return ret; } @@ -301,7 +302,7 @@ index 49e84362a83..f6b6165d7a9 100644 struct token *token_create_admin( void ) { struct token *token = NULL; -@@ -1269,6 +1275,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; } @@ -314,5 +315,5 @@ index 49e84362a83..f6b6165d7a9 100644 { GENERIC_MAPPING mapping; -- -2.14.2 +1.9.1 diff --git a/patches/kernel32-COMSPEC/0001-kernel32-Fallback-to-default-comspec-when-COMSPEC-is.patch b/patches/kernel32-COMSPEC/0001-kernel32-Fallback-to-default-comspec-when-COMSPEC-is.patch index 87749d88..89461a8e 100644 --- a/patches/kernel32-COMSPEC/0001-kernel32-Fallback-to-default-comspec-when-COMSPEC-is.patch +++ b/patches/kernel32-COMSPEC/0001-kernel32-Fallback-to-default-comspec-when-COMSPEC-is.patch @@ -1,7 +1,8 @@ -From be12a69b9edfbbb091450a42a4408bc5579d1d27 Mon Sep 17 00:00:00 2001 +From af37cc621e7a0c460240cc01049a10531f685e38 Mon Sep 17 00:00:00 2001 From: Qian Hong Date: Sun, 26 Jul 2015 17:55:01 +0800 -Subject: kernel32: Fallback to default comspec when %COMSPEC% is not set. +Subject: [PATCH] kernel32: Fallback to default comspec when %COMSPEC% is not + set. --- dlls/kernel32/process.c | 6 +++++- @@ -9,17 +10,18 @@ Subject: kernel32: Fallback to default comspec when %COMSPEC% is not set. 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c -index b0c06e3..caa005c 100644 +index 91d242e..2075dfd 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c -@@ -2174,13 +2174,17 @@ static BOOL create_cmd_process( LPCWSTR filename, LPWSTR cmd_line, LPVOID env, L +@@ -2323,6 +2323,7 @@ static BOOL create_cmd_process( LPCWSTR filename, LPWSTR cmd_line, LPVOID env, L { static const WCHAR comspecW[] = {'C','O','M','S','P','E','C',0}; + static const WCHAR cmdW[] = {'\\','c','m','d','.','e','x','e',0}; - static const WCHAR slashcW[] = {' ','/','c',' ',0}; + static const WCHAR slashscW[] = {' ','/','s','/','c',' ',0}; + static const WCHAR quotW[] = {'"',0}; WCHAR comspec[MAX_PATH]; - WCHAR *newcmdline; +@@ -2330,7 +2331,10 @@ static BOOL create_cmd_process( LPCWSTR filename, LPWSTR cmd_line, LPVOID env, L BOOL ret; if (!GetEnvironmentVariableW( comspecW, comspec, sizeof(comspec)/sizeof(WCHAR) )) @@ -29,13 +31,13 @@ index b0c06e3..caa005c 100644 + strcatW( comspec, cmdW ); + } if (!(newcmdline = HeapAlloc( GetProcessHeap(), 0, - (strlenW(comspec) + 4 + strlenW(cmd_line) + 1) * sizeof(WCHAR)))) + (strlenW(comspec) + 7 + strlenW(cmd_line) + 2) * sizeof(WCHAR)))) return FALSE; diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c -index 7666329..b0ec82f 100644 +index 827ddd2..9feac1a 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c -@@ -2340,10 +2340,20 @@ int wmain (int argc, WCHAR *argvW[]) +@@ -2343,10 +2343,20 @@ int wmain (int argc, WCHAR *argvW[]) static const WCHAR offW[] = {'O','F','F','\0'}; static const WCHAR promptW[] = {'P','R','O','M','P','T','\0'}; static const WCHAR defaultpromptW[] = {'$','P','$','G','\0'}; @@ -57,5 +59,5 @@ index 7666329..b0ec82f 100644 /* Get the windows version being emulated */ -- -2.5.0 +1.9.1 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 1057a6af..01efa0d5 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "7f955f22d317cad1e7d5323179e9a0ee635c9768" + echo "8f46ac233ed96f7286f6aacd1f8fb2626d3ed1c2" } # Show version information