Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=52887 Signed-off-by: Louis Lenders xerox.xerox2000x@gmail.com --- dlls/wbemprox/builtin.c | 3 +++ dlls/wbemprox/tests/query.c | 1 + 2 files changed, 4 insertions(+)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 07a5873208f..9bfca994fbc 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -229,6 +229,7 @@ static const struct column col_networkadapterconfig[] = static const struct column col_operatingsystem[] = { { L"BuildNumber", CIM_STRING|COL_FLAG_DYNAMIC }, + { L"BuildType", CIM_STRING }, { L"Caption", CIM_STRING|COL_FLAG_DYNAMIC }, { L"CodeSet", CIM_STRING|COL_FLAG_DYNAMIC }, { L"CountryCode", CIM_STRING|COL_FLAG_DYNAMIC }, @@ -656,6 +657,7 @@ struct record_networkadapterconfig struct record_operatingsystem { const WCHAR *buildnumber; + const WCHAR *buildtype; const WCHAR *caption; const WCHAR *codeset; const WCHAR *countrycode; @@ -3613,6 +3615,7 @@ static enum fill_status fill_operatingsystem( struct table *table, const struct
rec = (struct record_operatingsystem *)table->data; rec->buildnumber = get_osbuildnumber( &ver ); + rec->buildtype = L"Wine build"; rec->caption = get_oscaption( &ver ); rec->codeset = get_codeset(); rec->countrycode = get_countrycode(); diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index 0a8c97ad166..6d287a4ca78 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1389,6 +1389,7 @@ static void test_Win32_OperatingSystem( IWbemServices *services ) ok( hr == S_OK, "got %#lx\n", hr );
check_property( obj, L"BuildNumber", VT_BSTR, CIM_STRING ); + check_property( obj, L"BuildType", VT_BSTR, CIM_STRING ); check_property( obj, L"Caption", VT_BSTR, CIM_STRING );
type = 0xdeadbeef;
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=52887 Signed-off-by: Louis Lenders xerox.xerox2000x@gmail.com --- dlls/wbemprox/builtin.c | 23 +++++++++++++++++++++++ dlls/wbemprox/tests/query.c | 1 + 2 files changed, 24 insertions(+)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 9bfca994fbc..9f6b6f0efbe 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -250,6 +250,7 @@ static const struct column col_operatingsystem[] = { L"OSType", CIM_UINT16 }, { L"Primary", CIM_BOOLEAN }, { L"ProductType", CIM_UINT32 }, + { L"RegisteredUser", CIM_STRING|COL_FLAG_DYNAMIC }, { L"SerialNumber", CIM_STRING|COL_FLAG_DYNAMIC }, { L"ServicePackMajorVersion", CIM_UINT16 }, { L"ServicePackMinorVersion", CIM_UINT16 }, @@ -678,6 +679,7 @@ struct record_operatingsystem UINT16 ostype; int primary; UINT32 producttype; + const WCHAR *registereduser; const WCHAR *serialnumber; UINT16 servicepackmajor; UINT16 servicepackminor; @@ -3592,6 +3594,26 @@ static DWORD get_operatingsystemsku(void) GetProductInfo( 6, 0, 0, 0, &ret ); return ret; } +static WCHAR *get_registereduser(void) +{ + HKEY hkey = 0; + DWORD size, type; + WCHAR *ret = NULL; + + if (!RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"Software\Microsoft\Windows NT\CurrentVersion", 0, KEY_READ, &hkey ) && + !RegQueryValueExW( hkey, L"RegisteredOwner", NULL, &type, NULL, &size ) && type == REG_SZ && + (ret = malloc( size + sizeof(WCHAR) ))) + { + size += sizeof(WCHAR); + if (RegQueryValueExW( hkey, L"RegisteredOwner", NULL, NULL, (BYTE *)ret, &size )) + { + free( ret ); + ret = NULL; + } + } + if (hkey) RegCloseKey( hkey ); + return ret; +} static INT16 get_currenttimezone(void) { TIME_ZONE_INFORMATION info; @@ -3636,6 +3658,7 @@ static enum fill_status fill_operatingsystem( struct table *table, const struct rec->ostype = 18; /* WINNT */ rec->primary = -1; rec->producttype = 1; + rec->registereduser = get_registereduser(); rec->serialnumber = get_osserialnumber(); rec->servicepackmajor = ver.wServicePackMajor; rec->servicepackminor = ver.wServicePackMinor; diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index 6d287a4ca78..e4a8a8d361b 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1430,6 +1430,7 @@ static void test_Win32_OperatingSystem( IWbemServices *services ) check_property( obj, L"Manufacturer", VT_BSTR, CIM_STRING ); check_property( obj, L"OSType", VT_I4, CIM_UINT16 ); check_property( obj, L"ProductType", VT_I4, CIM_UINT32 ); + check_property( obj, L"RegisteredUser", VT_BSTR, CIM_STRING ); check_property( obj, L"ServicePackMajorVersion", VT_I4, CIM_UINT16 ); check_property( obj, L"ServicePackMinorVersion", VT_I4, CIM_UINT16 ); check_property( obj, L"SuiteMask", VT_I4, CIM_UINT32 );
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=52887 Signed-off-by: Louis Lenders xerox.xerox2000x@gmail.com --- dlls/wbemprox/builtin.c | 23 +++++++++++++++++++++++ dlls/wbemprox/tests/query.c | 1 + 2 files changed, 24 insertions(+)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 9f6b6f0efbe..405f71b8bd3 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -244,6 +244,7 @@ static const struct column col_operatingsystem[] = { L"Manufacturer", CIM_STRING }, { L"Name", CIM_STRING|COL_FLAG_DYNAMIC }, { L"OperatingSystemSKU", CIM_UINT32 }, + { L"Organization", CIM_STRING|COL_FLAG_DYNAMIC }, { L"OSArchitecture", CIM_STRING }, { L"OSLanguage", CIM_UINT32 }, { L"OSProductSuite", CIM_UINT32 }, @@ -673,6 +674,7 @@ struct record_operatingsystem const WCHAR *manufacturer; const WCHAR *name; UINT32 operatingsystemsku; + const WCHAR *organization; const WCHAR *osarchitecture; UINT32 oslanguage; UINT32 osproductsuite; @@ -3503,6 +3505,26 @@ static WCHAR *get_locale(void) if (ret) GetLocaleInfoW( LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, ret, 5 ); return ret; } +static WCHAR *get_organization(void) +{ + HKEY hkey = 0; + DWORD size, type; + WCHAR *ret = NULL; + + if (!RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"Software\Microsoft\Windows NT\CurrentVersion", 0, KEY_READ, &hkey ) && + !RegQueryValueExW( hkey, L"RegisteredOrganization", NULL, &type, NULL, &size ) && type == REG_SZ && + (ret = malloc( size + sizeof(WCHAR) ))) + { + size += sizeof(WCHAR); + if (RegQueryValueExW( hkey, L"RegisteredOrganization", NULL, NULL, (BYTE *)ret, &size )) + { + free( ret ); + ret = NULL; + } + } + if (hkey) RegCloseKey( hkey ); + return ret; +} static WCHAR *get_osbuildnumber( OSVERSIONINFOEXW *ver ) { WCHAR *ret = malloc( 11 * sizeof(WCHAR) ); @@ -3652,6 +3674,7 @@ static enum fill_status fill_operatingsystem( struct table *table, const struct rec->manufacturer = L"The Wine Project"; rec->name = get_osname( rec->caption ); rec->operatingsystemsku = get_operatingsystemsku(); + rec->organization = get_organization(); rec->osarchitecture = get_osarchitecture(); rec->oslanguage = GetSystemDefaultLangID(); rec->osproductsuite = 2461140; /* Windows XP Professional */ diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index e4a8a8d361b..0d2848f609f 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1428,6 +1428,7 @@ static void test_Win32_OperatingSystem( IWbemServices *services ) check_property( obj, L"CSName", VT_BSTR, CIM_STRING ); check_property( obj, L"CurrentTimeZone", VT_I2, CIM_SINT16 ); check_property( obj, L"Manufacturer", VT_BSTR, CIM_STRING ); + check_property( obj, L"Organization", VT_BSTR, CIM_STRING ); check_property( obj, L"OSType", VT_I4, CIM_UINT16 ); check_property( obj, L"ProductType", VT_I4, CIM_UINT32 ); check_property( obj, L"RegisteredUser", VT_BSTR, CIM_STRING );
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=52887 Signed-off-by: Louis Lenders xerox.xerox2000x@gmail.com --- dlls/wbemprox/builtin.c | 3 +++ dlls/wbemprox/tests/query.c | 1 + 2 files changed, 4 insertions(+)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 405f71b8bd3..b36b9ae67b9 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -228,6 +228,7 @@ static const struct column col_networkadapterconfig[] = }; static const struct column col_operatingsystem[] = { + { L"BootDevice", CIM_STRING }, { L"BuildNumber", CIM_STRING|COL_FLAG_DYNAMIC }, { L"BuildType", CIM_STRING }, { L"Caption", CIM_STRING|COL_FLAG_DYNAMIC }, @@ -658,6 +659,7 @@ struct record_networkadapterconfig }; struct record_operatingsystem { + const WCHAR *bootdevice; const WCHAR *buildnumber; const WCHAR *buildtype; const WCHAR *caption; @@ -3658,6 +3660,7 @@ static enum fill_status fill_operatingsystem( struct table *table, const struct RtlGetVersion( &ver );
rec = (struct record_operatingsystem *)table->data; + rec->bootdevice = L"\Device\HarddiskVolume1"; rec->buildnumber = get_osbuildnumber( &ver ); rec->buildtype = L"Wine build"; rec->caption = get_oscaption( &ver ); diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index 0d2848f609f..80f4f678938 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1388,6 +1388,7 @@ static void test_Win32_OperatingSystem( IWbemServices *services ) hr = IWbemClassObject_EndEnumeration( obj ); ok( hr == S_OK, "got %#lx\n", hr );
+ check_property( obj, L"BootDevice", VT_BSTR, CIM_STRING ); check_property( obj, L"BuildNumber", VT_BSTR, CIM_STRING ); check_property( obj, L"BuildType", VT_BSTR, CIM_STRING ); check_property( obj, L"Caption", VT_BSTR, CIM_STRING );
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=52887 Signed-off-by: Louis Lenders xerox.xerox2000x@gmail.com --- dlls/wbemprox/builtin.c | 10 ++++++++++ dlls/wbemprox/tests/query.c | 1 + 2 files changed, 11 insertions(+)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index b36b9ae67b9..a0bd5b11f7f 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -263,6 +263,7 @@ static const struct column col_operatingsystem[] = { L"TotalVirtualMemorySize", CIM_UINT64 }, { L"TotalVisibleMemorySize", CIM_UINT64 }, { L"Version", CIM_STRING|COL_FLAG_DYNAMIC }, + { L"WindowsDirectory", CIM_STRING }, }; static const struct column col_param[] = { @@ -694,6 +695,7 @@ struct record_operatingsystem UINT64 totalvirtualmemorysize; UINT64 totalvisiblememorysize; const WCHAR *version; + const WCHAR *windowsdirectory; }; struct record_param { @@ -3489,6 +3491,13 @@ static WCHAR *get_systemdrive(void) free( ret ); return NULL; } +static WCHAR *get_systemroot(void) +{ + WCHAR *ret = malloc( 11 * sizeof(WCHAR) ); /* "c:\windows" */ + if (ret && GetEnvironmentVariableW( L"SystemRoot", ret, 11 )) return ret; + free( ret ); + return NULL; +} static WCHAR *get_codeset(void) { WCHAR *ret = malloc( 11 * sizeof(WCHAR) ); @@ -3695,6 +3704,7 @@ static enum fill_status fill_operatingsystem( struct table *table, const struct rec->totalvirtualmemorysize = get_total_physical_memory() / 1024; rec->totalvisiblememorysize = rec->totalvirtualmemorysize; rec->version = get_osversion( &ver ); + rec->windowsdirectory = get_systemroot(); if (!match_row( table, row, cond, &status )) free_row_values( table, row ); else row++;
diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index 80f4f678938..b46d1b1ad7b 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1441,6 +1441,7 @@ static void test_Win32_OperatingSystem( IWbemServices *services ) check_property( obj, L"TotalVirtualMemorySize", VT_BSTR, CIM_UINT64 ); check_property( obj, L"Status", VT_BSTR, CIM_STRING ); check_property( obj, L"SystemDrive", VT_BSTR, CIM_STRING ); + check_property( obj, L"WindowsDirectory", VT_BSTR, CIM_STRING );
IWbemClassObject_Release( obj ); IEnumWbemClassObject_Release( result );
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=113417
Your paranoid android.
=== build (build log) ===
error: patch failed: dlls/wbemprox/builtin.c:263 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wbemprox/builtin.c:263 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wbemprox/builtin.c:263 Task: Patch failed to apply
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=52887 Signed-off-by: Louis Lenders xerox.xerox2000x@gmail.com --- dlls/wbemprox/builtin.c | 18 +++++++++++------- dlls/wbemprox/tests/query.c | 1 + 2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index a0bd5b11f7f..cab598be5c6 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -105,6 +105,7 @@ static const struct column col_compsys[] = { L"Name", CIM_STRING|COL_FLAG_DYNAMIC }, { L"NumberOfLogicalProcessors", CIM_UINT32 }, { L"NumberOfProcessors", CIM_UINT32 }, + { L"SystemType", CIM_STRING }, { L"TotalPhysicalMemory", CIM_UINT64 }, { L"UserName", CIM_STRING|COL_FLAG_DYNAMIC }, }; @@ -537,6 +538,7 @@ struct record_computersystem const WCHAR *name; UINT32 num_logical_processors; UINT32 num_processors; + const WCHAR *systemtype; UINT64 total_physical_memory; const WCHAR *username; }; @@ -1568,6 +1570,14 @@ static WCHAR *get_computername(void) return ret; }
+static const WCHAR *get_osarchitecture(void) +{ + SYSTEM_INFO info; + GetNativeSystemInfo( &info ); + if (info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) return L"64-bit"; + return L"32-bit"; +} + static WCHAR *get_username(void) { WCHAR *ret; @@ -1602,6 +1612,7 @@ static enum fill_status fill_compsys( struct table *table, const struct expr *co rec->model = L"Wine"; rec->name = get_computername(); rec->num_logical_processors = get_logical_processor_count( NULL, &rec->num_processors ); + rec->systemtype = !wcscmp( get_osarchitecture(), L"64-bit" ) ? L"x64 based PC" : L"x86 based PC"; rec->total_physical_memory = get_total_physical_memory(); rec->username = get_username(); if (!match_row( table, row, cond, &status )) free_row_values( table, row ); @@ -3288,13 +3299,6 @@ static void get_processor_manufacturer( WCHAR *manufacturer, UINT len )
regs_to_str( regs + 1, min( 12, len ), manufacturer ); } -static const WCHAR *get_osarchitecture(void) -{ - SYSTEM_INFO info; - GetNativeSystemInfo( &info ); - if (info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) return L"64-bit"; - return L"32-bit"; -} static void get_processor_caption( WCHAR *caption, UINT len ) { const WCHAR *arch; diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index b46d1b1ad7b..aa6dc132ac6 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -752,6 +752,7 @@ static void test_Win32_ComputerSystem( IWbemServices *services ) }
check_property( obj, L"NumberOfProcessors", VT_I4, CIM_UINT32 ); + check_property( obj, L"SystemType", VT_BSTR, CIM_STRING );
type = 0xdeadbeef; VariantInit( &value );
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=113418
Your paranoid android.
=== build (build log) ===
error: patch failed: dlls/wbemprox/builtin.c:263 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wbemprox/builtin.c:263 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wbemprox/builtin.c:263 Task: Patch failed to apply
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=52887 Signed-off-by: Louis Lenders xerox.xerox2000x@gmail.com --- dlls/wbemprox/builtin.c | 12 ++++++++++++ dlls/wbemprox/tests/query.c | 1 + 2 files changed, 13 insertions(+)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index cab598be5c6..7075e4909db 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -239,6 +239,7 @@ static const struct column col_operatingsystem[] = { L"CSName", CIM_STRING|COL_FLAG_DYNAMIC }, { L"CurrentTimeZone", CIM_SINT16 }, { L"FreePhysicalMemory", CIM_UINT64 }, + { L"FreeVirtualMemory", CIM_UINT64 }, { L"InstallDate", CIM_DATETIME }, { L"LastBootUpTime", CIM_DATETIME|COL_FLAG_DYNAMIC }, { L"LocalDateTime", CIM_DATETIME|COL_FLAG_DYNAMIC }, @@ -672,6 +673,7 @@ struct record_operatingsystem const WCHAR *csname; INT16 currenttimezone; UINT64 freephysicalmemory; + UINT64 freevirtualmemory; const WCHAR *installdate; const WCHAR *lastbootuptime; const WCHAR *localdatetime; @@ -1560,6 +1562,15 @@ static UINT64 get_available_physical_memory(void) return status.ullAvailPhys; }
+static UINT64 get_available_virtual_memory(void) +{ + MEMORYSTATUSEX status; + + status.dwLength = sizeof(status); + if (!GlobalMemoryStatusEx( &status )) return 1024 * 1024 * 1024; + return status.ullAvailVirtual; +} + static WCHAR *get_computername(void) { WCHAR *ret; @@ -3683,6 +3694,7 @@ static enum fill_status fill_operatingsystem( struct table *table, const struct rec->csname = get_computername(); rec->currenttimezone = get_currenttimezone(); rec->freephysicalmemory = get_available_physical_memory() / 1024; + rec->freevirtualmemory = get_available_virtual_memory() / 1024; rec->installdate = L"20140101000000.000000+000"; rec->lastbootuptime = get_lastbootuptime(); rec->localdatetime = get_localdatetime(); diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index aa6dc132ac6..641535fa213 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1404,6 +1404,7 @@ static void test_Win32_OperatingSystem( IWbemServices *services ) VariantClear( &val );
check_property( obj, L"FreePhysicalMemory", VT_BSTR, CIM_UINT64 ); + check_property( obj, L"FreeVirtualMemory", VT_BSTR, CIM_UINT64 ); check_property( obj, L"Name", VT_BSTR, CIM_STRING );
type = 0xdeadbeef;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=113419
Your paranoid android.
=== build (build log) ===
error: patch failed: dlls/wbemprox/builtin.c:263 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wbemprox/builtin.c:263 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wbemprox/builtin.c:263 Task: Patch failed to apply