[WBEMPROX] Sync with Wine Staging 1.7.55. CORE-10536
[reactos.git] / reactos / dll / win32 / wbemprox / class.c
index aa51816..3d3e777 100644 (file)
@@ -101,13 +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) 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;
@@ -149,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;
 
@@ -498,23 +500,30 @@ static HRESULT WINAPI class_object_Next(
     CIMTYPE *pType,
     LONG *plFlavor )
 {
-    struct class_object *co = impl_from_IWbemClassObject( iface );
-    struct enum_class_object *ec = impl_from_IEnumWbemClassObject( co->iter );
-    struct view *view = ec->query->view;
-    BSTR property;
+    struct class_object *obj = impl_from_IWbemClassObject( iface );
+    struct enum_class_object *iter = impl_from_IEnumWbemClassObject( obj->iter );
+    struct view *view = iter->query->view;
+    BSTR prop;
     HRESULT hr;
+    UINT i;
 
     TRACE("%p, %08x, %p, %p, %p, %p\n", iface, lFlags, strName, pVal, pType, plFlavor);
 
-    if (!(property = get_property_name( co->name, co->index_property ))) return WBEM_S_NO_MORE_DATA;
-    if ((hr = get_propval( view, co->index, property, pVal, pType, plFlavor )) != S_OK)
+    for (i = obj->index_property; i < view->table->num_cols; i++)
     {
-        SysFreeString( property );
-        return hr;
+        if (is_method( view->table, i )) continue;
+        if (!is_selected_prop( view, view->table->columns[i].name )) continue;
+        if (!(prop = SysAllocString( view->table->columns[i].name ))) return E_OUTOFMEMORY;
+        if ((hr = get_propval( view, obj->index, prop, pVal, pType, plFlavor )) != S_OK)
+        {
+            SysFreeString( prop );
+            return hr;
+        }
+        obj->index_property = i + 1;
+        *strName = prop;
+        return S_OK;
     }
-    *strName = property;
-    co->index_property++;
-    return S_OK;
+    return WBEM_S_NO_MORE_DATA;
 }
 
 static HRESULT WINAPI class_object_EndEnumeration(