mirror of
https://github.com/reactos/reactos.git
synced 2025-05-28 13:38:19 +00:00
[SHELL32]
* Stop using the C defines LPSHELLFOLDER, LPSHELLVIEW and LPUNKNOWN, and use the respective C++ interfaces instead. * Change one batch of COM interface pointers into CComPtr-based pointers, and remove associated Release calls (including at least one that was not supposed to be there at all). * Remove a couple (repeated multiple times) pointless casts. svn path=/branches/shell-experiments/; revision=63908
This commit is contained in:
parent
a5ce7500a1
commit
ef04ff090e
23 changed files with 145 additions and 186 deletions
dll/win32/shell32
|
@ -116,7 +116,7 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBar::QueryService(
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnFocusChangeIS(THIS_ LPUNKNOWN lpUnknown, BOOL bFocus)
|
HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnFocusChangeIS(THIS_ IUnknown * lpUnknown, BOOL bFocus)
|
||||||
{
|
{
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ typedef struct tagbrowse_info
|
||||||
|
|
||||||
typedef struct tagTV_ITEMDATA
|
typedef struct tagTV_ITEMDATA
|
||||||
{
|
{
|
||||||
LPSHELLFOLDER lpsfParent; /* IShellFolder of the parent */
|
IShellFolder* lpsfParent; /* IShellFolder of the parent */
|
||||||
LPITEMIDLIST lpi; /* PIDL relative to parent */
|
LPITEMIDLIST lpi; /* PIDL relative to parent */
|
||||||
LPITEMIDLIST lpifq; /* Fully qualified PIDL */
|
LPITEMIDLIST lpifq; /* Fully qualified PIDL */
|
||||||
IEnumIDList* pEnumIL; /* Children iterator */
|
IEnumIDList* pEnumIL; /* Children iterator */
|
||||||
|
@ -81,7 +81,7 @@ static const LAYOUT_INFO g_layout_info[] =
|
||||||
BIF_NEWDIALOGSTYLE | \
|
BIF_NEWDIALOGSTYLE | \
|
||||||
BIF_BROWSEINCLUDEFILES)
|
BIF_BROWSEINCLUDEFILES)
|
||||||
|
|
||||||
static void FillTreeView(browse_info*, LPSHELLFOLDER,
|
static void FillTreeView(browse_info*, IShellFolder*,
|
||||||
LPITEMIDLIST, HTREEITEM, IEnumIDList*);
|
LPITEMIDLIST, HTREEITEM, IEnumIDList*);
|
||||||
static HTREEITEM InsertTreeViewItem( browse_info*, IShellFolder*,
|
static HTREEITEM InsertTreeViewItem( browse_info*, IShellFolder*,
|
||||||
LPCITEMIDLIST, LPCITEMIDLIST, IEnumIDList*, HTREEITEM);
|
LPCITEMIDLIST, LPCITEMIDLIST, IEnumIDList*, HTREEITEM);
|
||||||
|
@ -206,10 +206,11 @@ static void InitializeTreeView( browse_info *info )
|
||||||
ILRemoveLastID(pidlParent);
|
ILRemoveLastID(pidlParent);
|
||||||
pidlChild = ILClone(ILFindLastID(root));
|
pidlChild = ILClone(ILFindLastID(root));
|
||||||
|
|
||||||
if (_ILIsDesktop(pidlParent)) {
|
if (_ILIsDesktop(pidlParent))
|
||||||
|
{
|
||||||
hr = SHGetDesktopFolder(&lpsfParent);
|
hr = SHGetDesktopFolder(&lpsfParent);
|
||||||
} else {
|
} else {
|
||||||
IShellFolder *lpsfDesktop;
|
CComPtr<IShellFolder> lpsfDesktop;
|
||||||
hr = SHGetDesktopFolder(&lpsfDesktop);
|
hr = SHGetDesktopFolder(&lpsfDesktop);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
WARN("SHGetDesktopFolder failed! hr = %08x\n", hr);
|
WARN("SHGetDesktopFolder failed! hr = %08x\n", hr);
|
||||||
|
@ -218,7 +219,6 @@ static void InitializeTreeView( browse_info *info )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
hr = lpsfDesktop->BindToObject(pidlParent, 0, IID_PPV_ARG(IShellFolder, &lpsfParent));
|
hr = lpsfDesktop->BindToObject(pidlParent, 0, IID_PPV_ARG(IShellFolder, &lpsfParent));
|
||||||
lpsfDesktop->Release();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
|
@ -310,7 +310,7 @@ static void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq, LPTVITEMW lpTV_ITEM)
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*/
|
*/
|
||||||
static BOOL GetName(LPSHELLFOLDER lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR lpFriendlyName)
|
static BOOL GetName(IShellFolder * lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR lpFriendlyName)
|
||||||
{
|
{
|
||||||
BOOL bSuccess=TRUE;
|
BOOL bSuccess=TRUE;
|
||||||
STRRET str;
|
STRRET str;
|
||||||
|
@ -714,8 +714,9 @@ static HRESULT BrsFolder_Rename(browse_info *info, HTREEITEM rename)
|
||||||
static HRESULT BrsFolder_NewFolder(browse_info *info)
|
static HRESULT BrsFolder_NewFolder(browse_info *info)
|
||||||
{
|
{
|
||||||
DWORD flags = BrowseFlagsToSHCONTF(info->lpBrowseInfo->ulFlags);
|
DWORD flags = BrowseFlagsToSHCONTF(info->lpBrowseInfo->ulFlags);
|
||||||
IShellFolder *desktop, *cur;
|
CComPtr<IShellFolder> desktop;
|
||||||
ISFHelper *sfhelper;
|
CComPtr<IShellFolder> cur;
|
||||||
|
CComPtr<ISFHelper> sfhelper;
|
||||||
WCHAR name[MAX_PATH];
|
WCHAR name[MAX_PATH];
|
||||||
HTREEITEM parent, added;
|
HTREEITEM parent, added;
|
||||||
LPTV_ITEMDATA item_data;
|
LPTV_ITEMDATA item_data;
|
||||||
|
@ -734,7 +735,6 @@ static HRESULT BrsFolder_NewFolder(browse_info *info)
|
||||||
if(FAILED(hr))
|
if(FAILED(hr))
|
||||||
return hr;
|
return hr;
|
||||||
hr = desktop->BindToObject(info->pidlRet, 0, IID_PPV_ARG(IShellFolder, &cur));
|
hr = desktop->BindToObject(info->pidlRet, 0, IID_PPV_ARG(IShellFolder, &cur));
|
||||||
desktop->Release();
|
|
||||||
if(FAILED(hr))
|
if(FAILED(hr))
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
|
@ -750,7 +750,6 @@ static HRESULT BrsFolder_NewFolder(browse_info *info)
|
||||||
if(len<MAX_PATH)
|
if(len<MAX_PATH)
|
||||||
name[len++] = '\\';
|
name[len++] = '\\';
|
||||||
hr = sfhelper->GetUniqueName(&name[len], MAX_PATH-len);
|
hr = sfhelper->GetUniqueName(&name[len], MAX_PATH-len);
|
||||||
sfhelper->Release();
|
|
||||||
if(FAILED(hr))
|
if(FAILED(hr))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
@ -792,7 +791,6 @@ static HRESULT BrsFolder_NewFolder(browse_info *info)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
added = InsertTreeViewItem(info, cur, new_item, item_data->lpifq, NULL, parent);
|
added = InsertTreeViewItem(info, cur, new_item, item_data->lpifq, NULL, parent);
|
||||||
cur->Release();
|
|
||||||
SHFree(new_item);
|
SHFree(new_item);
|
||||||
|
|
||||||
SendMessageW(info->hwndTreeView, TVM_SORTCHILDREN, FALSE, (LPARAM)parent);
|
SendMessageW(info->hwndTreeView, TVM_SORTCHILDREN, FALSE, (LPARAM)parent);
|
||||||
|
@ -842,7 +840,7 @@ static BOOL BrsFolder_OnSetExpanded(browse_info *info, LPVOID selection,
|
||||||
|
|
||||||
/* If 'selection' is a string, convert to a Shell ID List. */
|
/* If 'selection' is a string, convert to a Shell ID List. */
|
||||||
if (is_str) {
|
if (is_str) {
|
||||||
IShellFolder *psfDesktop;
|
CComPtr<IShellFolder> psfDesktop;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
hr = SHGetDesktopFolder(&psfDesktop);
|
hr = SHGetDesktopFolder(&psfDesktop);
|
||||||
|
@ -851,7 +849,6 @@ static BOOL BrsFolder_OnSetExpanded(browse_info *info, LPVOID selection,
|
||||||
|
|
||||||
hr = psfDesktop->ParseDisplayName(NULL, NULL, (LPOLESTR)selection,
|
hr = psfDesktop->ParseDisplayName(NULL, NULL, (LPOLESTR)selection,
|
||||||
NULL, &pidlSelection, NULL);
|
NULL, &pidlSelection, NULL);
|
||||||
psfDesktop->Release();
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,10 +37,10 @@ class CDefaultContextMenu :
|
||||||
public IContextMenu2
|
public IContextMenu2
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
IShellFolder *m_psf;
|
CComPtr<IShellFolder> m_psf;
|
||||||
UINT m_cidl;
|
UINT m_cidl;
|
||||||
PCUITEMID_CHILD_ARRAY m_apidl;
|
PCUITEMID_CHILD_ARRAY m_apidl;
|
||||||
IDataObject *m_pDataObj;
|
CComPtr<IDataObject> m_pDataObj;
|
||||||
PIDLIST_ABSOLUTE m_pidlFolder;
|
PIDLIST_ABSOLUTE m_pidlFolder;
|
||||||
DWORD m_bGroupPolicyActive;
|
DWORD m_bGroupPolicyActive;
|
||||||
PDynamicShellEntry m_pDynamicEntries; /* first dynamic shell extension entry */
|
PDynamicShellEntry m_pDynamicEntries; /* first dynamic shell extension entry */
|
||||||
|
@ -135,16 +135,12 @@ CDefaultContextMenu::~CDefaultContextMenu()
|
||||||
|
|
||||||
if (m_pidlFolder)
|
if (m_pidlFolder)
|
||||||
CoTaskMemFree(m_pidlFolder);
|
CoTaskMemFree(m_pidlFolder);
|
||||||
if (m_pDataObj)
|
|
||||||
m_pDataObj->Release();
|
|
||||||
_ILFreeaPidl(const_cast<PITEMID_CHILD *>(m_apidl), m_cidl);
|
_ILFreeaPidl(const_cast<PITEMID_CHILD *>(m_apidl), m_cidl);
|
||||||
if (m_psf)
|
|
||||||
m_psf->Release();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI CDefaultContextMenu::Initialize(const DEFCONTEXTMENU *pdcm)
|
HRESULT WINAPI CDefaultContextMenu::Initialize(const DEFCONTEXTMENU *pdcm)
|
||||||
{
|
{
|
||||||
IDataObject *pDataObj;
|
CComPtr<IDataObject> pDataObj;
|
||||||
|
|
||||||
TRACE("cidl %u\n", pdcm->cidl);
|
TRACE("cidl %u\n", pdcm->cidl);
|
||||||
|
|
||||||
|
@ -153,7 +149,6 @@ HRESULT WINAPI CDefaultContextMenu::Initialize(const DEFCONTEXTMENU *pdcm)
|
||||||
if (m_cidl && !m_apidl)
|
if (m_cidl && !m_apidl)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
m_psf = pdcm->psf;
|
m_psf = pdcm->psf;
|
||||||
m_psf->AddRef();
|
|
||||||
|
|
||||||
if (SUCCEEDED(SHCreateDataObject(pdcm->pidlFolder, pdcm->cidl, pdcm->apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj))))
|
if (SUCCEEDED(SHCreateDataObject(pdcm->pidlFolder, pdcm->cidl, pdcm->apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj))))
|
||||||
m_pDataObj = pDataObj;
|
m_pDataObj = pDataObj;
|
||||||
|
@ -164,12 +159,11 @@ HRESULT WINAPI CDefaultContextMenu::Initialize(const DEFCONTEXTMENU *pdcm)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
IPersistFolder2 *pf = NULL;
|
CComPtr<IPersistFolder2> pf = NULL;
|
||||||
if (SUCCEEDED(m_psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &pf))))
|
if (SUCCEEDED(m_psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &pf))))
|
||||||
{
|
{
|
||||||
if (FAILED(pf->GetCurFolder(reinterpret_cast<LPITEMIDLIST*>(&m_pidlFolder))))
|
if (FAILED(pf->GetCurFolder(reinterpret_cast<LPITEMIDLIST*>(&m_pidlFolder))))
|
||||||
ERR("GetCurFolder failed\n");
|
ERR("GetCurFolder failed\n");
|
||||||
pf->Release();
|
|
||||||
}
|
}
|
||||||
TRACE("pidlFolder %p\n", m_pidlFolder);
|
TRACE("pidlFolder %p\n", m_pidlFolder);
|
||||||
}
|
}
|
||||||
|
@ -307,7 +301,7 @@ BOOL
|
||||||
HasClipboardData()
|
HasClipboardData()
|
||||||
{
|
{
|
||||||
BOOL bRet = FALSE;
|
BOOL bRet = FALSE;
|
||||||
IDataObject *pDataObj;
|
CComPtr<IDataObject> pDataObj;
|
||||||
|
|
||||||
if(SUCCEEDED(OleGetClipboard(&pDataObj)))
|
if(SUCCEEDED(OleGetClipboard(&pDataObj)))
|
||||||
{
|
{
|
||||||
|
@ -323,8 +317,6 @@ HasClipboardData()
|
||||||
bRet = TRUE;
|
bRet = TRUE;
|
||||||
ReleaseStgMedium(&medium);
|
ReleaseStgMedium(&medium);
|
||||||
}
|
}
|
||||||
|
|
||||||
pDataObj->Release();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return bRet;
|
return bRet;
|
||||||
|
@ -369,7 +361,7 @@ CDefaultContextMenu::LoadDynamicContextMenuHandler(HKEY hKey, const CLSID *pclsi
|
||||||
if (IsShellExtensionAlreadyLoaded(pclsid))
|
if (IsShellExtensionAlreadyLoaded(pclsid))
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
IContextMenu *pcm;
|
CComPtr<IContextMenu> pcm;
|
||||||
hr = SHCoCreateInstance(NULL, pclsid, NULL, IID_PPV_ARG(IContextMenu, &pcm));
|
hr = SHCoCreateInstance(NULL, pclsid, NULL, IID_PPV_ARG(IContextMenu, &pcm));
|
||||||
if (hr != S_OK)
|
if (hr != S_OK)
|
||||||
{
|
{
|
||||||
|
@ -377,28 +369,24 @@ CDefaultContextMenu::LoadDynamicContextMenuHandler(HKEY hKey, const CLSID *pclsi
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
IShellExtInit *pExtInit;
|
CComPtr<IShellExtInit> pExtInit;
|
||||||
hr = pcm->QueryInterface(IID_PPV_ARG(IShellExtInit, &pExtInit));
|
hr = pcm->QueryInterface(IID_PPV_ARG(IShellExtInit, &pExtInit));
|
||||||
if (hr != S_OK)
|
if (hr != S_OK)
|
||||||
{
|
{
|
||||||
ERR("Failed to query for interface IID_IShellExtInit hr %x pclsid %s\n", hr, wine_dbgstr_guid(pclsid));
|
ERR("Failed to query for interface IID_IShellExtInit hr %x pclsid %s\n", hr, wine_dbgstr_guid(pclsid));
|
||||||
pcm->Release();
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = pExtInit->Initialize(m_pidlFolder, m_pDataObj, hKey);
|
hr = pExtInit->Initialize(m_pidlFolder, m_pDataObj, hKey);
|
||||||
pExtInit->Release();
|
|
||||||
if (hr != S_OK)
|
if (hr != S_OK)
|
||||||
{
|
{
|
||||||
TRACE("Failed to initialize shell extension error %x pclsid %s\n", hr, wine_dbgstr_guid(pclsid));
|
TRACE("Failed to initialize shell extension error %x pclsid %s\n", hr, wine_dbgstr_guid(pclsid));
|
||||||
pcm->Release();
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
PDynamicShellEntry pEntry = (DynamicShellEntry *)HeapAlloc(GetProcessHeap(), 0, sizeof(DynamicShellEntry));
|
PDynamicShellEntry pEntry = (DynamicShellEntry *)HeapAlloc(GetProcessHeap(), 0, sizeof(DynamicShellEntry));
|
||||||
if (!pEntry)
|
if (!pEntry)
|
||||||
{
|
{
|
||||||
pcm->Release();
|
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -945,7 +933,7 @@ NotifyShellViewWindow(LPCMINVOKECOMMANDINFO lpcmi, BOOL bRefresh)
|
||||||
if (!lpSB)
|
if (!lpSB)
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
LPSHELLVIEW lpSV = NULL;
|
IShellView * lpSV = NULL;
|
||||||
if (FAILED(lpSB->QueryActiveShellView(&lpSV)))
|
if (FAILED(lpSB->QueryActiveShellView(&lpSV)))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
|
@ -1060,7 +1048,7 @@ CDefaultContextMenu::DoPaste(
|
||||||
dwKey = MK_CONTROL|MK_SHIFT;
|
dwKey = MK_CONTROL|MK_SHIFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
IDropTarget *pdrop;
|
CComPtr<IDropTarget> pdrop;
|
||||||
hr = psfTarget->QueryInterface(IID_PPV_ARG(IDropTarget, &pdrop));
|
hr = psfTarget->QueryInterface(IID_PPV_ARG(IDropTarget, &pdrop));
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
|
@ -1086,8 +1074,8 @@ HRESULT
|
||||||
CDefaultContextMenu::DoCreateLink(
|
CDefaultContextMenu::DoCreateLink(
|
||||||
LPCMINVOKECOMMANDINFO lpcmi)
|
LPCMINVOKECOMMANDINFO lpcmi)
|
||||||
{
|
{
|
||||||
LPDATAOBJECT pDataObj;
|
CComPtr<IDataObject> pDataObj;
|
||||||
IDropTarget *pDT;
|
CComPtr<IDropTarget> pDT;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
CComPtr<IPersistFolder2> ppf2 = NULL;
|
CComPtr<IPersistFolder2> ppf2 = NULL;
|
||||||
LPITEMIDLIST pidl;
|
LPITEMIDLIST pidl;
|
||||||
|
@ -1143,13 +1131,11 @@ CDefaultContextMenu::DoCreateLink(
|
||||||
HRESULT CDefaultContextMenu::DoDelete(LPCMINVOKECOMMANDINFO lpcmi) {
|
HRESULT CDefaultContextMenu::DoDelete(LPCMINVOKECOMMANDINFO lpcmi) {
|
||||||
TRACE("(%p) Deleting\n", this);
|
TRACE("(%p) Deleting\n", this);
|
||||||
|
|
||||||
LPDATAOBJECT pDataObj;
|
CComPtr<IDataObject> pDataObj;
|
||||||
|
|
||||||
if (SUCCEEDED(SHCreateDataObject(m_pidlFolder, m_cidl, m_apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj))))
|
if (SUCCEEDED(SHCreateDataObject(m_pidlFolder, m_cidl, m_apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj))))
|
||||||
{
|
{
|
||||||
pDataObj->AddRef();
|
|
||||||
SHCreateThread(DoDeleteThreadProc, pDataObj, NULL, NULL);
|
SHCreateThread(DoDeleteThreadProc, pDataObj, NULL, NULL);
|
||||||
pDataObj->Release();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
@ -1162,7 +1148,7 @@ CDefaultContextMenu::DoCopyOrCut(
|
||||||
LPCMINVOKECOMMANDINFO lpcmi,
|
LPCMINVOKECOMMANDINFO lpcmi,
|
||||||
BOOL bCopy)
|
BOOL bCopy)
|
||||||
{
|
{
|
||||||
LPDATAOBJECT pDataObj;
|
CComPtr<IDataObject> pDataObj;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (SUCCEEDED(SHCreateDataObject(m_pidlFolder, m_cidl, m_apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj))))
|
if (SUCCEEDED(SHCreateDataObject(m_pidlFolder, m_cidl, m_apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj))))
|
||||||
|
@ -1181,7 +1167,6 @@ CDefaultContextMenu::DoCopyOrCut(
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = OleSetClipboard(pDataObj);
|
hr = OleSetClipboard(pDataObj);
|
||||||
pDataObj->Release();
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1193,7 +1178,7 @@ CDefaultContextMenu::DoCopyOrCut(
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
LPSHELLVIEW lpSV;
|
CComPtr<IShellView> lpSV;
|
||||||
hr = lpSB->QueryActiveShellView(&lpSV);
|
hr = lpSB->QueryActiveShellView(&lpSV);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
|
@ -1211,7 +1196,6 @@ CDefaultContextMenu::DoCopyOrCut(
|
||||||
} else
|
} else
|
||||||
ERR("failed to get item object\n");
|
ERR("failed to get item object\n");
|
||||||
|
|
||||||
lpSV->Release();
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1236,7 +1220,7 @@ CDefaultContextMenu::DoRename(
|
||||||
(void)TreeView_EditLabel(hwnd, hItem);
|
(void)TreeView_EditLabel(hwnd, hItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
LPSHELLVIEW lpSV;
|
CComPtr<IShellView> lpSV;
|
||||||
HRESULT hr = lpSB->QueryActiveShellView(&lpSV);
|
HRESULT hr = lpSB->QueryActiveShellView(&lpSV);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
|
@ -1244,9 +1228,8 @@ CDefaultContextMenu::DoRename(
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
lpSV->SelectItem(m_apidl[0],
|
SVSIF selFlags = SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE | SVSI_FOCUSED | SVSI_SELECT;
|
||||||
SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE | SVSI_FOCUSED | SVSI_SELECT);
|
lpSV->SelectItem(m_apidl[0], selFlags);
|
||||||
lpSV->Release();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1259,13 +1242,12 @@ CDefaultContextMenu::DoProperties(
|
||||||
|
|
||||||
if (!pidlParent)
|
if (!pidlParent)
|
||||||
{
|
{
|
||||||
IPersistFolder2 *pf;
|
CComPtr<IPersistFolder2> pf;
|
||||||
|
|
||||||
/* pidlFolder is optional */
|
/* pidlFolder is optional */
|
||||||
if (SUCCEEDED(m_psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &pf))))
|
if (SUCCEEDED(m_psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &pf))))
|
||||||
{
|
{
|
||||||
pf->GetCurFolder((_ITEMIDLIST**)&pidlParent);
|
pf->GetCurFolder((_ITEMIDLIST**)&pidlParent);
|
||||||
pf->Release();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ private:
|
||||||
HWND hWndDesktopListView;
|
HWND hWndDesktopListView;
|
||||||
CComPtr<IShellDesktopTray> ShellDesk;
|
CComPtr<IShellDesktopTray> ShellDesk;
|
||||||
CComPtr<IShellView> DesktopView;
|
CComPtr<IShellView> DesktopView;
|
||||||
IShellBrowser *DefaultShellBrowser;
|
CComPtr<IShellBrowser> DefaultShellBrowser;
|
||||||
LPITEMIDLIST pidlDesktopDirectory;
|
LPITEMIDLIST pidlDesktopDirectory;
|
||||||
LPITEMIDLIST pidlDesktop;
|
LPITEMIDLIST pidlDesktop;
|
||||||
public:
|
public:
|
||||||
|
@ -159,7 +159,7 @@ HRESULT CDesktopBrowser::Initialize(HWND hWndx, IShellDesktopTray *ShellDeskx)
|
||||||
|
|
||||||
static CDesktopBrowser *SHDESK_Create(HWND hWnd, LPCREATESTRUCT lpCreateStruct)
|
static CDesktopBrowser *SHDESK_Create(HWND hWnd, LPCREATESTRUCT lpCreateStruct)
|
||||||
{
|
{
|
||||||
IShellDesktopTray *ShellDesk;
|
CComPtr<IShellDesktopTray> ShellDesk;
|
||||||
CComObject<CDesktopBrowser> *pThis;
|
CComObject<CDesktopBrowser> *pThis;
|
||||||
HRESULT hRet;
|
HRESULT hRet;
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,6 @@ void InitIconOverlays(void)
|
||||||
WCHAR szName[MAX_PATH];
|
WCHAR szName[MAX_PATH];
|
||||||
WCHAR szValue[100];
|
WCHAR szValue[100];
|
||||||
CLSID clsid;
|
CLSID clsid;
|
||||||
IShellIconOverlayIdentifier * Overlay;
|
|
||||||
|
|
||||||
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ShellIconOverlayIdentifiers", 0, KEY_READ, &hKey) != ERROR_SUCCESS)
|
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ShellIconOverlayIdentifiers", 0, KEY_READ, &hKey) != ERROR_SUCCESS)
|
||||||
return;
|
return;
|
||||||
|
@ -131,12 +130,13 @@ void InitIconOverlays(void)
|
||||||
dwSize = sizeof(szValue) / sizeof(WCHAR);
|
dwSize = sizeof(szValue) / sizeof(WCHAR);
|
||||||
if (RegGetValueW(hKey, szName, NULL, RRF_RT_REG_SZ, NULL, szValue, &dwSize) == ERROR_SUCCESS)
|
if (RegGetValueW(hKey, szName, NULL, RRF_RT_REG_SZ, NULL, szValue, &dwSize) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
|
CComPtr<IShellIconOverlayIdentifier> Overlay;
|
||||||
|
|
||||||
CLSIDFromString(szValue, &clsid);
|
CLSIDFromString(szValue, &clsid);
|
||||||
dwResult = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IShellIconOverlayIdentifier, &Overlay));
|
dwResult = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IShellIconOverlayIdentifier, &Overlay));
|
||||||
if (dwResult == S_OK)
|
if (dwResult == S_OK)
|
||||||
{
|
{
|
||||||
Handlers[NumIconOverlayHandlers] = Overlay;
|
Handlers[NumIconOverlayHandlers] = Overlay.Detach();
|
||||||
NumIconOverlayHandlers++;
|
NumIconOverlayHandlers++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ GetIconOverlay(LPCITEMIDLIST pidl, WCHAR * wTemp, int* pIndex)
|
||||||
IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl)
|
IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl)
|
||||||
{
|
{
|
||||||
CComPtr<IDefaultExtractIconInit> initIcon;
|
CComPtr<IDefaultExtractIconInit> initIcon;
|
||||||
IExtractIconW *extractIcon;
|
CComPtr<IExtractIconW> extractIcon;
|
||||||
GUID const * riid;
|
GUID const * riid;
|
||||||
int icon_idx;
|
int icon_idx;
|
||||||
UINT flags;
|
UINT flags;
|
||||||
|
@ -418,7 +418,7 @@ IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl)
|
||||||
initIcon->SetNormalIcon(wTemp, icon_idx);
|
initIcon->SetNormalIcon(wTemp, icon_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
return extractIcon;
|
return extractIcon.Detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -426,8 +426,8 @@ IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl)
|
||||||
*/
|
*/
|
||||||
IExtractIconA* IExtractIconA_Constructor(LPCITEMIDLIST pidl)
|
IExtractIconA* IExtractIconA_Constructor(LPCITEMIDLIST pidl)
|
||||||
{
|
{
|
||||||
IExtractIconW *extractIconW;
|
CComPtr<IExtractIconW> extractIconW;
|
||||||
IExtractIconA *extractIconA;
|
CComPtr<IExtractIconA> extractIconA;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
extractIconW = IExtractIconW_Constructor(pidl);
|
extractIconW = IExtractIconW_Constructor(pidl);
|
||||||
|
@ -435,8 +435,7 @@ IExtractIconA* IExtractIconA_Constructor(LPCITEMIDLIST pidl)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
hr = extractIconW->QueryInterface(IID_PPV_ARG(IExtractIconA, &extractIconA));
|
hr = extractIconW->QueryInterface(IID_PPV_ARG(IExtractIconA, &extractIconA));
|
||||||
extractIconW->Release();
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
return NULL;
|
return NULL;
|
||||||
return extractIconA;
|
return extractIconA.Detach();
|
||||||
}
|
}
|
||||||
|
|
|
@ -316,14 +316,14 @@ HRESULT WINAPI CAdminToolsFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, LPCIT
|
||||||
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
|
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
|
||||||
{
|
{
|
||||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
|
pObj = IExtractIconA_Constructor (pidl);
|
||||||
SHFree (pidl);
|
SHFree (pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
|
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
|
||||||
{
|
{
|
||||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
|
pObj = IExtractIconW_Constructor (pidl);
|
||||||
SHFree (pidl);
|
SHFree (pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -547,12 +547,12 @@ HRESULT WINAPI CControlPanelFolder::GetUIObjectOf(HWND hwndOwner,
|
||||||
hr = IDataObject_Constructor(hwndOwner, pidlRoot, apidl, cidl, (IDataObject **)&pObj);
|
hr = IDataObject_Constructor(hwndOwner, pidlRoot, apidl, cidl, (IDataObject **)&pObj);
|
||||||
} else if (IsEqualIID(riid, IID_IExtractIconA) && (cidl == 1)) {
|
} else if (IsEqualIID(riid, IID_IExtractIconA) && (cidl == 1)) {
|
||||||
pidl = ILCombine(pidlRoot, apidl[0]);
|
pidl = ILCombine(pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconA_Constructor(pidl);
|
pObj = IExtractIconA_Constructor(pidl);
|
||||||
SHFree(pidl);
|
SHFree(pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
} else if (IsEqualIID(riid, IID_IExtractIconW) && (cidl == 1)) {
|
} else if (IsEqualIID(riid, IID_IExtractIconW) && (cidl == 1)) {
|
||||||
pidl = ILCombine(pidlRoot, apidl[0]);
|
pidl = ILCombine(pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconW_Constructor(pidl);
|
pObj = IExtractIconW_Constructor(pidl);
|
||||||
SHFree(pidl);
|
SHFree(pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
} else if ((IsEqualIID(riid, IID_IShellLinkW) || IsEqualIID(riid, IID_IShellLinkA))
|
} else if ((IsEqualIID(riid, IID_IShellLinkW) || IsEqualIID(riid, IID_IShellLinkA))
|
||||||
|
|
|
@ -637,14 +637,14 @@ HRESULT WINAPI CDesktopFolder::GetUIObjectOf(
|
||||||
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
|
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
|
||||||
{
|
{
|
||||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
|
pObj = IExtractIconA_Constructor (pidl);
|
||||||
SHFree (pidl);
|
SHFree (pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
|
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
|
||||||
{
|
{
|
||||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
|
pObj = IExtractIconW_Constructor (pidl);
|
||||||
SHFree (pidl);
|
SHFree (pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
}
|
}
|
||||||
|
@ -1476,7 +1476,7 @@ HRESULT WINAPI CDesktopFolder::Drop(IDataObject *pDataObject,
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
IDropTarget *pDT;
|
CComPtr<IDropTarget> pDT;
|
||||||
hr = this->BindToObject(pidl, NULL, IID_PPV_ARG(IDropTarget, &pDT));
|
hr = this->BindToObject(pidl, NULL, IID_PPV_ARG(IDropTarget, &pDT));
|
||||||
CoTaskMemFree(pidl);
|
CoTaskMemFree(pidl);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
|
@ -1517,13 +1517,12 @@ HRESULT WINAPI CDesktopFolder::_GetDropTarget(LPCITEMIDLIST pidl, LPVOID *ppvOut
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
IShellFolder *psf;
|
CComPtr<IShellFolder> psf;
|
||||||
hr = this->BindToObject(pidlNext, NULL, IID_PPV_ARG(IShellFolder, &psf));
|
hr = this->BindToObject(pidlNext, NULL, IID_PPV_ARG(IShellFolder, &psf));
|
||||||
CoTaskMemFree(pidlNext);
|
CoTaskMemFree(pidlNext);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
hr = psf->GetUIObjectOf(NULL, 1, &pidl, IID_IDropTarget, NULL, ppvOut);
|
hr = psf->GetUIObjectOf(NULL, 1, &pidl, IID_IDropTarget, NULL, ppvOut);
|
||||||
psf->Release();
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
ERR("FS GetUIObjectOf failed: %x\n", hr);
|
ERR("FS GetUIObjectOf failed: %x\n", hr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -409,14 +409,14 @@ HRESULT WINAPI CFontsFolder::GetUIObjectOf(
|
||||||
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
|
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
|
||||||
{
|
{
|
||||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
|
pObj = IExtractIconA_Constructor (pidl);
|
||||||
SHFree (pidl);
|
SHFree (pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
|
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
|
||||||
{
|
{
|
||||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
|
pObj = IExtractIconW_Constructor (pidl);
|
||||||
SHFree (pidl);
|
SHFree (pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -350,7 +350,7 @@ HRESULT WINAPI CFSFolder::CompareIDs(LPARAM lParam,
|
||||||
HRESULT WINAPI CFSFolder::CreateViewObject(HWND hwndOwner,
|
HRESULT WINAPI CFSFolder::CreateViewObject(HWND hwndOwner,
|
||||||
REFIID riid, LPVOID * ppvOut)
|
REFIID riid, LPVOID * ppvOut)
|
||||||
{
|
{
|
||||||
LPSHELLVIEW pShellView;
|
CComPtr<IShellView> pShellView;
|
||||||
HRESULT hr = E_INVALIDARG;
|
HRESULT hr = E_INVALIDARG;
|
||||||
|
|
||||||
TRACE ("(%p)->(hwnd=%p,%s,%p)\n", this, hwndOwner, shdebugstr_guid (&riid),
|
TRACE ("(%p)->(hwnd=%p,%s,%p)\n", this, hwndOwner, shdebugstr_guid (&riid),
|
||||||
|
@ -373,7 +373,6 @@ HRESULT WINAPI CFSFolder::CreateViewObject(HWND hwndOwner,
|
||||||
if (pShellView)
|
if (pShellView)
|
||||||
{
|
{
|
||||||
hr = pShellView->QueryInterface(riid, ppvOut);
|
hr = pShellView->QueryInterface(riid, ppvOut);
|
||||||
pShellView->Release();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -494,14 +493,14 @@ HRESULT WINAPI CFSFolder::GetUIObjectOf(HWND hwndOwner,
|
||||||
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
|
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
|
||||||
{
|
{
|
||||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
|
pObj = IExtractIconA_Constructor (pidl);
|
||||||
SHFree (pidl);
|
SHFree (pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
|
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
|
||||||
{
|
{
|
||||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
|
pObj = IExtractIconW_Constructor (pidl);
|
||||||
SHFree (pidl);
|
SHFree (pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
}
|
}
|
||||||
|
@ -862,7 +861,7 @@ HRESULT WINAPI CFSFolder::MapColumnToSCID (UINT column,
|
||||||
|
|
||||||
HRESULT WINAPI CFSFolder::GetUniqueName(LPWSTR pwszName, UINT uLen)
|
HRESULT WINAPI CFSFolder::GetUniqueName(LPWSTR pwszName, UINT uLen)
|
||||||
{
|
{
|
||||||
IEnumIDList *penum;
|
CComPtr<IEnumIDList> penum;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
WCHAR wszText[MAX_PATH];
|
WCHAR wszText[MAX_PATH];
|
||||||
WCHAR wszNewFolder[25];
|
WCHAR wszNewFolder[25];
|
||||||
|
@ -900,8 +899,6 @@ next:
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
penum->Release();
|
|
||||||
}
|
}
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
@ -1749,8 +1746,8 @@ HRESULT WINAPI CFSFolder::_DoDrop(IDataObject *pDataObject,
|
||||||
DWORD WINAPI CFSFolder::_DoDropThreadProc(LPVOID lpParameter) {
|
DWORD WINAPI CFSFolder::_DoDropThreadProc(LPVOID lpParameter) {
|
||||||
CoInitialize(NULL);
|
CoInitialize(NULL);
|
||||||
_DoDropData *data = static_cast<_DoDropData*>(lpParameter);
|
_DoDropData *data = static_cast<_DoDropData*>(lpParameter);
|
||||||
IDataObject *pDataObject;
|
CComPtr<IDataObject> pDataObject;
|
||||||
HRESULT hr = CoGetInterfaceAndReleaseStream (data->pStream, IID_IDataObject, (void**) &pDataObject);
|
HRESULT hr = CoGetInterfaceAndReleaseStream (data->pStream, IID_PPV_ARG(IDataObject, &pDataObject));
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
|
@ -1760,7 +1757,6 @@ DWORD WINAPI CFSFolder::_DoDropThreadProc(LPVOID lpParameter) {
|
||||||
{
|
{
|
||||||
pAsyncOperation->EndOperation(hr, NULL, data->pdwEffect);
|
pAsyncOperation->EndOperation(hr, NULL, data->pdwEffect);
|
||||||
}
|
}
|
||||||
pDataObject->Release();
|
|
||||||
}
|
}
|
||||||
//Release the CFSFolder and data object holds in the copying thread.
|
//Release the CFSFolder and data object holds in the copying thread.
|
||||||
data->This->Release();
|
data->This->Release();
|
||||||
|
@ -1861,7 +1857,7 @@ HRESULT WINAPI CFSFolder::_LoadDynamicDropTargetHandler(const CLSID *pclsid, LPC
|
||||||
TRACE("CFSFolder::_LoadDynamicDropTargetHandler entered\n");
|
TRACE("CFSFolder::_LoadDynamicDropTargetHandler entered\n");
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
IPersistFile *pp;
|
CComPtr<IPersistFile> pp;
|
||||||
hr = SHCoCreateInstance(NULL, pclsid, NULL, IID_PPV_ARG(IPersistFile, &pp));
|
hr = SHCoCreateInstance(NULL, pclsid, NULL, IID_PPV_ARG(IPersistFile, &pp));
|
||||||
if (hr != S_OK)
|
if (hr != S_OK)
|
||||||
{
|
{
|
||||||
|
@ -1875,6 +1871,5 @@ HRESULT WINAPI CFSFolder::_LoadDynamicDropTargetHandler(const CLSID *pclsid, LPC
|
||||||
ERR("Failed to query for interface IID_IShellExtInit hr %x pclsid %s\n", hr, wine_dbgstr_guid(pclsid));
|
ERR("Failed to query for interface IID_IShellExtInit hr %x pclsid %s\n", hr, wine_dbgstr_guid(pclsid));
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
pp->Release();
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
|
@ -326,7 +326,7 @@ HRESULT WINAPI CDrivesFolder::CompareIDs(LPARAM lParam, LPCITEMIDLIST pidl1, LPC
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI CDrivesFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
|
HRESULT WINAPI CDrivesFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
|
||||||
{
|
{
|
||||||
LPSHELLVIEW pShellView;
|
CComPtr<IShellView> pShellView;
|
||||||
HRESULT hr = E_INVALIDARG;
|
HRESULT hr = E_INVALIDARG;
|
||||||
|
|
||||||
TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
|
TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
|
||||||
|
@ -353,7 +353,6 @@ HRESULT WINAPI CDrivesFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVO
|
||||||
if (pShellView)
|
if (pShellView)
|
||||||
{
|
{
|
||||||
hr = pShellView->QueryInterface(riid, ppvOut);
|
hr = pShellView->QueryInterface(riid, ppvOut);
|
||||||
pShellView->Release();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
|
TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
|
||||||
|
@ -449,14 +448,14 @@ HRESULT WINAPI CDrivesFolder::GetUIObjectOf(HWND hwndOwner,
|
||||||
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
|
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
|
||||||
{
|
{
|
||||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
|
pObj = IExtractIconA_Constructor (pidl);
|
||||||
SHFree (pidl);
|
SHFree (pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
|
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
|
||||||
{
|
{
|
||||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
|
pObj = IExtractIconW_Constructor (pidl);
|
||||||
SHFree (pidl);
|
SHFree (pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -283,7 +283,7 @@ HRESULT WINAPI CMyDocsFolder::CompareIDs(LPARAM lParam, LPCITEMIDLIST pidl1, LPC
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI CMyDocsFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
|
HRESULT WINAPI CMyDocsFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
|
||||||
{
|
{
|
||||||
LPSHELLVIEW pShellView;
|
CComPtr<IShellView> pShellView;
|
||||||
HRESULT hr = E_INVALIDARG;
|
HRESULT hr = E_INVALIDARG;
|
||||||
|
|
||||||
TRACE ("(%p)->(hwnd=%p,%s,%p)\n",
|
TRACE ("(%p)->(hwnd=%p,%s,%p)\n",
|
||||||
|
@ -309,7 +309,6 @@ HRESULT WINAPI CMyDocsFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVO
|
||||||
if (pShellView)
|
if (pShellView)
|
||||||
{
|
{
|
||||||
hr = pShellView->QueryInterface(riid, ppvOut);
|
hr = pShellView->QueryInterface(riid, ppvOut);
|
||||||
pShellView->Release();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
|
TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
|
||||||
|
@ -401,14 +400,14 @@ HRESULT WINAPI CMyDocsFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, LPCITEMID
|
||||||
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
|
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
|
||||||
{
|
{
|
||||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
|
pObj = IExtractIconA_Constructor (pidl);
|
||||||
SHFree (pidl);
|
SHFree (pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
|
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
|
||||||
{
|
{
|
||||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
|
pObj = IExtractIconW_Constructor (pidl);
|
||||||
SHFree (pidl);
|
SHFree (pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,7 +140,7 @@ HRESULT WINAPI CNetFolder::CompareIDs(LPARAM lParam, LPCITEMIDLIST pidl1, LPCITE
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI CNetFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
|
HRESULT WINAPI CNetFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
|
||||||
{
|
{
|
||||||
LPSHELLVIEW pShellView;
|
CComPtr<IShellView> pShellView;
|
||||||
HRESULT hr = E_INVALIDARG;
|
HRESULT hr = E_INVALIDARG;
|
||||||
|
|
||||||
TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
|
TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
|
||||||
|
@ -167,7 +167,6 @@ HRESULT WINAPI CNetFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID
|
||||||
if (pShellView)
|
if (pShellView)
|
||||||
{
|
{
|
||||||
hr = pShellView->QueryInterface(riid, ppvOut);
|
hr = pShellView->QueryInterface(riid, ppvOut);
|
||||||
pShellView->Release();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TRACE("-- (%p)->(interface=%p)\n", this, ppvOut);
|
TRACE("-- (%p)->(interface=%p)\n", this, ppvOut);
|
||||||
|
@ -257,14 +256,14 @@ HRESULT WINAPI CNetFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, LPCITEMIDLIS
|
||||||
else if (IsEqualIID(riid, IID_IExtractIconA) && (cidl == 1))
|
else if (IsEqualIID(riid, IID_IExtractIconA) && (cidl == 1))
|
||||||
{
|
{
|
||||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
|
pObj = IExtractIconA_Constructor (pidl);
|
||||||
SHFree (pidl);
|
SHFree (pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualIID(riid, IID_IExtractIconW) && (cidl == 1))
|
else if (IsEqualIID(riid, IID_IExtractIconW) && (cidl == 1))
|
||||||
{
|
{
|
||||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||||
pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
|
pObj = IExtractIconW_Constructor (pidl);
|
||||||
SHFree (pidl);
|
SHFree (pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -448,7 +448,7 @@ HRESULT WINAPI CPrinterFolder::CompareIDs(LPARAM lParam, LPCITEMIDLIST pidl1, LP
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI CPrinterFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
|
HRESULT WINAPI CPrinterFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
|
||||||
{
|
{
|
||||||
LPSHELLVIEW pShellView;
|
CComPtr<IShellView> pShellView;
|
||||||
HRESULT hr = E_INVALIDARG;
|
HRESULT hr = E_INVALIDARG;
|
||||||
|
|
||||||
TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
|
TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
|
||||||
|
|
|
@ -560,7 +560,7 @@ HRESULT WINAPI CRecycleBin::CompareIDs(LPARAM lParam, LPCITEMIDLIST pidl1, LPCIT
|
||||||
|
|
||||||
HRESULT WINAPI CRecycleBin::CreateViewObject(HWND hwndOwner, REFIID riid, void **ppv)
|
HRESULT WINAPI CRecycleBin::CreateViewObject(HWND hwndOwner, REFIID riid, void **ppv)
|
||||||
{
|
{
|
||||||
LPSHELLVIEW pShellView;
|
CComPtr<IShellView> pShellView;
|
||||||
HRESULT hr = E_NOINTERFACE;
|
HRESULT hr = E_NOINTERFACE;
|
||||||
|
|
||||||
TRACE("(%p, %p, %s, %p)\n", this, hwndOwner, debugstr_guid(&riid), ppv);
|
TRACE("(%p, %p, %s, %p)\n", this, hwndOwner, debugstr_guid(&riid), ppv);
|
||||||
|
@ -584,7 +584,6 @@ HRESULT WINAPI CRecycleBin::CreateViewObject(HWND hwndOwner, REFIID riid, void *
|
||||||
if (pShellView)
|
if (pShellView)
|
||||||
{
|
{
|
||||||
hr = pShellView->QueryInterface(riid, ppv);
|
hr = pShellView->QueryInterface(riid, ppv);
|
||||||
pShellView->Release();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -855,7 +854,7 @@ HRESULT WINAPI CRecycleBin::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
LPSHELLBROWSER lpSB;
|
LPSHELLBROWSER lpSB;
|
||||||
LPSHELLVIEW lpSV = NULL;
|
IShellView * lpSV = NULL;
|
||||||
|
|
||||||
TRACE("%p %p verb %p\n", this, lpcmi, lpcmi->lpVerb);
|
TRACE("%p %p verb %p\n", this, lpcmi, lpcmi->lpVerb);
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ static LPWSTR _ILGetTextPointerW(LPCITEMIDLIST pidl);
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* True if the display name could be retrieved successfully, False otherwise
|
* True if the display name could be retrieved successfully, False otherwise
|
||||||
*/
|
*/
|
||||||
static BOOL ILGetDisplayNameExA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPSTR path, DWORD type)
|
static BOOL ILGetDisplayNameExA(IShellFolder * psf, LPCITEMIDLIST pidl, LPSTR path, DWORD type)
|
||||||
{
|
{
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
WCHAR wPath[MAX_PATH];
|
WCHAR wPath[MAX_PATH];
|
||||||
|
@ -68,10 +68,10 @@ static BOOL ILGetDisplayNameExA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPSTR pat
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
|
BOOL WINAPI ILGetDisplayNameExW(IShellFolder * psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
|
||||||
{
|
{
|
||||||
CComPtr<IShellFolder> psfParent;
|
CComPtr<IShellFolder> psfParent;
|
||||||
LPSHELLFOLDER lsf = psf;
|
IShellFolder * lsf = psf;
|
||||||
HRESULT ret = NO_ERROR;
|
HRESULT ret = NO_ERROR;
|
||||||
LPCITEMIDLIST pidllast;
|
LPCITEMIDLIST pidllast;
|
||||||
STRRET strret;
|
STRRET strret;
|
||||||
|
@ -141,7 +141,7 @@ BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR pa
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* ILGetDisplayNameEx [SHELL32.186]
|
* ILGetDisplayNameEx [SHELL32.186]
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI ILGetDisplayNameEx(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPVOID path, DWORD type)
|
BOOL WINAPI ILGetDisplayNameEx(IShellFolder * psf, LPCITEMIDLIST pidl, LPVOID path, DWORD type)
|
||||||
{
|
{
|
||||||
TRACE_(shell)("%p %p %p %d\n", psf, pidl, path, type);
|
TRACE_(shell)("%p %p %p %d\n", psf, pidl, path, type);
|
||||||
|
|
||||||
|
@ -681,7 +681,7 @@ LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI SHGetRealIDL(LPSHELLFOLDER lpsf, LPCITEMIDLIST pidlSimple, LPITEMIDLIST *pidlReal)
|
HRESULT WINAPI SHGetRealIDL(IShellFolder * lpsf, LPCITEMIDLIST pidlSimple, LPITEMIDLIST *pidlReal)
|
||||||
{
|
{
|
||||||
CComPtr<IDataObject> pDataObj;
|
CComPtr<IDataObject> pDataObj;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
@ -1063,7 +1063,7 @@ EXTERN_C LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW(LPCVOID lpszPath)
|
||||||
* the pidl can be a simple one. since we can't get the path out of the pidl
|
* the pidl can be a simple one. since we can't get the path out of the pidl
|
||||||
* we have to take all data from the pidl
|
* we have to take all data from the pidl
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI SHGetDataFromIDListA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl,
|
HRESULT WINAPI SHGetDataFromIDListA(IShellFolder * psf, LPCITEMIDLIST pidl,
|
||||||
int nFormat, LPVOID dest, int len)
|
int nFormat, LPVOID dest, int len)
|
||||||
{
|
{
|
||||||
LPSTR filename, shortname;
|
LPSTR filename, shortname;
|
||||||
|
@ -1121,7 +1121,7 @@ HRESULT WINAPI SHGetDataFromIDListA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl,
|
||||||
* SHGetDataFromIDListW [SHELL32.248]
|
* SHGetDataFromIDListW [SHELL32.248]
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl,
|
HRESULT WINAPI SHGetDataFromIDListW(IShellFolder * psf, LPCITEMIDLIST pidl,
|
||||||
int nFormat, LPVOID dest, int len)
|
int nFormat, LPVOID dest, int len)
|
||||||
{
|
{
|
||||||
LPSTR filename, shortname;
|
LPSTR filename, shortname;
|
||||||
|
|
|
@ -244,7 +244,7 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
|
||||||
IShellFolder *psfParent, LPCITEMIDLIST pidl, IShellItem **ppsi)
|
IShellFolder *psfParent, LPCITEMIDLIST pidl, IShellItem **ppsi)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
IShellItem *newShellItem;
|
CComPtr<IShellItem> newShellItem;
|
||||||
LPITEMIDLIST new_pidl;
|
LPITEMIDLIST new_pidl;
|
||||||
CComPtr<IPersistIDList> newPersistIDList;
|
CComPtr<IPersistIDList> newPersistIDList;
|
||||||
|
|
||||||
|
@ -308,6 +308,8 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
ILFree(new_pidl);
|
ILFree(new_pidl);
|
||||||
*ppsi = newShellItem;
|
|
||||||
|
*ppsi = newShellItem.Detach();
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2173,7 +2173,7 @@ HRESULT WINAPI CShellLink::DragEnter(IDataObject *pDataObject,
|
||||||
{
|
{
|
||||||
TRACE("(%p)->(DataObject=%p)\n", this, pDataObject);
|
TRACE("(%p)->(DataObject=%p)\n", this, pDataObject);
|
||||||
LPCITEMIDLIST pidlLast;
|
LPCITEMIDLIST pidlLast;
|
||||||
IShellFolder *psf;
|
CComPtr<IShellFolder> psf;
|
||||||
|
|
||||||
HRESULT hr = SHBindToParent(pPidl, IID_PPV_ARG(IShellFolder, &psf), &pidlLast);
|
HRESULT hr = SHBindToParent(pPidl, IID_PPV_ARG(IShellFolder, &psf), &pidlLast);
|
||||||
|
|
||||||
|
@ -2185,8 +2185,6 @@ HRESULT WINAPI CShellLink::DragEnter(IDataObject *pDataObject,
|
||||||
hr = mDropTarget->DragEnter(pDataObject, dwKeyState, pt, pdwEffect);
|
hr = mDropTarget->DragEnter(pDataObject, dwKeyState, pt, pdwEffect);
|
||||||
else
|
else
|
||||||
*pdwEffect = DROPEFFECT_NONE;
|
*pdwEffect = DROPEFFECT_NONE;
|
||||||
|
|
||||||
psf->Release();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*pdwEffect = DROPEFFECT_NONE;
|
*pdwEffect = DROPEFFECT_NONE;
|
||||||
|
|
|
@ -68,7 +68,7 @@ DWORD WINAPI __SHGUIDToStringW (REFGUID guid, LPWSTR str)
|
||||||
HRESULT WINAPI SHCoCreateInstance(
|
HRESULT WINAPI SHCoCreateInstance(
|
||||||
LPCWSTR aclsid,
|
LPCWSTR aclsid,
|
||||||
const CLSID *clsid,
|
const CLSID *clsid,
|
||||||
LPUNKNOWN pUnkOuter,
|
IUnknown * pUnkOuter,
|
||||||
REFIID refiid,
|
REFIID refiid,
|
||||||
LPVOID *ppv)
|
LPVOID *ppv)
|
||||||
{
|
{
|
||||||
|
@ -314,7 +314,7 @@ public:
|
||||||
HRESULT Initialize(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, const IID *riidInstx);
|
HRESULT Initialize(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, const IID *riidInstx);
|
||||||
|
|
||||||
// IClassFactory
|
// IClassFactory
|
||||||
virtual HRESULT WINAPI CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject);
|
virtual HRESULT WINAPI CreateInstance(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppvObject);
|
||||||
virtual HRESULT WINAPI LockServer(BOOL fLock);
|
virtual HRESULT WINAPI LockServer(BOOL fLock);
|
||||||
|
|
||||||
BEGIN_COM_MAP(IDefClFImpl)
|
BEGIN_COM_MAP(IDefClFImpl)
|
||||||
|
@ -346,7 +346,7 @@ HRESULT IDefClFImpl::Initialize(LPFNCREATEINSTANCE lpfnCIx, PLONG pcRefDllx, con
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* IDefClF_fnCreateInstance
|
* IDefClF_fnCreateInstance
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI IDefClFImpl::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
|
HRESULT WINAPI IDefClFImpl::CreateInstance(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppvObject)
|
||||||
{
|
{
|
||||||
TRACE("%p->(%p,%s,%p)\n", this, pUnkOuter, shdebugstr_guid(&riid), ppvObject);
|
TRACE("%p->(%p,%s,%p)\n", this, pUnkOuter, shdebugstr_guid(&riid), ppvObject);
|
||||||
|
|
||||||
|
|
|
@ -484,7 +484,7 @@ HRESULT WINAPI SHRevokeDragDrop(HWND hWnd)
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI SHDoDragDrop(
|
HRESULT WINAPI SHDoDragDrop(
|
||||||
HWND hWnd,
|
HWND hWnd,
|
||||||
LPDATAOBJECT lpDataObject,
|
IDataObject * lpDataObject,
|
||||||
LPDROPSOURCE lpDropSource,
|
LPDROPSOURCE lpDropSource,
|
||||||
DWORD dwOKEffect,
|
DWORD dwOKEffect,
|
||||||
LPDWORD pdwEffect)
|
LPDWORD pdwEffect)
|
||||||
|
@ -1015,7 +1015,7 @@ HRESULT WINAPI SHCreateShellFolderViewEx(
|
||||||
LPCSFV psvcbi, /* [in] shelltemplate struct */
|
LPCSFV psvcbi, /* [in] shelltemplate struct */
|
||||||
IShellView **ppv) /* [out] IShellView pointer */
|
IShellView **ppv) /* [out] IShellView pointer */
|
||||||
{
|
{
|
||||||
IShellView *psf;
|
CComPtr<IShellView> psf;
|
||||||
HRESULT hRes;
|
HRESULT hRes;
|
||||||
|
|
||||||
TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n",
|
TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n",
|
||||||
|
@ -1028,7 +1028,6 @@ HRESULT WINAPI SHCreateShellFolderViewEx(
|
||||||
return hRes;
|
return hRes;
|
||||||
|
|
||||||
hRes = psf->QueryInterface(IID_PPV_ARG(IShellView, ppv));
|
hRes = psf->QueryInterface(IID_PPV_ARG(IShellView, ppv));
|
||||||
psf->Release();
|
|
||||||
|
|
||||||
return hRes;
|
return hRes;
|
||||||
}
|
}
|
||||||
|
@ -1050,14 +1049,14 @@ EXTERN_C BOOL WINAPI SHRunControlPanel (LPCWSTR lpcszCmdLine, HWND hwndMsgParent
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LPUNKNOWN SHELL32_IExplorerInterface=0;
|
static IUnknown * SHELL32_IExplorerInterface=0;
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* SHSetInstanceExplorer [SHELL32.176]
|
* SHSetInstanceExplorer [SHELL32.176]
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Sets the interface
|
* Sets the interface
|
||||||
*/
|
*/
|
||||||
VOID WINAPI SHSetInstanceExplorer (LPUNKNOWN lpUnknown)
|
VOID WINAPI SHSetInstanceExplorer (IUnknown * lpUnknown)
|
||||||
{ TRACE("%p\n", lpUnknown);
|
{ TRACE("%p\n", lpUnknown);
|
||||||
SHELL32_IExplorerInterface = lpUnknown;
|
SHELL32_IExplorerInterface = lpUnknown;
|
||||||
}
|
}
|
||||||
|
@ -1897,7 +1896,7 @@ HRESULT WINAPI SHCreateStdEnumFmtEtc(
|
||||||
const FORMATETC *lpFormats,
|
const FORMATETC *lpFormats,
|
||||||
LPENUMFORMATETC *ppenumFormatetc)
|
LPENUMFORMATETC *ppenumFormatetc)
|
||||||
{
|
{
|
||||||
IEnumFORMATETC *pef;
|
CComPtr<IEnumFORMATETC> pef;
|
||||||
HRESULT hRes;
|
HRESULT hRes;
|
||||||
TRACE("cf=%d fe=%p pef=%p\n", cFormats, lpFormats, ppenumFormatetc);
|
TRACE("cf=%d fe=%p pef=%p\n", cFormats, lpFormats, ppenumFormatetc);
|
||||||
|
|
||||||
|
@ -1907,7 +1906,6 @@ HRESULT WINAPI SHCreateStdEnumFmtEtc(
|
||||||
|
|
||||||
pef->AddRef();
|
pef->AddRef();
|
||||||
hRes = pef->QueryInterface(IID_PPV_ARG(IEnumFORMATETC, ppenumFormatetc));
|
hRes = pef->QueryInterface(IID_PPV_ARG(IEnumFORMATETC, ppenumFormatetc));
|
||||||
pef->Release();
|
|
||||||
|
|
||||||
return hRes;
|
return hRes;
|
||||||
}
|
}
|
||||||
|
@ -1918,7 +1916,7 @@ HRESULT WINAPI SHCreateStdEnumFmtEtc(
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
|
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
|
||||||
{
|
{
|
||||||
IShellView *psf;
|
CComPtr<IShellView> psf;
|
||||||
HRESULT hRes;
|
HRESULT hRes;
|
||||||
|
|
||||||
*ppsv = NULL;
|
*ppsv = NULL;
|
||||||
|
@ -1933,7 +1931,6 @@ HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **pps
|
||||||
return hRes;
|
return hRes;
|
||||||
|
|
||||||
hRes = psf->QueryInterface(IID_PPV_ARG(IShellView, ppsv));
|
hRes = psf->QueryInterface(IID_PPV_ARG(IShellView, ppsv));
|
||||||
psf->Release();
|
|
||||||
|
|
||||||
return hRes;
|
return hRes;
|
||||||
}
|
}
|
||||||
|
|
|
@ -404,7 +404,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR*
|
||||||
static HRESULT SHELL_GetPathFromIDListForExecuteW(LPCITEMIDLIST pidl, LPWSTR pszPath, UINT uOutSize)
|
static HRESULT SHELL_GetPathFromIDListForExecuteW(LPCITEMIDLIST pidl, LPWSTR pszPath, UINT uOutSize)
|
||||||
{
|
{
|
||||||
STRRET strret;
|
STRRET strret;
|
||||||
IShellFolder *desktop;
|
CComPtr<IShellFolder> desktop;
|
||||||
|
|
||||||
HRESULT hr = SHGetDesktopFolder(&desktop);
|
HRESULT hr = SHGetDesktopFolder(&desktop);
|
||||||
|
|
||||||
|
@ -414,8 +414,6 @@ static HRESULT SHELL_GetPathFromIDListForExecuteW(LPCITEMIDLIST pidl, LPWSTR psz
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
StrRetToStrNW(pszPath, uOutSize, &strret, pidl);
|
StrRetToStrNW(pszPath, uOutSize, &strret, pidl);
|
||||||
|
|
||||||
desktop->Release();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
@ -1782,7 +1780,7 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc)
|
||||||
/* process the IDList */
|
/* process the IDList */
|
||||||
if (sei_tmp.fMask & SEE_MASK_IDLIST)
|
if (sei_tmp.fMask & SEE_MASK_IDLIST)
|
||||||
{
|
{
|
||||||
IShellExecuteHookW* pSEH;
|
CComPtr<IShellExecuteHookW> pSEH;
|
||||||
|
|
||||||
HRESULT hr = SHBindToParent((LPCITEMIDLIST)sei_tmp.lpIDList, IID_PPV_ARG(IShellExecuteHookW, &pSEH), NULL);
|
HRESULT hr = SHBindToParent((LPCITEMIDLIST)sei_tmp.lpIDList, IID_PPV_ARG(IShellExecuteHookW, &pSEH), NULL);
|
||||||
|
|
||||||
|
@ -1790,8 +1788,6 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc)
|
||||||
{
|
{
|
||||||
hr = pSEH->Execute(&sei_tmp);
|
hr = pSEH->Execute(&sei_tmp);
|
||||||
|
|
||||||
pSEH->Release();
|
|
||||||
|
|
||||||
if (hr == S_OK)
|
if (hr == S_OK)
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, wszApplicationName);
|
HeapFree(GetProcessHeap(), 0, wszApplicationName);
|
||||||
|
|
|
@ -212,11 +212,11 @@ static HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot,
|
||||||
if (SUCCEEDED (hr))
|
if (SUCCEEDED (hr))
|
||||||
{
|
{
|
||||||
LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
|
LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
|
||||||
IPersistFolder *pPF;
|
CComPtr<IPersistFolder> ppf;
|
||||||
IPersistFolder3 *ppf;
|
CComPtr<IPersistFolder3> ppf3;
|
||||||
|
|
||||||
if (_ILIsFolder(pidlChild) &&
|
if (_ILIsFolder(pidlChild) &&
|
||||||
SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf))))
|
SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf3))))
|
||||||
{
|
{
|
||||||
PERSIST_FOLDER_TARGET_INFO ppfti;
|
PERSIST_FOLDER_TARGET_INFO ppfti;
|
||||||
|
|
||||||
|
@ -241,13 +241,11 @@ static HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot,
|
||||||
hr = E_INVALIDARG;
|
hr = E_INVALIDARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
ppf->InitializeEx(NULL, pidlAbsolute, &ppfti);
|
ppf3->InitializeEx(NULL, pidlAbsolute, &ppfti);
|
||||||
ppf->Release();
|
|
||||||
}
|
}
|
||||||
else if (SUCCEEDED((hr = pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder, &pPF)))))
|
else if (SUCCEEDED((hr = pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder, &ppf)))))
|
||||||
{
|
{
|
||||||
pPF->Initialize(pidlAbsolute);
|
ppf->Initialize(pidlAbsolute);
|
||||||
pPF->Release();
|
|
||||||
}
|
}
|
||||||
ILFree (pidlAbsolute);
|
ILFree (pidlAbsolute);
|
||||||
}
|
}
|
||||||
|
@ -280,7 +278,7 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
|
||||||
LPCWSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut)
|
LPCWSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut)
|
||||||
{
|
{
|
||||||
GUID const *clsid;
|
GUID const *clsid;
|
||||||
IShellFolder *pSF;
|
CComPtr<IShellFolder> pSF;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
LPITEMIDLIST pidlChild;
|
LPITEMIDLIST pidlChild;
|
||||||
|
|
||||||
|
@ -325,7 +323,6 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
|
||||||
/* go deeper */
|
/* go deeper */
|
||||||
hr = pSF->BindToObject(ILGetNext (pidlComplete), NULL, riid, ppvOut);
|
hr = pSF->BindToObject(ILGetNext (pidlComplete), NULL, riid, ppvOut);
|
||||||
}
|
}
|
||||||
pSF->Release();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE ("-- returning (%p) %08x\n", *ppvOut, hr);
|
TRACE ("-- returning (%p) %08x\n", *ppvOut, hr);
|
||||||
|
@ -359,7 +356,7 @@ HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf,
|
||||||
pidlFirst = ILCloneFirst(pidl);
|
pidlFirst = ILCloneFirst(pidl);
|
||||||
if (pidlFirst)
|
if (pidlFirst)
|
||||||
{
|
{
|
||||||
IShellFolder *psfChild;
|
CComPtr<IShellFolder> psfChild;
|
||||||
|
|
||||||
hr = psf->BindToObject(pidlFirst, NULL, IID_PPV_ARG(IShellFolder, &psfChild));
|
hr = psf->BindToObject(pidlFirst, NULL, IID_PPV_ARG(IShellFolder, &psfChild));
|
||||||
if (SUCCEEDED (hr))
|
if (SUCCEEDED (hr))
|
||||||
|
@ -373,7 +370,6 @@ HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf,
|
||||||
if(!StrRetToStrNW (szOut, dwOutLen, &strTemp, pidlNext))
|
if(!StrRetToStrNW (szOut, dwOutLen, &strTemp, pidlNext))
|
||||||
hr = E_FAIL;
|
hr = E_FAIL;
|
||||||
}
|
}
|
||||||
psfChild->Release();
|
|
||||||
}
|
}
|
||||||
ILFree (pidlFirst);
|
ILFree (pidlFirst);
|
||||||
} else
|
} else
|
||||||
|
@ -491,7 +487,7 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO
|
||||||
|
|
||||||
if (SFGAO_HASSUBFOLDER & *pdwAttributes)
|
if (SFGAO_HASSUBFOLDER & *pdwAttributes)
|
||||||
{
|
{
|
||||||
IShellFolder *psf2;
|
CComPtr<IShellFolder> psf2;
|
||||||
if (SUCCEEDED(psf->BindToObject(pidl, 0, IID_PPV_ARG(IShellFolder, &psf2))))
|
if (SUCCEEDED(psf->BindToObject(pidl, 0, IID_PPV_ARG(IShellFolder, &psf2))))
|
||||||
{
|
{
|
||||||
IEnumIDList *pEnumIL = NULL;
|
IEnumIDList *pEnumIL = NULL;
|
||||||
|
@ -501,7 +497,6 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO
|
||||||
*pdwAttributes &= ~SFGAO_HASSUBFOLDER;
|
*pdwAttributes &= ~SFGAO_HASSUBFOLDER;
|
||||||
pEnumIL->Release();
|
pEnumIL->Release();
|
||||||
}
|
}
|
||||||
psf2->Release();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
@ -521,10 +516,10 @@ HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST p
|
||||||
char szTemp1[MAX_PATH];
|
char szTemp1[MAX_PATH];
|
||||||
char szTemp2[MAX_PATH];
|
char szTemp2[MAX_PATH];
|
||||||
HRESULT nReturn;
|
HRESULT nReturn;
|
||||||
LPITEMIDLIST firstpidl,
|
LPITEMIDLIST firstpidl;
|
||||||
nextpidl1,
|
LPITEMIDLIST nextpidl1;
|
||||||
nextpidl2;
|
LPITEMIDLIST nextpidl2;
|
||||||
IShellFolder *psf;
|
CComPtr<IShellFolder> psf;
|
||||||
|
|
||||||
/* test for empty pidls */
|
/* test for empty pidls */
|
||||||
BOOL isEmpty1 = _ILIsDesktop(pidl1);
|
BOOL isEmpty1 = _ILIsDesktop(pidl1);
|
||||||
|
@ -564,16 +559,21 @@ HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST p
|
||||||
isEmpty1 = _ILIsDesktop(nextpidl1);
|
isEmpty1 = _ILIsDesktop(nextpidl1);
|
||||||
isEmpty2 = _ILIsDesktop(nextpidl2);
|
isEmpty2 = _ILIsDesktop(nextpidl2);
|
||||||
|
|
||||||
if (isEmpty1 && isEmpty2) {
|
if (isEmpty1 && isEmpty2)
|
||||||
|
{
|
||||||
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 0);
|
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 0);
|
||||||
} else if (isEmpty1) {
|
}
|
||||||
|
else if (isEmpty1)
|
||||||
|
{
|
||||||
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, (WORD) -1);
|
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, (WORD) -1);
|
||||||
} else if (isEmpty2) {
|
}
|
||||||
|
else if (isEmpty2)
|
||||||
|
{
|
||||||
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 1);
|
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 1);
|
||||||
/* optimizing end */
|
/* optimizing end */
|
||||||
} else if (SUCCEEDED (iface->BindToObject(firstpidl, NULL, IID_PPV_ARG(IShellFolder, &psf)))) {
|
}
|
||||||
|
else if (SUCCEEDED(iface->BindToObject(firstpidl, NULL, IID_PPV_ARG(IShellFolder, &psf)))) {
|
||||||
nReturn = psf->CompareIDs(lParam, nextpidl1, nextpidl2);
|
nReturn = psf->CompareIDs(lParam, nextpidl1, nextpidl2);
|
||||||
psf->Release();
|
|
||||||
}
|
}
|
||||||
ILFree(firstpidl);
|
ILFree(firstpidl);
|
||||||
return nReturn;
|
return nReturn;
|
||||||
|
@ -584,7 +584,7 @@ HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST p
|
||||||
*
|
*
|
||||||
* Undocumented.
|
* Undocumented.
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI SHCreateLinks( HWND hWnd, LPCSTR lpszDir, LPDATAOBJECT lpDataObject,
|
HRESULT WINAPI SHCreateLinks( HWND hWnd, LPCSTR lpszDir, IDataObject * lpDataObject,
|
||||||
UINT uFlags, LPITEMIDLIST *lppidlLinks)
|
UINT uFlags, LPITEMIDLIST *lppidlLinks)
|
||||||
{
|
{
|
||||||
FIXME("%p %s %p %08x %p\n", hWnd, lpszDir, lpDataObject, uFlags, lppidlLinks);
|
FIXME("%p %s %p %08x %p\n", hWnd, lpszDir, lpDataObject, uFlags, lppidlLinks);
|
||||||
|
|
|
@ -1755,7 +1755,7 @@ LRESULT CDefView::OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandl
|
||||||
|
|
||||||
if (GetSelections())
|
if (GetSelections())
|
||||||
{
|
{
|
||||||
IDataObject * pda;
|
CComPtr<IDataObject> pda;
|
||||||
DWORD dwAttributes = SFGAO_CANLINK;
|
DWORD dwAttributes = SFGAO_CANLINK;
|
||||||
DWORD dwEffect = DROPEFFECT_COPY | DROPEFFECT_MOVE;
|
DWORD dwEffect = DROPEFFECT_COPY | DROPEFFECT_MOVE;
|
||||||
|
|
||||||
|
@ -1775,14 +1775,12 @@ LRESULT CDefView::OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandl
|
||||||
if (SUCCEEDED(pda->QueryInterface(IID_PPV_ARG(IAsyncOperation, &piaso))))
|
if (SUCCEEDED(pda->QueryInterface(IID_PPV_ARG(IAsyncOperation, &piaso))))
|
||||||
{
|
{
|
||||||
piaso->SetAsyncMode(TRUE);
|
piaso->SetAsyncMode(TRUE);
|
||||||
piaso->Release();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pds)
|
if (pds)
|
||||||
{ DWORD dwEffect2;
|
{ DWORD dwEffect2;
|
||||||
DoDragDrop(pda, pds, dwEffect, &dwEffect2);
|
DoDragDrop(pda, pds, dwEffect, &dwEffect2);
|
||||||
}
|
}
|
||||||
pda->Release();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue