[v2 3/5] compobj.dll16: Implement CoCreateInstance16().

Alexandre Julliard julliard at winehq.org
Thu Feb 9 09:27:50 CST 2017


Zebediah Figura <z.figura12 at gmail.com> writes:

> @@ -899,17 +899,22 @@ HRESULT WINAPI CoCreateGuid16(GUID *pguid)
>   *           CoCreateInstance [COMPOBJ.13]
>   */
>  HRESULT WINAPI CoCreateInstance16(
> -	REFCLSID rclsid,
> -	LPUNKNOWN pUnkOuter,
> -	DWORD dwClsContext,
> -	REFIID iid,
> -	LPVOID *ppv)
> -{
> -  FIXME("(%s, %p, %x, %s, %p), stub!\n",
> -	debugstr_guid(rclsid), pUnkOuter, dwClsContext, debugstr_guid(iid),
> -	ppv
> -  );
> -  return E_NOTIMPL;
> +    REFCLSID rclsid,
> +    LPUNKNOWN pUnkOuter,
> +    DWORD dwClsContext,
> +    REFIID riid,
> +    LPVOID *ppv)
> +{
> +    IClassFactory *cf;
> +    HRESULT hr;
> +
> +    hr = CoGetClassObject16(rclsid, dwClsContext, NULL, &IID_IClassFactory, (void **)&cf);
> +    if (FAILED(hr))
> +        return hr;
> +
> +    hr = IClassFactory_CreateInstance(cf, pUnkOuter, riid, ppv);
> +    IClassFactory_Release(cf);
> +    return hr;

CoGetClassObject16 is supposed to return a 16-bit interface, you can't
call it like that. How did you test this?

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list