From 1be967df936b831018841119500aaa5fe546c49b Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 3 Mar 2021 09:05:49 +0300 Subject: [PATCH] wbemprox: Implement context object cloning. Signed-off-by: Nikolay Sivov Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/wbemprox/services.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/dlls/wbemprox/services.c b/dlls/wbemprox/services.c index 19e03fa152b..7de97dbae64 100644 --- a/dlls/wbemprox/services.c +++ b/dlls/wbemprox/services.c @@ -1039,9 +1039,32 @@ static HRESULT WINAPI wbem_context_Clone( IWbemContext *iface, IWbemContext **newcopy ) { - FIXME("%p, %p\n", iface, newcopy); + struct wbem_context *context = impl_from_IWbemContext( iface ); + struct wbem_context_value *value; + IWbemContext *cloned_context; + HRESULT hr; - return E_NOTIMPL; + TRACE("%p, %p\n", iface, newcopy); + + if (SUCCEEDED(hr = WbemContext_create( (void **)&cloned_context ))) + { + LIST_FOR_EACH_ENTRY( value, &context->values, struct wbem_context_value, entry ) + { + if (FAILED(hr = IWbemContext_SetValue( cloned_context, value->name, 0, &value->value ))) break; + } + } + + if (SUCCEEDED(hr)) + { + *newcopy = cloned_context; + } + else + { + *newcopy = NULL; + IWbemContext_Release( cloned_context ); + } + + return hr; } static HRESULT WINAPI wbem_context_GetNames(