winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2023
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
910 discussions
Start a n
N
ew thread
Carlos Rodriguez : wined3d: Add GPU information for another Intel UHD 630 GPU.
by Alexandre Julliard
29 Mar '23
29 Mar '23
Module: wine Branch: master Commit: 318b0bbed60a769fe74ffc0bc7c206543f3a612c URL:
https://gitlab.winehq.org/wine/wine/-/commit/318b0bbed60a769fe74ffc0bc7c206…
Author: Carlos Rodriguez <mrdeathjr28(a)yahoo.es> Date: Wed Mar 8 14:45:08 2023 +0000 wined3d: Add GPU information for another Intel UHD 630 GPU. --- dlls/wined3d/directx.c | 3 ++- dlls/wined3d/wined3d_private.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 5dc0e227fd2..8f719cd605e 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -626,7 +626,8 @@ static const struct wined3d_gpu_description gpu_description_table[] = {HW_VENDOR_INTEL, CARD_INTEL_HD620, "Intel(R) HD Graphics 620", DRIVER_INTEL_HD4000, 3072}, {HW_VENDOR_INTEL, CARD_INTEL_HD630_1, "Intel(R) HD Graphics 630", DRIVER_INTEL_HD4000, 3072}, {HW_VENDOR_INTEL, CARD_INTEL_HD630_2, "Intel(R) HD Graphics 630", DRIVER_INTEL_HD4000, 3072}, - {HW_VENDOR_INTEL, CARD_INTEL_UHD630, "Intel(R) UHD Graphics 630", DRIVER_INTEL_HD4000, 3072}, + {HW_VENDOR_INTEL, CARD_INTEL_UHD630_1, "Intel(R) UHD Graphics 630", DRIVER_INTEL_HD4000, 3072}, + {HW_VENDOR_INTEL, CARD_INTEL_UHD630_2, "Intel(R) UHD Graphics 630", DRIVER_INTEL_HD4000, 3072}, }; static const struct driver_version_information *get_driver_version_info(enum wined3d_display_driver driver, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 2d420a60369..f808852ffef 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3314,7 +3314,8 @@ enum wined3d_pci_device CARD_INTEL_HD620 = 0x5916, CARD_INTEL_HD630_1 = 0x5912, CARD_INTEL_HD630_2 = 0x591b, - CARD_INTEL_UHD630 = 0x3e9b, + CARD_INTEL_UHD630_1 = 0x3e9b, + CARD_INTEL_UHD630_2 = 0x3e91, }; struct wined3d_fbo_ops
1
0
0
0
Zebediah Figura : d3d11/tests: Add a broken() case for WARP in test_occlusion_query().
by Alexandre Julliard
29 Mar '23
29 Mar '23
Module: wine Branch: master Commit: bb351c7a785bd1e68b9aa8d64331adad86162767 URL:
https://gitlab.winehq.org/wine/wine/-/commit/bb351c7a785bd1e68b9aa8d64331ad…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Mar 22 13:27:40 2023 -0500 d3d11/tests: Add a broken() case for WARP in test_occlusion_query(). Wine-Bug:
https://bugs.winehq.org//show_bug.cgi?id=53252
--- dlls/d3d11/tests/d3d11.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 9bb585f8c13..f6623614583 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6011,7 +6011,10 @@ static void test_occlusion_query(void) ID3D11DeviceContext_End(context, query); get_query_data(context, query, &data, sizeof(data)); - ok(data.uint == 640 * 480, "Got unexpected query result 0x%08lx%08lx.\n", data.dword[1], data.dword[0]); + /* WARP devices randomly return zero as if the draw did not happen, much + * like in test_pipeline_statistics_query(). */ + ok(data.uint == 640 * 480 || broken(is_warp_device(device) && !data.uint), + "Got unexpected query result 0x%08lx%08lx.\n", data.dword[1], data.dword[0]); memset(&data, 0xff, sizeof(data)); hr = ID3D11DeviceContext_GetData(context, query, &data, sizeof(DWORD), 0);
1
0
0
0
Zebediah Figura : d3d10core/tests: Add a broken() case for WARP in test_occlusion_query().
by Alexandre Julliard
29 Mar '23
29 Mar '23
Module: wine Branch: master Commit: 2763e5b70ffad52cd8ec8a227890a009ea8fc51d URL:
https://gitlab.winehq.org/wine/wine/-/commit/2763e5b70ffad52cd8ec8a227890a0…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Mar 22 13:27:34 2023 -0500 d3d10core/tests: Add a broken() case for WARP in test_occlusion_query(). Wine-Bug:
https://bugs.winehq.org//show_bug.cgi?id=53252
--- dlls/d3d10core/tests/d3d10core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index 38a67eac5f9..bb68c5f2989 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -4683,7 +4683,10 @@ static void test_occlusion_query(void) ID3D10Asynchronous_End(query); get_query_data(query, &data, sizeof(data)); - ok(data.uint == 640 * 480, "Got unexpected query result 0x%08x%08x.\n", data.dword[1], data.dword[0]); + /* WARP devices randomly return zero as if the draw did not happen, much + * like in test_pipeline_statistics_query(). */ + ok(data.uint == 640 * 480 || broken(is_warp_device(device) && !data.uint), + "Got unexpected query result 0x%08x%08x.\n", data.dword[1], data.dword[0]); memset(&data, 0xff, sizeof(data)); hr = ID3D10Asynchronous_GetData(query, &data, sizeof(DWORD), 0);
1
0
0
0
Sven Baars : wine.inf: Put the Clients key in the right place.
by Alexandre Julliard
29 Mar '23
29 Mar '23
Module: wine Branch: master Commit: cabd68728d33817c966bdbf6acfed3b6daff2140 URL:
https://gitlab.winehq.org/wine/wine/-/commit/cabd68728d33817c966bdbf6acfed3…
Author: Sven Baars <sbaars(a)codeweavers.com> Date: Mon Oct 17 16:20:29 2022 +0200 wine.inf: Put the Clients key in the right place. --- loader/wine.inf.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 9aaf2124ee3..38103d12876 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -554,11 +554,11 @@ HKLM,%MciExtStr%,"wvx",,"MPEGVideo" [Misc] HKLM,Software\Borland\Database Engine\Settings\SYSTEM\INIT,SHAREDMEMLOCATION,,9000 +HKLM,Software\Clients,,16 HKLM,Software\Clients\Mail,,2,"Native Mail Client" HKLM,Software\Clients\Mail\Native Mail Client,,2,"Native Mail Client" HKLM,Software\Clients\Mail\Native Mail Client,"DLLPath",2,"%11%\winemapi.dll" HKLM,Software\Microsoft\Advanced INF Setup,,16 -HKLM,Software\Microsoft\Clients,,16 HKLM,Software\Microsoft\Cryptography\Calais\Current,,16 HKLM,Software\Microsoft\Cryptography\Calais\Readers,,16 HKLM,Software\Microsoft\Cryptography\Services,,16 @@ -2531,7 +2531,7 @@ HKLM,Software\Classes\Wow6432Node\Interface,,16 HKLM,Software\Classes\Wow6432Node\Media Type,,16 HKLM,Software\Classes\Wow6432Node\MediaFoundation,,16 ; symlinks for shared keys under HKLM\Software -HKLM,Software\Wow6432Node\Microsoft\Clients,"SymbolicLinkValue",0x60000,"\Registry\Machine\Software\Microsoft\Clients" +HKLM,Software\Wow6432Node\Clients,"SymbolicLinkValue",0x60000,"\Registry\Machine\Software\Clients" HKLM,Software\Wow6432Node\Microsoft\Cryptography\Calais\Current,"SymbolicLinkValue",0x60000,"\Registry\Machine\Software\Microsoft\Cryptography\Calais\Current" HKLM,Software\Wow6432Node\Microsoft\Cryptography\Calais\Readers,"SymbolicLinkValue",0x60000,"\Registry\Machine\Software\Microsoft\Cryptography\Calais\Readers" HKLM,Software\Wow6432Node\Microsoft\Cryptography\Services,"SymbolicLinkValue",0x60000,"\Registry\Machine\Software\Microsoft\Cryptography\Services"
1
0
0
0
Sven Baars : kernelbase: Remove special Wow64 handling for HKEY_CLASSES_ROOT.
by Alexandre Julliard
29 Mar '23
29 Mar '23
Module: wine Branch: master Commit: 24208208e32e5b73e96d5d6c8ba817c75900d9e9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/24208208e32e5b73e96d5d6c8ba817…
Author: Sven Baars <sbaars(a)codeweavers.com> Date: Fri Sep 23 16:09:13 2022 +0200 kernelbase: Remove special Wow64 handling for HKEY_CLASSES_ROOT. The server always returns the same key now. --- dlls/kernelbase/registry.c | 59 +++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 32 deletions(-)
1
0
0
0
Paul Gofman : taskkill: Support terminating child processes.
by Alexandre Julliard
29 Mar '23
29 Mar '23
Module: wine Branch: master Commit: fb6b1c91bbf412f5eba260ae52ee38176fd693d4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/fb6b1c91bbf412f5eba260ae52ee38…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Mar 28 08:19:45 2023 -0600 taskkill: Support terminating child processes. --- po/ar.po | 13 ++++++++++ po/ast.po | 11 ++++++++ po/bg.po | 11 ++++++++ po/ca.po | 13 ++++++++++ po/cs.po | 13 ++++++++++ po/da.po | 13 ++++++++++ po/de.po | 13 ++++++++++ po/el.po | 11 ++++++++ po/en.po | 14 ++++++++++ po/en_US.po | 14 ++++++++++ po/eo.po | 11 ++++++++ po/es.po | 13 ++++++++++ po/fa.po | 11 ++++++++ po/fi.po | 13 ++++++++++ po/fr.po | 13 ++++++++++ po/he.po | 13 ++++++++++ po/hi.po | 11 ++++++++ po/hr.po | 11 ++++++++ po/hu.po | 13 ++++++++++ po/it.po | 13 ++++++++++ po/ja.po | 13 ++++++++++ po/ko.po | 13 ++++++++++ po/lt.po | 13 ++++++++++ po/ml.po | 11 ++++++++ po/nb_NO.po | 13 ++++++++++ po/nl.po | 13 ++++++++++ po/or.po | 11 ++++++++ po/pa.po | 11 ++++++++ po/pl.po | 13 ++++++++++ po/pt_BR.po | 13 ++++++++++ po/pt_PT.po | 13 ++++++++++ po/rm.po | 11 ++++++++ po/ro.po | 11 ++++++++ po/ru.po | 13 ++++++++++ po/si.po | 11 ++++++++ po/sk.po | 11 ++++++++ po/sl.po | 13 ++++++++++ po/sr_RS(a)cyrillic.po | 11 ++++++++ po/sr_RS(a)latin.po | 11 ++++++++ po/sv.po | 13 ++++++++++ po/ta.po | 11 ++++++++ po/te.po | 11 ++++++++ po/th.po | 11 ++++++++ po/tr.po | 13 ++++++++++ po/uk.po | 13 ++++++++++ po/wa.po | 11 ++++++++ po/wine.pot | 11 ++++++++ po/zh_CN.po | 13 ++++++++++ po/zh_TW.po | 13 ++++++++++ programs/taskkill/taskkill.c | 59 ++++++++++++++++++++++++++++++++++++++----- programs/taskkill/taskkill.h | 2 ++ programs/taskkill/taskkill.rc | 2 ++ 52 files changed, 654 insertions(+), 6 deletions(-)
1
0
0
0
Paul Gofman : taskkill: Mark processes for termination in main().
by Alexandre Julliard
29 Mar '23
29 Mar '23
Module: wine Branch: master Commit: 5c851451892e05c1747108432a5a2bff3a78ed9e URL:
https://gitlab.winehq.org/wine/wine/-/commit/5c851451892e05c1747108432a5a2b…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Mar 28 15:14:17 2023 -0600 taskkill: Mark processes for termination in main(). --- programs/taskkill/taskkill.c | 82 ++++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 30 deletions(-) diff --git a/programs/taskkill/taskkill.c b/programs/taskkill/taskkill.c index b60b5486f87..c32c380f001 100644 --- a/programs/taskkill/taskkill.c +++ b/programs/taskkill/taskkill.c @@ -37,6 +37,7 @@ static struct { PROCESSENTRY32W p; BOOL matched; + BOOL is_numeric; } *process_list; static unsigned int process_count; @@ -151,6 +152,7 @@ static BOOL enumerate_processes(void) do { + process_list[process_count].is_numeric = FALSE; process_list[process_count++].matched = FALSE; if (process_count == alloc_count) { @@ -166,40 +168,42 @@ static BOOL enumerate_processes(void) return TRUE; } -static BOOL get_task_pid(const WCHAR *str, BOOL *is_numeric, WCHAR *process_name, int *status_code, DWORD *pid) +static void mark_task_process(const WCHAR *str, int *status_code) { DWORD self_pid = GetCurrentProcessId(); const WCHAR *p = str; + BOOL is_numeric; unsigned int i; + DWORD pid; - *is_numeric = TRUE; + is_numeric = TRUE; while (*p) { if (!iswdigit(*p++)) { - *is_numeric = FALSE; + is_numeric = FALSE; break; } } - if (*is_numeric) + if (is_numeric) { - *pid = wcstol(str, NULL, 10); + pid = wcstol(str, NULL, 10); for (i = 0; i < process_count; ++i) { - if (process_list[i].p.th32ProcessID == *pid) + if (process_list[i].p.th32ProcessID == pid) break; } if (i == process_count || process_list[i].matched) goto not_found; process_list[i].matched = TRUE; - if (*pid == self_pid) + process_list[i].is_numeric = TRUE; + if (pid == self_pid) { taskkill_message(STRING_SELF_TERMINATION); *status_code = 1; - return FALSE; } - return TRUE; + return; } for (i = 0; i < process_count; ++i) @@ -211,18 +215,27 @@ static BOOL get_task_pid(const WCHAR *str, BOOL *is_numeric, WCHAR *process_name { taskkill_message(STRING_SELF_TERMINATION); *status_code = 1; - return FALSE; } - *pid = process_list[i].p.th32ProcessID; - wcscpy(process_name, process_list[i].p.szExeFile); - return TRUE; + return; } } not_found: taskkill_message_printfW(STRING_SEARCH_FAILED, str); *status_code = 128; - return FALSE; +} + +static void taskkill_message_print_process(int msg, unsigned int index) +{ + WCHAR pid_str[16]; + + if (!process_list[index].is_numeric) + { + taskkill_message_printfW(msg, process_list[index].p.szExeFile); + return; + } + wsprintfW(pid_str, L"%lu", process_list[index].p.th32ProcessID); + taskkill_message_printfW(msg, pid_str); } /* The implemented task enumeration and termination behavior does not @@ -241,28 +254,28 @@ not_found: * system processes. */ static int send_close_messages(void) { - WCHAR process_name[MAX_PATH]; + const WCHAR *process_name; struct pid_close_info info; unsigned int i; int status_code = 0; - BOOL is_numeric; for (i = 0; i < task_count; i++) { - if (!get_task_pid(task_list[i], &is_numeric, process_name, &status_code, &info.pid)) + if (!process_list[i].matched) continue; - + info.pid = process_list[i].p.th32ProcessID; + process_name = process_list[i].p.szExeFile; info.found = FALSE; EnumWindows(pid_enum_proc, (LPARAM)&info); if (info.found) { - if (is_numeric) + if (process_list[i].is_numeric) taskkill_message_printfW(STRING_CLOSE_PID_SEARCH, info.pid); else taskkill_message_printfW(STRING_CLOSE_PROC_SRCH, process_name, info.pid); continue; } - taskkill_message_printfW(STRING_SEARCH_FAILED, task_list[i]); + taskkill_message_print_process(STRING_SEARCH_FAILED, i); status_code = 128; } @@ -271,36 +284,37 @@ static int send_close_messages(void) static int terminate_processes(void) { - WCHAR process_name[MAX_PATH]; + const WCHAR *process_name; unsigned int i; int status_code = 0; - BOOL is_numeric; HANDLE process; DWORD pid; - for (i = 0; i < task_count; i++) + for (i = 0; i < process_count; i++) { - if (!get_task_pid(task_list[i], &is_numeric, process_name, &status_code, &pid)) + if (!process_list[i].matched) continue; + pid = process_list[i].p.th32ProcessID; + process_name = process_list[i].p.szExeFile; process = OpenProcess(PROCESS_TERMINATE, FALSE, pid); if (!process) { - taskkill_message_printfW(STRING_SEARCH_FAILED, task_list[i]); + taskkill_message_print_process(STRING_SEARCH_FAILED, i); status_code = 128; continue; } if (!TerminateProcess(process, 1)) { - taskkill_message_printfW(STRING_TERMINATE_FAILED, task_list[i]); + taskkill_message_print_process(STRING_TERMINATE_FAILED, i); status_code = 1; CloseHandle(process); continue; } - if (is_numeric) + if (process_list[i].is_numeric) taskkill_message_printfW(STRING_TERM_PID_SEARCH, pid); else - taskkill_message_printfW(STRING_TERM_PROC_SEARCH, task_list[i], pid); + taskkill_message_printfW(STRING_TERM_PROC_SEARCH, process_name, pid); CloseHandle(process); } return status_code; @@ -414,6 +428,9 @@ static BOOL process_arguments(int argc, WCHAR *argv[]) int __cdecl wmain(int argc, WCHAR *argv[]) { + int search_status = 0, terminate_status; + unsigned int i; + if (!process_arguments(argc, argv)) return 1; @@ -423,7 +440,12 @@ int __cdecl wmain(int argc, WCHAR *argv[]) return 1; } + for (i = 0; i < task_count; ++i) + mark_task_process(task_list[i], &search_status); + if (force_termination) - return terminate_processes(); - return send_close_messages(); + terminate_status = terminate_processes(); + else + terminate_status = send_close_messages(); + return search_status ? search_status : terminate_status; }
1
0
0
0
Paul Gofman : taskkill: Use toolhelp snapshot to get process information.
by Alexandre Julliard
29 Mar '23
29 Mar '23
Module: wine Branch: master Commit: 6cca1f5099a8354b67578b42dd34fd010e80b6de URL:
https://gitlab.winehq.org/wine/wine/-/commit/6cca1f5099a8354b67578b42dd34fd…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Mar 28 14:32:31 2023 -0600 taskkill: Use toolhelp snapshot to get process information. --- programs/taskkill/taskkill.c | 99 ++++++++++++++++++++------------------------ 1 file changed, 45 insertions(+), 54 deletions(-) diff --git a/programs/taskkill/taskkill.c b/programs/taskkill/taskkill.c index d2e1dd54209..b60b5486f87 100644 --- a/programs/taskkill/taskkill.c +++ b/programs/taskkill/taskkill.c @@ -21,7 +21,7 @@ #include <stdlib.h> #include <windows.h> -#include <psapi.h> +#include <tlhelp32.h> #include <wine/debug.h> #include "taskkill.h" @@ -33,7 +33,13 @@ static BOOL force_termination = FALSE; static WCHAR **task_list; static unsigned int task_count; -static DWORD *pid_list, pid_list_size; +static struct +{ + PROCESSENTRY32W p; + BOOL matched; +} +*process_list; +static unsigned int process_count; struct pid_close_info { @@ -127,61 +133,36 @@ static BOOL CALLBACK pid_enum_proc(HWND hwnd, LPARAM lParam) static BOOL enumerate_processes(void) { - DWORD alloc_bytes = 1024 * sizeof(*pid_list), needed_bytes; + unsigned int alloc_count = 128; + void *realloc_list; + HANDLE snapshot; - pid_list = malloc(alloc_bytes); - if (!pid_list) + snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); + if (snapshot == INVALID_HANDLE_VALUE) return FALSE; - for (;;) - { - DWORD *realloc_list; - - if (!EnumProcesses(pid_list, alloc_bytes, &needed_bytes)) - return FALSE; - - /* EnumProcesses can't signal an insufficient buffer condition, so the - * only way to possibly determine whether a larger buffer is required - * is to see whether the written number of bytes is the same as the - * buffer size. If so, the buffer will be reallocated to twice the - * size. */ - if (alloc_bytes != needed_bytes) - break; - - alloc_bytes *= 2; - realloc_list = realloc(pid_list, alloc_bytes); - if (!realloc_list) - return FALSE; - pid_list = realloc_list; - } - - pid_list_size = needed_bytes / sizeof(*pid_list); - return TRUE; -} - -static BOOL get_process_name_from_pid(DWORD pid, WCHAR *buf, DWORD chars) -{ - HANDLE process; - HMODULE module; - DWORD required_size; - - process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid); - if (!process) + process_list = malloc(alloc_count * sizeof(*process_list)); + if (!process_list) return FALSE; - if (!EnumProcessModules(process, &module, sizeof(module), &required_size)) - { - CloseHandle(process); + process_list[0].p.dwSize = sizeof(process_list[0].p); + if (!Process32FirstW(snapshot, &process_list[0].p)) return FALSE; - } - if (!GetModuleBaseNameW(process, module, buf, chars)) + do { - CloseHandle(process); - return FALSE; - } - - CloseHandle(process); + process_list[process_count++].matched = FALSE; + if (process_count == alloc_count) + { + alloc_count *= 2; + realloc_list = realloc(process_list, alloc_count * sizeof(*process_list)); + if (!realloc_list) + return FALSE; + process_list = realloc_list; + } + process_list[process_count].p.dwSize = sizeof(process_list[process_count].p); + } while (Process32NextW(snapshot, &process_list[process_count].p)); + CloseHandle(snapshot); return TRUE; } @@ -204,6 +185,14 @@ static BOOL get_task_pid(const WCHAR *str, BOOL *is_numeric, WCHAR *process_name if (*is_numeric) { *pid = wcstol(str, NULL, 10); + for (i = 0; i < process_count; ++i) + { + if (process_list[i].p.th32ProcessID == *pid) + break; + } + if (i == process_count || process_list[i].matched) + goto not_found; + process_list[i].matched = TRUE; if (*pid == self_pid) { taskkill_message(STRING_SELF_TERMINATION); @@ -213,22 +202,24 @@ static BOOL get_task_pid(const WCHAR *str, BOOL *is_numeric, WCHAR *process_name return TRUE; } - for (i = 0; i < pid_list_size; ++i) + for (i = 0; i < process_count; ++i) { - if (get_process_name_from_pid(pid_list[i], process_name, MAX_PATH) && - !wcsicmp(process_name, str)) + if (!wcsicmp(process_list[i].p.szExeFile, str) && !process_list[i].matched) { - if (pid_list[i] == self_pid) + process_list[i].matched = TRUE; + if (process_list[i].p.th32ProcessID == self_pid) { taskkill_message(STRING_SELF_TERMINATION); *status_code = 1; return FALSE; } - *pid = pid_list[i]; + *pid = process_list[i].p.th32ProcessID; + wcscpy(process_name, process_list[i].p.szExeFile); return TRUE; } } +not_found: taskkill_message_printfW(STRING_SEARCH_FAILED, str); *status_code = 128; return FALSE;
1
0
0
0
Paul Gofman : taskkill: Factor out get_task_pid().
by Alexandre Julliard
29 Mar '23
29 Mar '23
Module: wine Branch: master Commit: 62ef3c5be1d2c5374399984588a9daa75663d030 URL:
https://gitlab.winehq.org/wine/wine/-/commit/62ef3c5be1d2c5374399984588a9da…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Mar 28 13:21:13 2023 -0600 taskkill: Factor out get_task_pid(). --- programs/taskkill/taskkill.c | 234 +++++++++++++++---------------------------- 1 file changed, 82 insertions(+), 152 deletions(-) diff --git a/programs/taskkill/taskkill.c b/programs/taskkill/taskkill.c index 595bfa659af..d2e1dd54209 100644 --- a/programs/taskkill/taskkill.c +++ b/programs/taskkill/taskkill.c @@ -185,6 +185,55 @@ static BOOL get_process_name_from_pid(DWORD pid, WCHAR *buf, DWORD chars) return TRUE; } +static BOOL get_task_pid(const WCHAR *str, BOOL *is_numeric, WCHAR *process_name, int *status_code, DWORD *pid) +{ + DWORD self_pid = GetCurrentProcessId(); + const WCHAR *p = str; + unsigned int i; + + *is_numeric = TRUE; + while (*p) + { + if (!iswdigit(*p++)) + { + *is_numeric = FALSE; + break; + } + } + + if (*is_numeric) + { + *pid = wcstol(str, NULL, 10); + if (*pid == self_pid) + { + taskkill_message(STRING_SELF_TERMINATION); + *status_code = 1; + return FALSE; + } + return TRUE; + } + + for (i = 0; i < pid_list_size; ++i) + { + if (get_process_name_from_pid(pid_list[i], process_name, MAX_PATH) && + !wcsicmp(process_name, str)) + { + if (pid_list[i] == self_pid) + { + taskkill_message(STRING_SELF_TERMINATION); + *status_code = 1; + return FALSE; + } + *pid = pid_list[i]; + return TRUE; + } + } + + taskkill_message_printfW(STRING_SEARCH_FAILED, str); + *status_code = 128; + return FALSE; +} + /* The implemented task enumeration and termination behavior does not * exactly match native behavior. On Windows: * @@ -201,79 +250,29 @@ static BOOL get_process_name_from_pid(DWORD pid, WCHAR *buf, DWORD chars) * system processes. */ static int send_close_messages(void) { - DWORD self_pid = GetCurrentProcessId(); + WCHAR process_name[MAX_PATH]; + struct pid_close_info info; unsigned int i; int status_code = 0; + BOOL is_numeric; for (i = 0; i < task_count; i++) { - WCHAR *p = task_list[i]; - BOOL is_numeric = TRUE; - - /* Determine whether the string is not numeric. */ - while (*p) - { - if (!iswdigit(*p++)) - { - is_numeric = FALSE; - break; - } - } + if (!get_task_pid(task_list[i], &is_numeric, process_name, &status_code, &info.pid)) + continue; - if (is_numeric) + info.found = FALSE; + EnumWindows(pid_enum_proc, (LPARAM)&info); + if (info.found) { - DWORD pid = wcstol(task_list[i], NULL, 10); - struct pid_close_info info = { pid }; - - if (pid == self_pid) - { - taskkill_message(STRING_SELF_TERMINATION); - status_code = 1; - continue; - } - - EnumWindows(pid_enum_proc, (LPARAM)&info); - if (info.found) - taskkill_message_printfW(STRING_CLOSE_PID_SEARCH, pid); + if (is_numeric) + taskkill_message_printfW(STRING_CLOSE_PID_SEARCH, info.pid); else - { - taskkill_message_printfW(STRING_SEARCH_FAILED, task_list[i]); - status_code = 128; - } - } - else - { - DWORD index; - BOOL found_process = FALSE; - - for (index = 0; index < pid_list_size; index++) - { - WCHAR process_name[MAX_PATH]; - - if (get_process_name_from_pid(pid_list[index], process_name, MAX_PATH) && - !wcsicmp(process_name, task_list[i])) - { - struct pid_close_info info = { pid_list[index] }; - - found_process = TRUE; - if (pid_list[index] == self_pid) - { - taskkill_message(STRING_SELF_TERMINATION); - status_code = 1; - continue; - } - - EnumWindows(pid_enum_proc, (LPARAM)&info); - taskkill_message_printfW(STRING_CLOSE_PROC_SRCH, process_name, pid_list[index]); - } - } - - if (!found_process) - { - taskkill_message_printfW(STRING_SEARCH_FAILED, task_list[i]); - status_code = 128; - } + taskkill_message_printfW(STRING_CLOSE_PROC_SRCH, process_name, info.pid); + continue; } + taskkill_message_printfW(STRING_SEARCH_FAILED, task_list[i]); + status_code = 128; } return status_code; @@ -281,107 +280,38 @@ static int send_close_messages(void) static int terminate_processes(void) { - DWORD self_pid = GetCurrentProcessId(); + WCHAR process_name[MAX_PATH]; unsigned int i; int status_code = 0; + BOOL is_numeric; + HANDLE process; + DWORD pid; for (i = 0; i < task_count; i++) { - WCHAR *p = task_list[i]; - BOOL is_numeric = TRUE; + if (!get_task_pid(task_list[i], &is_numeric, process_name, &status_code, &pid)) + continue; - /* Determine whether the string is not numeric. */ - while (*p) + process = OpenProcess(PROCESS_TERMINATE, FALSE, pid); + if (!process) { - if (!iswdigit(*p++)) - { - is_numeric = FALSE; - break; - } + taskkill_message_printfW(STRING_SEARCH_FAILED, task_list[i]); + status_code = 128; + continue; } - - if (is_numeric) + if (!TerminateProcess(process, 1)) { - DWORD pid = wcstol(task_list[i], NULL, 10); - HANDLE process; - - if (pid == self_pid) - { - taskkill_message(STRING_SELF_TERMINATION); - status_code = 1; - continue; - } - - process = OpenProcess(PROCESS_TERMINATE, FALSE, pid); - if (!process) - { - taskkill_message_printfW(STRING_SEARCH_FAILED, task_list[i]); - status_code = 128; - continue; - } - - if (!TerminateProcess(process, 1)) - { - taskkill_message_printfW(STRING_TERMINATE_FAILED, task_list[i]); - status_code = 1; - CloseHandle(process); - continue; - } - - taskkill_message_printfW(STRING_TERM_PID_SEARCH, pid); + taskkill_message_printfW(STRING_TERMINATE_FAILED, task_list[i]); + status_code = 1; CloseHandle(process); + continue; } + if (is_numeric) + taskkill_message_printfW(STRING_TERM_PID_SEARCH, pid); else - { - DWORD index; - BOOL found_process = FALSE; - - for (index = 0; index < pid_list_size; index++) - { - WCHAR process_name[MAX_PATH]; - - if (get_process_name_from_pid(pid_list[index], process_name, MAX_PATH) && - !wcsicmp(process_name, task_list[i])) - { - HANDLE process; - - if (pid_list[index] == self_pid) - { - taskkill_message(STRING_SELF_TERMINATION); - status_code = 1; - continue; - } - - process = OpenProcess(PROCESS_TERMINATE, FALSE, pid_list[index]); - if (!process) - { - taskkill_message_printfW(STRING_SEARCH_FAILED, task_list[i]); - status_code = 128; - continue; - } - - if (!TerminateProcess(process, 1)) - { - taskkill_message_printfW(STRING_TERMINATE_FAILED, task_list[i]); - status_code = 1; - CloseHandle(process); - continue; - } - - found_process = TRUE; - taskkill_message_printfW(STRING_TERM_PROC_SEARCH, task_list[i], pid_list[index]); - CloseHandle(process); - } - } - - if (!found_process) - { - taskkill_message_printfW(STRING_SEARCH_FAILED, task_list[i]); - status_code = 128; - } - } + taskkill_message_printfW(STRING_TERM_PROC_SEARCH, task_list[i], pid); + CloseHandle(process); } - return status_code; }
1
0
0
0
Paul Gofman : taskkill: Enumerate processes in main().
by Alexandre Julliard
29 Mar '23
29 Mar '23
Module: wine Branch: master Commit: cf4a0b7392f33ba3e0b3fe69007a6d1f327f13f2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/cf4a0b7392f33ba3e0b3fe69007a6d…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Mar 28 10:09:11 2023 -0600 taskkill: Enumerate processes in main(). --- programs/taskkill/taskkill.c | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/programs/taskkill/taskkill.c b/programs/taskkill/taskkill.c index ad5f8e389f7..595bfa659af 100644 --- a/programs/taskkill/taskkill.c +++ b/programs/taskkill/taskkill.c @@ -33,6 +33,8 @@ static BOOL force_termination = FALSE; static WCHAR **task_list; static unsigned int task_count; +static DWORD *pid_list, pid_list_size; + struct pid_close_info { DWORD pid; @@ -123,20 +125,20 @@ static BOOL CALLBACK pid_enum_proc(HWND hwnd, LPARAM lParam) return TRUE; } -static DWORD *enumerate_processes(DWORD *list_count) +static BOOL enumerate_processes(void) { - DWORD *pid_list, alloc_bytes = 1024 * sizeof(*pid_list), needed_bytes; + DWORD alloc_bytes = 1024 * sizeof(*pid_list), needed_bytes; pid_list = malloc(alloc_bytes); if (!pid_list) - return NULL; + return FALSE; for (;;) { DWORD *realloc_list; if (!EnumProcesses(pid_list, alloc_bytes, &needed_bytes)) - return NULL; + return FALSE; /* EnumProcesses can't signal an insufficient buffer condition, so the * only way to possibly determine whether a larger buffer is required @@ -149,12 +151,12 @@ static DWORD *enumerate_processes(DWORD *list_count) alloc_bytes *= 2; realloc_list = realloc(pid_list, alloc_bytes); if (!realloc_list) - return NULL; + return FALSE; pid_list = realloc_list; } - *list_count = needed_bytes / sizeof(*pid_list); - return pid_list; + pid_list_size = needed_bytes / sizeof(*pid_list); + return TRUE; } static BOOL get_process_name_from_pid(DWORD pid, WCHAR *buf, DWORD chars) @@ -199,18 +201,10 @@ static BOOL get_process_name_from_pid(DWORD pid, WCHAR *buf, DWORD chars) * system processes. */ static int send_close_messages(void) { - DWORD *pid_list, pid_list_size; DWORD self_pid = GetCurrentProcessId(); unsigned int i; int status_code = 0; - pid_list = enumerate_processes(&pid_list_size); - if (!pid_list) - { - taskkill_message(STRING_ENUM_FAILED); - return 1; - } - for (i = 0; i < task_count; i++) { WCHAR *p = task_list[i]; @@ -287,18 +281,10 @@ static int send_close_messages(void) static int terminate_processes(void) { - DWORD *pid_list, pid_list_size; DWORD self_pid = GetCurrentProcessId(); unsigned int i; int status_code = 0; - pid_list = enumerate_processes(&pid_list_size); - if (!pid_list) - { - taskkill_message(STRING_ENUM_FAILED); - return 1; - } - for (i = 0; i < task_count; i++) { WCHAR *p = task_list[i]; @@ -510,6 +496,12 @@ int __cdecl wmain(int argc, WCHAR *argv[]) if (!process_arguments(argc, argv)) return 1; + if (!enumerate_processes()) + { + taskkill_message(STRING_ENUM_FAILED); + return 1; + } + if (force_termination) return terminate_processes(); return send_close_messages();
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
91
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Results per page:
10
25
50
100
200