Commit 0e6c7979 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

wbemprox: Set iterator for spawned instances.

parent 01d2ca19
......@@ -674,13 +674,21 @@ static HRESULT WINAPI class_object_SpawnInstance(
struct class_object *co = impl_from_IWbemClassObject( iface );
struct enum_class_object *ec = impl_from_IEnumWbemClassObject( co->iter );
struct table *table = get_view_table( ec->query->view, co->index );
IEnumWbemClassObject *iter;
struct record *record;
HRESULT hr;
TRACE("%p, %08x, %p\n", iface, lFlags, ppNewInstance);
if (!(record = create_record( table ))) return E_OUTOFMEMORY;
return create_class_object( co->name, NULL, 0, record, ppNewInstance );
if (FAILED(hr = IEnumWbemClassObject_Clone( co->iter, &iter )))
{
destroy_record( record );
return hr;
}
hr = create_class_object( co->name, iter, 0, record, ppNewInstance );
IEnumWbemClassObject_Release( iter );
return hr;
}
static HRESULT WINAPI class_object_CompareTo(
......
......@@ -753,6 +753,16 @@ static void test_StdRegProv( IWbemServices *services )
hr = IWbemClassObject_SpawnInstance( sig_in, 0, &in );
ok( hr == S_OK, "failed to spawn instance %08x\n", hr );
hr = IWbemClassObject_BeginEnumeration( in, 0 );
ok( hr == S_OK, "failed to start enumeration %08x\n", hr );
hr = IWbemClassObject_Next( in, 0, &name, NULL, NULL, NULL );
ok( hr == S_OK, "got %08x\n", hr );
SysFreeString( name );
hr = IWbemClassObject_EndEnumeration( in );
ok( hr == S_OK, "failed to end enumeration %08x\n", hr );
V_VT( &defkey ) = VT_I4;
V_I4( &defkey ) = 0x80000001;
hr = IWbemClassObject_Put( in, L"hDefKey", 0, &defkey, 0 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment