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
July 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
865 discussions
Start a n
N
ew thread
Sven Baars : ntdll: Test against the correct limit in get_extended_params().
by Alexandre Julliard
11 Jul '23
11 Jul '23
Module: wine Branch: master Commit: 235e3e522e8776791e54541c7cdb2be1482424db URL:
https://gitlab.winehq.org/wine/wine/-/commit/235e3e522e8776791e54541c7cdb2b…
Author: Sven Baars <sbaars(a)codeweavers.com> Date: Tue Jul 11 15:21:08 2023 +0200 ntdll: Test against the correct limit in get_extended_params(). --- dlls/ntdll/unix/virtual.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 21b4e9b4dba..392ac4d9966 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -4353,6 +4353,10 @@ static NTSTATUS get_extended_params( const MEM_EXTENDED_PARAMETER *parameters, U case MemExtendedParameterAddressRequirements: { MEM_ADDRESS_REQUIREMENTS *r = parameters[i].Pointer; + ULONG_PTR limit; + + if (is_wow64()) limit = (ULONG_PTR)get_wow_user_space_limit(); + else limit = (ULONG_PTR)user_space_limit; if (r->Alignment) { @@ -4366,7 +4370,7 @@ static NTSTATUS get_extended_params( const MEM_EXTENDED_PARAMETER *parameters, U if (r->LowestStartingAddress) { *limit_low = (ULONG_PTR)r->LowestStartingAddress; - if (*limit_low >= (ULONG_PTR)user_space_limit || (*limit_low & granularity_mask)) + if (*limit_low >= limit || (*limit_low & granularity_mask)) { WARN( "Invalid limit %p.\n", r->LowestStartingAddress ); return STATUS_INVALID_PARAMETER; @@ -4375,7 +4379,7 @@ static NTSTATUS get_extended_params( const MEM_EXTENDED_PARAMETER *parameters, U if (r->HighestEndingAddress) { *limit_high = (ULONG_PTR)r->HighestEndingAddress; - if (*limit_high > (ULONG_PTR)user_space_limit || + if (*limit_high > limit || *limit_high <= *limit_low || ((*limit_high + 1) & (page_mask - 1))) {
1
0
0
0
Jinoh Kang : riched20: Don't call ME_UpdateRepaint inside set_selection().
by Alexandre Julliard
11 Jul '23
11 Jul '23
Module: wine Branch: master Commit: ac5110131493b8b05795e8825285e41ca40ab6f1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ac5110131493b8b05795e8825285e4…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Sat Jul 1 13:36:17 2023 +0900 riched20: Don't call ME_UpdateRepaint inside set_selection(). This partially reverts c5daf6a30f21 (riched20: Call ME_UpdateRepaint instead of editor_ensure_visible in set_selection.) Fixes: c5daf6a30f21acd20263692b278acba49e014cc1 --- dlls/riched20/editor.c | 3 ++- dlls/riched20/tests/txtsrv.c | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 5cf43f4e29a..201c4435453 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2148,9 +2148,10 @@ int set_selection( ME_TextEditor *editor, int to, int from ) if (!editor->bHideSelection) ME_InvalidateSelection( editor ); end = set_selection_cursors( editor, to, from ); - ME_UpdateRepaint( editor, FALSE ); + editor_ensure_visible( editor, &editor->pCursors[0] ); if (!editor->bHideSelection) ME_InvalidateSelection( editor ); update_caret( editor ); + ME_Repaint( editor ); ME_SendSelChange( editor ); return end; diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c index ec2997cb2df..adb36642f4f 100644 --- a/dlls/riched20/tests/txtsrv.c +++ b/dlls/riched20/tests/txtsrv.c @@ -1303,7 +1303,6 @@ static void test_set_selection_message( void ) ok( hr == S_OK, "got %08lx\n", hr ); CHECK_CALLED(ITextHostImpl_TxViewChange); - todo_wine ok(en_change_sent == 0, "got %d\n", en_change_sent); todo_wine ok(en_selchange_sent == 0, "got %d\n", en_selchange_sent); @@ -1322,7 +1321,6 @@ static void test_set_selection_message( void ) ok( hr == S_OK, "got %08lx\n", hr ); CHECK_CALLED(ITextHostImpl_TxViewChange); - todo_wine ok(en_change_sent == 0, "got %d\n", en_change_sent); ok(en_selchange_sent == 0, "got %d\n", en_selchange_sent); @@ -1353,7 +1351,6 @@ static void test_set_selection_message( void ) ok( hr == S_OK, "got %08lx\n", hr ); CHECK_CALLED(ITextHostImpl_TxViewChange); - todo_wine ok(en_change_sent == 0, "got %d\n", en_change_sent); ok(en_selchange_sent == 1, "got %d\n", en_selchange_sent); @@ -1371,7 +1368,6 @@ static void test_set_selection_message( void ) ok( hr == S_OK, "got %08lx\n", hr ); CHECK_CALLED(ITextHostImpl_TxViewChange); - todo_wine ok(en_change_sent == 0, "got %d\n", en_change_sent); ok(en_selchange_sent == 0, "got %d\n", en_selchange_sent);
1
0
0
0
Jinoh Kang : riched20/tests: Add tests for change notifications caused by EM_SETSEL{,EX}.
by Alexandre Julliard
11 Jul '23
11 Jul '23
Module: wine Branch: master Commit: c35926e49825f7a3d48ba826085fe1ae3d2a7e27 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c35926e49825f7a3d48ba826085fe1…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Sat Jul 1 13:35:03 2023 +0900 riched20/tests: Add tests for change notifications caused by EM_SETSEL{,EX}. --- dlls/riched20/tests/txtsrv.c | 91 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c index 63d622a6755..ec2997cb2df 100644 --- a/dlls/riched20/tests/txtsrv.c +++ b/dlls/riched20/tests/txtsrv.c @@ -424,6 +424,8 @@ static HRESULT __thiscall ITextHostImpl_TxGetPropertyBits(ITextHost *iface, DWOR static int en_vscroll_sent; static int en_update_sent; +static int en_change_sent; +static int en_selchange_sent; static HRESULT __thiscall ITextHostImpl_TxNotify( ITextHost *iface, DWORD code, void *data ) { ITextHostTestImpl *This = impl_from_ITextHost(iface); @@ -438,6 +440,15 @@ static HRESULT __thiscall ITextHostImpl_TxNotify( ITextHost *iface, DWORD code, en_update_sent++; ok( !data, "got %p\n", data ); break; + case EN_CHANGE: + en_change_sent++; + todo_wine + ok( data != NULL, "got %p\n", data ); + break; + case EN_SELCHANGE: + en_selchange_sent++; + ok( data != NULL, "got %p\n", data ); + break; } return S_OK; } @@ -1268,25 +1279,105 @@ static void test_set_selection_message( void ) { ITextServices *txtserv; ITextHost *host; + CHARRANGE range; LRESULT result; HRESULT hr; if (!init_texthost(&txtserv, &host)) return; + ITextServices_TxSetText(txtserv, L""); + + if (winetest_debug > 1) trace("TxSendMessage EM_SETEVENTMASK"); + + hr = ITextServices_TxSendMessage( txtserv, EM_SETEVENTMASK, 0, ENM_CHANGE | ENM_SELCHANGE, &result ); + ok( hr == S_OK, "got %08lx\n", hr ); + + if (winetest_debug > 1) trace("TxSendMessage EM_SETSEL 0 20"); + CLEAR_COUNTER(ITextHostImpl_TxViewChange); + en_change_sent = 0; + en_selchange_sent = 0; + hr = ITextServices_TxSendMessage(txtserv, EM_SETSEL, 0, 20, &result); ok( hr == S_OK, "got %08lx\n", hr ); + CHECK_CALLED(ITextHostImpl_TxViewChange); + todo_wine + ok(en_change_sent == 0, "got %d\n", en_change_sent); + todo_wine + ok(en_selchange_sent == 0, "got %d\n", en_selchange_sent); + + hr = ITextServices_TxSendMessage(txtserv, EM_EXGETSEL, 0, (LPARAM)&range, &result); ok( hr == S_OK, "got %08lx\n", hr ); trace("getsel: %lu, %lu\n", range.cpMin, range.cpMax); + + if (winetest_debug > 1) trace("TxSendMessage EM_SETSELEX 0 20"); + + CLEAR_COUNTER(ITextHostImpl_TxViewChange); + en_change_sent = 0; + en_selchange_sent = 0; + + range.cpMin = 0; + range.cpMax = 20; + hr = ITextServices_TxSendMessage(txtserv, EM_EXSETSEL, 0, (LPARAM)&range, &result); + ok( hr == S_OK, "got %08lx\n", hr ); + + CHECK_CALLED(ITextHostImpl_TxViewChange); + todo_wine + ok(en_change_sent == 0, "got %d\n", en_change_sent); + ok(en_selchange_sent == 0, "got %d\n", en_selchange_sent); + + if (winetest_debug > 1) trace("TxSetText"); CLEAR_COUNTER(ITextHostImpl_TxViewChange); + en_change_sent = 0; + en_selchange_sent = 0; + + hr = ITextServices_TxSendMessage(txtserv, EM_EXGETSEL, 0, (LPARAM)&range, &result); ok( hr == S_OK, "got %08lx\n", hr ); trace("getsel: %lu, %lu\n", range.cpMin, range.cpMax); + ITextServices_TxSetText(txtserv, lorem); + + hr = ITextServices_TxSendMessage(txtserv, EM_EXGETSEL, 0, (LPARAM)&range, &result); ok( hr == S_OK, "got %08lx\n", hr ); trace("getsel: %lu, %lu\n", range.cpMin, range.cpMax); + CHECK_CALLED(ITextHostImpl_TxViewChange); + ok(en_change_sent == 1, "got %d\n", en_change_sent); + todo_wine + ok(en_selchange_sent == 0, "got %d\n", en_selchange_sent); + + if (winetest_debug > 1) trace("TxSendMessage EM_SETSEL 0 20"); CLEAR_COUNTER(ITextHostImpl_TxViewChange); + en_change_sent = 0; + en_selchange_sent = 0; + hr = ITextServices_TxSendMessage(txtserv, EM_SETSEL, 0, 20, &result); ok( hr == S_OK, "got %08lx\n", hr ); + + CHECK_CALLED(ITextHostImpl_TxViewChange); + todo_wine + ok(en_change_sent == 0, "got %d\n", en_change_sent); + ok(en_selchange_sent == 1, "got %d\n", en_selchange_sent); + + hr = ITextServices_TxSendMessage(txtserv, EM_EXGETSEL, 0, (LPARAM)&range, &result); ok( hr == S_OK, "got %08lx\n", hr ); trace("getsel: %lu, %lu\n", range.cpMin, range.cpMax); + + if (winetest_debug > 1) trace("TxSendMessage EM_SETSELEX 0 20"); + + CLEAR_COUNTER(ITextHostImpl_TxViewChange); + en_change_sent = 0; + en_selchange_sent = 0; + + range.cpMin = 0; + range.cpMax = 20; + hr = ITextServices_TxSendMessage(txtserv, EM_EXSETSEL, 0, (LPARAM)&range, &result); + ok( hr == S_OK, "got %08lx\n", hr ); + CHECK_CALLED(ITextHostImpl_TxViewChange); + todo_wine + ok(en_change_sent == 0, "got %d\n", en_change_sent); + ok(en_selchange_sent == 0, "got %d\n", en_selchange_sent); + + hr = ITextServices_TxSendMessage(txtserv, EM_EXGETSEL, 0, (LPARAM)&range, &result); ok( hr == S_OK, "got %08lx\n", hr ); trace("getsel: %lu, %lu\n", range.cpMin, range.cpMax); + + if (winetest_debug > 1) trace("release interfaces"); ITextServices_Release( txtserv ); ITextHost_Release( host );
1
0
0
0
Jinoh Kang : riched20: Wrap marked paragraphs at Text Services initialization.
by Alexandre Julliard
11 Jul '23
11 Jul '23
Module: wine Branch: master Commit: b70eb32c5f3e506181d9e1e9fbef62e9baf3674d URL:
https://gitlab.winehq.org/wine/wine/-/commit/b70eb32c5f3e506181d9e1e9fbef62…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Sat Jul 1 13:22:46 2023 +0900 riched20: Wrap marked paragraphs at Text Services initialization. Today, CreateTextServices() returns an Rich Edit object without row start and end marks, which are expected to exist by many Rich Edit operations as well as EM_* message handlers. This leads to a crash when certain messages (e.g., EM_SCROLLCARET) are sent to the Rich Edit object via ITextServices::TxSendMessage(), unless ME_WrapMarkedParagraphs() has been called beforehand. Fix this by calling wrap_marked_paras_dc() early in the initialization process. This is not a problem for windowed Rich Edit controls, which already calls ME_WrapMarkedParagraphs() before the user or application starts interacting with it. --- dlls/riched20/para.c | 1 + dlls/riched20/tests/txtsrv.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c index 357d6797c8c..6085816f315 100644 --- a/dlls/riched20/para.c +++ b/dlls/riched20/para.c @@ -222,6 +222,7 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor) wine_rb_init( &editor->marked_paras, para_mark_compare ); para_mark_add( editor, para ); ME_DestroyContext(&c); + wrap_marked_paras_dc( editor, hdc, FALSE ); ITextHost_TxReleaseDC( editor->texthost, hdc ); } diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c index 830a95e37c5..63d622a6755 100644 --- a/dlls/riched20/tests/txtsrv.c +++ b/dlls/riched20/tests/txtsrv.c @@ -1292,6 +1292,23 @@ static void test_set_selection_message( void ) ITextHost_Release( host ); } +static void test_scrollcaret( void ) +{ + ITextServices *txtserv; + ITextHost *host; + LRESULT result; + HRESULT hr; + + if (!init_texthost(&txtserv, &host)) + return; + + hr = ITextServices_TxSendMessage(txtserv, EM_SCROLLCARET, 0, 0, &result); + ok( hr == S_OK, "got %08lx\n", hr ); + + ITextServices_Release( txtserv ); + ITextHost_Release( host ); +} + START_TEST( txtsrv ) { ITextServices *txtserv; @@ -1326,6 +1343,7 @@ START_TEST( txtsrv ) test_TxGetScroll(); test_notifications(); test_set_selection_message(); + test_scrollcaret(); } if (wrapperCodeMem) VirtualFree(wrapperCodeMem, 0, MEM_RELEASE); }
1
0
0
0
Alistair Leslie-Hughes : widl: Remove unnecessary null check (Coverity).
by Alexandre Julliard
11 Jul '23
11 Jul '23
Module: wine Branch: master Commit: f1b9150451723a003a18dc64f2d43d95b5cb1fae URL:
https://gitlab.winehq.org/wine/wine/-/commit/f1b9150451723a003a18dc64f2d43d…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Mon Jul 10 13:19:44 2023 +1000 widl: Remove unnecessary null check (Coverity). --- tools/widl/header.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/widl/header.c b/tools/widl/header.c index b7497e215d5..624d38094f9 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -168,7 +168,7 @@ static void write_fields(FILE *h, var_list_t *fields, enum name_type name_type) if (!fields) return; LIST_FOR_EACH_ENTRY( v, fields, var_t, entry ) { - if (!v || !v->declspec.type) continue; + if (!v->declspec.type) continue; switch(type_get_type_detect_alias(v->declspec.type)) { case TYPE_STRUCT: @@ -185,7 +185,7 @@ static void write_fields(FILE *h, var_list_t *fields, enum name_type name_type) LIST_FOR_EACH_ENTRY( v, fields, var_t, entry ) { expr_t *contract = get_attrp(v->attrs, ATTR_CONTRACT); - if (!v || !v->declspec.type) continue; + if (!v->declspec.type) continue; if (contract) write_apicontract_guard_start(h, contract); indent(h, 0);
1
0
0
0
Alexandre Julliard : ntdll: Implement RtlWow64GetSharedInfoProcess().
by Alexandre Julliard
11 Jul '23
11 Jul '23
Module: wine Branch: master Commit: 257221843f6fc8fb0b96ba4a8873e4e9c6588f84 URL:
https://gitlab.winehq.org/wine/wine/-/commit/257221843f6fc8fb0b96ba4a8873e4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jul 11 16:56:50 2023 +0200 ntdll: Implement RtlWow64GetSharedInfoProcess(). --- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/process.c | 15 ++++++++++++ dlls/ntdll/tests/wow64.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ include/winternl.h | 2 ++ 4 files changed, 78 insertions(+) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 2be318b128a..011f0648522 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1104,6 +1104,7 @@ @ stdcall -arch=win64 RtlWow64GetCurrentCpuArea(ptr ptr ptr) @ stdcall RtlWow64GetCurrentMachine() @ stdcall RtlWow64GetProcessMachines(long ptr ptr) +@ stdcall RtlWow64GetSharedInfoProcess(long ptr ptr) @ stdcall -arch=win64 RtlWow64GetThreadContext(long ptr) @ stdcall -arch=win64 RtlWow64GetThreadSelectorEntry(long ptr long ptr) @ stdcall RtlWow64IsWowGuestMachineSupported(long ptr) diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c index 3f78559d8df..09cc86889b9 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c @@ -128,6 +128,21 @@ NTSTATUS WINAPI RtlWow64GetProcessMachines( HANDLE process, USHORT *current_ret, } +/********************************************************************** + * RtlWow64GetSharedInfoProcess (NTDLL.@) + */ +NTSTATUS WINAPI RtlWow64GetSharedInfoProcess( HANDLE process, BOOLEAN *is_wow64, WOW64INFO *info ) +{ + PEB32 *peb32; + NTSTATUS status = NtQueryInformationProcess( process, ProcessWow64Information, + &peb32, sizeof(peb32), NULL ); + if (status) return status; + if (peb32) status = NtReadVirtualMemory( process, peb32 + 1, info, sizeof(*info), NULL ); + *is_wow64 = !!peb32; + return status; +} + + /********************************************************************** * RtlWow64IsWowGuestMachineSupported (NTDLL.@) */ diff --git a/dlls/ntdll/tests/wow64.c b/dlls/ntdll/tests/wow64.c index 46523d47c46..e9f1c10ec43 100644 --- a/dlls/ntdll/tests/wow64.c +++ b/dlls/ntdll/tests/wow64.c @@ -21,6 +21,7 @@ #include "ntdll_test.h" #include "winioctl.h" +#include "winuser.h" #include "ddk/wdm.h" static NTSTATUS (WINAPI *pNtQuerySystemInformation)(SYSTEM_INFORMATION_CLASS,void*,ULONG,ULONG*); @@ -28,6 +29,7 @@ static NTSTATUS (WINAPI *pNtQuerySystemInformationEx)(SYSTEM_INFORMATION_CLASS,v static NTSTATUS (WINAPI *pRtlGetNativeSystemInformation)(SYSTEM_INFORMATION_CLASS,void*,ULONG,ULONG*); static USHORT (WINAPI *pRtlWow64GetCurrentMachine)(void); static NTSTATUS (WINAPI *pRtlWow64GetProcessMachines)(HANDLE,WORD*,WORD*); +static NTSTATUS (WINAPI *pRtlWow64GetSharedInfoProcess)(HANDLE,BOOLEAN*,WOW64INFO*); static NTSTATUS (WINAPI *pRtlWow64GetThreadContext)(HANDLE,WOW64_CONTEXT*); static NTSTATUS (WINAPI *pRtlWow64IsWowGuestMachineSupported)(USHORT,BOOLEAN*); static NTSTATUS (WINAPI *pNtMapViewOfSectionEx)(HANDLE,HANDLE,PVOID*,const LARGE_INTEGER*,SIZE_T*,ULONG,ULONG,MEM_EXTENDED_PARAMETER*,ULONG); @@ -87,6 +89,7 @@ static void init(void) GET_PROC( RtlGetNativeSystemInformation ); GET_PROC( RtlWow64GetCurrentMachine ); GET_PROC( RtlWow64GetProcessMachines ); + GET_PROC( RtlWow64GetSharedInfoProcess ); GET_PROC( RtlWow64GetThreadContext ); GET_PROC( RtlWow64IsWowGuestMachineSupported ); #ifdef _WIN64 @@ -278,6 +281,9 @@ static void test_peb_teb(void) RTL_USER_PROCESS_PARAMETERS params; RTL_USER_PROCESS_PARAMETERS32 params32; ULONG_PTR peb_ptr; + ULONG buffer[16]; + WOW64INFO *wow64info = (WOW64INFO *)buffer; + BOOLEAN wow64; Wow64DisableWow64FsRedirection( &redir ); @@ -370,6 +376,47 @@ static void test_peb_teb(void) params32.EnvironmentSize, params.EnvironmentSize ); } + ResumeThread( pi.hThread ); + WaitForInputIdle( pi.hProcess, 1000 ); + + if (pRtlWow64GetSharedInfoProcess) + { + ULONG i, peb_data[0x200]; + + wow64 = 0xcc; + memset( buffer, 0xcc, sizeof(buffer) ); + status = pRtlWow64GetSharedInfoProcess( pi.hProcess, &wow64, wow64info ); + ok( !status, "RtlWow64GetSharedInfoProcess failed %lx\n", status ); + ok( wow64 == TRUE, "wrong wow64 %u\n", wow64 ); + todo_wine_if (!wow64info->NativeSystemPageSize) /* not set in old wow64 */ + { + ok( wow64info->NativeSystemPageSize == 0x1000, "wrong page size %lx\n", + wow64info->NativeSystemPageSize ); + ok( wow64info->CpuFlags == (native_machine == IMAGE_FILE_MACHINE_AMD64 ? WOW64_CPUFLAGS_MSFT64 : WOW64_CPUFLAGS_SOFTWARE), + "wrong flags %lx\n", wow64info->CpuFlags ); + ok( wow64info->NativeMachineType == native_machine, "wrong machine %x / %x\n", + wow64info->NativeMachineType, native_machine ); + ok( wow64info->EmulatedMachineType == IMAGE_FILE_MACHINE_I386, "wrong machine %x\n", + wow64info->EmulatedMachineType ); + } + ok( buffer[sizeof(*wow64info) / sizeof(ULONG)] == 0xcccccccc, "buffer set %lx\n", + buffer[sizeof(*wow64info) / sizeof(ULONG)] ); + if (ReadProcessMemory( pi.hProcess, (void *)peb_ptr, peb_data, sizeof(peb_data), &res )) + { + ULONG limit = (sizeof(peb_data) - sizeof(wow64info)) / sizeof(ULONG); + for (i = 0; i < limit; i++) + { + if (!memcmp( peb_data + i, wow64info, sizeof(*wow64info) )) + { + trace( "wow64info found at %lx\n", i * 4 ); + break; + } + } + ok( i < limit, "wow64info not found in PEB\n" ); + } + } + else win_skip( "RtlWow64GetSharedInfoProcess not supported\n" ); + ret = DebugActiveProcess( pi.dwProcessId ); ok( ret, "debugging failed\n" ); if (!ReadProcessMemory( pi.hProcess, proc_info.PebBaseAddress, &peb, sizeof(peb), &res )) res = 0; @@ -416,6 +463,19 @@ static void test_peb_teb(void) ok( proc_info.PebBaseAddress == teb.Peb, "wrong peb %p / %p\n", proc_info.PebBaseAddress, teb.Peb ); + ResumeThread( pi.hThread ); + WaitForInputIdle( pi.hProcess, 1000 ); + + if (pRtlWow64GetSharedInfoProcess) + { + wow64 = 0xcc; + memset( buffer, 0xcc, sizeof(buffer) ); + status = pRtlWow64GetSharedInfoProcess( pi.hProcess, &wow64, wow64info ); + ok( !status, "RtlWow64GetSharedInfoProcess failed %lx\n", status ); + ok( !wow64, "wrong wow64 %u\n", wow64 ); + ok( buffer[0] == 0xcccccccc, "buffer set %lx\n", buffer[0] ); + } + TerminateProcess( pi.hProcess, 0 ); CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); diff --git a/include/winternl.h b/include/winternl.h index faa8621c152..f57b5b43d37 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -4013,6 +4013,7 @@ typedef struct _WOW64INFO ULONG unknown[5]; USHORT NativeMachineType; USHORT EmulatedMachineType; + ULONG unknown2; } WOW64INFO; #define WOW64_CPUFLAGS_MSFT64 0x01 @@ -4820,6 +4821,7 @@ NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirection(BOOLEAN); NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx(ULONG,ULONG*); NTSYSAPI USHORT WINAPI RtlWow64GetCurrentMachine(void); NTSYSAPI NTSTATUS WINAPI RtlWow64GetProcessMachines(HANDLE,USHORT*,USHORT*); +NTSYSAPI NTSTATUS WINAPI RtlWow64GetSharedInfoProcess(HANDLE,BOOLEAN*,WOW64INFO*); NTSYSAPI NTSTATUS WINAPI RtlWow64IsWowGuestMachineSupported(USHORT,BOOLEAN*); NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG,PCWSTR,PCWSTR,ULONG,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI RtlZombifyActivationContext(HANDLE);
1
0
0
0
Alexandre Julliard : wow64: Use ProcessWow64Information to retrieve the 32-bit PEB.
by Alexandre Julliard
11 Jul '23
11 Jul '23
Module: wine Branch: master Commit: 168ce9164faf4ce768e9f9f1f5f8415f5c097ca7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/168ce9164faf4ce768e9f9f1f5f841…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jul 11 15:37:14 2023 +0200 wow64: Use ProcessWow64Information to retrieve the 32-bit PEB. --- dlls/wow64/syscall.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index 0f8135859bc..e741654a056 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -873,7 +873,7 @@ static const WCHAR *get_cpu_dll_name(void) */ static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **context ) { - TEB32 *teb32 = (TEB32 *)((char *)NtCurrentTeb() + NtCurrentTeb()->WowTebOffset); + PEB32 *peb32; HMODULE module, ntdll; UNICODE_STRING str = RTL_CONSTANT_STRING( L"ntdll.dll" ); SYSTEM_BASIC_INFORMATION info; @@ -884,7 +884,8 @@ static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **contex NtQuerySystemInformation( SystemEmulationBasicInformation, &info, sizeof(info), NULL ); highest_user_address = (ULONG_PTR)info.HighestUserAddress; default_zero_bits = (ULONG_PTR)info.HighestUserAddress | 0x7fffffff; - wow64info = (WOW64INFO *)((PEB32 *)ULongToPtr( teb32->Peb ) + 1); + NtQueryInformationProcess( GetCurrentProcess(), ProcessWow64Information, &peb32, sizeof(peb32), NULL ); + wow64info = (WOW64INFO *)(peb32 + 1); wow64info->NativeSystemPageSize = 0x1000; wow64info->NativeMachineType = native_machine; wow64info->EmulatedMachineType = current_machine;
1
0
0
0
Alexandre Julliard : kernelbase: Use ProcessWow64Information to retrieve the 32-bit PEB.
by Alexandre Julliard
11 Jul '23
11 Jul '23
Module: wine Branch: master Commit: 7261aca185e090e9f802b5b73d12c33d16fd67f0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7261aca185e090e9f802b5b73d12c3…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jul 11 14:14:33 2023 +0200 kernelbase: Use ProcessWow64Information to retrieve the 32-bit PEB. --- dlls/kernelbase/debug.c | 58 +++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c index 4353b0590f3..7132f63bb52 100644 --- a/dlls/kernelbase/debug.c +++ b/dlls/kernelbase/debug.c @@ -824,37 +824,39 @@ struct module_iterator }; -/* Caller must ensure that wow64=TRUE is only passed from 64bit for 'process' being a wow64 process */ -static BOOL init_module_iterator( struct module_iterator *iter, HANDLE process, BOOL wow64 ) +static BOOL init_module_iterator_wow64( struct module_iterator *iter, HANDLE process ) +{ + PEB_LDR_DATA32 *ldr_data32_ptr; + DWORD ldr_data32, first_module; + PEB32 *peb32; + + iter->wow64 = TRUE; + if (!set_ntstatus( NtQueryInformationProcess( process, ProcessWow64Information, + &peb32, sizeof(peb32), NULL ))) + return FALSE; + if (!ReadProcessMemory( process, &peb32->LdrData, &ldr_data32, sizeof(ldr_data32), NULL )) + return FALSE; + ldr_data32_ptr = (PEB_LDR_DATA32 *)(DWORD_PTR) ldr_data32; + if (!ReadProcessMemory( process, &ldr_data32_ptr->InLoadOrderModuleList.Flink, + &first_module, sizeof(first_module), NULL )) + return FALSE; + iter->head = (LIST_ENTRY *)&ldr_data32_ptr->InLoadOrderModuleList; + iter->current = (LIST_ENTRY *)(DWORD_PTR)first_module; + iter->process = process; + return TRUE; +} + + +static BOOL init_module_iterator( struct module_iterator *iter, HANDLE process ) { PROCESS_BASIC_INFORMATION pbi; PPEB_LDR_DATA ldr_data; - /* get address of PEB */ + iter->wow64 = FALSE; if (!set_ntstatus( NtQueryInformationProcess( process, ProcessBasicInformation, &pbi, sizeof(pbi), NULL ))) return FALSE; - iter->wow64 = wow64; - if (wow64) - { - PEB_LDR_DATA32 *ldr_data32_ptr; - DWORD ldr_data32, first_module; - PEB32 *peb32; - - peb32 = (PEB32 *)((char *)pbi.PebBaseAddress + 0x1000); - if (!ReadProcessMemory( process, &peb32->LdrData, &ldr_data32, sizeof(ldr_data32), NULL )) - return FALSE; - ldr_data32_ptr = (PEB_LDR_DATA32 *)(DWORD_PTR) ldr_data32; - if (!ReadProcessMemory( process, &ldr_data32_ptr->InLoadOrderModuleList.Flink, - &first_module, sizeof(first_module), NULL )) - return FALSE; - iter->head = (LIST_ENTRY *)&ldr_data32_ptr->InLoadOrderModuleList; - iter->current = (LIST_ENTRY *)(DWORD_PTR)first_module; - iter->process = process; - return TRUE; - } - /* read address of LdrData from PEB */ if (!ReadProcessMemory( process, &pbi.PebBaseAddress->LdrData, &ldr_data, sizeof(ldr_data), NULL )) return FALSE; @@ -907,7 +909,7 @@ static BOOL get_ldr_module( HANDLE process, HMODULE module, LDR_DATA_TABLE_ENTRY struct module_iterator iter; INT ret; - if (!init_module_iterator( &iter, process, FALSE )) return FALSE; + if (!init_module_iterator( &iter, process )) return FALSE; while ((ret = module_iterator_next( &iter )) > 0) /* When hModule is NULL we return the process image - which will be @@ -935,7 +937,7 @@ static BOOL get_ldr_module32( HANDLE process, HMODULE module, LDR_DATA_TABLE_ENT return FALSE; } #endif - if (!init_module_iterator( &iter, process, TRUE )) return FALSE; + if (!init_module_iterator_wow64( &iter, process )) return FALSE; while ((ret = module_iterator_next( &iter )) > 0) /* When hModule is NULL we return the process image - which will be @@ -1101,12 +1103,12 @@ BOOL WINAPI EnumProcessModulesEx( HANDLE process, HMODULE *module, DWORD count, if (is_win64 && target_wow64 && (list_mode & LIST_MODULES_32BIT)) { - if (!init_module_iterator( &iter, process, TRUE ) || module_push_all( &mp, &iter ) < 0) + if (!init_module_iterator_wow64( &iter, process ) || module_push_all( &mp, &iter ) < 0) return FALSE; } if (!(is_win64 && list_mode == LIST_MODULES_32BIT)) { - if (init_module_iterator( &iter, process, FALSE )) + if (init_module_iterator( &iter, process )) { if (is_win64 && target_wow64 && (list_mode & LIST_MODULES_64BIT)) /* Don't add main module twice in _ALL mode */ @@ -1120,7 +1122,7 @@ BOOL WINAPI EnumProcessModulesEx( HANDLE process, HMODULE *module, DWORD count, */ if (list_mode == LIST_MODULES_DEFAULT) { - if (init_module_iterator( &iter, process, TRUE ) && module_iterator_next( &iter ) > 0) + if (init_module_iterator_wow64( &iter, process ) && module_iterator_next( &iter ) > 0) module_push_iter( &mp, &iter ); else ret = -1;
1
0
0
0
Alexandre Julliard : psapi/tests: Use MAX_PATH size for arrays holding file paths.
by Alexandre Julliard
11 Jul '23
11 Jul '23
Module: wine Branch: master Commit: b1f603d8bca63095be73956fc1e959bc1afb99ba URL:
https://gitlab.winehq.org/wine/wine/-/commit/b1f603d8bca63095be73956fc1e959…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jul 11 14:08:37 2023 +0200 psapi/tests: Use MAX_PATH size for arrays holding file paths. --- dlls/psapi/tests/psapi_main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c index 8d7b169703a..e7e5e5f04e6 100644 --- a/dlls/psapi/tests/psapi_main.c +++ b/dlls/psapi/tests/psapi_main.c @@ -76,7 +76,7 @@ static void test_EnumProcesses(void) static void test_EnumProcessModules(void) { - char buffer[200] = "C:\\windows\\system32\\msinfo32.exe"; + char buffer[MAX_PATH] = "C:\\windows\\system32\\msinfo32.exe"; PROCESS_INFORMATION pi = {0}; STARTUPINFOA si = {0}; void *cookie; @@ -140,7 +140,7 @@ static void test_EnumProcessModules(void) if (sizeof(void *) == 8) { MODULEINFO info; - char name[40]; + char name[MAX_PATH]; HMODULE hmods[3]; strcpy(buffer, "C:\\windows\\syswow64\\msinfo32.exe"); @@ -224,8 +224,8 @@ static BOOL test_EnumProcessModulesEx_snapshot(HANDLE proc, struct moduleex_snap { void* cookie; DWORD needed; - char buffer[80]; - char buffer2[80]; + char buffer[MAX_PATH]; + char buffer2[MAX_PATH]; MODULEINFO info; int i, j; BOOL ret; @@ -334,7 +334,7 @@ static BOOL snapshot_are_disjoint(const struct moduleex_snapshot* seta, const st static void snapshot_check_first_main_module(const struct moduleex_snapshot* snap, HANDLE proc, const char* filename) { - char buffer[80]; + char buffer[MAX_PATH]; MODULEINFO info; const char* modname; BOOL ret; @@ -359,7 +359,7 @@ static void snapshot_check_first_main_module(const struct moduleex_snapshot* sna static unsigned int snapshot_count_in_dir(const struct moduleex_snapshot* snap, HANDLE proc, const char* dirname) { unsigned int count = 0; - char buffer[128]; + char buffer[MAX_PATH]; size_t dirname_len = strlen(dirname); BOOL ret; int i; @@ -375,7 +375,7 @@ static unsigned int snapshot_count_in_dir(const struct moduleex_snapshot* snap, static void test_EnumProcessModulesEx(void) { - char buffer[200] = "C:\\windows\\system32\\msinfo32.exe"; + char buffer[MAX_PATH] = "C:\\windows\\system32\\msinfo32.exe"; PROCESS_INFORMATION pi = {0}; STARTUPINFOA si = {0}; void *cookie;
1
0
0
0
Alexandre Julliard : ntdll: Return the 32-bit PEB for NtQueryInformationProcess(ProcessWow64Information).
by Alexandre Julliard
11 Jul '23
11 Jul '23
Module: wine Branch: master Commit: fb5cfacce5c6450a4b0b0edafc9e9cc21d73552e URL:
https://gitlab.winehq.org/wine/wine/-/commit/fb5cfacce5c6450a4b0b0edafc9e9c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jul 11 13:43:26 2023 +0200 ntdll: Return the 32-bit PEB for NtQueryInformationProcess(ProcessWow64Information). --- dlls/ntdll/tests/info.c | 5 ++++- dlls/ntdll/tests/wow64.c | 7 +++++++ dlls/ntdll/unix/process.c | 11 ++++++----- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index fafbd1ac997..877978b6b3c 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -1735,7 +1735,8 @@ static void test_query_process_wow64(void) status = NtQueryInformationProcess(GetCurrentProcess(), ProcessWow64Information, pbi, sizeof(ULONG_PTR), NULL); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08lx\n", status); ok( is_wow64 == (pbi[0] != 0), "is_wow64 %x, pbi[0] %Ix\n", is_wow64, pbi[0]); - ok( pbi[0] != dummy, "pbi[0] %Ix\n", pbi[0]); + if (is_wow64) + ok( (void *)pbi[0] == NtCurrentTeb()->Peb, "pbi[0] %Ix / %p\n", pbi[0], NtCurrentTeb()->Peb); ok( pbi[1] == dummy, "pbi[1] changed to %Ix\n", pbi[1]); /* Test written size on 64 bit by checking high 32 bit buffer */ if (sizeof(ULONG_PTR) > sizeof(DWORD)) @@ -1750,6 +1751,8 @@ static void test_query_process_wow64(void) status = NtQueryInformationProcess(GetCurrentProcess(), ProcessWow64Information, pbi, sizeof(ULONG_PTR), &ReturnLength); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08lx\n", status); ok( is_wow64 == (pbi[0] != 0), "is_wow64 %x, pbi[0] %Ix\n", is_wow64, pbi[0]); + if (is_wow64) + ok( (void *)pbi[0] == NtCurrentTeb()->Peb, "pbi[0] %Ix / %p\n", pbi[0], NtCurrentTeb()->Peb); ok( pbi[1] == dummy, "pbi[1] changed to %Ix\n", pbi[1]); ok( ReturnLength == sizeof(ULONG_PTR), "Inconsistent length %ld\n", ReturnLength); diff --git a/dlls/ntdll/tests/wow64.c b/dlls/ntdll/tests/wow64.c index b99b22fb1af..46523d47c46 100644 --- a/dlls/ntdll/tests/wow64.c +++ b/dlls/ntdll/tests/wow64.c @@ -277,6 +277,7 @@ static void test_peb_teb(void) PEB32 peb32; RTL_USER_PROCESS_PARAMETERS params; RTL_USER_PROCESS_PARAMETERS32 params32; + ULONG_PTR peb_ptr; Wow64DisableWow64FsRedirection( &redir ); @@ -317,6 +318,12 @@ static void test_peb_teb(void) ok( !status, "ProcessBasicInformation failed %lx\n", status ); ok( proc_info.PebBaseAddress == teb.Peb, "wrong peb %p / %p\n", proc_info.PebBaseAddress, teb.Peb ); + status = NtQueryInformationProcess( pi.hProcess, ProcessWow64Information, + &peb_ptr, sizeof(peb_ptr), NULL ); + ok( !status, "ProcessWow64Information failed %lx\n", status ); + ok( (void *)peb_ptr == (is_wow64 ? teb.Peb : ULongToPtr(teb32.Peb)), + "wrong peb %p\n", (void *)peb_ptr ); + if (!ReadProcessMemory( pi.hProcess, proc_info.PebBaseAddress, &peb, sizeof(peb), &res )) res = 0; ok( res == sizeof(peb), "wrong len %Ix\n", res ); ok( !peb.BeingDebugged, "BeingDebugged is %u\n", peb.BeingDebugged ); diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c index 140a93583b4..30bd6f083bd 100644 --- a/dlls/ntdll/unix/process.c +++ b/dlls/ntdll/unix/process.c @@ -1430,9 +1430,8 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class case ProcessWow64Information: len = sizeof(ULONG_PTR); if (size != len) return STATUS_INFO_LENGTH_MISMATCH; - else if (!info) ret = STATUS_ACCESS_VIOLATION; - else if (!handle) ret = STATUS_INVALID_HANDLE; - else if (handle == GetCurrentProcess()) *(ULONG_PTR *)info = is_wow64(); + if (handle == GetCurrentProcess()) + *(ULONG_PTR *)info = is_old_wow64() ? (ULONG_PTR)peb : (ULONG_PTR)wow_peb; else { ULONG_PTR val = 0; @@ -1440,10 +1439,12 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class SERVER_START_REQ( get_process_info ) { req->handle = wine_server_obj_handle( handle ); - if (!(ret = wine_server_call( req ))) val = (reply->machine != native_machine); + ret = wine_server_call( req ); + if (!ret && !is_machine_64bit( reply->machine ) && is_machine_64bit( native_machine )) + val = reply->peb + 0x1000; } SERVER_END_REQ; - *(ULONG_PTR *)info = val; + if (!ret) *(ULONG_PTR *)info = val; } break;
1
0
0
0
← Newer
1
...
53
54
55
56
57
58
59
...
87
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
Results per page:
10
25
50
100
200