HRESULT WINAPI CPrinterFolder::FinalConstruct() { pidlRoot = _ILCreatePrinters(); /* my qualified pidl */ if (pidlRoot == NULL) return E_OUTOFMEMORY; return S_OK; }
/************************************************************************** * ISF_Printers_Constructor */ HRESULT WINAPI ISF_Printers_Constructor ( IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv) { IGenericSFImpl *sf; HRESULT hr; TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid)); if (pUnkOuter) return CLASS_E_NOAGGREGATION; sf = HeapAlloc( GetProcessHeap(), 0, sizeof(*sf) ); if (!sf) return E_OUTOFMEMORY; sf->ref = 1; sf->lpVtbl = &vt_ShellFolder2; sf->lpVtblPersistFolder2 = &vt_PersistFolder2; sf->pidlRoot = _ILCreatePrinters(); /* my qualified pidl */ hr = IUnknown_QueryInterface( _IUnknown_(sf), riid, ppv ); IUnknown_Release( _IUnknown_(sf) ); TRACE ("--(%p)\n", *ppv); return hr; }