On 07.01.2015 12:58, Hans Leidekker wrote:
> ---
> dlls/wbemdisp/locator.c | 145 +++++++++++++++++++++++++++++-------------------
> 1 file changed, 89 insertions(+), 56 deletions(-)
>
> +
> +static HRESULT get_typeinfo( enum type_id tid, ITypeInfo **ret )
> +{
> ...
> + }
> + *ret = wbemdisp_typeinfo[tid];
> + return S_OK;
> +}
get_typeinfo() doesn't AddRef() returned pointer.
> @@ -102,8 +155,10 @@ static HRESULT WINAPI services_GetTypeInfo(
> LCID lcid,
> ITypeInfo **info )
> {
> - FIXME( "\n" );
> - return E_NOTIMPL;
> + struct services *services = impl_from_ISWbemServices( iface );
> + TRACE( "%p, %u, %u, %p\n", services, index, lcid, info );
> +
> + return get_typeinfo( ISWbemServices_tid, info );
> }
That means you should AddRef() it here.
> static HRESULT WINAPI services_GetIDsOfNames(
> @@ -114,8 +169,21 @@ static HRESULT WINAPI services_GetIDsOfNames(
> LCID lcid,
> DISPID *dispid )
> {
> - FIXME( "\n" );
> - return E_NOTIMPL;
> + struct services *services = impl_from_ISWbemServices( iface );
> + ITypeInfo *typeinfo;
> + HRESULT hr;
> +
> + TRACE( "%p, %s, %p, %u, %u, %p\n", services, debugstr_guid(riid), names, count, lcid, dispid );
> +
> + if (!names || !count || !dispid) return E_INVALIDARG;
> +
> + hr = get_typeinfo( ISWbemServices_tid, &typeinfo );
> + if (SUCCEEDED(hr))
> + {
> + hr = ITypeInfo_GetIDsOfNames( typeinfo, names, count, dispid );
> + ITypeInfo_Release( typeinfo );
> + }
> + return hr;
And remove Release() here.
Or am I missing something?