Module: wine Branch: master Commit: 1be967df936b831018841119500aaa5fe546c49b URL: https://source.winehq.org/git/wine.git/?a=commit;h=1be967df936b8310188411195...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Wed Mar 3 09:05:49 2021 +0300
wbemprox: Implement context object cloning.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Hans Leidekker hans@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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(