Commit 2a35901a authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Do not assume that vtable is the first element of the object,…

windowscodecs: Do not assume that vtable is the first element of the object, avoid not necessary casts.
parent 9fecb853
......@@ -82,9 +82,10 @@ static HRESULT WINAPI ClassFactoryImpl_QueryInterface(IClassFactory *iface,
if (!ppv) return E_INVALIDARG;
if (IsEqualIID(&IID_IUnknown, iid) || IsEqualIID(&IID_IClassFactory, iid))
if (IsEqualIID(&IID_IUnknown, iid) ||
IsEqualIID(&IID_IClassFactory, iid))
{
*ppv = This;
*ppv = &This->IClassFactory_iface;
}
else
{
......@@ -155,8 +156,8 @@ static HRESULT ClassFactoryImpl_Constructor(classinfo *info, REFIID riid, LPVOID
This->ref = 1;
This->info = info;
ret = IClassFactory_QueryInterface((IClassFactory*)This, riid, ppv);
IClassFactory_Release((IClassFactory*)This);
ret = IClassFactory_QueryInterface(&This->IClassFactory_iface, riid, ppv);
IClassFactory_Release(&This->IClassFactory_iface);
return ret;
}
......
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