[WBEMDISP] Sync with Wine Staging 1.9.4. CORE-10912
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 5 Mar 2016 10:36:27 +0000 (10:36 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 5 Mar 2016 10:36:27 +0000 (10:36 +0000)
svn path=/trunk/; revision=70943

reactos/dll/win32/wbemdisp/locator.c
reactos/media/doc/README.WINE

index eb50ade..2f3c3ae 100644 (file)
@@ -343,6 +343,7 @@ struct objectset
     ISWbemObjectSet ISWbemObjectSet_iface;
     LONG refs;
     IEnumWbemClassObject *objectenum;
     ISWbemObjectSet ISWbemObjectSet_iface;
     LONG refs;
     IEnumWbemClassObject *objectenum;
+    LONG count;
 };
 
 static inline struct objectset *impl_from_ISWbemObjectSet(
 };
 
 static inline struct objectset *impl_from_ISWbemObjectSet(
@@ -504,20 +505,10 @@ static HRESULT WINAPI objectset_get_Count(
     LONG *iCount )
 {
     struct objectset *objectset = impl_from_ISWbemObjectSet( iface );
     LONG *iCount )
 {
     struct objectset *objectset = impl_from_ISWbemObjectSet( iface );
-    LONG count = 0, total = 0;
 
     TRACE( "%p, %p\n", objectset, iCount );
 
 
     TRACE( "%p, %p\n", objectset, iCount );
 
-    while (IEnumWbemClassObject_Skip( objectset->objectenum, WBEM_INFINITE, 1 ) == S_OK) count++;
-
-    IEnumWbemClassObject_Reset( objectset->objectenum );
-    while (IEnumWbemClassObject_Skip( objectset->objectenum, WBEM_INFINITE, 1 ) == S_OK) total++;
-
-    count = total - count;
-    IEnumWbemClassObject_Reset( objectset->objectenum );
-    while (count--) IEnumWbemClassObject_Skip( objectset->objectenum, WBEM_INFINITE, 1 );
-
-    *iCount = total;
+    *iCount = objectset->count;
     return S_OK;
 }
 
     return S_OK;
 }
 
@@ -554,6 +545,14 @@ static const ISWbemObjectSetVtbl objectset_vtbl =
     objectset_ItemIndex
 };
 
     objectset_ItemIndex
 };
 
+static LONG get_object_count( IEnumWbemClassObject *iter )
+{
+    LONG count = 0;
+    while (IEnumWbemClassObject_Skip( iter, WBEM_INFINITE, 1 ) == S_OK) count++;
+    IEnumWbemClassObject_Reset( iter );
+    return count;
+}
+
 static HRESULT SWbemObjectSet_create( IEnumWbemClassObject *wbem_objectenum, ISWbemObjectSet **obj )
 {
     struct objectset *objectset;
 static HRESULT SWbemObjectSet_create( IEnumWbemClassObject *wbem_objectenum, ISWbemObjectSet **obj )
 {
     struct objectset *objectset;
@@ -565,6 +564,7 @@ static HRESULT SWbemObjectSet_create( IEnumWbemClassObject *wbem_objectenum, ISW
     objectset->refs = 1;
     objectset->objectenum = wbem_objectenum;
     IEnumWbemClassObject_AddRef( objectset->objectenum );
     objectset->refs = 1;
     objectset->objectenum = wbem_objectenum;
     IEnumWbemClassObject_AddRef( objectset->objectenum );
+    objectset->count = get_object_count( objectset->objectenum );
 
     *obj = &objectset->ISWbemObjectSet_iface;
     TRACE( "returning iface %p\n", *obj );
 
     *obj = &objectset->ISWbemObjectSet_iface;
     TRACE( "returning iface %p\n", *obj );
index f89e13a..fb4fa3f 100644 (file)
@@ -198,7 +198,7 @@ reactos/dll/win32/uxtheme             # Forked
 reactos/dll/win32/vbscript            # Synced to WineStaging-1.7.55
 reactos/dll/win32/version             # Synced to WineStaging-1.9.4
 reactos/dll/win32/vssapi              # Synced to WineStaging-1.7.55
 reactos/dll/win32/vbscript            # Synced to WineStaging-1.7.55
 reactos/dll/win32/version             # Synced to WineStaging-1.9.4
 reactos/dll/win32/vssapi              # Synced to WineStaging-1.7.55
-reactos/dll/win32/wbemdisp            # Synced to WineStaging-1.7.55
+reactos/dll/win32/wbemdisp            # Synced to WineStaging-1.9.4
 reactos/dll/win32/wbemprox            # Synced to WineStaging-1.7.55
 reactos/dll/win32/windowscodecs       # Synced to WineStaging-1.7.55
 reactos/dll/win32/windowscodecsext    # Synced to WineStaging-1.7.55
 reactos/dll/win32/wbemprox            # Synced to WineStaging-1.7.55
 reactos/dll/win32/windowscodecs       # Synced to WineStaging-1.7.55
 reactos/dll/win32/windowscodecsext    # Synced to WineStaging-1.7.55