windowscodecs: Do not assume that vtable is the first element of the object, avoid not necessary casts.

This commit is contained in:
Dmitry Timoshkov 2012-07-24 15:05:18 +09:00 committed by Alexandre Julliard
parent 7824827a32
commit adbcfacb8c
1 changed files with 3 additions and 3 deletions

View File

@ -852,7 +852,7 @@ static HRESULT WINAPI FormatConverter_QueryInterface(IWICFormatConverter *iface,
IsEqualIID(&IID_IWICBitmapSource, iid) ||
IsEqualIID(&IID_IWICFormatConverter, iid))
{
*ppv = This;
*ppv = &This->IWICFormatConverter_iface;
}
else
{
@ -1103,8 +1103,8 @@ HRESULT FormatConverter_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** p
InitializeCriticalSection(&This->lock);
This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": FormatConverter.lock");
ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv);
IUnknown_Release((IUnknown*)This);
ret = IWICFormatConverter_QueryInterface(&This->IWICFormatConverter_iface, iid, ppv);
IWICFormatConverter_Release(&This->IWICFormatConverter_iface);
return ret;
}