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
April 2021
----- 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
2 participants
865 discussions
Start a n
N
ew thread
Hans Leidekker : msv1_0: Initial implementation of the LSA and user mode interfaces.
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: 1eefdd6bee17d547a3ac3cf639203021aa16d7e7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1eefdd6bee17d547a3ac3cf6…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Apr 29 12:47:30 2021 +0200 msv1_0: Initial implementation of the LSA and user mode interfaces. Just enough to initialize the provider. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msv1_0/Makefile.in | 3 + dlls/msv1_0/main.c | 188 ++++++++++++++++++++++++++++++++++++++++++++++++ dlls/msv1_0/msv1_0.spec | 4 +- 3 files changed, 193 insertions(+), 2 deletions(-) diff --git a/dlls/msv1_0/Makefile.in b/dlls/msv1_0/Makefile.in index ceac399a207..155ce593ab1 100644 --- a/dlls/msv1_0/Makefile.in +++ b/dlls/msv1_0/Makefile.in @@ -1,3 +1,6 @@ MODULE = msv1_0.dll EXTRADLLFLAGS = -mno-cygwin + +C_SRCS = \ + main.c diff --git a/dlls/msv1_0/main.c b/dlls/msv1_0/main.c new file mode 100644 index 00000000000..d3480c563f0 --- /dev/null +++ b/dlls/msv1_0/main.c @@ -0,0 +1,188 @@ +/* + * Copyright 2005, 2006 Kai Blin + * Copyright 2021 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winbase.h" +#include "winternl.h" +#include "sspi.h" +#include "ntsecapi.h" +#include "ntsecpkg.h" +#include "rpc.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(ntlm); + +static ULONG ntlm_package_id; +static LSA_DISPATCH_TABLE lsa_dispatch; + +#define NTLM_CAPS \ + ( SECPKG_FLAG_INTEGRITY \ + | SECPKG_FLAG_PRIVACY \ + | SECPKG_FLAG_TOKEN_ONLY \ + | SECPKG_FLAG_CONNECTION \ + | SECPKG_FLAG_MULTI_REQUIRED \ + | SECPKG_FLAG_IMPERSONATION \ + | SECPKG_FLAG_ACCEPT_WIN32_NAME \ + | SECPKG_FLAG_NEGOTIABLE \ + | SECPKG_FLAG_LOGON \ + | SECPKG_FLAG_RESTRICTED_TOKENS ) + +#define NTLM_MAX_BUF 1904 + +static const SecPkgInfoW ntlm_package_info = +{ + NTLM_CAPS, + 1, + RPC_C_AUTHN_WINNT, + NTLM_MAX_BUF, + (SEC_WCHAR *)L"NTLM", + (SEC_WCHAR *)L"NTLM Security Package" +}; + +static inline const char *debugstr_as( const STRING *str ) +{ + if (!str) return "<null>"; + return debugstr_an( str->Buffer, str->Length ); +} + +static NTSTATUS NTAPI ntlm_LsaApInitializePackage( ULONG package_id, LSA_DISPATCH_TABLE *dispatch, + LSA_STRING *database, LSA_STRING *confidentiality, + LSA_STRING **package_name ) +{ + LSA_STRING *str; + char *ptr; + + TRACE( "%08x, %p, %s, %s, %p\n", package_id, dispatch, debugstr_as(database), debugstr_as(confidentiality), + package_name ); + + if (!(str = dispatch->AllocateLsaHeap( sizeof(*str) + sizeof("NTLM" )))) return STATUS_NO_MEMORY; + ptr = (char *)(str + 1); + memcpy( ptr, "NTLM", sizeof("NTLM") ); + RtlInitString( str, ptr ); + + ntlm_package_id = package_id; + lsa_dispatch = *dispatch; + + *package_name = str; + return STATUS_SUCCESS; +} + +static NTSTATUS NTAPI ntlm_SpInitialize( ULONG_PTR package_id, SECPKG_PARAMETERS *params, + LSA_SECPKG_FUNCTION_TABLE *lsa_function_table ) +{ + FIXME( "%lu, %p, %p\n", package_id, params, lsa_function_table ); + return STATUS_SUCCESS; +} + +static NTSTATUS NTAPI ntlm_SpGetInfo( SecPkgInfoW *info ) +{ + TRACE( "%p\n", info ); + *info = ntlm_package_info; + return STATUS_SUCCESS; +} + +static SECPKG_FUNCTION_TABLE ntlm_table = +{ + ntlm_LsaApInitializePackage, + NULL, /* LsaLogonUser */ + NULL, /* CallPackage */ + NULL, /* LogonTerminated */ + NULL, /* CallPackageUntrusted */ + NULL, /* CallPackagePassthrough */ + NULL, /* LogonUserEx */ + NULL, /* LogonUserEx2 */ + ntlm_SpInitialize, + NULL, /* SpShutdown */ + ntlm_SpGetInfo, + NULL, /* AcceptCredentials */ + NULL, /* SpAcquireCredentialsHandle */ + NULL, /* SpQueryCredentialsAttributes */ + NULL, /* SpFreeCredentialsHandle */ + NULL, /* SaveCredentials */ + NULL, /* GetCredentials */ + NULL, /* DeleteCredentials */ + NULL, /* SpInitLsaModeContext */ + NULL, /* SpAcceptLsaModeContext */ + NULL, /* SpDeleteContext */ + NULL, /* ApplyControlToken */ + NULL, /* GetUserInfo */ + NULL, /* GetExtendedInformation */ + NULL, /* SpQueryContextAttributes */ + NULL, /* SpAddCredentials */ + NULL, /* SetExtendedInformation */ + NULL, /* SetContextAttributes */ + NULL, /* SetCredentialsAttributes */ + NULL, /* ChangeAccountPassword */ + NULL, /* QueryMetaData */ + NULL, /* ExchangeMetaData */ + NULL, /* GetCredUIContext */ + NULL, /* UpdateCredentials */ + NULL, /* ValidateTargetInfo */ + NULL, /* PostLogonUser */ +}; + +NTSTATUS NTAPI SpLsaModeInitialize( ULONG lsa_version, ULONG *package_version, SECPKG_FUNCTION_TABLE **table, + ULONG *table_count ) +{ + TRACE( "%08x, %p, %p, %p\n", lsa_version, package_version, table, table_count ); + + *package_version = SECPKG_INTERFACE_VERSION; + *table = &ntlm_table; + *table_count = 1; + return STATUS_SUCCESS; +} + +static NTSTATUS NTAPI ntlm_SpInstanceInit( ULONG version, SECPKG_DLL_FUNCTIONS *dll_functions, void **user_functions ) +{ + TRACE( "%08x, %p, %p\n", version, dll_functions, user_functions ); + return STATUS_SUCCESS; +} + +static SECPKG_USER_FUNCTION_TABLE ntlm_user_table = +{ + ntlm_SpInstanceInit, + NULL, /* SpInitUserModeContext */ + NULL, /* SpMakeSignature */ + NULL, /* SpVerifySignature */ + NULL, /* SpSealMessage */ + NULL, /* SpUnsealMessage */ + NULL, /* SpGetContextToken */ + NULL, /* SpQueryContextAttributes */ + NULL, /* SpCompleteAuthToken */ + NULL, /* SpDeleteContext */ + NULL, /* SpFormatCredentialsFn */ + NULL, /* SpMarshallSupplementalCreds */ + NULL, /* SpExportSecurityContext */ + NULL /* SpImportSecurityContext */ +}; + +NTSTATUS NTAPI SpUserModeInitialize( ULONG lsa_version, ULONG *package_version, SECPKG_USER_FUNCTION_TABLE **table, + ULONG *table_count ) +{ + TRACE( "%08x, %p, %p, %p\n", lsa_version, package_version, table, table_count ); + + *package_version = SECPKG_INTERFACE_VERSION; + *table = &ntlm_user_table; + *table_count = 1; + return STATUS_SUCCESS; +} diff --git a/dlls/msv1_0/msv1_0.spec b/dlls/msv1_0/msv1_0.spec index cb544188b87..f751ed40521 100644 --- a/dlls/msv1_0/msv1_0.spec +++ b/dlls/msv1_0/msv1_0.spec @@ -15,5 +15,5 @@ @ stub MsvValidateTarget @ stub SpInitialize @ stub SpInstanceInit -@ stub SpLsaModeInitialize -@ stub SpUserModeInitialize +@ stdcall SpLsaModeInitialize(long ptr ptr ptr) +@ stdcall SpUserModeInitialize(long ptr ptr ptr)
1
0
0
0
Hans Leidekker : msv1_0: New dll.
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: 5070d6acd2ac45c6a717723b491eb08deedb2be7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5070d6acd2ac45c6a717723b…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Apr 29 12:47:29 2021 +0200 msv1_0: New dll. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 2 ++ configure.ac | 1 + dlls/msv1_0/Makefile.in | 3 +++ dlls/msv1_0/msv1_0.spec | 19 +++++++++++++++++++ 4 files changed, 25 insertions(+) diff --git a/configure b/configure index 14e4bc87ce9..a3d73d0551e 100755 --- a/configure +++ b/configure @@ -1471,6 +1471,7 @@ enable_msscript_ocx enable_mssign32 enable_mssip32 enable_mstask +enable_msv1_0 enable_msvcirt enable_msvcm80 enable_msvcm90 @@ -20820,6 +20821,7 @@ wine_fn_config_makefile dlls/mssign32 enable_mssign32 wine_fn_config_makefile dlls/mssip32 enable_mssip32 wine_fn_config_makefile dlls/mstask enable_mstask wine_fn_config_makefile dlls/mstask/tests enable_tests +wine_fn_config_makefile dlls/msv1_0 enable_msv1_0 wine_fn_config_makefile dlls/msvcirt enable_msvcirt wine_fn_config_makefile dlls/msvcirt/tests enable_tests wine_fn_config_makefile dlls/msvcm80 enable_msvcm80 diff --git a/configure.ac b/configure.ac index daa7203748c..678d3c8344a 100644 --- a/configure.ac +++ b/configure.ac @@ -3485,6 +3485,7 @@ WINE_CONFIG_MAKEFILE(dlls/mssign32) WINE_CONFIG_MAKEFILE(dlls/mssip32) WINE_CONFIG_MAKEFILE(dlls/mstask) WINE_CONFIG_MAKEFILE(dlls/mstask/tests) +WINE_CONFIG_MAKEFILE(dlls/msv1_0) WINE_CONFIG_MAKEFILE(dlls/msvcirt) WINE_CONFIG_MAKEFILE(dlls/msvcirt/tests) WINE_CONFIG_MAKEFILE(dlls/msvcm80) diff --git a/dlls/msv1_0/Makefile.in b/dlls/msv1_0/Makefile.in new file mode 100644 index 00000000000..ceac399a207 --- /dev/null +++ b/dlls/msv1_0/Makefile.in @@ -0,0 +1,3 @@ +MODULE = msv1_0.dll + +EXTRADLLFLAGS = -mno-cygwin diff --git a/dlls/msv1_0/msv1_0.spec b/dlls/msv1_0/msv1_0.spec new file mode 100644 index 00000000000..cb544188b87 --- /dev/null +++ b/dlls/msv1_0/msv1_0.spec @@ -0,0 +1,19 @@ +@ stub DllMain +@ stub LsaApCallPackage +@ stub LsaApCallPackagePassthrough +@ stub LsaApCallPackageUntrusted +@ stub LsaApInitializePackage +@ stub LsaApLogonTerminated +@ stub LsaApLogonUserEx2 +@ stub Msv1_0ExportSubAuthenticationRoutine +@ stub Msv1_0SubAuthenticationPresent +@ stub MsvGetLogonAttemptCount +@ stub MsvIsIpAddressLocal +@ stub MsvIsLocalhostAliases +@ stub MsvSamLogoff +@ stub MsvSamValidate +@ stub MsvValidateTarget +@ stub SpInitialize +@ stub SpInstanceInit +@ stub SpLsaModeInitialize +@ stub SpUserModeInitialize
1
0
0
0
Rémi Bernon : ntdll/tests: Remove Qpc(Interrupt|System)TimeIncrement(Shift) checks.
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: 24d2a659167d2d95ec68708dbbea30d2624cf548 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=24d2a659167d2d95ec68708d…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Apr 29 11:03:06 2021 +0200 ntdll/tests: Remove Qpc(Interrupt|System)TimeIncrement(Shift) checks. They are not fixed and are updated from time to time (every few secs), randomly failing the tests on the testbot. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/time.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/dlls/ntdll/tests/time.c b/dlls/ntdll/tests/time.c index 2ed28a35d8e..90737521a4d 100644 --- a/dlls/ntdll/tests/time.c +++ b/dlls/ntdll/tests/time.c @@ -172,14 +172,6 @@ static void test_RtlQueryPerformanceCounter(void) "unexpected QpcBypassEnabled %x, expected 0x83\n", usd->u3.s.QpcBypassEnabled ); ok( usd->QpcFrequency == 10000000, "unexpected QpcFrequency %I64d, expected 10000000\n", usd->QpcFrequency ); ok( !usd->u3.s.QpcShift, "unexpected QpcShift %d, expected 0\n", usd->u3.s.QpcShift ); - ok( usd->QpcInterruptTimeIncrement == ((ULONGLONG)1 << 63), - "unexpected QpcInterruptTimeIncrement %I64x, expected 1<<63\n", usd->QpcInterruptTimeIncrement ); - ok( usd->QpcInterruptTimeIncrementShift == 1, - "unexpected QpcInterruptTimeIncrementShift %d, expected 1\n", usd->QpcInterruptTimeIncrementShift ); - ok( usd->QpcSystemTimeIncrement == ((ULONGLONG)1 << 63), - "unexpected QpcSystemTimeIncrement %I64x, expected 1<<63\n", usd->QpcSystemTimeIncrement ); - ok( usd->QpcSystemTimeIncrementShift == 1, - "unexpected QpcSystemTimeIncrementShift %d, expected 1\n", usd->QpcSystemTimeIncrementShift ); hsd = NULL; status = pNtQuerySystemInformation( SystemHypervisorSharedPageInformation, &hsd, sizeof(void *), &len ); @@ -201,10 +193,6 @@ static void test_RtlQueryPerformanceCounter(void) else { ok( usd->u3.s.QpcShift == 10, "unexpected QpcShift %d, expected 10\n", usd->u3.s.QpcShift ); - ok( usd->QpcInterruptTimeIncrementShift == 2, - "unexpected QpcInterruptTimeIncrementShift %d, expected 2\n", usd->QpcInterruptTimeIncrementShift ); - ok( usd->QpcSystemTimeIncrementShift == 2, - "unexpected QpcSystemTimeIncrementShift %d, expected 2\n", usd->QpcSystemTimeIncrementShift ); tsc0 = __rdtsc(); ret = pRtlQueryPerformanceCounter( &counter );
1
0
0
0
Francois Gouget : winetest: Fix the path to the ntoskrnl.exe/tests source.
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: f932fb327ae1459dac54a488bc4a0a5dbdd49cd4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f932fb327ae1459dac54a488…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Thu Apr 29 15:14:40 2021 +0200 winetest: Fix the path to the ntoskrnl.exe/tests source. It's the only test with a .exe extension for which the source is not in programs! Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/winetest/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/programs/winetest/main.c b/programs/winetest/main.c index cb2f23a161e..a05c8f9939b 100644 --- a/programs/winetest/main.c +++ b/programs/winetest/main.c @@ -518,7 +518,8 @@ static const char* get_test_source_file(const char* test, const char* subtest) static char buffer[MAX_PATH]; int len = strlen(test); - if (len > 4 && !strcmp( test + len - 4, ".exe" )) + if (len > 4 && !strcmp( test + len - 4, ".exe" ) && + strcmp( test, "ntoskrnl.exe" )) /* the one exception! */ { len = sprintf(buffer, "programs/%s", test) - 4; buffer[len] = 0;
1
0
0
0
Alexandre Julliard : regsvr32: Restart the correct version for all supported architectures.
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: 20984f2e1f7f6445a5b6bcdf8aa1354c8d539128 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=20984f2e1f7f6445a5b6bcdf…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 29 17:09:06 2021 +0200 regsvr32: Restart the correct version for all supported architectures. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/regsvr32/Makefile.in | 2 +- programs/regsvr32/regsvr32.c | 51 ++++++++++++++++--------------------------- 2 files changed, 20 insertions(+), 33 deletions(-) diff --git a/programs/regsvr32/Makefile.in b/programs/regsvr32/Makefile.in index d8aee0ea666..3321ca68a94 100644 --- a/programs/regsvr32/Makefile.in +++ b/programs/regsvr32/Makefile.in @@ -1,5 +1,5 @@ MODULE = regsvr32.exe -IMPORTS = ole32 user32 +IMPORTS = ole32 user32 kernelbase EXTRADLLFLAGS = -mwindows -municode -mno-cygwin diff --git a/programs/regsvr32/regsvr32.c b/programs/regsvr32/regsvr32.c index ee915ed3e21..fb307d797a1 100644 --- a/programs/regsvr32/regsvr32.c +++ b/programs/regsvr32/regsvr32.c @@ -112,46 +112,39 @@ static LPCWSTR find_arg_start(LPCWSTR cmdline) return s; } -static void reexec_self(void) +static void reexec_self( WORD machine ) { - /* restart current process as 32-bit or 64-bit with same command line */ -#ifndef _WIN64 - BOOL wow64; -#endif - WCHAR systemdir[MAX_PATH]; + WCHAR app[MAX_PATH]; LPCWSTR args; WCHAR *cmdline; + ULONG i, machines[8]; + HANDLE process = 0; STARTUPINFOW si = {0}; PROCESS_INFORMATION pi; + void *cookie; -#ifdef _WIN64 - TRACE("restarting as 32-bit\n"); - GetSystemWow64DirectoryW(systemdir, MAX_PATH); -#else - TRACE("restarting as 64-bit\n"); + NtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), + machines, sizeof(machines), NULL ); + for (i = 0; machines[i]; i++) if (LOWORD(machines[i]) == machine) break; + if (!machines[i]) return; + if (HIWORD(machines[i]) & 4 /* native machine */) machine = IMAGE_FILE_MACHINE_TARGET_HOST; + if (!GetSystemWow64Directory2W( app, MAX_PATH, machine )) return; + wcscat( app, L"\\regsvr32.exe" ); - if (!IsWow64Process(GetCurrentProcess(), &wow64) || !wow64) - { - TRACE("not running in wow64, can't restart as 64-bit\n"); - return; - } - - GetWindowsDirectoryW(systemdir, MAX_PATH); - wcscat(systemdir, L"\\SysNative"); -#endif + TRACE( "restarting as %s\n", debugstr_w(app) ); args = find_arg_start(GetCommandLineW()); cmdline = HeapAlloc(GetProcessHeap(), 0, - (wcslen(systemdir)+wcslen(L"\\regsvr32.exe")+wcslen(args)+1)*sizeof(WCHAR)); + (wcslen(app)+wcslen(args)+1)*sizeof(WCHAR)); - wcscpy(cmdline, systemdir); - wcscat(cmdline, L"\\regsvr32.exe"); + wcscpy(cmdline, app); wcscat(cmdline, args); si.cb = sizeof(si); - if (CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) + Wow64DisableWow64FsRedirection(&cookie); + if (CreateProcessW(app, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { DWORD exit_code; WaitForSingleObject(pi.hProcess, INFINITE); @@ -162,16 +155,10 @@ static void reexec_self(void) { WINE_TRACE("failed to restart, err=%d\n", GetLastError()); } - + Wow64RevertWow64FsRedirection(cookie); HeapFree(GetProcessHeap(), 0, cmdline); } -#ifdef _WIN64 -# define ALT_MACHINE IMAGE_FILE_MACHINE_I386 -#else -# define ALT_MACHINE IMAGE_FILE_MACHINE_AMD64 -#endif - /** * Loads procedure. * @@ -193,7 +180,7 @@ static VOID *LoadProc(const WCHAR* strDll, const char* procName, HMODULE* DllHan (module = LoadLibraryExW(strDll, 0, LOAD_LIBRARY_AS_IMAGE_RESOURCE))) { IMAGE_NT_HEADERS *nt = RtlImageNtHeader( (HMODULE)((ULONG_PTR)module & ~3) ); - if (nt->FileHeader.Machine == ALT_MACHINE) reexec_self(); + reexec_self( nt->FileHeader.Machine ); } output_write(STRING_DLL_LOAD_FAILED, strDll); ExitProcess(LOADLIBRARY_FAILED);
1
0
0
0
Alexandre Julliard : kernelbase: Use RtlWow64GetProcessMachines() to get native system information.
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: 9b0a8f5f49f941d42ed08b1546c50203c0b07ad6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9b0a8f5f49f941d42ed08b15…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 29 16:19:27 2021 +0200 kernelbase: Use RtlWow64GetProcessMachines() to get native system information. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/memory.c | 13 +++++++--- dlls/kernelbase/process.c | 65 +---------------------------------------------- 2 files changed, 11 insertions(+), 67 deletions(-) diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c index fb5f5100399..4e03267cbb5 100644 --- a/dlls/kernelbase/memory.c +++ b/dlls/kernelbase/memory.c @@ -74,14 +74,21 @@ SIZE_T WINAPI GetLargePageMinimum(void) */ void WINAPI DECLSPEC_HOTPATCH GetNativeSystemInfo( SYSTEM_INFO *si ) { + USHORT current_machine, native_machine; + GetSystemInfo( si ); - if (!is_wow64) return; - switch (si->u.s.wProcessorArchitecture) + RtlWow64GetProcessMachines( GetCurrentProcess(), ¤t_machine, &native_machine ); + if (!current_machine) return; + switch (native_machine) { - case PROCESSOR_ARCHITECTURE_INTEL: + case PROCESSOR_ARCHITECTURE_AMD64: si->u.s.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_AMD64; si->dwProcessorType = PROCESSOR_AMD_X8664; break; + case PROCESSOR_ARCHITECTURE_ARM64: + si->u.s.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_ARM64; + si->dwProcessorType = 0; + break; default: FIXME( "Add the proper information for %d in wow64 mode\n", si->u.s.wProcessorArchitecture ); } diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 2b0287432fb..ae91168ecf4 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -952,70 +952,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH IsProcessorFeaturePresent ( DWORD feature ) */ BOOL WINAPI DECLSPEC_HOTPATCH IsWow64Process2( HANDLE process, USHORT *machine, USHORT *native_machine ) { - BOOL wow64; - SYSTEM_INFO si; - - TRACE( "(%p,%p,%p)\n", process, machine, native_machine ); - - if (!IsWow64Process( process, &wow64 )) - return FALSE; - - if (wow64) - { - if (process != GetCurrentProcess()) - { -#if defined(__i386__) || defined(__x86_64__) - *machine = IMAGE_FILE_MACHINE_I386; -#else - FIXME("not implemented for other process\n"); - *machine = IMAGE_FILE_MACHINE_UNKNOWN; -#endif - } - else - { - IMAGE_NT_HEADERS *nt; - nt = RtlImageNtHeader( NtCurrentTeb()->Peb->ImageBaseAddress ); - *machine = nt->FileHeader.Machine; - } - - if (!native_machine) return TRUE; - - GetNativeSystemInfo( &si ); - } - else - { - *machine = IMAGE_FILE_MACHINE_UNKNOWN; - - if (!native_machine) return TRUE; - -#ifdef _WIN64 - GetSystemInfo( &si ); -#else - GetNativeSystemInfo( &si ); -#endif - } - - switch (si.u.s.wProcessorArchitecture) - { - case PROCESSOR_ARCHITECTURE_INTEL: - *native_machine = IMAGE_FILE_MACHINE_I386; - break; - case PROCESSOR_ARCHITECTURE_ARM: - *native_machine = IMAGE_FILE_MACHINE_ARMNT; - break; - case PROCESSOR_ARCHITECTURE_AMD64: - *native_machine = IMAGE_FILE_MACHINE_AMD64; - break; - case PROCESSOR_ARCHITECTURE_ARM64: - *native_machine = IMAGE_FILE_MACHINE_ARM64; - break; - default: - FIXME("unknown architecture %u\n", si.u.s.wProcessorArchitecture); - *native_machine = IMAGE_FILE_MACHINE_UNKNOWN; - break; - } - - return TRUE; + return set_ntstatus( RtlWow64GetProcessMachines( process, machine, native_machine )); }
1
0
0
0
Alexandre Julliard : ntdll: Implement RtlWow64IsWowGuestMachineSupported().
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: 4f8ede8e7665328a2a3ccd303875e239bf443512 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4f8ede8e7665328a2a3ccd30…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 29 17:15:15 2021 +0200 ntdll: Implement RtlWow64IsWowGuestMachineSupported(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/process.c | 22 ++++++++++++++++++++++ dlls/ntdll/tests/info.c | 26 ++++++++++++++++++++++++++ include/winternl.h | 1 + 4 files changed, 50 insertions(+) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 431ab7c6db7..4da9ea5a0b1 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1071,6 +1071,7 @@ @ stdcall RtlWow64GetCurrentMachine() @ stdcall RtlWow64GetProcessMachines(long ptr ptr) @ stdcall -arch=x86_64 RtlWow64GetThreadContext(long ptr) +@ stdcall RtlWow64IsWowGuestMachineSupported(long ptr) @ stdcall -arch=x86_64 RtlWow64SetThreadContext(long ptr) @ stub RtlWriteMemoryStream @ stdcall RtlWriteRegistryValue(long ptr ptr long ptr long) diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c index f42dc6d8201..dbb94cfb8b7 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c @@ -86,6 +86,28 @@ NTSTATUS WINAPI RtlWow64GetProcessMachines( HANDLE process, USHORT *current_ret, } +/********************************************************************** + * RtlWow64IsWowGuestMachineSupported (NTDLL.@) + */ +NTSTATUS WINAPI RtlWow64IsWowGuestMachineSupported( USHORT machine, BOOLEAN *supported ) +{ + ULONG i, machines[8]; + HANDLE process = 0; + NTSTATUS status; + + status = NtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), + machines, sizeof(machines), NULL ); + if (status) return status; + *supported = FALSE; + for (i = 0; machines[i]; i++) + { + if (HIWORD(machines[i]) & 4 /* native machine */) continue; + if (machine == LOWORD(machines[i])) *supported = TRUE; + } + return status; +} + + /********************************************************************** * RtlCreateUserProcess (NTDLL.@) */ diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index af53c696cdf..d27ec576637 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -27,6 +27,7 @@ static NTSTATUS (WINAPI * pNtSetSystemInformation)(SYSTEM_INFORMATION_CLASS, PVO static NTSTATUS (WINAPI * pRtlGetNativeSystemInformation)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG); static USHORT (WINAPI * pRtlWow64GetCurrentMachine)(void); static NTSTATUS (WINAPI * pRtlWow64GetProcessMachines)(HANDLE,WORD*,WORD*); +static NTSTATUS (WINAPI * pRtlWow64IsWowGuestMachineSupported)(USHORT,BOOLEAN*); static NTSTATUS (WINAPI * pNtQuerySystemInformationEx)(SYSTEM_INFORMATION_CLASS, void*, ULONG, void*, ULONG, ULONG*); static NTSTATUS (WINAPI * pNtPowerInformation)(POWER_INFORMATION_LEVEL, PVOID, ULONG, PVOID, ULONG); static NTSTATUS (WINAPI * pNtQueryInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG); @@ -86,6 +87,7 @@ static BOOL InitFunctionPtrs(void) NTDLL_GET_PROC(RtlGetNativeSystemInformation); NTDLL_GET_PROC(RtlWow64GetCurrentMachine); NTDLL_GET_PROC(RtlWow64GetProcessMachines); + NTDLL_GET_PROC(RtlWow64IsWowGuestMachineSupported); NTDLL_GET_PROC(NtPowerInformation); NTDLL_GET_PROC(NtQueryInformationProcess); NTDLL_GET_PROC(NtQueryInformationThread); @@ -3017,6 +3019,30 @@ static void test_query_architectures(void) USHORT machine = pRtlWow64GetCurrentMachine(); ok( machine == current_machine, "wrong machine %x / %x\n", machine, current_machine ); } + if (pRtlWow64IsWowGuestMachineSupported) + { + BOOLEAN ret = 0xcc; + status = pRtlWow64IsWowGuestMachineSupported( IMAGE_FILE_MACHINE_I386, &ret ); + ok( !status, "failed %x\n", status ); + ok( ret == (native_machine == IMAGE_FILE_MACHINE_AMD64 || + native_machine == IMAGE_FILE_MACHINE_ARM64), "wrong result %u\n", ret ); + ret = 0xcc; + status = pRtlWow64IsWowGuestMachineSupported( IMAGE_FILE_MACHINE_ARMNT, &ret ); + ok( !status, "failed %x\n", status ); + ok( ret == (native_machine == IMAGE_FILE_MACHINE_ARM64), "wrong result %u\n", ret ); + ret = 0xcc; + status = pRtlWow64IsWowGuestMachineSupported( IMAGE_FILE_MACHINE_AMD64, &ret ); + ok( !status, "failed %x\n", status ); + ok( !ret, "wrong result %u\n", ret ); + ret = 0xcc; + status = pRtlWow64IsWowGuestMachineSupported( IMAGE_FILE_MACHINE_ARM64, &ret ); + ok( !status, "failed %x\n", status ); + ok( !ret, "wrong result %u\n", ret ); + ret = 0xcc; + status = pRtlWow64IsWowGuestMachineSupported( 0xdead, &ret ); + ok( !status, "failed %x\n", status ); + ok( !ret, "wrong result %u\n", ret ); + } } static void test_thread_lookup(void) diff --git a/include/winternl.h b/include/winternl.h index 5067fa8ae34..82014d7fb11 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -4258,6 +4258,7 @@ NTSYSAPI NTSTATUS WINAPI RtlWow64GetProcessMachines(HANDLE,USHORT*,USHORT*); NTSYSAPI NTSTATUS WINAPI RtlWow64GetThreadContext(HANDLE, WOW64_CONTEXT *); NTSYSAPI NTSTATUS WINAPI RtlWow64SetThreadContext(HANDLE, const WOW64_CONTEXT *); #endif +NTSYSAPI NTSTATUS WINAPI RtlWow64IsWowGuestMachineSupported(USHORT,BOOLEAN*); NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG,PCWSTR,PCWSTR,ULONG,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI RtlZombifyActivationContext(HANDLE); NTSYSAPI NTSTATUS WINAPI RtlpNtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
1
0
0
0
Alexandre Julliard : ntdll: Implement RtlWow64GetCurrentMachine().
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: 6c2f19c0a72e84579da5fe7d5433de426858a4ad URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6c2f19c0a72e84579da5fe7d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 29 17:14:20 2021 +0200 ntdll: Implement RtlWow64GetCurrentMachine(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/process.c | 12 ++++++++++++ dlls/ntdll/tests/info.c | 8 ++++++++ include/winternl.h | 1 + 4 files changed, 22 insertions(+) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 198a7287302..431ab7c6db7 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1068,6 +1068,7 @@ @ stdcall RtlWalkHeap(long ptr) @ stdcall RtlWow64EnableFsRedirection(long) @ stdcall RtlWow64EnableFsRedirectionEx(long ptr) +@ stdcall RtlWow64GetCurrentMachine() @ stdcall RtlWow64GetProcessMachines(long ptr ptr) @ stdcall -arch=x86_64 RtlWow64GetThreadContext(long ptr) @ stdcall -arch=x86_64 RtlWow64SetThreadContext(long ptr) diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c index 8621d4f4123..f42dc6d8201 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c @@ -49,6 +49,18 @@ PEB * WINAPI RtlGetCurrentPeb(void) } +/********************************************************************** + * RtlWow64GetCurrentMachine (NTDLL.@) + */ +USHORT WINAPI RtlWow64GetCurrentMachine(void) +{ + USHORT current, native; + + RtlWow64GetProcessMachines( GetCurrentProcess(), ¤t, &native ); + return current ? current : native; +} + + /********************************************************************** * RtlWow64GetProcessMachines (NTDLL.@) */ diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 1b20937de50..af53c696cdf 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -25,6 +25,7 @@ static NTSTATUS (WINAPI * pNtQuerySystemInformation)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG); static NTSTATUS (WINAPI * pNtSetSystemInformation)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG); static NTSTATUS (WINAPI * pRtlGetNativeSystemInformation)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG); +static USHORT (WINAPI * pRtlWow64GetCurrentMachine)(void); static NTSTATUS (WINAPI * pRtlWow64GetProcessMachines)(HANDLE,WORD*,WORD*); static NTSTATUS (WINAPI * pNtQuerySystemInformationEx)(SYSTEM_INFORMATION_CLASS, void*, ULONG, void*, ULONG, ULONG*); static NTSTATUS (WINAPI * pNtPowerInformation)(POWER_INFORMATION_LEVEL, PVOID, ULONG, PVOID, ULONG); @@ -83,6 +84,7 @@ static BOOL InitFunctionPtrs(void) NTDLL_GET_PROC(NtQuerySystemInformation); NTDLL_GET_PROC(NtSetSystemInformation); NTDLL_GET_PROC(RtlGetNativeSystemInformation); + NTDLL_GET_PROC(RtlWow64GetCurrentMachine); NTDLL_GET_PROC(RtlWow64GetProcessMachines); NTDLL_GET_PROC(NtPowerInformation); NTDLL_GET_PROC(NtQueryInformationProcess); @@ -3009,6 +3011,12 @@ static void test_query_architectures(void) CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); } + + if (pRtlWow64GetCurrentMachine) + { + USHORT machine = pRtlWow64GetCurrentMachine(); + ok( machine == current_machine, "wrong machine %x / %x\n", machine, current_machine ); + } } static void test_thread_lookup(void) diff --git a/include/winternl.h b/include/winternl.h index fece32a6f5c..5067fa8ae34 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -4252,6 +4252,7 @@ NTSYSAPI void WINAPI RtlWakeConditionVariable(RTL_CONDITION_VARIABLE *); NTSYSAPI NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID); NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirection(BOOLEAN); NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx(ULONG,ULONG*); +NTSYSAPI USHORT WINAPI RtlWow64GetCurrentMachine(void); NTSYSAPI NTSTATUS WINAPI RtlWow64GetProcessMachines(HANDLE,USHORT*,USHORT*); #ifdef __x86_64__ NTSYSAPI NTSTATUS WINAPI RtlWow64GetThreadContext(HANDLE, WOW64_CONTEXT *);
1
0
0
0
Alexandre Julliard : ntdll: Implement RtlWow64GetProcessMachines().
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: f2c1470c7c4799c620cdbc5195a8823fdd51ae16 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f2c1470c7c4799c620cdbc51…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 29 16:18:30 2021 +0200 ntdll: Implement RtlWow64GetProcessMachines(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/process.c | 25 +++++++++++++++++++++++++ dlls/ntdll/tests/info.c | 14 ++++++++++++++ include/winternl.h | 1 + 4 files changed, 41 insertions(+) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index cade83da4b1..198a7287302 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1068,6 +1068,7 @@ @ stdcall RtlWalkHeap(long ptr) @ stdcall RtlWow64EnableFsRedirection(long) @ stdcall RtlWow64EnableFsRedirectionEx(long ptr) +@ stdcall RtlWow64GetProcessMachines(long ptr ptr) @ stdcall -arch=x86_64 RtlWow64GetThreadContext(long ptr) @ stdcall -arch=x86_64 RtlWow64SetThreadContext(long ptr) @ stub RtlWriteMemoryStream diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c index a86eb80e0cc..8621d4f4123 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c @@ -49,6 +49,31 @@ PEB * WINAPI RtlGetCurrentPeb(void) } +/********************************************************************** + * RtlWow64GetProcessMachines (NTDLL.@) + */ +NTSTATUS WINAPI RtlWow64GetProcessMachines( HANDLE process, USHORT *current_ret, USHORT *native_ret ) +{ + ULONG i, machines[8]; + USHORT current = 0, native = 0; + NTSTATUS status; + + status = NtQuerySystemInformationEx( SystemSupportedProcessorArchitectures, &process, sizeof(process), + machines, sizeof(machines), NULL ); + if (status) return status; + for (i = 0; machines[i]; i++) + { + USHORT flags = HIWORD(machines[i]); + USHORT machine = LOWORD(machines[i]); + if (flags & 4 /* native machine */) native = machine; + else if (flags & 8 /* current machine */) current = machine; + } + if (current_ret) *current_ret = current; + if (native_ret) *native_ret = native; + return status; +} + + /********************************************************************** * RtlCreateUserProcess (NTDLL.@) */ diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index f12b2862a99..1b20937de50 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -25,6 +25,7 @@ static NTSTATUS (WINAPI * pNtQuerySystemInformation)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG); static NTSTATUS (WINAPI * pNtSetSystemInformation)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG); static NTSTATUS (WINAPI * pRtlGetNativeSystemInformation)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG); +static NTSTATUS (WINAPI * pRtlWow64GetProcessMachines)(HANDLE,WORD*,WORD*); static NTSTATUS (WINAPI * pNtQuerySystemInformationEx)(SYSTEM_INFORMATION_CLASS, void*, ULONG, void*, ULONG, ULONG*); static NTSTATUS (WINAPI * pNtPowerInformation)(POWER_INFORMATION_LEVEL, PVOID, ULONG, PVOID, ULONG); static NTSTATUS (WINAPI * pNtQueryInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG); @@ -82,6 +83,7 @@ static BOOL InitFunctionPtrs(void) NTDLL_GET_PROC(NtQuerySystemInformation); NTDLL_GET_PROC(NtSetSystemInformation); NTDLL_GET_PROC(RtlGetNativeSystemInformation); + NTDLL_GET_PROC(RtlWow64GetProcessMachines); NTDLL_GET_PROC(NtPowerInformation); NTDLL_GET_PROC(NtQueryInformationProcess); NTDLL_GET_PROC(NtQueryInformationThread); @@ -2920,6 +2922,18 @@ static void test_process_architecture( HANDLE process, USHORT expect_machine, US &buffer, len, &len ); ok( status == STATUS_BUFFER_TOO_SMALL, "failed %x\n", status ); ok( len == (i + 1) * sizeof(DWORD), "wrong len %u\n", len ); + + if (pRtlWow64GetProcessMachines) + { + USHORT current = 0xdead, native = 0xbeef; + status = pRtlWow64GetProcessMachines( process, ¤t, &native ); + ok( !status, "failed %x\n", status ); + if (expect_machine == expect_native) + ok( current == 0, "wrong current machine %x / %x\n", current, expect_machine ); + else + ok( current == expect_machine, "wrong current machine %x / %x\n", current, expect_machine ); + ok( native == expect_native, "wrong native machine %x / %x\n", native, expect_native ); + } } static void test_query_architectures(void) diff --git a/include/winternl.h b/include/winternl.h index dd2bdbbebbe..fece32a6f5c 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -4252,6 +4252,7 @@ NTSYSAPI void WINAPI RtlWakeConditionVariable(RTL_CONDITION_VARIABLE *); NTSYSAPI NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID); NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirection(BOOLEAN); NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx(ULONG,ULONG*); +NTSYSAPI NTSTATUS WINAPI RtlWow64GetProcessMachines(HANDLE,USHORT*,USHORT*); #ifdef __x86_64__ NTSYSAPI NTSTATUS WINAPI RtlWow64GetThreadContext(HANDLE, WOW64_CONTEXT *); NTSYSAPI NTSTATUS WINAPI RtlWow64SetThreadContext(HANDLE, const WOW64_CONTEXT *);
1
0
0
0
Alexandre Julliard : ntdll/tests: Fix a test failure on Windows 8.
by Alexandre Julliard
29 Apr '21
29 Apr '21
Module: wine Branch: master Commit: b5095a1028b9c79170dfe0d927422a0658bee502 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b5095a1028b9c79170dfe0d9…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Apr 29 22:53:59 2021 +0200 ntdll/tests: Fix a test failure on Windows 8. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index b68edfa64dc..f12b2862a99 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -3097,7 +3097,7 @@ static void test_wow64(void) ok( (char *)teb64 + 0x2000 == (char *)NtCurrentTeb(), "unexpected diff %p / %p\n", teb64, NtCurrentTeb() ); ok( (char *)teb64 + teb64->WowTebOffset == (char *)NtCurrentTeb() || - broken( NtCurrentTeb()->WowTebOffset == 1 ), /* vista */ + broken( !teb64->WowTebOffset || teb64->WowTebOffset == 1 ), /* pre-win10 */ "wrong WowTebOffset %x (%p/%p)\n", teb64->WowTebOffset, teb64, NtCurrentTeb() ); ok( !teb64->GdiBatchCount, "GdiBatchCount set %x\n", teb64->GdiBatchCount ); ok( teb64->Tib.ExceptionList == PtrToUlong( NtCurrentTeb() ), "wrong Tib.ExceptionList %s / %p\n",
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
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