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