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
May 2024
----- 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
705 discussions
Start a n
N
ew thread
Alexandre Julliard : wbemprox: Use RtlGetNativeSystemInformation directly to get the correct info on ARM platforms.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: 80c9034976dee54a549b789e50cae071a0c1b7e5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/80c9034976dee54a549b789e50cae0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 15 10:48:43 2024 +0200 wbemprox: Use RtlGetNativeSystemInformation directly to get the correct info on ARM platforms. --- dlls/wbemprox/builtin.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 72ee294dd08..80434e5f19f 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -1725,10 +1725,16 @@ static WCHAR *get_computername(void) static const WCHAR *get_systemtype(void) { - SYSTEM_INFO info; - GetNativeSystemInfo( &info ); - if (info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) return L"x64 based PC"; - return L"x86 based PC"; + SYSTEM_CPU_INFORMATION info; + + RtlGetNativeSystemInformation( SystemCpuInformation, &info, sizeof(info), NULL ); + switch (info.ProcessorArchitecture) + { + case PROCESSOR_ARCHITECTURE_ARM: return L"ARM-based PC"; + case PROCESSOR_ARCHITECTURE_ARM64: return L"ARM64-based PC"; + case PROCESSOR_ARCHITECTURE_AMD64: return L"x64-based PC"; + default: return L"x86-based PC"; + } } static WCHAR *get_username(void) @@ -3416,10 +3422,17 @@ static WCHAR *get_processor_manufacturer( UINT index, const char *buf, UINT len } static const WCHAR *get_osarchitecture(void) { - SYSTEM_INFO info; - GetNativeSystemInfo( &info ); - if (info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) return L"64-bit"; - return L"32-bit"; + SYSTEM_CPU_INFORMATION info; + + RtlGetNativeSystemInformation( SystemCpuInformation, &info, sizeof(info), NULL ); + switch (info.ProcessorArchitecture) + { + case PROCESSOR_ARCHITECTURE_INTEL: + case PROCESSOR_ARCHITECTURE_ARM: + return L"32-bit"; + default: + return L"64-bit"; + } } static WCHAR *get_processor_caption( UINT index ) {
1
0
0
0
Alexandre Julliard : wbemprox: Get the processor type and model with SystemCpuInformation.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: 372bae07731bc43865922687e966b29adfc31a60 URL:
https://gitlab.winehq.org/wine/wine/-/commit/372bae07731bc43865922687e966b2…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 15 10:47:15 2024 +0200 wbemprox: Get the processor type and model with SystemCpuInformation. --- dlls/wbemprox/builtin.c | 52 +++++++------------------------------------------ 1 file changed, 7 insertions(+), 45 deletions(-) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 18a7f5a5168..72ee294dd08 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -19,7 +19,6 @@ #define COBJMACROS #include <stdarg.h> -#include <intrin.h> #include "ntstatus.h" #define WIN32_NO_STATUS @@ -44,7 +43,6 @@ #include "setupapi.h" #include "ntddstor.h" -#include "wine/asm.h" #include "wine/debug.h" #include "wbemprox_private.h" @@ -3410,29 +3408,6 @@ done: return status; } -void do_cpuid( unsigned int ax, int *p ) -{ -#if defined(__i386__) || defined(__x86_64__) - __cpuid( p, ax ); -#else - FIXME("\n"); -#endif -} - -static unsigned int get_processor_model( unsigned int reg0, unsigned int *stepping, unsigned int *family ) -{ - unsigned int model, family_id = (reg0 & (0x0f << 8)) >> 8; - - model = (reg0 & (0x0f << 4)) >> 4; - if (family_id == 6 || family_id == 15) model |= (reg0 & (0x0f << 16)) >> 12; - if (family) - { - *family = family_id; - if (family_id == 15) *family += (reg0 & (0xff << 20)) >> 20; - } - *stepping = reg0 & 0x0f; - return model; -} static WCHAR *get_processor_manufacturer( UINT index, const char *buf, UINT len ) { WCHAR *ret = get_smbios_string( SMBIOS_TYPE_PROCESSOR, index, offsetof(struct smbios_processor, vendor), buf, len ); @@ -3452,22 +3427,6 @@ static WCHAR *get_processor_caption( UINT index ) swprintf( name, ARRAY_SIZE(name), L"Hardware\\Description\\System\\CentralProcessor\\%u", index ); return get_reg_str( HKEY_LOCAL_MACHINE, name, L"Identifier" ); } -static void get_processor_version( WCHAR *version, UINT len ) -{ - int regs[4] = {0, 0, 0, 0}; - unsigned int model, stepping; - - do_cpuid( 1, regs ); - - model = get_processor_model( regs[0], &stepping, NULL ); - swprintf( version, len, L"Model %u Stepping %u", model, stepping ); -} -static UINT16 get_processor_revision(void) -{ - int regs[4] = {0, 0, 0, 0}; - do_cpuid( 1, regs ); - return regs[0]; -} static WCHAR *get_processor_name( UINT index, const char *buf, UINT len ) { WCHAR *ret = get_smbios_string( SMBIOS_TYPE_PROCESSOR, index, offsetof(struct smbios_processor, version), buf, len ); @@ -3511,6 +3470,7 @@ static enum fill_status fill_processor( struct table *table, const struct expr * struct record_processor *rec; UINT i, len, offset = 0, num_rows = 0, num_packages; enum fill_status status = FILL_STATUS_UNFILTERED; + SYSTEM_CPU_INFORMATION info; char *buf; len = GetSystemFirmwareTable( RSMB, 0, NULL, 0 ); @@ -3525,7 +3485,9 @@ static enum fill_status fill_processor( struct table *table, const struct expr * return FILL_STATUS_FAILED; } - get_processor_version( version, ARRAY_SIZE( version ) ); + RtlGetNativeSystemInformation( SystemCpuInformation, &info, sizeof(info), NULL ); + swprintf( version, sizeof(version), L"Model %u, Stepping %u", + HIBYTE(info.ProcessorRevision), LOBYTE(info.ProcessorRevision) ); for (i = 0; i < num_packages; i++) { @@ -3535,7 +3497,7 @@ static enum fill_status fill_processor( struct table *table, const struct expr * rec = (struct record_processor *)(table->data + offset); rec->addresswidth = (proc->characteristics & 4) ? 64 : 32; - rec->architecture = !wcscmp( get_osarchitecture(), L"32-bit" ) ? 0 : 9; + rec->architecture = info.ProcessorArchitecture; rec->caption = get_processor_caption( i ); rec->cpu_status = proc->status; rec->currentclockspeed = get_processor_currentclockspeed( i ); @@ -3544,7 +3506,7 @@ static enum fill_status fill_processor( struct table *table, const struct expr * swprintf( device_id, ARRAY_SIZE( device_id ), L"CPU%u", i ); rec->device_id = wcsdup( device_id ); rec->family = proc->family; - rec->level = 15; + rec->level = info.ProcessorLevel; rec->manufacturer = get_processor_manufacturer( i, buf, len ); rec->maxclockspeed = get_processor_maxclockspeed( i ); rec->name = get_processor_name( i, buf, len ); @@ -3553,7 +3515,7 @@ static enum fill_status fill_processor( struct table *table, const struct expr * swprintf( processor_id, ARRAY_SIZE( processor_id ), L"%016I64X", proc->id ); rec->processor_id = wcsdup( processor_id ); rec->processortype = proc->type; - rec->revision = get_processor_revision(); + rec->revision = info.ProcessorRevision; rec->version = wcsdup( version ); if (!match_row( table, i, cond, &status )) {
1
0
0
0
Alexandre Julliard : wbemprox: Get a few more processor details from the SMBIOS table.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: 76d9721ebb860885709505ab476f12ca615ea394 URL:
https://gitlab.winehq.org/wine/wine/-/commit/76d9721ebb860885709505ab476f12…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 15 10:45:34 2024 +0200 wbemprox: Get a few more processor details from the SMBIOS table. --- dlls/wbemprox/builtin.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index c371537c66d..18a7f5a5168 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -3534,16 +3534,16 @@ static enum fill_status fill_processor( struct table *table, const struct expr * proc = (const struct smbios_processor *)hdr; rec = (struct record_processor *)(table->data + offset); - rec->addresswidth = !wcscmp( get_osarchitecture(), L"32-bit" ) ? 32 : 64; + rec->addresswidth = (proc->characteristics & 4) ? 64 : 32; rec->architecture = !wcscmp( get_osarchitecture(), L"32-bit" ) ? 0 : 9; rec->caption = get_processor_caption( i ); - rec->cpu_status = 1; /* CPU Enabled */ + rec->cpu_status = proc->status; rec->currentclockspeed = get_processor_currentclockspeed( i ); - rec->datawidth = !wcscmp( get_osarchitecture(), L"32-bit" ) ? 32 : 64; + rec->datawidth = rec->addresswidth; rec->description = get_processor_caption( i ); swprintf( device_id, ARRAY_SIZE( device_id ), L"CPU%u", i ); rec->device_id = wcsdup( device_id ); - rec->family = 2; /* Unknown */ + rec->family = proc->family; rec->level = 15; rec->manufacturer = get_processor_manufacturer( i, buf, len ); rec->maxclockspeed = get_processor_maxclockspeed( i ); @@ -3552,7 +3552,7 @@ static enum fill_status fill_processor( struct table *table, const struct expr * rec->num_logical_processors = proc->thread_count2; swprintf( processor_id, ARRAY_SIZE( processor_id ), L"%016I64X", proc->id ); rec->processor_id = wcsdup( processor_id ); - rec->processortype = 3; /* central processor */ + rec->processortype = proc->type; rec->revision = get_processor_revision(); rec->version = wcsdup( version ); if (!match_row( table, i, cond, &status ))
1
0
0
0
Alexandre Julliard : wbemprox: Get the processor id from the SMBIOS table.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: 865522533dc15727e5dae4692d4b64cf9a1b8dde URL:
https://gitlab.winehq.org/wine/wine/-/commit/865522533dc15727e5dae4692d4b64…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 15 10:44:34 2024 +0200 wbemprox: Get the processor id from the SMBIOS table. --- dlls/wbemprox/builtin.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index d1eaeef9e50..c371537c66d 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -3468,13 +3468,6 @@ static UINT16 get_processor_revision(void) do_cpuid( 1, regs ); return regs[0]; } -static void get_processor_id( WCHAR *processor_id, UINT len ) -{ - int regs[4] = {0, 0, 0, 0}; - - do_cpuid( 1, regs ); - swprintf( processor_id, len, L"%08X%08X", regs[3], regs[0] ); -} static WCHAR *get_processor_name( UINT index, const char *buf, UINT len ) { WCHAR *ret = get_smbios_string( SMBIOS_TYPE_PROCESSOR, index, offsetof(struct smbios_processor, version), buf, len ); @@ -3532,7 +3525,6 @@ static enum fill_status fill_processor( struct table *table, const struct expr * return FILL_STATUS_FAILED; } - get_processor_id( processor_id, ARRAY_SIZE( processor_id ) ); get_processor_version( version, ARRAY_SIZE( version ) ); for (i = 0; i < num_packages; i++) @@ -3558,6 +3550,7 @@ static enum fill_status fill_processor( struct table *table, const struct expr * rec->name = get_processor_name( i, buf, len ); rec->num_cores = proc->core_count2; rec->num_logical_processors = proc->thread_count2; + swprintf( processor_id, ARRAY_SIZE( processor_id ), L"%016I64X", proc->id ); rec->processor_id = wcsdup( processor_id ); rec->processortype = 3; /* central processor */ rec->revision = get_processor_revision();
1
0
0
0
Alexandre Julliard : wbemprox: Get the processor count from the SMBIOS table.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: 29ce1e685db0d4f331383e1520617b2f55caf6d1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/29ce1e685db0d4f331383e1520617b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 15 10:43:15 2024 +0200 wbemprox: Get the processor count from the SMBIOS table. --- dlls/wbemprox/builtin.c | 63 +++++++++++++++++-------------------------------- 1 file changed, 21 insertions(+), 42 deletions(-) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 099b4481bfd..d1eaeef9e50 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -1663,47 +1663,20 @@ static UINT get_processor_count(void) return info.NumberOfProcessors; } -static UINT get_logical_processor_count( UINT *num_physical, UINT *num_packages ) +static UINT get_physical_processor_count( const char *buf, UINT len, UINT *num_logical ) { - SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *buf, *entry; - UINT core_relation_count = 0, package_relation_count = 0; - NTSTATUS status; - ULONG len, offset = 0; - BOOL smt_enabled = FALSE; - DWORD all = RelationAll; - - if (num_packages) *num_packages = 1; - status = NtQuerySystemInformationEx( SystemLogicalProcessorInformationEx, &all, sizeof(all), NULL, 0, &len ); - if (status != STATUS_INFO_LENGTH_MISMATCH) return get_processor_count(); + const struct smbios_header *hdr; + const struct smbios_processor *proc; + UINT thread_count = 0, package_count = 0; - if (!(buf = malloc( len ))) return get_processor_count(); - status = NtQuerySystemInformationEx( SystemLogicalProcessorInformationEx, &all, sizeof(all), buf, len, &len ); - if (status != STATUS_SUCCESS) + while ((hdr = find_smbios_entry( SMBIOS_TYPE_PROCESSOR, package_count, buf, len ))) { - free( buf ); - return get_processor_count(); + proc = (const struct smbios_processor *)hdr; + thread_count += proc->thread_count2; + package_count++; } - - while (offset < len) - { - entry = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *)((char *)buf + offset); - - if (entry->Relationship == RelationProcessorCore) - { - core_relation_count++; - if (entry->Processor.Flags & LTP_PC_SMT) smt_enabled = TRUE; - } - else if (entry->Relationship == RelationProcessorPackage) - { - package_relation_count++; - } - offset += entry->Size; - } - - free( buf ); - if (num_physical) *num_physical = core_relation_count; - if (num_packages) *num_packages = package_relation_count; - return smt_enabled ? core_relation_count * 2 : core_relation_count; + if (num_logical) *num_logical = thread_count; + return package_count; } static UINT64 get_total_physical_memory(void) @@ -1811,7 +1784,7 @@ static enum fill_status fill_compsys( struct table *table, const struct expr *co rec->manufacturer = get_compsysproduct_vendor( buf, len ); rec->model = get_compsysproduct_name( buf, len ); rec->name = get_computername(); - rec->num_logical_processors = get_logical_processor_count( NULL, &rec->num_processors ); + rec->num_processors = get_physical_processor_count( buf, len, &rec->num_logical_processors ); rec->systemtype = get_systemtype(); rec->total_physical_memory = get_total_physical_memory(); rec->username = get_username(); @@ -3540,8 +3513,10 @@ static UINT get_processor_maxclockspeed( UINT index ) static enum fill_status fill_processor( struct table *table, const struct expr *cond ) { WCHAR device_id[14], processor_id[17], version[50]; + const struct smbios_header *hdr; + const struct smbios_processor *proc; struct record_processor *rec; - UINT i, len, offset = 0, num_rows = 0, num_logical, num_physical, num_packages; + UINT i, len, offset = 0, num_rows = 0, num_packages; enum fill_status status = FILL_STATUS_UNFILTERED; char *buf; @@ -3549,7 +3524,7 @@ static enum fill_status fill_processor( struct table *table, const struct expr * if (!(buf = malloc( len ))) return FILL_STATUS_FAILED; GetSystemFirmwareTable( RSMB, 0, buf, len ); - num_logical = get_logical_processor_count( &num_physical, &num_packages ); + num_packages = get_physical_processor_count( buf, len, NULL ); if (!resize_table( table, num_packages, sizeof(*rec) )) { @@ -3562,6 +3537,10 @@ static enum fill_status fill_processor( struct table *table, const struct expr * for (i = 0; i < num_packages; i++) { + if (!(hdr = find_smbios_entry( SMBIOS_TYPE_PROCESSOR, i, buf, len )) || hdr->length < sizeof(*proc)) + continue; + proc = (const struct smbios_processor *)hdr; + rec = (struct record_processor *)(table->data + offset); rec->addresswidth = !wcscmp( get_osarchitecture(), L"32-bit" ) ? 32 : 64; rec->architecture = !wcscmp( get_osarchitecture(), L"32-bit" ) ? 0 : 9; @@ -3577,8 +3556,8 @@ static enum fill_status fill_processor( struct table *table, const struct expr * rec->manufacturer = get_processor_manufacturer( i, buf, len ); rec->maxclockspeed = get_processor_maxclockspeed( i ); rec->name = get_processor_name( i, buf, len ); - rec->num_cores = num_physical / num_packages; - rec->num_logical_processors = num_logical / num_packages; + rec->num_cores = proc->core_count2; + rec->num_logical_processors = proc->thread_count2; rec->processor_id = wcsdup( processor_id ); rec->processortype = 3; /* central processor */ rec->revision = get_processor_revision();
1
0
0
0
Alexandre Julliard : wbemprox: Get the processor name from the SMBIOS table.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: a36cf20d708a7e71ab3ea44847687165331e8e91 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a36cf20d708a7e71ab3ea448476871…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 15 10:42:03 2024 +0200 wbemprox: Get the processor name from the SMBIOS table. --- dlls/wbemprox/builtin.c | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index ff6e35c5e24..099b4481bfd 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -3460,14 +3460,6 @@ static unsigned int get_processor_model( unsigned int reg0, unsigned int *steppi *stepping = reg0 & 0x0f; return model; } -static void regs_to_str( int *regs, unsigned int len, WCHAR *buffer ) -{ - unsigned int i; - unsigned char *p = (unsigned char *)regs; - - for (i = 0; i < len; i++) { buffer[i] = *p++; } - buffer[i] = 0; -} static WCHAR *get_processor_manufacturer( UINT index, const char *buf, UINT len ) { WCHAR *ret = get_smbios_string( SMBIOS_TYPE_PROCESSOR, index, offsetof(struct smbios_processor, vendor), buf, len ); @@ -3510,22 +3502,11 @@ static void get_processor_id( WCHAR *processor_id, UINT len ) do_cpuid( 1, regs ); swprintf( processor_id, len, L"%08X%08X", regs[3], regs[0] ); } -static void get_processor_name( WCHAR *name ) +static WCHAR *get_processor_name( UINT index, const char *buf, UINT len ) { - int regs[4] = {0, 0, 0, 0}; - int i; - - do_cpuid( 0x80000000, regs ); - if (regs[0] >= 0x80000004) - { - do_cpuid( 0x80000002, regs ); - regs_to_str( regs, 16, name ); - do_cpuid( 0x80000003, regs ); - regs_to_str( regs, 16, name + 16 ); - do_cpuid( 0x80000004, regs ); - regs_to_str( regs, 16, name + 32 ); - } - for (i = lstrlenW(name) - 1; i >= 0 && name[i] == ' '; i--) name[i] = 0; + WCHAR *ret = get_smbios_string( SMBIOS_TYPE_PROCESSOR, index, offsetof(struct smbios_processor, version), buf, len ); + if (!ret) ret = wcsdup( L"Unknown CPU" ); + return ret; } static UINT get_processor_currentclockspeed( UINT index ) { @@ -3558,7 +3539,7 @@ static UINT get_processor_maxclockspeed( UINT index ) static enum fill_status fill_processor( struct table *table, const struct expr *cond ) { - WCHAR device_id[14], processor_id[17], name[49] = {0}, version[50]; + WCHAR device_id[14], processor_id[17], version[50]; struct record_processor *rec; UINT i, len, offset = 0, num_rows = 0, num_logical, num_physical, num_packages; enum fill_status status = FILL_STATUS_UNFILTERED; @@ -3577,7 +3558,6 @@ static enum fill_status fill_processor( struct table *table, const struct expr * } get_processor_id( processor_id, ARRAY_SIZE( processor_id ) ); - get_processor_name( name ); get_processor_version( version, ARRAY_SIZE( version ) ); for (i = 0; i < num_packages; i++) @@ -3596,7 +3576,7 @@ static enum fill_status fill_processor( struct table *table, const struct expr * rec->level = 15; rec->manufacturer = get_processor_manufacturer( i, buf, len ); rec->maxclockspeed = get_processor_maxclockspeed( i ); - rec->name = wcsdup( name ); + rec->name = get_processor_name( i, buf, len ); rec->num_cores = num_physical / num_packages; rec->num_logical_processors = num_logical / num_packages; rec->processor_id = wcsdup( processor_id );
1
0
0
0
Alexandre Julliard : wbemprox: Get the processor manufacturer from the SMBIOS table.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: 63cd5d18f6f7d0fe182dc354c741248ca5d82b13 URL:
https://gitlab.winehq.org/wine/wine/-/commit/63cd5d18f6f7d0fe182dc354c74124…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 15 10:41:23 2024 +0200 wbemprox: Get the processor manufacturer from the SMBIOS table. --- dlls/wbemprox/builtin.c | 75 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 57 insertions(+), 18 deletions(-) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index e362fec02a5..ff6e35c5e24 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -1221,10 +1221,13 @@ struct smbios_prologue enum smbios_type { - SMBIOS_TYPE_BIOS, - SMBIOS_TYPE_SYSTEM, - SMBIOS_TYPE_BASEBOARD, - SMBIOS_TYPE_CHASSIS, + SMBIOS_TYPE_BIOS = 0, + SMBIOS_TYPE_SYSTEM = 1, + SMBIOS_TYPE_BASEBOARD = 2, + SMBIOS_TYPE_CHASSIS = 3, + SMBIOS_TYPE_PROCESSOR = 4, + SMBIOS_TYPE_BOOTINFO = 32, + SMBIOS_TYPE_END = 127 }; struct smbios_header @@ -1278,6 +1281,37 @@ struct smbios_system BYTE serial; BYTE uuid[16]; }; + +struct smbios_processor +{ + struct smbios_header hdr; + BYTE socket; + BYTE type; + BYTE family; + BYTE vendor; + ULONGLONG id; + BYTE version; + BYTE voltage; + WORD clock; + WORD max_speed; + WORD cur_speed; + BYTE status; + BYTE upgrade; + WORD l1cache; + WORD l2cache; + WORD l3cache; + BYTE serial; + BYTE asset_tag; + BYTE part_number; + BYTE core_count; + BYTE core_enabled; + BYTE thread_count; + WORD characteristics; + WORD family2; + WORD core_count2; + WORD core_enabled2; + WORD thread_count2; +}; #include "poppack.h" #define RSMB (('R' << 24) | ('S' << 16) | ('M' << 8) | 'B') @@ -3434,16 +3468,11 @@ static void regs_to_str( int *regs, unsigned int len, WCHAR *buffer ) for (i = 0; i < len; i++) { buffer[i] = *p++; } buffer[i] = 0; } -static void get_processor_manufacturer( WCHAR *manufacturer, UINT len ) +static WCHAR *get_processor_manufacturer( UINT index, const char *buf, UINT len ) { - int tmp, regs[4] = {0, 0, 0, 0}; - - do_cpuid( 0, regs ); - tmp = regs[2]; /* swap edx and ecx */ - regs[2] = regs[3]; - regs[3] = tmp; - - regs_to_str( regs + 1, min( 12, len ), manufacturer ); + WCHAR *ret = get_smbios_string( SMBIOS_TYPE_PROCESSOR, index, offsetof(struct smbios_processor, vendor), buf, len ); + if (!ret) ret = wcsdup( L"Unknown" ); + return ret; } static const WCHAR *get_osarchitecture(void) { @@ -3529,17 +3558,25 @@ static UINT get_processor_maxclockspeed( UINT index ) static enum fill_status fill_processor( struct table *table, const struct expr *cond ) { - WCHAR device_id[14], processor_id[17], manufacturer[13], name[49] = {0}, version[50]; + WCHAR device_id[14], processor_id[17], name[49] = {0}, version[50]; struct record_processor *rec; - UINT i, offset = 0, num_rows = 0, num_logical, num_physical, num_packages; + UINT i, len, offset = 0, num_rows = 0, num_logical, num_physical, num_packages; enum fill_status status = FILL_STATUS_UNFILTERED; + char *buf; + + len = GetSystemFirmwareTable( RSMB, 0, NULL, 0 ); + if (!(buf = malloc( len ))) return FILL_STATUS_FAILED; + GetSystemFirmwareTable( RSMB, 0, buf, len ); num_logical = get_logical_processor_count( &num_physical, &num_packages ); - if (!resize_table( table, num_packages, sizeof(*rec) )) return FILL_STATUS_FAILED; + if (!resize_table( table, num_packages, sizeof(*rec) )) + { + free( buf ); + return FILL_STATUS_FAILED; + } get_processor_id( processor_id, ARRAY_SIZE( processor_id ) ); - get_processor_manufacturer( manufacturer, ARRAY_SIZE( manufacturer ) ); get_processor_name( name ); get_processor_version( version, ARRAY_SIZE( version ) ); @@ -3557,7 +3594,7 @@ static enum fill_status fill_processor( struct table *table, const struct expr * rec->device_id = wcsdup( device_id ); rec->family = 2; /* Unknown */ rec->level = 15; - rec->manufacturer = wcsdup( manufacturer ); + rec->manufacturer = get_processor_manufacturer( i, buf, len ); rec->maxclockspeed = get_processor_maxclockspeed( i ); rec->name = wcsdup( name ); rec->num_cores = num_physical / num_packages; @@ -3575,6 +3612,8 @@ static enum fill_status fill_processor( struct table *table, const struct expr * num_rows++; } + free( buf ); + TRACE("created %u rows\n", num_rows); table->num_rows = num_rows; return status;
1
0
0
0
Alexandre Julliard : wbemprox: Support multiple SMBIOS entries of the same type.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: a5e707f7a1ed7f65ef6484ffcdbf2ee597bad030 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a5e707f7a1ed7f65ef6484ffcdbf2e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 15 10:40:49 2024 +0200 wbemprox: Support multiple SMBIOS entries of the same type. --- dlls/wbemprox/builtin.c | 61 +++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 32 deletions(-)
1
0
0
0
Alexandre Julliard : wbemprox: Get the processor caption from the registry.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: 7a054a4a8f477142d88c5ec07e0ba32ab52875c9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7a054a4a8f477142d88c5ec07e0ba3…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 15 10:39:21 2024 +0200 wbemprox: Get the processor caption from the registry. --- dlls/wbemprox/builtin.c | 68 ++++++++++++++++++++----------------------------- 1 file changed, 28 insertions(+), 40 deletions(-) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index fa4c6ee6351..ebfd8e5fc9d 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -1351,6 +1351,27 @@ static WCHAR *get_smbios_string( enum smbios_type type, size_t field_offset, con return get_smbios_string_by_id( ((const BYTE *)hdr)[field_offset], buf, offset, len ); } +static WCHAR *get_reg_str( HKEY root, const WCHAR *path, const WCHAR *value ) +{ + HKEY hkey = 0; + DWORD size, type; + WCHAR *ret = NULL; + + if (!RegOpenKeyExW( root, path, 0, KEY_READ, &hkey ) && + !RegQueryValueExW( hkey, value, NULL, &type, NULL, &size ) && type == REG_SZ && + (ret = malloc( size + sizeof(WCHAR) ))) + { + size += sizeof(WCHAR); + if (RegQueryValueExW( hkey, value, NULL, NULL, (BYTE *)ret, &size )) + { + free( ret ); + ret = NULL; + } + } + if (hkey) RegCloseKey( hkey ); + return ret; +} + static WCHAR *get_baseboard_manufacturer( const char *buf, UINT len ) { WCHAR *ret = get_smbios_string( SMBIOS_TYPE_BASEBOARD, offsetof(struct smbios_baseboard, vendor), buf, len ); @@ -3434,22 +3455,11 @@ static const WCHAR *get_osarchitecture(void) if (info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) return L"64-bit"; return L"32-bit"; } -static void get_processor_caption( WCHAR *caption, UINT len ) +static WCHAR *get_processor_caption( UINT index ) { - const WCHAR *arch; - WCHAR manufacturer[13]; - int regs[4] = {0, 0, 0, 0}; - unsigned int family, model, stepping; - - get_processor_manufacturer( manufacturer, ARRAY_SIZE( manufacturer ) ); - if (!wcscmp( get_osarchitecture(), L"32-bit" )) arch = L"x86"; - else if (!wcscmp( manufacturer, L"AuthenticAMD" )) arch = L"AMD64"; - else arch = L"Intel64"; - - do_cpuid( 1, regs ); - - model = get_processor_model( regs[0], &stepping, &family ); - swprintf( caption, len, L"%s Family %u Model %u Stepping %u", arch, family, model, stepping ); + WCHAR name[64]; + swprintf( name, ARRAY_SIZE(name), L"Hardware\\Description\\System\\CentralProcessor\\%u", index ); + return get_reg_str( HKEY_LOCAL_MACHINE, name, L"Identifier" ); } static void get_processor_version( WCHAR *version, UINT len ) { @@ -3522,7 +3532,7 @@ static UINT get_processor_maxclockspeed( UINT index ) static enum fill_status fill_processor( struct table *table, const struct expr *cond ) { - WCHAR caption[100], device_id[14], processor_id[17], manufacturer[13], name[49] = {0}, version[50]; + WCHAR device_id[14], processor_id[17], manufacturer[13], name[49] = {0}, version[50]; struct record_processor *rec; UINT i, offset = 0, num_rows = 0, num_logical, num_physical, num_packages; enum fill_status status = FILL_STATUS_UNFILTERED; @@ -3531,7 +3541,6 @@ static enum fill_status fill_processor( struct table *table, const struct expr * if (!resize_table( table, num_packages, sizeof(*rec) )) return FILL_STATUS_FAILED; - get_processor_caption( caption, ARRAY_SIZE( caption ) ); get_processor_id( processor_id, ARRAY_SIZE( processor_id ) ); get_processor_manufacturer( manufacturer, ARRAY_SIZE( manufacturer ) ); get_processor_name( name ); @@ -3542,11 +3551,11 @@ static enum fill_status fill_processor( struct table *table, const struct expr * rec = (struct record_processor *)(table->data + offset); rec->addresswidth = !wcscmp( get_osarchitecture(), L"32-bit" ) ? 32 : 64; rec->architecture = !wcscmp( get_osarchitecture(), L"32-bit" ) ? 0 : 9; - rec->caption = wcsdup( caption ); + rec->caption = get_processor_caption( i ); rec->cpu_status = 1; /* CPU Enabled */ rec->currentclockspeed = get_processor_currentclockspeed( i ); rec->datawidth = !wcscmp( get_osarchitecture(), L"32-bit" ) ? 32 : 64; - rec->description = wcsdup( caption ); + rec->description = get_processor_caption( i ); swprintf( device_id, ARRAY_SIZE( device_id ), L"CPU%u", i ); rec->device_id = wcsdup( device_id ); rec->family = 2; /* Unknown */ @@ -3657,27 +3666,6 @@ static WCHAR *get_locale(void) return ret; } -static WCHAR *get_reg_str( HKEY root, const WCHAR *path, const WCHAR *value ) -{ - HKEY hkey = 0; - DWORD size, type; - WCHAR *ret = NULL; - - if (!RegOpenKeyExW( root, path, 0, KEY_READ, &hkey ) && - !RegQueryValueExW( hkey, value, NULL, &type, NULL, &size ) && type == REG_SZ && - (ret = malloc( size + sizeof(WCHAR) ))) - { - size += sizeof(WCHAR); - if (RegQueryValueExW( hkey, value, NULL, NULL, (BYTE *)ret, &size )) - { - free( ret ); - ret = NULL; - } - } - if (hkey) RegCloseKey( hkey ); - return ret; -} - static WCHAR *get_organization(void) { return get_reg_str( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion",
1
0
0
0
Piotr Caban : msvcrt/tests: Don't link to _wcsicmp_l and _create_locale.
by Alexandre Julliard
15 May '24
15 May '24
Module: wine Branch: master Commit: d2043a73a6594cd11a0a93655007ebf45be6e7c2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d2043a73a6594cd11a0a93655007eb…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed May 15 13:45:53 2024 +0200 msvcrt/tests: Don't link to _wcsicmp_l and _create_locale. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=56682
--- dlls/msvcrt/tests/locale.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/dlls/msvcrt/tests/locale.c b/dlls/msvcrt/tests/locale.c index 38dc62eb416..cb56fe39754 100644 --- a/dlls/msvcrt/tests/locale.c +++ b/dlls/msvcrt/tests/locale.c @@ -27,6 +27,9 @@ static BOOL (__cdecl *p__crtGetStringTypeW)(DWORD, DWORD, const wchar_t*, int, W static int (__cdecl *pmemcpy_s)(void *, size_t, void*, size_t); static int (__cdecl *p___mb_cur_max_func)(void); static int *(__cdecl *p__p___mb_cur_max)(void); +static _locale_t(__cdecl *p_create_locale)(int, const char*); +static void(__cdecl *p_free_locale)(_locale_t); +static int (__cdecl *p_wcsicmp_l)(const wchar_t*, const wchar_t*, _locale_t); void* __cdecl _Gettnames(void); static void init(void) @@ -37,6 +40,9 @@ static void init(void) pmemcpy_s = (void*)GetProcAddress(hmod, "memcpy_s"); p___mb_cur_max_func = (void*)GetProcAddress(hmod, "___mb_cur_max_func"); p__p___mb_cur_max = (void*)GetProcAddress(hmod, "__p___mb_cur_max"); + p_create_locale = (void*)GetProcAddress(hmod, "_create_locale"); + p_free_locale = (void*)GetProcAddress(hmod, "_free_locale"); + p_wcsicmp_l = (void*)GetProcAddress(hmod, "_wcsicmp_l"); } static void test_setlocale(void) @@ -815,20 +821,27 @@ static void test__wcsicmp_l(void) }; int ret, i; + if (!p_wcsicmp_l || !p_create_locale) + { + win_skip("_wcsicmp_l or _create_locale not available\n"); + return; + } + ok(!!p_free_locale, "_free_locale not available\n"); + for(i=0; i<ARRAY_SIZE(tests); i++) { _locale_t loc = NULL; - if(tests[i].loc && !(loc = _create_locale(LC_ALL, tests[i].loc))) { + if(tests[i].loc && !(loc = p_create_locale(LC_ALL, tests[i].loc))) { win_skip("locale %s not available. skipping\n", tests[i].loc); continue; } - ret = _wcsicmp_l(tests[i].str1, tests[i].str2, loc); + ret = p_wcsicmp_l(tests[i].str1, tests[i].str2, loc); ok(ret == tests[i].exp, "_wcsicmp_l = %d, expected %d for test %d '%ls' vs '%ls' using %s locale\n", ret, tests[i].exp, i, tests[i].str1, tests[i].str2, loc ? tests[i].loc : "current"); if(loc) - _free_locale(loc); + p_free_locale(loc); } }
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
41
...
71
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
Results per page:
10
25
50
100
200