diff --git a/reactos/dll/win32/shell32/shlview.cpp b/reactos/dll/win32/shell32/shlview.cpp index 82cc929bb47..3d5eddad65c 100644 --- a/reactos/dll/win32/shell32/shlview.cpp +++ b/reactos/dll/win32/shell32/shlview.cpp @@ -2817,6 +2817,9 @@ HRESULT STDMETHODCALLTYPE CDefView::QueryService(REFGUID guidService, REFIID rii { if (IsEqualIID(guidService, SID_IShellBrowser)) return pShellBrowser->QueryInterface(riid, ppvObject); + else if(IsEqualIID(guidService, SID_IFolderView)) + return QueryInterface(riid, ppvObject); + return E_NOINTERFACE; } diff --git a/reactos/dll/win32/shell32/shv_item_new.cpp b/reactos/dll/win32/shell32/shv_item_new.cpp index fead6e009c1..ce933ac0645 100644 --- a/reactos/dll/win32/shell32/shv_item_new.cpp +++ b/reactos/dll/win32/shell32/shv_item_new.cpp @@ -336,7 +336,7 @@ CNewMenu::InsertShellNewItems(HMENU hMenu, UINT idFirst, UINT idMenu) } HRESULT -CNewMenu::DoShellNewCmd(LPCMINVOKECOMMANDINFO lpcmi) +CNewMenu::DoShellNewCmd(LPCMINVOKECOMMANDINFO lpcmi, IShellView *psv) { SHELLNEW_ITEM *pCurItem = s_SnHead; IPersistFolder3 * psf; @@ -372,9 +372,9 @@ CNewMenu::DoShellNewCmd(LPCMINVOKECOMMANDINFO lpcmi) if (!pCurItem) return E_UNEXPECTED; - if (fSite == NULL) - return E_FAIL; - hResult = IUnknown_QueryService(fSite, SID_IFolderView, IID_IFolderView, (void **)&folderView); + //if (fSite == NULL) + // return E_FAIL; + hResult = IUnknown_QueryService(psv, SID_IFolderView, IID_IFolderView, (void **)&folderView); if (FAILED(hResult)) return hResult; hResult = folderView->GetFolder(IID_IShellFolder, (void **)&parentFolder); @@ -575,9 +575,9 @@ void CNewMenu::DoNewFolder( CComPtr parentFolder; HRESULT hResult; - if (fSite == NULL) - return; - hResult = IUnknown_QueryService(fSite, SID_IFolderView, IID_IFolderView, (void **)&folderView); + //if (fSite == NULL) + // return; + hResult = IUnknown_QueryService(psv, SID_IFolderView, IID_IFolderView, (void **)&folderView); if (FAILED(hResult)) return; hResult = folderView->GetFolder(IID_IShellFolder, (void **)&parentFolder); @@ -620,8 +620,8 @@ HRESULT STDMETHODCALLTYPE CNewMenu::GetSite(REFIID riid, void **ppvSite) if (ppvSite == NULL) return E_POINTER; *ppvSite = fSite; - if (fSite.p != NULL) - fSite.p->AddRef(); + if (fSite != NULL) + fSite->AddRef(); return S_OK; } @@ -690,7 +690,7 @@ CNewMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpici) return S_OK; } - hr = DoShellNewCmd(lpici); + hr = DoShellNewCmd(lpici, lpSV); if (SUCCEEDED(hr) && lpSV) { lpSV->Refresh(); diff --git a/reactos/dll/win32/shell32/shv_item_new.h b/reactos/dll/win32/shell32/shv_item_new.h index 2d8778f263d..02019458021 100644 --- a/reactos/dll/win32/shell32/shv_item_new.h +++ b/reactos/dll/win32/shell32/shv_item_new.h @@ -51,7 +51,7 @@ private: LPWSTR szPath; SHELLNEW_ITEM *s_SnHead; - CComPtr fSite; + IUnknown* fSite; public: CNewMenu(); ~CNewMenu(); @@ -60,7 +60,7 @@ public: void UnloadShellItems(); BOOL LoadShellNewItems(); UINT InsertShellNewItems(HMENU hMenu, UINT idFirst, UINT idMenu); - HRESULT DoShellNewCmd(LPCMINVOKECOMMANDINFO lpcmi); + HRESULT DoShellNewCmd(LPCMINVOKECOMMANDINFO lpcmi, IShellView * psv); HRESULT DoMeasureItem(HWND hWnd, MEASUREITEMSTRUCT *lpmis); HRESULT DoDrawItem(HWND hWnd, DRAWITEMSTRUCT *drawItem); void DoNewFolder(IShellView *psv);