On 5/18/2012 14:06, Detlef Riekenberg wrote:
- if (ppv == NULL)
return E_POINTER;
This is usually redundant.
- if (IsEqualGUID(&IID_IUnknown, riid) ||
IsEqualGUID(&IID_IQueryInfo, riid)) {
*ppv =&This->IQueryInfo_iface;
IUnknown_AddRef((IUnknown*)*ppv);
TRACE("returning IQueryInfo: %p\n", *ppv);
return S_OK;
- }
Instead of using IUnknown for some reason a clean way could be to call IQueryInfo_AddRef(iface). Trace is not needed here - you have a trace on top of that and FIXME trace on a failure, so you'll know.
- *ppv = NULL;
- FIXME("(%p)->(%s %p) interface not supported\n", This, debugstr_guid(riid), ppv);
- return E_NOINTERFACE;
+} +IQueryInfo *IQueryInfo_Constructor(LPCITEMIDLIST pidl) +{
- IQueryInfoImpl *qi;
- TRACE("(%p)\n", pidl);
- qi = HeapAlloc(GetProcessHeap(), 0, sizeof(IQueryInfoImpl));
- qi->IQueryInfo_iface.lpVtbl =&IQueryInfo_vtbl;
- qi->ref=1;
- qi->pidl=ILClone(pidl);
- TRACE("==> %p (pidl: %p)\n", qi, qi->pidl);
- return&qi->IQueryInfo_iface;
+}
This doesn't handle HeaoAlloc() or ILClone failures.