wbemprox: Implement IEnumWbemClassObject::Next.
diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c
index d405206..a950e41 100644
--- a/dlls/wbemprox/class.c
+++ b/dlls/wbemprox/class.c
@@ -102,8 +102,27 @@
     IWbemClassObject **apObjects,
     ULONG *puReturned )
 {
-    FIXME("%p, %d, %u, %p, %p\n", iface, lTimeout, uCount, apObjects, puReturned);
-    return E_NOTIMPL;
+    struct enum_class_object *ec = impl_from_IEnumWbemClassObject( iface );
+    struct view *view = ec->query->view;
+    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");
+
+    *puReturned = 0;
+    if (view->index + uCount > view->count) return WBEM_S_FALSE;
+
+    hr = WbemClassObject_create( NULL, iface, view->index, (void **)apObjects );
+    if (hr != S_OK) return hr;
+
+    view->index++;
+    *puReturned = 1;
+    if (view->index == view->count) return WBEM_S_FALSE;
+    if (uCount > 1) return WBEM_S_TIMEDOUT;
+    return WBEM_S_NO_ERROR;
 }
 
 static HRESULT WINAPI enum_class_object_NextAsync(
@@ -168,6 +187,8 @@
 {
     IWbemClassObject IWbemClassObject_iface;
     LONG refs;
+    IEnumWbemClassObject *iter;
+    UINT index;
 };
 
 static inline struct class_object *impl_from_IWbemClassObject(
@@ -191,6 +212,7 @@
     if (!refs)
     {
         TRACE("destroying %p\n", co);
+        if (co->iter) IEnumWbemClassObject_Release( co->iter );
         heap_free( co );
     }
     return refs;
@@ -472,7 +494,7 @@
 };
 
 HRESULT WbemClassObject_create(
-    IUnknown *pUnkOuter, LPVOID *ppObj )
+    IUnknown *pUnkOuter, IEnumWbemClassObject *iter, UINT index, LPVOID *ppObj )
 {
     struct class_object *co;
 
@@ -482,7 +504,10 @@
     if (!co) return E_OUTOFMEMORY;
 
     co->IWbemClassObject_iface.lpVtbl = &class_object_vtbl;
-    co->refs = 1;
+    co->refs  = 1;
+    co->iter  = iter;
+    co->index = index;
+    if (iter) IEnumWbemClassObject_AddRef( iter );
 
     *ppObj = &co->IWbemClassObject_iface;
 
diff --git a/dlls/wbemprox/query.c b/dlls/wbemprox/query.c
index eb2f332..701d656 100644
--- a/dlls/wbemprox/query.c
+++ b/dlls/wbemprox/query.c
@@ -41,6 +41,7 @@
     view->cond     = cond;
     view->result   = NULL;
     view->count    = 0;
+    view->index    = 0;
     *ret = view;
     return S_OK;
 }
diff --git a/dlls/wbemprox/wbemprox_private.h b/dlls/wbemprox/wbemprox_private.h
index bb29738..3b4af0d 100644
--- a/dlls/wbemprox/wbemprox_private.h
+++ b/dlls/wbemprox/wbemprox_private.h
@@ -95,6 +95,7 @@
     const struct expr *cond;
     UINT *result;
     UINT  count;
+    UINT  index;
 };
 
 struct query
@@ -113,6 +114,7 @@
 
 HRESULT WbemLocator_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN;
 HRESULT WbemServices_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN;
+HRESULT WbemClassObject_create(IUnknown *, IEnumWbemClassObject *, UINT, LPVOID *) DECLSPEC_HIDDEN;
 HRESULT EnumWbemClassObject_create(IUnknown *, struct query *, LPVOID *) DECLSPEC_HIDDEN;
 
 static void *heap_alloc( size_t len ) __WINE_ALLOC_SIZE(1);