Commit 93858d78 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

wbemdisp: Pass context value to ConnectServer().

parent 65ed5d9c
......@@ -35,6 +35,22 @@
WINE_DEFAULT_DEBUG_CHANNEL(wbemdisp);
struct namedvalueset
{
ISWbemNamedValueSet ISWbemNamedValueSet_iface;
LONG refs;
IWbemContext *context;
};
static struct namedvalueset *unsafe_valueset_impl_from_IDispatch(IDispatch *iface);
static IWbemContext * unsafe_get_context_from_namedvalueset( IDispatch *disp )
{
struct namedvalueset *valueset = unsafe_valueset_impl_from_IDispatch( disp );
return valueset ? valueset->context : NULL;
}
static WCHAR *heap_strdupW( const WCHAR *src )
{
WCHAR *dst;
......@@ -2751,6 +2767,7 @@ static HRESULT WINAPI locator_ConnectServer(
{
struct locator *locator = impl_from_ISWbemLocator( iface );
IWbemServices *services;
IWbemContext *context;
BSTR resource;
HRESULT hr;
......@@ -2758,8 +2775,6 @@ static HRESULT WINAPI locator_ConnectServer(
debugstr_w(strNamespace), debugstr_w(strUser), strPassword, debugstr_w(strLocale),
debugstr_w(strAuthority), iSecurityFlags, objWbemNamedValueSet, objWbemServices );
if (objWbemNamedValueSet) FIXME( "context not supported\n" );
if (!locator->locator)
{
hr = CoCreateInstance( &CLSID_WbemLocator, NULL, CLSCTX_INPROC_SERVER, &IID_IWbemLocator,
......@@ -2767,9 +2782,11 @@ static HRESULT WINAPI locator_ConnectServer(
if (hr != S_OK) return hr;
}
context = unsafe_get_context_from_namedvalueset( objWbemNamedValueSet );
if (!(resource = build_resource_string( strServer, strNamespace ))) return E_OUTOFMEMORY;
hr = IWbemLocator_ConnectServer( locator->locator, resource, strUser, strPassword, strLocale,
iSecurityFlags, strAuthority, NULL, &services );
iSecurityFlags, strAuthority, context, &services );
SysFreeString( resource );
if (hr != S_OK) return hr;
......@@ -3047,14 +3064,6 @@ static HRESULT ISWbemSecurity_create( ISWbemSecurity **obj )
return S_OK;
}
struct namedvalueset
{
ISWbemNamedValueSet ISWbemNamedValueSet_iface;
LONG refs;
IWbemContext *context;
};
struct namedvalue
{
ISWbemNamedValue ISWbemNamedValue_iface;
......@@ -3478,6 +3487,18 @@ static const ISWbemNamedValueSetVtbl namedvalueset_vtbl =
namedvalueset_DeleteAll,
};
static struct namedvalueset *unsafe_valueset_impl_from_IDispatch(IDispatch *iface)
{
if (!iface)
return NULL;
if (iface->lpVtbl != (IDispatchVtbl *)&namedvalueset_vtbl)
{
FIXME( "External implementations are not supported.\n" );
return NULL;
}
return CONTAINING_RECORD(iface, struct namedvalueset, ISWbemNamedValueSet_iface);
}
HRESULT SWbemNamedValueSet_create( void **obj )
{
struct namedvalueset *set;
......
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