static HRESULT WINAPI ItemMonikerCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv) { ItemMonikerImpl* newItemMoniker; HRESULT hr; static const WCHAR wszEmpty[] = { 0 }; TRACE("(%p, %s, %p)\n", pUnk, debugstr_guid(riid), ppv); *ppv = NULL; if (pUnk) return CLASS_E_NOAGGREGATION; newItemMoniker = HeapAlloc(GetProcessHeap(), 0, sizeof(ItemMonikerImpl)); if (!newItemMoniker) return E_OUTOFMEMORY; hr = ItemMonikerImpl_Construct(newItemMoniker, wszEmpty, wszEmpty); if (SUCCEEDED(hr)) hr = ItemMonikerImpl_QueryInterface(&newItemMoniker->IMoniker_iface, riid, ppv); if (FAILED(hr)) HeapFree(GetProcessHeap(),0,newItemMoniker); return hr; }
/****************************************************************************** * CreateItemMoniker [OLE32.@] ******************************************************************************/ HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR lpszItem, IMoniker **ppmk) { ItemMonikerImpl* newItemMoniker; HRESULT hr; TRACE("(%s,%s,%p)\n",debugstr_w(lpszDelim),debugstr_w(lpszItem),ppmk); newItemMoniker = HeapAlloc(GetProcessHeap(), 0, sizeof(ItemMonikerImpl)); if (!newItemMoniker) return STG_E_INSUFFICIENTMEMORY; hr = ItemMonikerImpl_Construct(newItemMoniker,lpszDelim,lpszItem); if (FAILED(hr)){ HeapFree(GetProcessHeap(),0,newItemMoniker); return hr; } return ItemMonikerImpl_QueryInterface(&newItemMoniker->IMoniker_iface,&IID_IMoniker, (void**)ppmk); }