[WBOMPROX] Sync with Wine Staging 1.9.23. CORE-12409
authorAmine Khaldi <amine.khaldi@reactos.org>
Thu, 17 Nov 2016 23:18:42 +0000 (23:18 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Thu, 17 Nov 2016 23:18:42 +0000 (23:18 +0000)
svn path=/trunk/; revision=73300

reactos/dll/win32/wbemprox/builtin.c
reactos/dll/win32/wbemprox/reg.c
reactos/media/doc/README.WINE

index 912909b..31b8a10 100644 (file)
@@ -401,7 +401,7 @@ static const struct column col_compsys[] =
 static const struct column col_compsysproduct[] =
 {
     { prop_identifyingnumberW,  CIM_STRING|COL_FLAG_KEY },
 static const struct column col_compsysproduct[] =
 {
     { prop_identifyingnumberW,  CIM_STRING|COL_FLAG_KEY },
-    { prop_uuidW,               CIM_STRING }
+    { prop_uuidW,               CIM_STRING|COL_FLAG_DYNAMIC }
 };
 static const struct column col_datafile[] =
 {
 };
 static const struct column col_datafile[] =
 {
@@ -481,16 +481,16 @@ static const struct column col_networkadapterconfig[] =
 };
 static const struct column col_os[] =
 {
 };
 static const struct column col_os[] =
 {
-    { prop_buildnumberW,            CIM_STRING },
-    { prop_captionW,                CIM_STRING },
+    { prop_buildnumberW,            CIM_STRING|COL_FLAG_DYNAMIC },
+    { prop_captionW,                CIM_STRING|COL_FLAG_DYNAMIC },
     { prop_codesetW,                CIM_STRING|COL_FLAG_DYNAMIC },
     { prop_countrycodeW,            CIM_STRING|COL_FLAG_DYNAMIC },
     { prop_codesetW,                CIM_STRING|COL_FLAG_DYNAMIC },
     { prop_countrycodeW,            CIM_STRING|COL_FLAG_DYNAMIC },
-    { prop_csdversionW,             CIM_STRING },
+    { prop_csdversionW,             CIM_STRING|COL_FLAG_DYNAMIC },
     { prop_installdateW,            CIM_DATETIME },
     { prop_lastbootuptimeW,         CIM_DATETIME|COL_FLAG_DYNAMIC },
     { prop_localdatetimeW,          CIM_DATETIME|COL_FLAG_DYNAMIC },
     { prop_localeW,                 CIM_STRING|COL_FLAG_DYNAMIC },
     { prop_installdateW,            CIM_DATETIME },
     { prop_lastbootuptimeW,         CIM_DATETIME|COL_FLAG_DYNAMIC },
     { prop_localdatetimeW,          CIM_DATETIME|COL_FLAG_DYNAMIC },
     { prop_localeW,                 CIM_STRING|COL_FLAG_DYNAMIC },
-    { prop_nameW,                   CIM_STRING },
+    { prop_nameW,                   CIM_STRING|COL_FLAG_DYNAMIC },
     { prop_osarchitectureW,         CIM_STRING },
     { prop_oslanguageW,             CIM_UINT32, VT_I4 },
     { prop_osproductsuiteW,         CIM_UINT32, VT_I4 },
     { prop_osarchitectureW,         CIM_STRING },
     { prop_oslanguageW,             CIM_UINT32, VT_I4 },
     { prop_osproductsuiteW,         CIM_UINT32, VT_I4 },
@@ -502,7 +502,7 @@ static const struct column col_os[] =
     { prop_suitemaskW,              CIM_UINT32, VT_I4 },
     { prop_systemdirectoryW,        CIM_STRING|COL_FLAG_DYNAMIC },
     { prop_totalvisiblememorysizeW, CIM_UINT64 },
     { prop_suitemaskW,              CIM_UINT32, VT_I4 },
     { prop_systemdirectoryW,        CIM_STRING|COL_FLAG_DYNAMIC },
     { prop_totalvisiblememorysizeW, CIM_UINT64 },
-    { prop_versionW,                CIM_STRING }
+    { prop_versionW,                CIM_STRING|COL_FLAG_DYNAMIC }
 };
 static const struct column col_param[] =
 {
 };
 static const struct column col_param[] =
 {
@@ -619,7 +619,7 @@ static const struct column col_stdregprov[] =
 static const struct column col_systemenclosure[] =
 {
     { prop_captionW,      CIM_STRING },
 static const struct column col_systemenclosure[] =
 {
     { prop_captionW,      CIM_STRING },
-    { prop_chassistypesW, CIM_UINT16|CIM_FLAG_ARRAY },
+    { prop_chassistypesW, CIM_UINT16|CIM_FLAG_ARRAY, VT_I4|VT_ARRAY },
     { prop_descriptionW,  CIM_STRING },
     { prop_lockpresentW,  CIM_BOOLEAN },
     { prop_manufacturerW, CIM_STRING },
     { prop_descriptionW,  CIM_STRING },
     { prop_lockpresentW,  CIM_BOOLEAN },
     { prop_manufacturerW, CIM_STRING },
@@ -719,24 +719,10 @@ static const WCHAR os_32bitW[] =
     {'3','2','-','b','i','t',0};
 static const WCHAR os_64bitW[] =
     {'6','4','-','b','i','t',0};
     {'3','2','-','b','i','t',0};
 static const WCHAR os_64bitW[] =
     {'6','4','-','b','i','t',0};
-static const WCHAR os_buildnumberW[] =
-    {'2','6','0','0',0};
-static const WCHAR os_captionW[] =
-    {'M','i','c','r','o','s','o','f','t',' ','W','i','n','d','o','w','s',' ','X','P',' ',
-     'V','e','r','s','i','o','n',' ','=',' ','5','.','1','.','2','6','0','0',0};
-static const WCHAR os_csdversionW[] =
-    {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','3',0};
 static const WCHAR os_installdateW[] =
     {'2','0','1','4','0','1','0','1','0','0','0','0','0','0','.','0','0','0','0','0','0','+','0','0','0',0};
 static const WCHAR os_installdateW[] =
     {'2','0','1','4','0','1','0','1','0','0','0','0','0','0','.','0','0','0','0','0','0','+','0','0','0',0};
-static const WCHAR os_nameW[] =
-    {'M','i','c','r','o','s','o','f','t',' ','W','i','n','d','o','w','s',' ','X','P',' ',
-     'P','r','o','f','e','s','s','i','o','n','a','l','|','C',':','\\','W','I','N','D','O','W','S',
-     '|','\\','D','e','v','i','c','e','\\','H','a','r','d','d','i','s','k','0',
-     '\\','P','a','r','t','i','t','i','o','n','1',0};
 static const WCHAR os_serialnumberW[] =
     {'1','2','3','4','5','-','O','E','M','-','1','2','3','4','5','6','7','-','1','2','3','4','5',0};
 static const WCHAR os_serialnumberW[] =
     {'1','2','3','4','5','-','O','E','M','-','1','2','3','4','5','6','7','-','1','2','3','4','5',0};
-static const WCHAR os_versionW[] =
-    {'5','.','1','.','2','6','0','0',0};
 static const WCHAR physicalmedia_tagW[] =
     {'\\','\\','.','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','0',0};
 static const WCHAR sounddevice_productnameW[] =
 static const WCHAR physicalmedia_tagW[] =
     {'\\','\\','.','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','0',0};
 static const WCHAR sounddevice_productnameW[] =
@@ -1059,13 +1045,9 @@ static const struct record_baseboard data_baseboard[] =
 };
 static const struct record_bios data_bios[] =
 {
 };
 static const struct record_bios data_bios[] =
 {
-    { bios_descriptionW, bios_descriptionW, bios_manufacturerW, bios_nameW, bios_releasedateW, bios_serialnumberW,
+    { bios_descriptionW, NULL, bios_manufacturerW, bios_nameW, bios_releasedateW, bios_serialnumberW,
       bios_smbiosbiosversionW, bios_versionW }
 };
       bios_smbiosbiosversionW, bios_versionW }
 };
-static const struct record_computersystemproduct data_compsysproduct[] =
-{
-    { compsysproduct_identifyingnumberW, compsysproduct_uuidW }
-};
 static const struct record_param data_param[] =
 {
     { class_processW, method_getownerW, -1, param_returnvalueW, CIM_UINT32, VT_I4 },
 static const struct record_param data_param[] =
 {
     { class_processW, method_getownerW, -1, param_returnvalueW, CIM_UINT32, VT_I4 },
@@ -1328,6 +1310,46 @@ static enum fill_status fill_compsys( struct table *table, const struct expr *co
     return status;
 }
 
     return status;
 }
 
+static WCHAR *get_compsysproduct_uuid(void)
+{
+#ifdef __APPLE__
+    unsigned char uuid[16];
+    const struct timespec timeout = {1, 0};
+    if (!gethostuuid( uuid, &timeout ))
+    {
+        static const WCHAR fmtW[] =
+            {'%','0','2','X','%','0','2','X','%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','-',
+             '%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X',
+             '%','0','2','X','%','0','2','X','%','0','2','X','%','0','2','X',0};
+        WCHAR *ret = heap_alloc( 37 * sizeof(WCHAR) );
+        if (!ret) return NULL;
+        sprintfW( ret, fmtW, uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7],
+                  uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15] );
+        return ret;
+    }
+#endif
+    return heap_strdupW( compsysproduct_uuidW );
+}
+
+static enum fill_status fill_compsysproduct( struct table *table, const struct expr *cond )
+{
+    struct record_computersystemproduct *rec;
+    enum fill_status status = FILL_STATUS_UNFILTERED;
+    UINT row = 0;
+
+    if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
+
+    rec = (struct record_computersystemproduct *)table->data;
+    rec->identifyingnumber = compsysproduct_identifyingnumberW;
+    rec->uuid              = get_compsysproduct_uuid();
+    if (!match_row( table, row, cond, &status )) free_row_values( table, row );
+    else row++;
+
+    TRACE("created %u rows\n", row);
+    table->num_rows = row;
+    return status;
+}
+
 struct dirstack
 {
     WCHAR **dirs;
 struct dirstack
 {
     WCHAR **dirs;
@@ -2623,38 +2645,122 @@ static WCHAR *get_locale(void)
     if (ret) GetLocaleInfoW( LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, ret, 5 );
     return ret;
 }
     if (ret) GetLocaleInfoW( LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, ret, 5 );
     return ret;
 }
+static WCHAR *get_osbuildnumber( OSVERSIONINFOEXW *ver )
+{
+    static const WCHAR fmtW[] = {'%','u',0};
+    WCHAR *ret = heap_alloc( 11 * sizeof(WCHAR) );
+    if (ret) sprintfW( ret, fmtW, ver->dwBuildNumber );
+    return ret;
+}
+static WCHAR *get_oscaption( OSVERSIONINFOEXW *ver )
+{
+    static const WCHAR windowsW[] =
+        {'M','i','c','r','o','s','o','f','t',' ','W','i','n','d','o','w','s',' '};
+    static const WCHAR win2000W[] =
+        {'2','0','0','0',' ','P','r','o','f','e','s','s','i','o','n','a','l',0};
+    static const WCHAR win2003W[] =
+        {'S','e','r','v','e','r',' ','2','0','0','3',' ','S','t','a','n','d','a','r','d',' ','E','d','i','t','i','o','n',0};
+    static const WCHAR winxpW[] =
+        {'X','P',' ','P','r','o','f','e','s','s','i','o','n','a','l',0};
+    static const WCHAR winxp64W[] =
+        {'X','P',' ','P','r','o','f','e','s','s','i','o','n','a','l',' ','x','6','4',' ','E','d','i','t','i','o','n',0};
+    static const WCHAR vistaW[] =
+        {'V','i','s','t','a',' ','U','l','t','i','m','a','t','e',0};
+    static const WCHAR win2008W[] =
+        {'S','e','r','v','e','r',' ','2','0','0','8',' ','S','t','a','n','d','a','r','d',0};
+    static const WCHAR win7W[] =
+        {'7',' ','P','r','o','f','e','s','s','i','o','n','a','l',0};
+    static const WCHAR win2008r2W[] =
+        {'S','e','r','v','e','r',' ','2','0','0','8',' ','R','2',' ','S','t','a','n','d','a','r','d',0};
+    static const WCHAR win8W[] =
+        {'8',' ','P','r','o',0};
+    static const WCHAR win81W[] =
+        {'8','.','1',' ','P','r','o',0};
+    static const WCHAR win10W[] =
+        {'1','0',' ','P','r','o',0};
+    int len = sizeof(windowsW)/sizeof(windowsW[0]);
+    WCHAR *ret;
+
+    if (!(ret = heap_alloc( len * sizeof(WCHAR) + sizeof(win2003W) ))) return NULL;
+    memcpy( ret, windowsW, sizeof(windowsW) );
+    if (ver->dwMajorVersion == 10 && ver->dwMinorVersion == 0) memcpy( ret + len, win10W, sizeof(win10W) );
+    else if (ver->dwMajorVersion == 6 && ver->dwMinorVersion == 3) memcpy( ret + len, win8W, sizeof(win8W) );
+    else if (ver->dwMajorVersion == 6 && ver->dwMinorVersion == 2) memcpy( ret + len, win81W, sizeof(win81W) );
+    else if (ver->dwMajorVersion == 6 && ver->dwMinorVersion == 1)
+    {
+        if (ver->wProductType == VER_NT_WORKSTATION) memcpy( ret + len, win7W, sizeof(win7W) );
+        else memcpy( ret + len, win2008r2W, sizeof(win2008r2W) );
+    }
+    else if (ver->dwMajorVersion == 6 && ver->dwMinorVersion == 0)
+    {
+        if (ver->wProductType == VER_NT_WORKSTATION) memcpy( ret + len, vistaW, sizeof(vistaW) );
+        else memcpy( ret + len, win2008W, sizeof(win2008W) );
+    }
+    else if (ver->dwMajorVersion == 5 && ver->dwMinorVersion == 2)
+    {
+        if (ver->wProductType == VER_NT_WORKSTATION) memcpy( ret + len, winxp64W, sizeof(winxp64W) );
+        else memcpy( ret + len, win2003W, sizeof(win2003W) );
+    }
+    else if (ver->dwMajorVersion == 5 && ver->dwMinorVersion == 1) memcpy( ret + len, winxpW, sizeof(winxpW) );
+    else memcpy( ret + len, win2000W, sizeof(win2000W) );
+    return ret;
+}
+static WCHAR *get_osname( const WCHAR *caption )
+{
+    static const WCHAR partitionW[] =
+        {'|','C',':','\\','W','I','N','D','O','W','S','|','\\','D','e','v','i','c','e','\\',
+         'H','a','r','d','d','i','s','k','0','\\','P','a','r','t','i','t','i','o','n','1',0};
+    int len = strlenW( caption );
+    WCHAR *ret;
+
+    if (!(ret = heap_alloc( len * sizeof(WCHAR) + sizeof(partitionW) ))) return NULL;
+    memcpy( ret, caption, len * sizeof(WCHAR) );
+    memcpy( ret + len, partitionW, sizeof(partitionW) );
+    return ret;
+}
+static WCHAR *get_osversion( OSVERSIONINFOEXW *ver )
+{
+    static const WCHAR fmtW[] = {'%','u','.','%','u','.','%','u',0};
+    WCHAR *ret = heap_alloc( 33 * sizeof(WCHAR) );
+    if (ret) sprintfW( ret, fmtW, ver->dwMajorVersion, ver->dwMinorVersion, ver->dwBuildNumber );
+    return ret;
+}
 
 static enum fill_status fill_os( struct table *table, const struct expr *cond )
 {
     struct record_operatingsystem *rec;
     enum fill_status status = FILL_STATUS_UNFILTERED;
 
 static enum fill_status fill_os( struct table *table, const struct expr *cond )
 {
     struct record_operatingsystem *rec;
     enum fill_status status = FILL_STATUS_UNFILTERED;
+    OSVERSIONINFOEXW ver;
     UINT row = 0;
 
     if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
 
     UINT row = 0;
 
     if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
 
+    ver.dwOSVersionInfoSize = sizeof(ver);
+    GetVersionExW( (OSVERSIONINFOW *)&ver );
+
     rec = (struct record_operatingsystem *)table->data;
     rec = (struct record_operatingsystem *)table->data;
-    rec->buildnumber            = os_buildnumberW;
-    rec->caption                = os_captionW;
+    rec->buildnumber            = get_osbuildnumber( &ver );
+    rec->caption                = get_oscaption( &ver );
     rec->codeset                = get_codeset();
     rec->countrycode            = get_countrycode();
     rec->codeset                = get_codeset();
     rec->countrycode            = get_countrycode();
-    rec->csdversion             = os_csdversionW;
+    rec->csdversion             = ver.szCSDVersion[0] ? heap_strdupW( ver.szCSDVersion ) : NULL;
     rec->installdate            = os_installdateW;
     rec->lastbootuptime         = get_lastbootuptime();
     rec->localdatetime          = get_localdatetime();
     rec->locale                 = get_locale();
     rec->installdate            = os_installdateW;
     rec->lastbootuptime         = get_lastbootuptime();
     rec->localdatetime          = get_localdatetime();
     rec->locale                 = get_locale();
-    rec->name                   = os_nameW;
+    rec->name                   = get_osname( rec->caption );
     rec->osarchitecture         = get_osarchitecture();
     rec->oslanguage             = GetSystemDefaultLangID();
     rec->osproductsuite         = 2461140; /* Windows XP Professional  */
     rec->ostype                 = 18;      /* WINNT */
     rec->primary                = -1;
     rec->serialnumber           = os_serialnumberW;
     rec->osarchitecture         = get_osarchitecture();
     rec->oslanguage             = GetSystemDefaultLangID();
     rec->osproductsuite         = 2461140; /* Windows XP Professional  */
     rec->ostype                 = 18;      /* WINNT */
     rec->primary                = -1;
     rec->serialnumber           = os_serialnumberW;
-    rec->servicepackmajor       = 3;
-    rec->servicepackminor       = 0;
+    rec->servicepackmajor       = ver.wServicePackMajor;
+    rec->servicepackminor       = ver.wServicePackMinor;
     rec->suitemask              = 272;     /* Single User + Terminal */
     rec->systemdirectory        = get_systemdirectory();
     rec->totalvisiblememorysize = get_total_physical_memory() / 1024;
     rec->suitemask              = 272;     /* Single User + Terminal */
     rec->systemdirectory        = get_systemdirectory();
     rec->totalvisiblememorysize = get_total_physical_memory() / 1024;
-    rec->version                = os_versionW;
+    rec->version                = get_osversion( &ver );
     if (!match_row( table, row, cond, &status )) free_row_values( table, row );
     else row++;
 
     if (!match_row( table, row, cond, &status )) free_row_values( table, row );
     else row++;
 
@@ -3010,7 +3116,7 @@ static struct table builtin_classes[] =
     { class_biosW, SIZEOF(col_bios), col_bios, SIZEOF(data_bios), 0, (BYTE *)data_bios },
     { class_cdromdriveW, SIZEOF(col_cdromdrive), col_cdromdrive, 0, 0, NULL, fill_cdromdrive },
     { class_compsysW, SIZEOF(col_compsys), col_compsys, 0, 0, NULL, fill_compsys },
     { class_biosW, SIZEOF(col_bios), col_bios, SIZEOF(data_bios), 0, (BYTE *)data_bios },
     { class_cdromdriveW, SIZEOF(col_cdromdrive), col_cdromdrive, 0, 0, NULL, fill_cdromdrive },
     { class_compsysW, SIZEOF(col_compsys), col_compsys, 0, 0, NULL, fill_compsys },
-    { class_compsysproductW, SIZEOF(col_compsysproduct), col_compsysproduct, SIZEOF(data_compsysproduct), 0, (BYTE *)data_compsysproduct },
+    { class_compsysproductW, SIZEOF(col_compsysproduct), col_compsysproduct, 0, 0, NULL, fill_compsysproduct },
     { class_datafileW, SIZEOF(col_datafile), col_datafile, 0, 0, NULL, fill_datafile },
     { class_desktopmonitorW, SIZEOF(col_desktopmonitor), col_desktopmonitor, 0, 0, NULL, fill_desktopmonitor },
     { class_directoryW, SIZEOF(col_directory), col_directory, 0, 0, NULL, fill_directory },
     { class_datafileW, SIZEOF(col_datafile), col_datafile, 0, 0, NULL, fill_datafile },
     { class_desktopmonitorW, SIZEOF(col_desktopmonitor), col_desktopmonitor, 0, 0, NULL, fill_desktopmonitor },
     { class_directoryW, SIZEOF(col_directory), col_directory, 0, 0, NULL, fill_directory },
index f942bda..247dcaa 100644 (file)
@@ -105,7 +105,7 @@ static HRESULT enum_key( HKEY root, const WCHAR *subkey, VARIANT *names, VARIANT
         if (!(strings[i] = SysAllocString( buf )))
         {
             for (i--; i >= 0; i--) SysFreeString( strings[i] );
         if (!(strings[i] = SysAllocString( buf )))
         {
             for (i--; i >= 0; i--) SysFreeString( strings[i] );
-            hr = ERROR_OUTOFMEMORY;
+            hr = E_OUTOFMEMORY;
             break;
         }
         i++;
             break;
         }
         i++;
@@ -210,7 +210,7 @@ static HRESULT enum_values( HKEY root, const WCHAR *subkey, VARIANT *names, VARI
         if (!(value_names[i] = SysAllocString( buf )))
         {
             for (i--; i >= 0; i--) SysFreeString( value_names[i] );
         if (!(value_names[i] = SysAllocString( buf )))
         {
             for (i--; i >= 0; i--) SysFreeString( value_names[i] );
-            hr = ERROR_OUTOFMEMORY;
+            hr = E_OUTOFMEMORY;
             break;
         }
         i++;
             break;
         }
         i++;
index d7c0ac4..1873b3f 100644 (file)
@@ -195,7 +195,7 @@ reactos/dll/win32/vbscript            # Synced to WineStaging-1.9.23
 reactos/dll/win32/version             # Synced to WineStaging-1.9.11
 reactos/dll/win32/vssapi              # Synced to WineStaging-1.9.11
 reactos/dll/win32/wbemdisp            # Synced to WineStaging-1.9.16
 reactos/dll/win32/version             # Synced to WineStaging-1.9.11
 reactos/dll/win32/vssapi              # Synced to WineStaging-1.9.11
 reactos/dll/win32/wbemdisp            # Synced to WineStaging-1.9.16
-reactos/dll/win32/wbemprox            # Synced to WineStaging-1.9.11
+reactos/dll/win32/wbemprox            # Synced to WineStaging-1.9.23
 reactos/dll/win32/windowscodecs       # Synced to WineStaging-1.9.16
 reactos/dll/win32/windowscodecsext    # Synced to WineStaging-1.9.11
 reactos/dll/win32/winemp3.acm         # Synced to WineStaging-1.9.11
 reactos/dll/win32/windowscodecs       # Synced to WineStaging-1.9.16
 reactos/dll/win32/windowscodecsext    # Synced to WineStaging-1.9.11
 reactos/dll/win32/winemp3.acm         # Synced to WineStaging-1.9.11