static HRESULT WINAPI RecycleBin_CreateViewObject(IShellFolder2 *iface, HWND hwndOwner, REFIID riid, void **ppv) { RecycleBin *This = impl_from_IShellFolder2(iface); HRESULT ret; TRACE("(%p, %p, %s, %p)\n", This, hwndOwner, debugstr_guid(riid), ppv); *ppv = NULL; if (IsEqualGUID(riid, &IID_IShellView)) { IShellView *tmp; CSFV sfv; ZeroMemory(&sfv, sizeof(sfv)); sfv.cbSize = sizeof(sfv); sfv.pshf = (IShellFolder *)This; TRACE("Calling SHCreateShellFolderViewEx\n"); ret = SHCreateShellFolderViewEx(&sfv, &tmp); TRACE("Result: %08x, output: %p\n", (unsigned int)ret, tmp); *ppv = tmp; return ret; } return E_NOINTERFACE; }
/************************************************************************** * ISF_NetConnect_fnCreateViewObject */ HRESULT WINAPI CNetworkConnections::CreateViewObject( HWND hwndOwner, REFIID riid, LPVOID * ppvOut) { CSFV cvf; HRESULT hr = E_NOINTERFACE; if (!ppvOut) return hr; *ppvOut = NULL; if (IsEqualIID(riid, IID_IShellView)) { ZeroMemory(&cvf, sizeof(cvf)); cvf.cbSize = sizeof(cvf); cvf.pshf = static_cast<IShellFolder*>(this); IShellView* pShellView; hr = SHCreateShellFolderViewEx(&cvf, &pShellView); if (SUCCEEDED(hr)) { hr = pShellView->QueryInterface(riid, ppvOut); pShellView->Release(); } } return hr; }