Commit b7efa008 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 6859a15b
......@@ -1842,9 +1842,10 @@ static HRESULT WINAPI ComponentEnum_QueryInterface(IEnumUnknown *iface, REFIID i
if (!ppv) return E_INVALIDARG;
if (IsEqualIID(&IID_IUnknown, iid) || IsEqualIID(&IID_IEnumUnknown, iid))
if (IsEqualIID(&IID_IUnknown, iid) ||
IsEqualIID(&IID_IEnumUnknown, iid))
{
*ppv = This;
*ppv = &This->IEnumUnknown_iface;
}
else
{
......@@ -1996,11 +1997,11 @@ static HRESULT WINAPI ComponentEnum_Clone(IEnumUnknown *iface, IEnumUnknown **pp
if (FAILED(ret))
{
IUnknown_Release((IUnknown*)new_enum);
IEnumUnknown_Release(&new_enum->IEnumUnknown_iface);
*ppenum = NULL;
}
else
*ppenum = (IEnumUnknown*)new_enum;
*ppenum = &new_enum->IEnumUnknown_iface;
return ret;
}
......@@ -2091,13 +2092,13 @@ HRESULT CreateComponentEnumerator(DWORD componentTypes, DWORD options, IEnumUnkn
if (SUCCEEDED(hr))
{
IEnumUnknown_Reset((IEnumUnknown*)This);
*ppIEnumUnknown = (IEnumUnknown*)This;
IEnumUnknown_Reset(&This->IEnumUnknown_iface);
*ppIEnumUnknown = &This->IEnumUnknown_iface;
}
else
{
*ppIEnumUnknown = NULL;
IUnknown_Release((IUnknown*)This);
IEnumUnknown_Release(&This->IEnumUnknown_iface);
}
return hr;
......
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