[WBEMPROX] Sync with Wine Staging 1.7.55. CORE-10536
authorAmine Khaldi <amine.khaldi@reactos.org>
Mon, 23 Nov 2015 09:48:39 +0000 (09:48 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Mon, 23 Nov 2015 09:48:39 +0000 (09:48 +0000)
svn path=/trunk/; revision=70063

reactos/dll/win32/wbemprox/builtin.c
reactos/dll/win32/wbemprox/class.c
reactos/dll/win32/wbemprox/query.c
reactos/dll/win32/wbemprox/service.c
reactos/media/doc/README.WINE

index aa33523..d00ba55 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "wbemprox_private.h"
 
+#include <winuser.h>
 #include <wingdi.h>
 #include <winsock2.h>
 #include <ws2tcpip.h>
@@ -42,6 +43,8 @@ static const WCHAR class_compsysproductW[] =
     {'W','i','n','3','2','_','C','o','m','p','u','t','e','r','S','y','s','t','e','m','P','r','o','d','u','c','t',0};
 static const WCHAR class_datafileW[] =
     {'C','I','M','_','D','a','t','a','F','i','l','e',0};
+static const WCHAR class_desktopmonitorW[] =
+    {'W','i','n','3','2','_','D','e','s','k','t','o','p','M','o','n','i','t','o','r',0};
 static const WCHAR class_directoryW[] =
     {'W','i','n','3','2','_','D','i','r','e','c','t','o','r','y',0};
 static const WCHAR class_diskdriveW[] =
@@ -249,6 +252,8 @@ static const WCHAR prop_parameterW[] =
     {'P','a','r','a','m','e','t','e','r',0};
 static const WCHAR prop_physicaladapterW[] =
     {'P','h','y','s','i','c','a','l','A','d','a','p','t','e','r',0};
+static const WCHAR prop_pixelsperxlogicalinchW[] =
+    {'P','i','x','e','l','s','P','e','r','X','L','o','g','i','c','a','l','I','n','c','h',0};
 static const WCHAR prop_pnpdeviceidW[] =
     {'P','N','P','D','e','v','i','c','e','I','D',0};
 static const WCHAR prop_pprocessidW[] =
@@ -352,6 +357,7 @@ static const struct column col_bios[] =
     { prop_descriptionW,        CIM_STRING },
     { prop_identificationcodeW, CIM_STRING },
     { prop_manufacturerW,       CIM_STRING },
+    { prop_nameW,               CIM_STRING },
     { prop_releasedateW,        CIM_DATETIME },
     { prop_serialnumberW,       CIM_STRING },
     { prop_smbiosbiosversionW,  CIM_STRING },
@@ -388,6 +394,10 @@ static const struct column col_datafile[] =
     { prop_nameW,    CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY },
     { prop_versionW, CIM_STRING|COL_FLAG_DYNAMIC }
 };
+static const struct column col_desktopmonitor[] =
+{
+    { prop_pixelsperxlogicalinchW, CIM_UINT32 }
+};
 static const struct column col_directory[] =
 {
     { prop_accessmaskW, CIM_UINT32 },
@@ -632,6 +642,8 @@ static const WCHAR bios_descriptionW[] =
     {'D','e','f','a','u','l','t',' ','S','y','s','t','e','m',' ','B','I','O','S',0};
 static const WCHAR bios_manufacturerW[] =
     {'T','h','e',' ','W','i','n','e',' ','P','r','o','j','e','c','t',0};
+static const WCHAR bios_nameW[] =
+    {'W','I','N','E',' ','B','I','O','S',0};
 static const WCHAR bios_releasedateW[] =
     {'2','0','1','2','0','6','0','8','0','0','0','0','0','0','.','0','0','0','0','0','0','+','0','0','0',0};
 static const WCHAR bios_serialnumberW[] =
@@ -735,6 +747,7 @@ struct record_bios
     const WCHAR *description;
     const WCHAR *identificationcode;
     const WCHAR *manufacturer;
+    const WCHAR *name;
     const WCHAR *releasedate;
     const WCHAR *serialnumber;
     const WCHAR *smbiosbiosversion;
@@ -771,6 +784,10 @@ struct record_datafile
     const WCHAR *name;
     const WCHAR *version;
 };
+struct record_desktopmonitor
+{
+    UINT32       pixelsperxlogicalinch;
+};
 struct record_directory
 {
     UINT32       accessmask;
@@ -1010,7 +1027,7 @@ static const struct record_baseboard data_baseboard[] =
 };
 static const struct record_bios data_bios[] =
 {
-    { bios_descriptionW, bios_descriptionW, bios_manufacturerW, bios_releasedateW, bios_serialnumberW,
+    { bios_descriptionW, bios_descriptionW, bios_manufacturerW, bios_nameW, bios_releasedateW, bios_serialnumberW,
       bios_smbiosbiosversionW, bios_versionW }
 };
 static const struct record_computersystemproduct data_compsysproduct[] =
@@ -1640,6 +1657,35 @@ done:
     return status;
 }
 
+static UINT32 get_pixelsperxlogicalinch(void)
+{
+    HDC hdc = GetDC( NULL );
+    UINT32 ret;
+
+    if (!hdc) return 96;
+    ret = GetDeviceCaps( hdc, LOGPIXELSX );
+    ReleaseDC( NULL, hdc );
+    return ret;
+}
+
+static enum fill_status fill_desktopmonitor( struct table *table, const struct expr *cond )
+{
+    struct record_desktopmonitor *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_desktopmonitor *)table->data;
+    rec->pixelsperxlogicalinch = get_pixelsperxlogicalinch();
+
+    if (match_row( table, row, cond, &status )) row++;
+
+    TRACE("created %u rows\n", row);
+    table->num_rows = row;
+    return status;
+}
+
 static enum fill_status fill_directory( struct table *table, const struct expr *cond )
 {
     static const WCHAR dotW[] = {'.',0}, dotdotW[] = {'.','.',0};
@@ -2845,6 +2891,7 @@ static struct table builtin_classes[] =
     { 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_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_diskdriveW, SIZEOF(col_diskdrive), col_diskdrive, 0, 0, NULL, fill_diskdrive },
     { class_diskpartitionW, SIZEOF(col_diskpartition), col_diskpartition, 0, 0, NULL, fill_diskpartition },
index 41b39df..3d3e777 100644 (file)
@@ -101,17 +101,14 @@ static HRESULT WINAPI enum_class_object_Next(
 {
     struct enum_class_object *ec = impl_from_IEnumWbemClassObject( iface );
     struct view *view = ec->query->view;
+    static int once = 0;
     HRESULT hr;
 
     TRACE("%p, %d, %u, %p, %p\n", iface, lTimeout, uCount, apObjects, puReturned);
 
     if (!uCount) return WBEM_S_FALSE;
     if (!apObjects || !puReturned) return WBEM_E_INVALID_PARAMETER;
-    if (lTimeout != WBEM_INFINITE)
-    {
-        static int once;
-        if (!once++) FIXME("timeout not supported\n");
-    }
+    if (lTimeout != WBEM_INFINITE && !once++) FIXME("timeout not supported\n");
 
     *puReturned = 0;
     if (ec->index >= view->count) return WBEM_S_FALSE;
@@ -153,10 +150,11 @@ static HRESULT WINAPI enum_class_object_Skip(
 {
     struct enum_class_object *ec = impl_from_IEnumWbemClassObject( iface );
     struct view *view = ec->query->view;
+    static int once = 0;
 
     TRACE("%p, %d, %u\n", iface, lTimeout, nCount);
 
-    if (lTimeout != WBEM_INFINITE) FIXME("timeout not supported\n");
+    if (lTimeout != WBEM_INFINITE && !once++) FIXME("timeout not supported\n");
 
     if (!view->count) return WBEM_S_FALSE;
 
index 869870a..0d179b8 100644 (file)
@@ -51,10 +51,10 @@ static BOOL eval_like( const WCHAR *lstr, const WCHAR *rstr )
         {
             while (*q == '%') q++;
             if (!*q) return TRUE;
-            while (*p && toupperW( p[1] ) != toupperW( q[1] )) p++;
-            if (!*p) return TRUE;
+            while (*p && *q && toupperW( *p ) == toupperW( *q )) { p++; q++; };
+            if (!*p && !*q) return TRUE;
         }
-        if (toupperW( *p++ ) != toupperW( *q++ )) return FALSE;
+        if (*q != '%' && toupperW( *p++ ) != toupperW( *q++ )) return FALSE;
     }
     return TRUE;
 }
index a399a85..6c09f76 100644 (file)
@@ -56,11 +56,11 @@ static HRESULT control_service( const WCHAR *name, DWORD control, VARIANT *retva
         goto done;
     }
     if (!ControlService( service, control, &status )) error = map_error( GetLastError() );
+    CloseServiceHandle( service );
 
 done:
     set_variant( VT_UI4, error, NULL, retval );
-    CloseServiceHandle( service );
-    CloseServiceHandle( manager );
+    if (manager) CloseServiceHandle( manager );
     return S_OK;
 }
 
@@ -170,11 +170,11 @@ static HRESULT start_service( const WCHAR *name, VARIANT *retval )
         goto done;
     }
     if (!StartServiceW( service, 0, NULL )) error = map_error( GetLastError() );
+    CloseServiceHandle( service );
 
 done:
     set_variant( VT_UI4, error, NULL, retval );
-    CloseServiceHandle( service );
-    CloseServiceHandle( manager );
+    if (manager) CloseServiceHandle( manager );
     return S_OK;
 }
 
index 36514fb..3f5b6e5 100644 (file)
@@ -199,7 +199,7 @@ reactos/dll/win32/vbscript            # Synced to WineStaging-1.7.47
 reactos/dll/win32/version             # Synced to WineStaging-1.7.55
 reactos/dll/win32/vssapi              # Synced to WineStaging-1.7.47
 reactos/dll/win32/wbemdisp            # Synced to WineStaging-1.7.47
-reactos/dll/win32/wbemprox            # Synced to WineStaging-1.7.47
+reactos/dll/win32/wbemprox            # Synced to WineStaging-1.7.55
 reactos/dll/win32/windowscodecs       # Synced to WineStaging-1.7.47
 reactos/dll/win32/windowscodecsext    # Synced to WineStaging-1.7.47
 reactos/dll/win32/winemp3.acm         # Synced to WineStaging-1.7.47