Author: dquintana
Date: Wed Aug 20 00:39:40 2014
New Revision: 63908
URL:
http://svn.reactos.org/svn/reactos?rev=63908&view=rev
Log:
[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.
Modified:
branches/shell-experiments/dll/win32/shell32/CMenuDeskBar.cpp
branches/shell-experiments/dll/win32/shell32/brsfolder.cpp
branches/shell-experiments/dll/win32/shell32/defcontextmenu.cpp
branches/shell-experiments/dll/win32/shell32/desktop.cpp
branches/shell-experiments/dll/win32/shell32/folders.cpp
branches/shell-experiments/dll/win32/shell32/folders/admintools.cpp
branches/shell-experiments/dll/win32/shell32/folders/cpanel.cpp
branches/shell-experiments/dll/win32/shell32/folders/desktop.cpp
branches/shell-experiments/dll/win32/shell32/folders/fonts.cpp
branches/shell-experiments/dll/win32/shell32/folders/fs.cpp
branches/shell-experiments/dll/win32/shell32/folders/mycomp.cpp
branches/shell-experiments/dll/win32/shell32/folders/mydocuments.cpp
branches/shell-experiments/dll/win32/shell32/folders/netplaces.cpp
branches/shell-experiments/dll/win32/shell32/folders/printers.cpp
branches/shell-experiments/dll/win32/shell32/folders/recyclebin.cpp
branches/shell-experiments/dll/win32/shell32/pidl.cpp
branches/shell-experiments/dll/win32/shell32/shellitem.cpp
branches/shell-experiments/dll/win32/shell32/shelllink.cpp
branches/shell-experiments/dll/win32/shell32/shellole.cpp
branches/shell-experiments/dll/win32/shell32/shellord.cpp
branches/shell-experiments/dll/win32/shell32/shlexec.cpp
branches/shell-experiments/dll/win32/shell32/shlfolder.cpp
branches/shell-experiments/dll/win32/shell32/shlview.cpp
Modified: branches/shell-experiments/dll/win32/shell32/CMenuDeskBar.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/CMenuDeskBar.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/CMenuDeskBar.cpp [iso-8859-1] Wed Aug 20
00:39:40 2014
@@ -116,7 +116,7 @@
return S_OK;
}
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnFocusChangeIS(THIS_ LPUNKNOWN lpUnknown, BOOL
bFocus)
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnFocusChangeIS(THIS_ IUnknown * lpUnknown, BOOL
bFocus)
{
return S_OK;
}
Modified: branches/shell-experiments/dll/win32/shell32/brsfolder.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/brsfolder.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/brsfolder.cpp [iso-8859-1] Wed Aug 20
00:39:40 2014
@@ -46,7 +46,7 @@
typedef struct tagTV_ITEMDATA
{
- LPSHELLFOLDER lpsfParent; /* IShellFolder of the parent */
+ IShellFolder* lpsfParent; /* IShellFolder of the parent */
LPITEMIDLIST lpi; /* PIDL relative to parent */
LPITEMIDLIST lpifq; /* Fully qualified PIDL */
IEnumIDList* pEnumIL; /* Children iterator */
@@ -81,9 +81,9 @@
BIF_NEWDIALOGSTYLE | \
BIF_BROWSEINCLUDEFILES)
-static void FillTreeView(browse_info*, LPSHELLFOLDER,
+static void FillTreeView(browse_info*, IShellFolder*,
LPITEMIDLIST, HTREEITEM, IEnumIDList*);
-static HTREEITEM InsertTreeViewItem( browse_info*, IShellFolder *,
+static HTREEITEM InsertTreeViewItem( browse_info*, IShellFolder*,
LPCITEMIDLIST, LPCITEMIDLIST, IEnumIDList*, HTREEITEM);
static const WCHAR szBrowseFolderInfo[] = L"__WINE_BRSFOLDERDLG_INFO";
@@ -206,10 +206,11 @@
ILRemoveLastID(pidlParent);
pidlChild = ILClone(ILFindLastID(root));
- if (_ILIsDesktop(pidlParent)) {
+ if (_ILIsDesktop(pidlParent))
+ {
hr = SHGetDesktopFolder(&lpsfParent);
} else {
- IShellFolder *lpsfDesktop;
+ CComPtr<IShellFolder> lpsfDesktop;
hr = SHGetDesktopFolder(&lpsfDesktop);
if (FAILED(hr)) {
WARN("SHGetDesktopFolder failed! hr = %08x\n", hr);
@@ -218,7 +219,6 @@
return;
}
hr = lpsfDesktop->BindToObject(pidlParent, 0, IID_PPV_ARG(IShellFolder,
&lpsfParent));
- lpsfDesktop->Release();
}
if (FAILED(hr)) {
@@ -310,7 +310,7 @@
* Success: TRUE
* 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;
STRRET str;
@@ -714,8 +714,9 @@
static HRESULT BrsFolder_NewFolder(browse_info *info)
{
DWORD flags = BrowseFlagsToSHCONTF(info->lpBrowseInfo->ulFlags);
- IShellFolder *desktop, *cur;
- ISFHelper *sfhelper;
+ CComPtr<IShellFolder> desktop;
+ CComPtr<IShellFolder> cur;
+ CComPtr<ISFHelper> sfhelper;
WCHAR name[MAX_PATH];
HTREEITEM parent, added;
LPTV_ITEMDATA item_data;
@@ -734,7 +735,6 @@
if(FAILED(hr))
return hr;
hr = desktop->BindToObject(info->pidlRet, 0, IID_PPV_ARG(IShellFolder,
&cur));
- desktop->Release();
if(FAILED(hr))
return hr;
@@ -750,7 +750,6 @@
if(len<MAX_PATH)
name[len++] = '\\';
hr = sfhelper->GetUniqueName(&name[len], MAX_PATH-len);
- sfhelper->Release();
if(FAILED(hr))
goto cleanup;
@@ -792,7 +791,6 @@
goto cleanup;
added = InsertTreeViewItem(info, cur, new_item, item_data->lpifq, NULL, parent);
- cur->Release();
SHFree(new_item);
SendMessageW(info->hwndTreeView, TVM_SORTCHILDREN, FALSE, (LPARAM)parent);
@@ -842,7 +840,7 @@
/* If 'selection' is a string, convert to a Shell ID List. */
if (is_str) {
- IShellFolder *psfDesktop;
+ CComPtr<IShellFolder> psfDesktop;
HRESULT hr;
hr = SHGetDesktopFolder(&psfDesktop);
@@ -851,7 +849,6 @@
hr = psfDesktop->ParseDisplayName(NULL, NULL, (LPOLESTR)selection,
NULL, &pidlSelection, NULL);
- psfDesktop->Release();
if (FAILED(hr))
goto done;
}
Modified: branches/shell-experiments/dll/win32/shell32/defcontextmenu.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/defcontextmenu.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/shell32/defcontextmenu.cpp [iso-8859-1] Wed Aug
20 00:39:40 2014
@@ -37,10 +37,10 @@
public IContextMenu2
{
private:
- IShellFolder *m_psf;
+ CComPtr<IShellFolder> m_psf;
UINT m_cidl;
PCUITEMID_CHILD_ARRAY m_apidl;
- IDataObject *m_pDataObj;
+ CComPtr<IDataObject> m_pDataObj;
PIDLIST_ABSOLUTE m_pidlFolder;
DWORD m_bGroupPolicyActive;
PDynamicShellEntry m_pDynamicEntries; /* first dynamic shell extension entry */
@@ -135,16 +135,12 @@
if (m_pidlFolder)
CoTaskMemFree(m_pidlFolder);
- if (m_pDataObj)
- m_pDataObj->Release();
_ILFreeaPidl(const_cast<PITEMID_CHILD *>(m_apidl), m_cidl);
- if (m_psf)
- m_psf->Release();
}
HRESULT WINAPI CDefaultContextMenu::Initialize(const DEFCONTEXTMENU *pdcm)
{
- IDataObject *pDataObj;
+ CComPtr<IDataObject> pDataObj;
TRACE("cidl %u\n", pdcm->cidl);
@@ -153,7 +149,6 @@
if (m_cidl && !m_apidl)
return E_OUTOFMEMORY;
m_psf = pdcm->psf;
- m_psf->AddRef();
if (SUCCEEDED(SHCreateDataObject(pdcm->pidlFolder, pdcm->cidl, pdcm->apidl,
NULL, IID_PPV_ARG(IDataObject, &pDataObj))))
m_pDataObj = pDataObj;
@@ -164,12 +159,11 @@
}
else
{
- IPersistFolder2 *pf = NULL;
+ CComPtr<IPersistFolder2> pf = NULL;
if (SUCCEEDED(m_psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &pf))))
{
if
(FAILED(pf->GetCurFolder(reinterpret_cast<LPITEMIDLIST*>(&m_pidlFolder))))
ERR("GetCurFolder failed\n");
- pf->Release();
}
TRACE("pidlFolder %p\n", m_pidlFolder);
}
@@ -307,7 +301,7 @@
HasClipboardData()
{
BOOL bRet = FALSE;
- IDataObject *pDataObj;
+ CComPtr<IDataObject> pDataObj;
if(SUCCEEDED(OleGetClipboard(&pDataObj)))
{
@@ -323,8 +317,6 @@
bRet = TRUE;
ReleaseStgMedium(&medium);
}
-
- pDataObj->Release();
}
return bRet;
@@ -369,7 +361,7 @@
if (IsShellExtensionAlreadyLoaded(pclsid))
return S_OK;
- IContextMenu *pcm;
+ CComPtr<IContextMenu> pcm;
hr = SHCoCreateInstance(NULL, pclsid, NULL, IID_PPV_ARG(IContextMenu, &pcm));
if (hr != S_OK)
{
@@ -377,28 +369,24 @@
return hr;
}
- IShellExtInit *pExtInit;
+ CComPtr<IShellExtInit> pExtInit;
hr = pcm->QueryInterface(IID_PPV_ARG(IShellExtInit, &pExtInit));
if (hr != S_OK)
{
ERR("Failed to query for interface IID_IShellExtInit hr %x pclsid
%s\n", hr, wine_dbgstr_guid(pclsid));
- pcm->Release();
return hr;
}
hr = pExtInit->Initialize(m_pidlFolder, m_pDataObj, hKey);
- pExtInit->Release();
if (hr != S_OK)
{
TRACE("Failed to initialize shell extension error %x pclsid %s\n", hr,
wine_dbgstr_guid(pclsid));
- pcm->Release();
return hr;
}
PDynamicShellEntry pEntry = (DynamicShellEntry *)HeapAlloc(GetProcessHeap(), 0,
sizeof(DynamicShellEntry));
if (!pEntry)
{
- pcm->Release();
return E_OUTOFMEMORY;
}
@@ -945,7 +933,7 @@
if (!lpSB)
return E_FAIL;
- LPSHELLVIEW lpSV = NULL;
+ IShellView * lpSV = NULL;
if (FAILED(lpSB->QueryActiveShellView(&lpSV)))
return E_FAIL;
@@ -1060,7 +1048,7 @@
dwKey = MK_CONTROL|MK_SHIFT;
}
- IDropTarget *pdrop;
+ CComPtr<IDropTarget> pdrop;
hr = psfTarget->QueryInterface(IID_PPV_ARG(IDropTarget, &pdrop));
if (FAILED(hr))
{
@@ -1086,8 +1074,8 @@
CDefaultContextMenu::DoCreateLink(
LPCMINVOKECOMMANDINFO lpcmi)
{
- LPDATAOBJECT pDataObj;
- IDropTarget *pDT;
+ CComPtr<IDataObject> pDataObj;
+ CComPtr<IDropTarget> pDT;
HRESULT hr;
CComPtr<IPersistFolder2> ppf2 = NULL;
LPITEMIDLIST pidl;
@@ -1143,13 +1131,11 @@
HRESULT CDefaultContextMenu::DoDelete(LPCMINVOKECOMMANDINFO lpcmi) {
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))))
{
- pDataObj->AddRef();
SHCreateThread(DoDeleteThreadProc, pDataObj, NULL, NULL);
- pDataObj->Release();
}
else
return E_FAIL;
@@ -1162,7 +1148,7 @@
LPCMINVOKECOMMANDINFO lpcmi,
BOOL bCopy)
{
- LPDATAOBJECT pDataObj;
+ CComPtr<IDataObject> pDataObj;
HRESULT hr;
if (SUCCEEDED(SHCreateDataObject(m_pidlFolder, m_cidl, m_apidl, NULL,
IID_PPV_ARG(IDataObject, &pDataObj))))
@@ -1181,7 +1167,6 @@
}
hr = OleSetClipboard(pDataObj);
- pDataObj->Release();
return hr;
}
@@ -1193,7 +1178,7 @@
return E_FAIL;
}
- LPSHELLVIEW lpSV;
+ CComPtr<IShellView> lpSV;
hr = lpSB->QueryActiveShellView(&lpSV);
if (FAILED(hr))
{
@@ -1211,7 +1196,6 @@
} else
ERR("failed to get item object\n");
- lpSV->Release();
return hr;
}
@@ -1236,7 +1220,7 @@
(void)TreeView_EditLabel(hwnd, hItem);
}
- LPSHELLVIEW lpSV;
+ CComPtr<IShellView> lpSV;
HRESULT hr = lpSB->QueryActiveShellView(&lpSV);
if (FAILED(hr))
{
@@ -1244,9 +1228,8 @@
return hr;
}
- lpSV->SelectItem(m_apidl[0],
- SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE | SVSI_FOCUSED
| SVSI_SELECT);
- lpSV->Release();
+ SVSIF selFlags = SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE | SVSI_FOCUSED
| SVSI_SELECT;
+ lpSV->SelectItem(m_apidl[0], selFlags);
return S_OK;
}
@@ -1259,13 +1242,12 @@
if (!pidlParent)
{
- IPersistFolder2 *pf;
+ CComPtr<IPersistFolder2> pf;
/* pidlFolder is optional */
if (SUCCEEDED(m_psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &pf))))
{
pf->GetCurFolder((_ITEMIDLIST**)&pidlParent);
- pf->Release();
}
}
Modified: branches/shell-experiments/dll/win32/shell32/desktop.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/desktop.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/desktop.cpp [iso-8859-1] Wed Aug 20
00:39:40 2014
@@ -45,7 +45,7 @@
HWND hWndDesktopListView;
CComPtr<IShellDesktopTray> ShellDesk;
CComPtr<IShellView> DesktopView;
- IShellBrowser *DefaultShellBrowser;
+ CComPtr<IShellBrowser> DefaultShellBrowser;
LPITEMIDLIST pidlDesktopDirectory;
LPITEMIDLIST pidlDesktop;
public:
@@ -159,7 +159,7 @@
static CDesktopBrowser *SHDESK_Create(HWND hWnd, LPCREATESTRUCT lpCreateStruct)
{
- IShellDesktopTray *ShellDesk;
+ CComPtr<IShellDesktopTray> ShellDesk;
CComObject<CDesktopBrowser> *pThis;
HRESULT hRet;
Modified: branches/shell-experiments/dll/win32/shell32/folders.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/folders.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/folders.cpp [iso-8859-1] Wed Aug 20
00:39:40 2014
@@ -96,7 +96,6 @@
WCHAR szName[MAX_PATH];
WCHAR szValue[100];
CLSID clsid;
- IShellIconOverlayIdentifier * Overlay;
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ShellIconOverlayIdentifiers",
0, KEY_READ, &hKey) != ERROR_SUCCESS)
return;
@@ -131,12 +130,13 @@
dwSize = sizeof(szValue) / sizeof(WCHAR);
if (RegGetValueW(hKey, szName, NULL, RRF_RT_REG_SZ, NULL, szValue,
&dwSize) == ERROR_SUCCESS)
{
+ CComPtr<IShellIconOverlayIdentifier> Overlay;
CLSIDFromString(szValue, &clsid);
dwResult = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IShellIconOverlayIdentifier, &Overlay));
if (dwResult == S_OK)
{
- Handlers[NumIconOverlayHandlers] = Overlay;
+ Handlers[NumIconOverlayHandlers] = Overlay.Detach();
NumIconOverlayHandlers++;
}
}
@@ -200,7 +200,7 @@
IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl)
{
CComPtr<IDefaultExtractIconInit> initIcon;
- IExtractIconW *extractIcon;
+ CComPtr<IExtractIconW> extractIcon;
GUID const * riid;
int icon_idx;
UINT flags;
@@ -418,7 +418,7 @@
initIcon->SetNormalIcon(wTemp, icon_idx);
}
- return extractIcon;
+ return extractIcon.Detach();
}
/**************************************************************************
@@ -426,8 +426,8 @@
*/
IExtractIconA* IExtractIconA_Constructor(LPCITEMIDLIST pidl)
{
- IExtractIconW *extractIconW;
- IExtractIconA *extractIconA;
+ CComPtr<IExtractIconW> extractIconW;
+ CComPtr<IExtractIconA> extractIconA;
HRESULT hr;
extractIconW = IExtractIconW_Constructor(pidl);
@@ -435,8 +435,7 @@
return NULL;
hr = extractIconW->QueryInterface(IID_PPV_ARG(IExtractIconA, &extractIconA));
- extractIconW->Release();
if (FAILED(hr))
return NULL;
- return extractIconA;
+ return extractIconA.Detach();
}
Modified: branches/shell-experiments/dll/win32/shell32/folders/admintools.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/folders/admintools.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/shell32/folders/admintools.cpp [iso-8859-1] Wed
Aug 20 00:39:40 2014
@@ -316,14 +316,14 @@
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
{
pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
+ pObj = IExtractIconA_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
{
pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
+ pObj = IExtractIconW_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
Modified: branches/shell-experiments/dll/win32/shell32/folders/cpanel.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/folders/cpanel.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/shell32/folders/cpanel.cpp [iso-8859-1] Wed Aug
20 00:39:40 2014
@@ -547,12 +547,12 @@
hr = IDataObject_Constructor(hwndOwner, pidlRoot, apidl, cidl, (IDataObject
**)&pObj);
} else if (IsEqualIID(riid, IID_IExtractIconA) && (cidl == 1)) {
pidl = ILCombine(pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconA_Constructor(pidl);
+ pObj = IExtractIconA_Constructor(pidl);
SHFree(pidl);
hr = S_OK;
} else if (IsEqualIID(riid, IID_IExtractIconW) && (cidl == 1)) {
pidl = ILCombine(pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconW_Constructor(pidl);
+ pObj = IExtractIconW_Constructor(pidl);
SHFree(pidl);
hr = S_OK;
} else if ((IsEqualIID(riid, IID_IShellLinkW) || IsEqualIID(riid,
IID_IShellLinkA))
Modified: branches/shell-experiments/dll/win32/shell32/folders/desktop.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/folders/desktop.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/shell32/folders/desktop.cpp [iso-8859-1] Wed Aug
20 00:39:40 2014
@@ -637,14 +637,14 @@
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
{
pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
+ pObj = IExtractIconA_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
{
pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
+ pObj = IExtractIconW_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
@@ -1476,7 +1476,7 @@
if (SUCCEEDED(hr))
{
- IDropTarget *pDT;
+ CComPtr<IDropTarget> pDT;
hr = this->BindToObject(pidl, NULL, IID_PPV_ARG(IDropTarget, &pDT));
CoTaskMemFree(pidl);
if (SUCCEEDED(hr))
@@ -1517,13 +1517,12 @@
if (SUCCEEDED(hr))
{
- IShellFolder *psf;
+ CComPtr<IShellFolder> psf;
hr = this->BindToObject(pidlNext, NULL, IID_PPV_ARG(IShellFolder,
&psf));
CoTaskMemFree(pidlNext);
if (SUCCEEDED(hr))
{
hr = psf->GetUIObjectOf(NULL, 1, &pidl, IID_IDropTarget, NULL,
ppvOut);
- psf->Release();
if (FAILED(hr))
ERR("FS GetUIObjectOf failed: %x\n", hr);
}
Modified: branches/shell-experiments/dll/win32/shell32/folders/fonts.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/folders/fonts.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/shell32/folders/fonts.cpp [iso-8859-1] Wed Aug 20
00:39:40 2014
@@ -409,14 +409,14 @@
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
{
pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
+ pObj = IExtractIconA_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
{
pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
+ pObj = IExtractIconW_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
Modified: branches/shell-experiments/dll/win32/shell32/folders/fs.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/folders/fs.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/folders/fs.cpp [iso-8859-1] Wed Aug 20
00:39:40 2014
@@ -350,7 +350,7 @@
HRESULT WINAPI CFSFolder::CreateViewObject(HWND hwndOwner,
REFIID riid, LPVOID * ppvOut)
{
- LPSHELLVIEW pShellView;
+ CComPtr<IShellView> pShellView;
HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(hwnd=%p,%s,%p)\n", this, hwndOwner, shdebugstr_guid
(&riid),
@@ -373,7 +373,6 @@
if (pShellView)
{
hr = pShellView->QueryInterface(riid, ppvOut);
- pShellView->Release();
}
}
}
@@ -494,14 +493,14 @@
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
{
pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
+ pObj = IExtractIconA_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
{
pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
+ pObj = IExtractIconW_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
@@ -862,7 +861,7 @@
HRESULT WINAPI CFSFolder::GetUniqueName(LPWSTR pwszName, UINT uLen)
{
- IEnumIDList *penum;
+ CComPtr<IEnumIDList> penum;
HRESULT hr;
WCHAR wszText[MAX_PATH];
WCHAR wszNewFolder[25];
@@ -900,8 +899,6 @@
goto next;
}
}
-
- penum->Release();
}
return hr;
}
@@ -1749,8 +1746,8 @@
DWORD WINAPI CFSFolder::_DoDropThreadProc(LPVOID lpParameter) {
CoInitialize(NULL);
_DoDropData *data = static_cast<_DoDropData*>(lpParameter);
- IDataObject *pDataObject;
- HRESULT hr = CoGetInterfaceAndReleaseStream (data->pStream, IID_IDataObject,
(void**) &pDataObject);
+ CComPtr<IDataObject> pDataObject;
+ HRESULT hr = CoGetInterfaceAndReleaseStream (data->pStream,
IID_PPV_ARG(IDataObject, &pDataObject));
if (SUCCEEDED(hr))
{
@@ -1760,7 +1757,6 @@
{
pAsyncOperation->EndOperation(hr, NULL, data->pdwEffect);
}
- pDataObject->Release();
}
//Release the CFSFolder and data object holds in the copying thread.
data->This->Release();
@@ -1861,7 +1857,7 @@
TRACE("CFSFolder::_LoadDynamicDropTargetHandler entered\n");
HRESULT hr;
- IPersistFile *pp;
+ CComPtr<IPersistFile> pp;
hr = SHCoCreateInstance(NULL, pclsid, NULL, IID_PPV_ARG(IPersistFile, &pp));
if (hr != S_OK)
{
@@ -1875,6 +1871,5 @@
ERR("Failed to query for interface IID_IShellExtInit hr %x pclsid
%s\n", hr, wine_dbgstr_guid(pclsid));
return hr;
}
- pp->Release();
return hr;
}
Modified: branches/shell-experiments/dll/win32/shell32/folders/mycomp.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/folders/mycomp.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/shell32/folders/mycomp.cpp [iso-8859-1] Wed Aug
20 00:39:40 2014
@@ -326,7 +326,7 @@
*/
HRESULT WINAPI CDrivesFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *
ppvOut)
{
- LPSHELLVIEW pShellView;
+ CComPtr<IShellView> pShellView;
HRESULT hr = E_INVALIDARG;
TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
@@ -353,7 +353,6 @@
if (pShellView)
{
hr = pShellView->QueryInterface(riid, ppvOut);
- pShellView->Release();
}
}
TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
@@ -449,14 +448,14 @@
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
{
pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
+ pObj = IExtractIconA_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
{
pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
+ pObj = IExtractIconW_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
Modified: branches/shell-experiments/dll/win32/shell32/folders/mydocuments.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/folders/mydocuments.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/shell32/folders/mydocuments.cpp [iso-8859-1] Wed
Aug 20 00:39:40 2014
@@ -283,7 +283,7 @@
*/
HRESULT WINAPI CMyDocsFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID
*ppvOut)
{
- LPSHELLVIEW pShellView;
+ CComPtr<IShellView> pShellView;
HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(hwnd=%p,%s,%p)\n",
@@ -309,7 +309,6 @@
if (pShellView)
{
hr = pShellView->QueryInterface(riid, ppvOut);
- pShellView->Release();
}
}
TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
@@ -401,14 +400,14 @@
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
{
pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
+ pObj = IExtractIconA_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
{
pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
+ pObj = IExtractIconW_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
Modified: branches/shell-experiments/dll/win32/shell32/folders/netplaces.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/folders/netplaces.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/shell32/folders/netplaces.cpp [iso-8859-1] Wed
Aug 20 00:39:40 2014
@@ -140,7 +140,7 @@
*/
HRESULT WINAPI CNetFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
{
- LPSHELLVIEW pShellView;
+ CComPtr<IShellView> pShellView;
HRESULT hr = E_INVALIDARG;
TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
@@ -167,7 +167,6 @@
if (pShellView)
{
hr = pShellView->QueryInterface(riid, ppvOut);
- pShellView->Release();
}
}
TRACE("-- (%p)->(interface=%p)\n", this, ppvOut);
@@ -257,14 +256,14 @@
else if (IsEqualIID(riid, IID_IExtractIconA) && (cidl == 1))
{
pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
+ pObj = IExtractIconA_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
else if (IsEqualIID(riid, IID_IExtractIconW) && (cidl == 1))
{
pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
+ pObj = IExtractIconW_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
Modified: branches/shell-experiments/dll/win32/shell32/folders/printers.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/folders/printers.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/shell32/folders/printers.cpp [iso-8859-1] Wed Aug
20 00:39:40 2014
@@ -448,7 +448,7 @@
*/
HRESULT WINAPI CPrinterFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *
ppvOut)
{
- LPSHELLVIEW pShellView;
+ CComPtr<IShellView> pShellView;
HRESULT hr = E_INVALIDARG;
TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
Modified: branches/shell-experiments/dll/win32/shell32/folders/recyclebin.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/folders/recyclebin.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/shell32/folders/recyclebin.cpp [iso-8859-1] Wed
Aug 20 00:39:40 2014
@@ -560,7 +560,7 @@
HRESULT WINAPI CRecycleBin::CreateViewObject(HWND hwndOwner, REFIID riid, void **ppv)
{
- LPSHELLVIEW pShellView;
+ CComPtr<IShellView> pShellView;
HRESULT hr = E_NOINTERFACE;
TRACE("(%p, %p, %s, %p)\n", this, hwndOwner, debugstr_guid(&riid),
ppv);
@@ -584,7 +584,6 @@
if (pShellView)
{
hr = pShellView->QueryInterface(riid, ppv);
- pShellView->Release();
}
}
else
@@ -855,7 +854,7 @@
{
HRESULT hr;
LPSHELLBROWSER lpSB;
- LPSHELLVIEW lpSV = NULL;
+ IShellView * lpSV = NULL;
TRACE("%p %p verb %p\n", this, lpcmi, lpcmi->lpVerb);
Modified: branches/shell-experiments/dll/win32/shell32/pidl.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/pidl.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/pidl.cpp [iso-8859-1] Wed Aug 20 00:39:40
2014
@@ -51,7 +51,7 @@
* RETURNS
* 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;
WCHAR wPath[MAX_PATH];
@@ -68,10 +68,10 @@
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;
- LPSHELLFOLDER lsf = psf;
+ IShellFolder * lsf = psf;
HRESULT ret = NO_ERROR;
LPCITEMIDLIST pidllast;
STRRET strret;
@@ -141,7 +141,7 @@
/*************************************************************************
* 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);
@@ -681,7 +681,7 @@
*
* NOTES
*/
-HRESULT WINAPI SHGetRealIDL(LPSHELLFOLDER lpsf, LPCITEMIDLIST pidlSimple, LPITEMIDLIST
*pidlReal)
+HRESULT WINAPI SHGetRealIDL(IShellFolder * lpsf, LPCITEMIDLIST pidlSimple, LPITEMIDLIST
*pidlReal)
{
CComPtr<IDataObject> pDataObj;
HRESULT hr;
@@ -1063,7 +1063,7 @@
* 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
*/
-HRESULT WINAPI SHGetDataFromIDListA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl,
+HRESULT WINAPI SHGetDataFromIDListA(IShellFolder * psf, LPCITEMIDLIST pidl,
int nFormat, LPVOID dest, int len)
{
LPSTR filename, shortname;
@@ -1121,7 +1121,7 @@
* SHGetDataFromIDListW [SHELL32.248]
*
*/
-HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl,
+HRESULT WINAPI SHGetDataFromIDListW(IShellFolder * psf, LPCITEMIDLIST pidl,
int nFormat, LPVOID dest, int len)
{
LPSTR filename, shortname;
Modified: branches/shell-experiments/dll/win32/shell32/shellitem.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/shellitem.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/shellitem.cpp [iso-8859-1] Wed Aug 20
00:39:40 2014
@@ -244,7 +244,7 @@
IShellFolder *psfParent, LPCITEMIDLIST pidl, IShellItem **ppsi)
{
HRESULT hr;
- IShellItem *newShellItem;
+ CComPtr<IShellItem> newShellItem;
LPITEMIDLIST new_pidl;
CComPtr<IPersistIDList> newPersistIDList;
@@ -308,6 +308,8 @@
return hr;
}
ILFree(new_pidl);
- *ppsi = newShellItem;
- return hr;
-}
+
+ *ppsi = newShellItem.Detach();
+
+ return hr;
+}
Modified: branches/shell-experiments/dll/win32/shell32/shelllink.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/shelllink.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/shelllink.cpp [iso-8859-1] Wed Aug 20
00:39:40 2014
@@ -2173,7 +2173,7 @@
{
TRACE("(%p)->(DataObject=%p)\n", this, pDataObject);
LPCITEMIDLIST pidlLast;
- IShellFolder *psf;
+ CComPtr<IShellFolder> psf;
HRESULT hr = SHBindToParent(pPidl, IID_PPV_ARG(IShellFolder, &psf),
&pidlLast);
@@ -2185,8 +2185,6 @@
hr = mDropTarget->DragEnter(pDataObject, dwKeyState, pt, pdwEffect);
else
*pdwEffect = DROPEFFECT_NONE;
-
- psf->Release();
}
else
*pdwEffect = DROPEFFECT_NONE;
Modified: branches/shell-experiments/dll/win32/shell32/shellole.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/shellole.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/shellole.cpp [iso-8859-1] Wed Aug 20
00:39:40 2014
@@ -68,7 +68,7 @@
HRESULT WINAPI SHCoCreateInstance(
LPCWSTR aclsid,
const CLSID *clsid,
- LPUNKNOWN pUnkOuter,
+ IUnknown * pUnkOuter,
REFIID refiid,
LPVOID *ppv)
{
@@ -314,7 +314,7 @@
HRESULT Initialize(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, const IID *riidInstx);
// 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);
BEGIN_COM_MAP(IDefClFImpl)
@@ -346,7 +346,7 @@
/******************************************************************************
* 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);
Modified: branches/shell-experiments/dll/win32/shell32/shellord.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/shellord.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/shellord.cpp [iso-8859-1] Wed Aug 20
00:39:40 2014
@@ -484,13 +484,13 @@
*/
HRESULT WINAPI SHDoDragDrop(
HWND hWnd,
- LPDATAOBJECT lpDataObject,
+ IDataObject * lpDataObject,
LPDROPSOURCE lpDropSource,
DWORD dwOKEffect,
LPDWORD pdwEffect)
{
FIXME("(%p %p %p 0x%08x %p):stub.\n",
- hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
+ hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
return DoDragDrop(lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
}
@@ -1015,7 +1015,7 @@
LPCSFV psvcbi, /* [in] shelltemplate struct */
IShellView **ppv) /* [out] IShellView pointer */
{
- IShellView *psf;
+ CComPtr<IShellView> psf;
HRESULT hRes;
TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n",
@@ -1028,7 +1028,6 @@
return hRes;
hRes = psf->QueryInterface(IID_PPV_ARG(IShellView, ppv));
- psf->Release();
return hRes;
}
@@ -1050,14 +1049,14 @@
return 0;
}
-static LPUNKNOWN SHELL32_IExplorerInterface=0;
+static IUnknown * SHELL32_IExplorerInterface=0;
/*************************************************************************
* SHSetInstanceExplorer [SHELL32.176]
*
* NOTES
* Sets the interface
*/
-VOID WINAPI SHSetInstanceExplorer (LPUNKNOWN lpUnknown)
+VOID WINAPI SHSetInstanceExplorer (IUnknown * lpUnknown)
{ TRACE("%p\n", lpUnknown);
SHELL32_IExplorerInterface = lpUnknown;
}
@@ -1897,7 +1896,7 @@
const FORMATETC *lpFormats,
LPENUMFORMATETC *ppenumFormatetc)
{
- IEnumFORMATETC *pef;
+ CComPtr<IEnumFORMATETC> pef;
HRESULT hRes;
TRACE("cf=%d fe=%p pef=%p\n", cFormats, lpFormats, ppenumFormatetc);
@@ -1907,7 +1906,6 @@
pef->AddRef();
hRes = pef->QueryInterface(IID_PPV_ARG(IEnumFORMATETC, ppenumFormatetc));
- pef->Release();
return hRes;
}
@@ -1918,7 +1916,7 @@
*/
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
{
- IShellView *psf;
+ CComPtr<IShellView> psf;
HRESULT hRes;
*ppsv = NULL;
@@ -1933,7 +1931,6 @@
return hRes;
hRes = psf->QueryInterface(IID_PPV_ARG(IShellView, ppsv));
- psf->Release();
return hRes;
}
Modified: branches/shell-experiments/dll/win32/shell32/shlexec.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/shlexec.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/shlexec.cpp [iso-8859-1] Wed Aug 20
00:39:40 2014
@@ -404,7 +404,7 @@
static HRESULT SHELL_GetPathFromIDListForExecuteW(LPCITEMIDLIST pidl, LPWSTR pszPath,
UINT uOutSize)
{
STRRET strret;
- IShellFolder *desktop;
+ CComPtr<IShellFolder> desktop;
HRESULT hr = SHGetDesktopFolder(&desktop);
@@ -414,8 +414,6 @@
if (SUCCEEDED(hr))
StrRetToStrNW(pszPath, uOutSize, &strret, pidl);
-
- desktop->Release();
}
return hr;
@@ -1782,15 +1780,13 @@
/* process the 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);
if (SUCCEEDED(hr))
{
hr = pSEH->Execute(&sei_tmp);
-
- pSEH->Release();
if (hr == S_OK)
{
Modified: branches/shell-experiments/dll/win32/shell32/shlfolder.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/shlfolder.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/shlfolder.cpp [iso-8859-1] Wed Aug 20
00:39:40 2014
@@ -212,11 +212,11 @@
if (SUCCEEDED (hr))
{
LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
- IPersistFolder *pPF;
- IPersistFolder3 *ppf;
+ CComPtr<IPersistFolder> ppf;
+ CComPtr<IPersistFolder3> ppf3;
if (_ILIsFolder(pidlChild) &&
- SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder3,
&ppf))))
+ SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder3,
&ppf3))))
{
PERSIST_FOLDER_TARGET_INFO ppfti;
@@ -241,13 +241,11 @@
hr = E_INVALIDARG;
}
- ppf->InitializeEx(NULL, pidlAbsolute, &ppfti);
- ppf->Release();
- }
- else if (SUCCEEDED((hr =
pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder, &pPF)))))
+ ppf3->InitializeEx(NULL, pidlAbsolute, &ppfti);
+ }
+ else if (SUCCEEDED((hr =
pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder, &ppf)))))
{
- pPF->Initialize(pidlAbsolute);
- pPF->Release();
+ ppf->Initialize(pidlAbsolute);
}
ILFree (pidlAbsolute);
}
@@ -280,7 +278,7 @@
LPCWSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid,
LPVOID * ppvOut)
{
GUID const *clsid;
- IShellFolder *pSF;
+ CComPtr<IShellFolder> pSF;
HRESULT hr;
LPITEMIDLIST pidlChild;
@@ -325,7 +323,6 @@
/* go deeper */
hr = pSF->BindToObject(ILGetNext (pidlComplete), NULL, riid, ppvOut);
}
- pSF->Release();
}
TRACE ("-- returning (%p) %08x\n", *ppvOut, hr);
@@ -359,7 +356,7 @@
pidlFirst = ILCloneFirst(pidl);
if (pidlFirst)
{
- IShellFolder *psfChild;
+ CComPtr<IShellFolder> psfChild;
hr = psf->BindToObject(pidlFirst, NULL, IID_PPV_ARG(IShellFolder,
&psfChild));
if (SUCCEEDED (hr))
@@ -373,7 +370,6 @@
if(!StrRetToStrNW (szOut, dwOutLen, &strTemp, pidlNext))
hr = E_FAIL;
}
- psfChild->Release();
}
ILFree (pidlFirst);
} else
@@ -491,7 +487,7 @@
if (SFGAO_HASSUBFOLDER & *pdwAttributes)
{
- IShellFolder *psf2;
+ CComPtr<IShellFolder> psf2;
if (SUCCEEDED(psf->BindToObject(pidl, 0, IID_PPV_ARG(IShellFolder,
&psf2))))
{
IEnumIDList *pEnumIL = NULL;
@@ -501,7 +497,6 @@
*pdwAttributes &= ~SFGAO_HASSUBFOLDER;
pEnumIL->Release();
}
- psf2->Release();
}
}
} else
@@ -514,68 +509,73 @@
/***********************************************************************
* SHELL32_CompareIDs
*/
-HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST pidl1,
LPCITEMIDLIST pidl2)
+HRESULT SHELL32_CompareIDs(IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST pidl1,
LPCITEMIDLIST pidl2)
{
int type1,
- type2;
+ type2;
char szTemp1[MAX_PATH];
char szTemp2[MAX_PATH];
HRESULT nReturn;
- LPITEMIDLIST firstpidl,
- nextpidl1,
- nextpidl2;
- IShellFolder *psf;
+ LPITEMIDLIST firstpidl;
+ LPITEMIDLIST nextpidl1;
+ LPITEMIDLIST nextpidl2;
+ CComPtr<IShellFolder> psf;
/* test for empty pidls */
- BOOL isEmpty1 = _ILIsDesktop (pidl1);
- BOOL isEmpty2 = _ILIsDesktop (pidl2);
+ BOOL isEmpty1 = _ILIsDesktop(pidl1);
+ BOOL isEmpty2 = _ILIsDesktop(pidl2);
if (isEmpty1 && isEmpty2)
- return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 0 );
+ return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 0);
if (isEmpty1)
- return MAKE_HRESULT( SEVERITY_SUCCESS, 0, (WORD)-1 );
+ return MAKE_HRESULT(SEVERITY_SUCCESS, 0, (WORD) -1);
if (isEmpty2)
- return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 1 );
+ return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 1);
/* test for different types. Sort order is the PT_* constant */
- type1 = _ILGetDataPointer (pidl1)->type;
- type2 = _ILGetDataPointer (pidl2)->type;
+ type1 = _ILGetDataPointer(pidl1)->type;
+ type2 = _ILGetDataPointer(pidl2)->type;
if (type1 < type2)
- return MAKE_HRESULT( SEVERITY_SUCCESS, 0, (WORD)-1 );
+ return MAKE_HRESULT(SEVERITY_SUCCESS, 0, (WORD) -1);
else if (type1 > type2)
- return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 1 );
+ return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 1);
/* test for name of pidl */
- _ILSimpleGetText (pidl1, szTemp1, MAX_PATH);
- _ILSimpleGetText (pidl2, szTemp2, MAX_PATH);
- nReturn = lstrcmpiA (szTemp1, szTemp2);
+ _ILSimpleGetText(pidl1, szTemp1, MAX_PATH);
+ _ILSimpleGetText(pidl2, szTemp2, MAX_PATH);
+ nReturn = lstrcmpiA(szTemp1, szTemp2);
if (nReturn < 0)
- return MAKE_HRESULT( SEVERITY_SUCCESS, 0, (WORD)-1 );
+ return MAKE_HRESULT(SEVERITY_SUCCESS, 0, (WORD) -1);
else if (nReturn > 0)
- return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 1 );
+ return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 1);
/* test of complex pidls */
- firstpidl = ILCloneFirst (pidl1);
- nextpidl1 = ILGetNext (pidl1);
- nextpidl2 = ILGetNext (pidl2);
+ firstpidl = ILCloneFirst(pidl1);
+ nextpidl1 = ILGetNext(pidl1);
+ nextpidl2 = ILGetNext(pidl2);
/* optimizing: test special cases and bind not deeper */
/* the deeper shellfolder would do the same */
- isEmpty1 = _ILIsDesktop (nextpidl1);
- isEmpty2 = _ILIsDesktop (nextpidl2);
-
- if (isEmpty1 && isEmpty2) {
- return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 0 );
- } else if (isEmpty1) {
- return MAKE_HRESULT( SEVERITY_SUCCESS, 0, (WORD)-1 );
- } else if (isEmpty2) {
- return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 1 );
- /* optimizing end */
- } else if (SUCCEEDED (iface->BindToObject(firstpidl, NULL,
IID_PPV_ARG(IShellFolder, &psf)))) {
- nReturn = psf->CompareIDs(lParam, nextpidl1, nextpidl2);
- psf->Release();
- }
- ILFree (firstpidl);
+ isEmpty1 = _ILIsDesktop(nextpidl1);
+ isEmpty2 = _ILIsDesktop(nextpidl2);
+
+ if (isEmpty1 && isEmpty2)
+ {
+ return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 0);
+ }
+ else if (isEmpty1)
+ {
+ return MAKE_HRESULT(SEVERITY_SUCCESS, 0, (WORD) -1);
+ }
+ else if (isEmpty2)
+ {
+ return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 1);
+ /* optimizing end */
+ }
+ else if (SUCCEEDED(iface->BindToObject(firstpidl, NULL, IID_PPV_ARG(IShellFolder,
&psf)))) {
+ nReturn = psf->CompareIDs(lParam, nextpidl1, nextpidl2);
+ }
+ ILFree(firstpidl);
return nReturn;
}
@@ -584,10 +584,10 @@
*
* Undocumented.
*/
-HRESULT WINAPI SHCreateLinks( HWND hWnd, LPCSTR lpszDir, LPDATAOBJECT lpDataObject,
+HRESULT WINAPI SHCreateLinks( HWND hWnd, LPCSTR lpszDir, IDataObject * lpDataObject,
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);
return E_NOTIMPL;
}
Modified: branches/shell-experiments/dll/win32/shell32/shlview.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] Wed Aug 20
00:39:40 2014
@@ -1755,7 +1755,7 @@
if (GetSelections())
{
- IDataObject * pda;
+ CComPtr<IDataObject> pda;
DWORD dwAttributes = SFGAO_CANLINK;
DWORD dwEffect = DROPEFFECT_COPY | DROPEFFECT_MOVE;
@@ -1775,14 +1775,12 @@
if (SUCCEEDED(pda->QueryInterface(IID_PPV_ARG(IAsyncOperation,
&piaso))))
{
piaso->SetAsyncMode(TRUE);
- piaso->Release();
}
if (pds)
{ DWORD dwEffect2;
DoDragDrop(pda, pds, dwEffect, &dwEffect2);
}
- pda->Release();
}
}
break;