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

wbemprox: Implement WbemContext stub.

parent ee4e33ed
......@@ -112,6 +112,7 @@ static const struct IClassFactoryVtbl wbemprox_cf_vtbl =
};
static wbemprox_cf wbem_locator_cf = { { &wbemprox_cf_vtbl }, WbemLocator_create };
static wbemprox_cf wbem_context_cf = { { &wbemprox_cf_vtbl }, WbemContext_create };
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
......@@ -139,6 +140,10 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID iid, LPVOID *ppv )
{
cf = &wbem_locator_cf.IClassFactory_iface;
}
else if (IsEqualGUID( rclsid, &CLSID_WbemContext ))
{
cf = &wbem_context_cf.IClassFactory_iface;
}
if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
return IClassFactory_QueryInterface( cf, iid, ppv );
}
......
......@@ -954,3 +954,178 @@ HRESULT WbemServices_create( const WCHAR *namespace, LPVOID *ppObj )
TRACE("returning iface %p\n", *ppObj);
return S_OK;
}
struct wbem_context
{
IWbemContext IWbemContext_iface;
LONG refs;
};
static struct wbem_context *impl_from_IWbemContext( IWbemContext *iface )
{
return CONTAINING_RECORD( iface, struct wbem_context, IWbemContext_iface );
}
static HRESULT WINAPI wbem_context_QueryInterface(
IWbemContext *iface,
REFIID riid,
void **obj)
{
TRACE("%p, %s, %p\n", iface, debugstr_guid( riid ), obj );
if ( IsEqualGUID( riid, &IID_IWbemContext ) ||
IsEqualGUID( riid, &IID_IUnknown ) )
{
*obj = iface;
}
else
{
FIXME("interface %s not implemented\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
IWbemContext_AddRef( iface );
return S_OK;
}
static ULONG WINAPI wbem_context_AddRef(
IWbemContext *iface )
{
struct wbem_context *context = impl_from_IWbemContext( iface );
return InterlockedIncrement( &context->refs );
}
static ULONG WINAPI wbem_context_Release(
IWbemContext *iface )
{
struct wbem_context *context = impl_from_IWbemContext( iface );
LONG refs = InterlockedDecrement( &context->refs );
if (!refs)
{
TRACE("destroying %p\n", context);
heap_free( context );
}
return refs;
}
static HRESULT WINAPI wbem_context_Clone(
IWbemContext *iface,
IWbemContext **newcopy )
{
FIXME("%p, %p\n", iface, newcopy);
return E_NOTIMPL;
}
static HRESULT WINAPI wbem_context_GetNames(
IWbemContext *iface,
LONG flags,
SAFEARRAY **names )
{
FIXME("%p, %#x, %p\n", iface, flags, names);
return E_NOTIMPL;
}
static HRESULT WINAPI wbem_context_BeginEnumeration(
IWbemContext *iface,
LONG flags )
{
FIXME("%p, %#x\n", iface, flags);
return E_NOTIMPL;
}
static HRESULT WINAPI wbem_context_Next(
IWbemContext *iface,
LONG flags,
BSTR *name,
VARIANT *value )
{
FIXME("%p, %#x, %p, %p\n", iface, flags, name, value);
return E_NOTIMPL;
}
static HRESULT WINAPI wbem_context_EndEnumeration(
IWbemContext *iface )
{
FIXME("%p\n", iface);
return E_NOTIMPL;
}
static HRESULT WINAPI wbem_context_SetValue(
IWbemContext *iface,
LPCWSTR name,
LONG flags,
VARIANT *value )
{
FIXME("%p, %s, %#x, %p\n", iface, debugstr_w(name), flags, value);
return E_NOTIMPL;
}
static HRESULT WINAPI wbem_context_GetValue(
IWbemContext *iface,
LPCWSTR name,
LONG flags,
VARIANT *value )
{
FIXME("%p, %s, %#x, %p\n", iface, debugstr_w(name), flags, value);
return E_NOTIMPL;
}
static HRESULT WINAPI wbem_context_DeleteValue(
IWbemContext *iface,
LPCWSTR name,
LONG flags )
{
FIXME("%p, %s, %#x\n", iface, debugstr_w(name), flags);
return E_NOTIMPL;
}
static HRESULT WINAPI wbem_context_DeleteAll(
IWbemContext *iface )
{
FIXME("%p\n", iface);
return E_NOTIMPL;
}
static const IWbemContextVtbl wbem_context_vtbl =
{
wbem_context_QueryInterface,
wbem_context_AddRef,
wbem_context_Release,
wbem_context_Clone,
wbem_context_GetNames,
wbem_context_BeginEnumeration,
wbem_context_Next,
wbem_context_EndEnumeration,
wbem_context_SetValue,
wbem_context_GetValue,
wbem_context_DeleteValue,
wbem_context_DeleteAll,
};
HRESULT WbemContext_create( void **obj )
{
struct wbem_context *context;
TRACE("(%p)\n", obj);
context = heap_alloc( sizeof(*context) );
if (!context) return E_OUTOFMEMORY;
context->IWbemContext_iface.lpVtbl = &wbem_context_vtbl;
context->refs = 1;
*obj = &context->IWbemContext_iface;
TRACE("returning iface %p\n", *obj);
return S_OK;
}
......@@ -149,10 +149,22 @@ static void test_IWbemLocator(void)
IWbemLocator_Release( locator );
}
static void test_IWbemContext(void)
{
IWbemContext *context;
HRESULT hr;
hr = CoCreateInstance( &CLSID_WbemContext, NULL, CLSCTX_INPROC_SERVER, &IID_IWbemContext, (void **)&context );
ok(hr == S_OK, "Failed to create context object, hr %#x.\n", hr);
IWbemContext_Release( context );
}
START_TEST(services)
{
CoInitialize( NULL );
test_IClientSecurity();
test_IWbemLocator();
test_IWbemContext();
CoUninitialize();
}
......@@ -28,6 +28,13 @@
coclass WbemLocator { interface IWbemLocator; }
[
helpstring("WBEM Call Context"),
threading(both),
uuid(674b6698-ee92-11d0-ad71-00c04fd8fdff)
]
coclass WbemContext { interface IWbemContext; }
[
helpstring("WBEM Administrative Locator"),
threading(both),
uuid(cb8555cc-9128-11d1-ad9b-00c04fd8fdff)
......
......@@ -237,6 +237,7 @@ HRESULT create_signature( const WCHAR *, const WCHAR *, enum param_direction,
HRESULT WbemLocator_create(LPVOID *) DECLSPEC_HIDDEN;
HRESULT WbemServices_create(const WCHAR *, LPVOID *) DECLSPEC_HIDDEN;
HRESULT WbemContext_create(void **) DECLSPEC_HIDDEN;
HRESULT create_class_object(const WCHAR *, IEnumWbemClassObject *, UINT,
struct record *, IWbemClassObject **) DECLSPEC_HIDDEN;
HRESULT EnumWbemClassObject_create(struct query *, LPVOID *) DECLSPEC_HIDDEN;
......
......@@ -936,3 +936,12 @@ coclass WbemRefresher
interface IWbemRefresher;
interface IWbemConfigureRefresher;
};
[
restricted,
uuid(674b6698-ee92-11d0-ad71-00c04fd8fdff)
]
coclass WbemContext
{
interface IWbemContext;
}
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