[0.4.9][SHELL32] Backport format+logging-trivia, ARRAYSIZE/_countof

Picks various trivial improvements from newer branches, does not fix specific JIRA-tickets and also doesn't
*entirely* cover a specific PR, therefore none of those are mentioned here.
Main motivation is to reduce large scale white-noise diff between the branches, to make
future commits diffs (with some fixes that actually matter) smaller in size and therefore easier to review.

Specifically:
- large-scale formatting & logging improvements, including but not limited to 0.4.15-dev-7653-g 6f91b6c0fe
- strip trailing whitespace
- also typos like 'unkown', missing \n as it was
  part of 0.4.15-dev-6323-g 3854a5d8e9 and
  0.4.15-dev-4492-g 03422451b3
  (I left out the MOUSE_MOVE-one from that, because I consider the missing \n there intentional)
- ports back many usages of ARRAYSIZE/_countof as it was added as part of some commits from Hermes, e.g.:
  *partial* pick of 0.4.13-dev-622-g 8a30801516 and
  *partial* pick of 0.4.15-dev-3642-g 83be315abf (I left out the literals here for now, ...
    I *might* pick them later on their own, but not now. I first want to verify their isolated impact on all compilers generated file-sizes.
    Some of those changes would even increase the binary size, especially those where the same literal is used multiple times,
    because string-pooling is currently not enabled for all toolchains and configurations.)
- COpenWithMenu.cpp: strip double-semicolon
- COpenWithMenu.cpp && folder_options.cpp: add \n to some dbg-prints without increasing their length
- CFSDropTarget.cpp: add \n to some dbg-prints, strip some good-path-traces that are no longer present in master in return to avoid size increase, fix indentation
- CShellLink.cpp: add \n to some dbg-prints without increasing their length
- iconcache.cpp: fix wrong indentation
- shlfileop.cpp: partially pick 0.4.15-dev-7388-g d689cfe158 just the stripping of #ifdef __REACTOS__ but NOT the actual fix! (the ifdefs were only present in 0.4.14)
- 0.4.10 and lower: shellpath.c Strip some TRACEs with wrong format-strings, strip unused string my_DocumentsW

binary size of shell32.dll has tendency to shrink slightly, which is caused solely by the logging changes:

master          RosBEWin2.2.2 GCC8.4.0 dbg x86               10.538.496 (0.4.15-dev-7640-gbdcfc6b)
releases/0.4.14 RosBEWin2.2.2 GCC8.4.0 dbg x86  9.317.888 ->  9.316.684
releases/0.4.14 RosBEWin2.1.6 GCC4.7.2 dbg x86  9.345.024 ->  9.345.024
releases/0.4.13 RosBEWin2.1.6 GCC4.7.2 dbg x86  9.201.152 ->  9.200.640
releases/0.4.12 RosBEWin2.1.6 GCC4.7.2 dbg x86  9.146.880 ->  9.146.880
releases/0.4.11 RosBEWin2.1.6 GCC4.7.2 dbg x86  9.077.760 ->  9.077.248
releases/0.4.10 RosBEWin2.1.6 GCC4.7.2 dbg x86  9.074.176 ->  9.072.128
releases/0.4. 9 RosBEWin2.1.6 GCC4.7.2 dbg x86  8.825.856 ->  8.824.832
releases/0.4. 8 RosBEWin2.1.6 GCC4.7.2 dbg x86  8.740.864 ->  8.738.816
releases/0.4. 7 RosBEWin2.1.6 GCC4.7.2 dbg x86  8.668.160 ->  8.666.624
This commit is contained in:
Joachim Henze 2024-02-25 01:53:19 +01:00
parent 395e494804
commit 589f4cf019
59 changed files with 766 additions and 1049 deletions

File diff suppressed because it is too large Load diff

View file

@ -133,8 +133,8 @@ CDefViewBckgrndMenu::SetSite(IUnknown *pUnkSite)
return S_OK; return S_OK;
} }
HRESULT HRESULT
WINAPI WINAPI
CDefViewBckgrndMenu::GetSite(REFIID riid, void **ppvSite) CDefViewBckgrndMenu::GetSite(REFIID riid, void **ppvSite)
{ {
if (!m_site) if (!m_site)
@ -152,12 +152,12 @@ CDefViewBckgrndMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFir
UINT cIds = 0; UINT cIds = 0;
/* This is something the implementations of IContextMenu should never really do. /* This is something the implementations of IContextMenu should never really do.
However CDefViewBckgrndMenu is more or less an overengineering result, its code could really be part of the However CDefViewBckgrndMenu is more or less an overengineering result, its code could really be part of the
CDefView. Given this, I think that abusing the interface here is not that bad since only CDefView is the ony CDefView. Given this, I think that abusing the interface here is not that bad since only CDefView is the ony
user of this class. Here we need to do two things to keep things as simple as possible. user of this class. Here we need to do two things to keep things as simple as possible.
First we want the menu part added by the shell folder to be the first to add so as to make as few id translations First we want the menu part added by the shell folder to be the first to add so as to make as few id translations
as possible. Second, we want to add the default part of the background menu without shifted ids, so as as possible. Second, we want to add the default part of the background menu without shifted ids, so as
to let the CDefView fill some parts like filling the arrange modes or checking the view mode. In order to let the CDefView fill some parts like filling the arrange modes or checking the view mode. In order
for that to work we need to save idCmdFirst because our caller will pass id offsets to InvokeCommand. for that to work we need to save idCmdFirst because our caller will pass id offsets to InvokeCommand.
This makes it impossible to concatenate the CDefViewBckgrndMenu with other menus since it abuses IContextMenu This makes it impossible to concatenate the CDefViewBckgrndMenu with other menus since it abuses IContextMenu
but as stated above, its sole user is CDefView and should really be that way. */ but as stated above, its sole user is CDefView and should really be that way. */

View file

@ -58,7 +58,6 @@ struct _StaticInvokeCommandMap_
{ "rename", FCIDM_SHVIEW_RENAME}, { "rename", FCIDM_SHVIEW_RENAME},
}; };
class CDefaultContextMenu : class CDefaultContextMenu :
public CComObjectRootEx<CComMultiThreadModelNoCS>, public CComObjectRootEx<CComMultiThreadModelNoCS>,
public IContextMenu3, public IContextMenu3,
@ -160,7 +159,6 @@ CDefaultContextMenu::CDefaultContextMenu() :
m_iIdCBLast(0), m_iIdCBLast(0),
m_iIdDfltFirst(0), m_iIdDfltFirst(0),
m_iIdDfltLast(0) m_iIdDfltLast(0)
{ {
} }
@ -515,7 +513,7 @@ UINT
CDefaultContextMenu::AddStaticContextMenusToMenu( CDefaultContextMenu::AddStaticContextMenusToMenu(
HMENU hMenu, HMENU hMenu,
UINT* pIndexMenu, UINT* pIndexMenu,
UINT iIdCmdFirst, UINT iIdCmdFirst,
UINT iIdCmdLast) UINT iIdCmdLast)
{ {
MENUITEMINFOW mii; MENUITEMINFOW mii;
@ -773,7 +771,7 @@ HRESULT CDefaultContextMenu::DoPaste(LPCMINVOKECOMMANDINFO lpcmi, BOOL bLink)
dwKey = MK_SHIFT; dwKey = MK_SHIFT;
} }
else { else {
ERR("No drop effect obtained"); ERR("No drop effect obtained\n");
} }
GlobalUnlock(medium2.hGlobal); GlobalUnlock(medium2.hGlobal);
} }

View file

@ -45,7 +45,7 @@ class CFolderOptions :
// IShellPropSheetExt // IShellPropSheetExt
virtual HRESULT STDMETHODCALLTYPE AddPages(LPFNSVADDPROPSHEETPAGE pfnAddPage, LPARAM lParam); virtual HRESULT STDMETHODCALLTYPE AddPages(LPFNSVADDPROPSHEETPAGE pfnAddPage, LPARAM lParam);
virtual HRESULT STDMETHODCALLTYPE ReplacePage(EXPPS uPageID, LPFNSVADDPROPSHEETPAGE pfnReplaceWith, LPARAM lParam); virtual HRESULT STDMETHODCALLTYPE ReplacePage(EXPPS uPageID, LPFNSVADDPROPSHEETPAGE pfnReplaceWith, LPARAM lParam);
// IShellExtInit // IShellExtInit
virtual HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID); virtual HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID);

View file

@ -1,24 +1,5 @@
/* // LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
* IEnumFORMATETC, IDataObject // COPYRIGHT: 1998-1999 <juergen.schmied@metronet.de>
*
* selecting and droping objects within the shell and/or common dialogs
*
* Copyright 1998, 1999 <juergen.schmied@metronet.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "precomp.h" #include "precomp.h"
@ -65,7 +46,7 @@ IEnumFORMATETCImpl::~IEnumFORMATETCImpl()
HRESULT WINAPI IEnumFORMATETCImpl::Initialize(UINT cfmt, const FORMATETC afmt[]) HRESULT WINAPI IEnumFORMATETCImpl::Initialize(UINT cfmt, const FORMATETC afmt[])
{ {
DWORD size; DWORD size;
size = cfmt * sizeof(FORMATETC); size = cfmt * sizeof(FORMATETC);
countFmt = cfmt; countFmt = cfmt;
@ -89,7 +70,7 @@ HRESULT WINAPI IEnumFORMATETCImpl::Next(ULONG celt, FORMATETC *rgelt, ULONG *pce
for(i = 0; posFmt < countFmt && celt > i; i++) for(i = 0; posFmt < countFmt && celt > i; i++)
{ {
*rgelt++ = pFmt[posFmt++]; *rgelt++ = pFmt[posFmt++];
} }
if (pceltFethed) *pceltFethed = i; if (pceltFethed) *pceltFethed = i;
@ -110,13 +91,13 @@ HRESULT WINAPI IEnumFORMATETCImpl::Reset()
{ {
TRACE("(%p)->()\n", this); TRACE("(%p)->()\n", this);
posFmt = 0; posFmt = 0;
return S_OK; return S_OK;
} }
HRESULT WINAPI IEnumFORMATETCImpl::Clone(LPENUMFORMATETC* ppenum) HRESULT WINAPI IEnumFORMATETCImpl::Clone(LPENUMFORMATETC* ppenum)
{ {
HRESULT hResult; HRESULT hResult;
TRACE("(%p)->(ppenum=%p)\n", this, ppenum); TRACE("(%p)->(ppenum=%p)\n", this, ppenum);
@ -143,7 +124,7 @@ HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMA
class CIDLDataObj : class CIDLDataObj :
public CComObjectRootEx<CComMultiThreadModelNoCS>, public CComObjectRootEx<CComMultiThreadModelNoCS>,
public IDataObject, public IDataObject,
public IAsyncOperation public IAsyncOperation
{ {
private: private:
LPITEMIDLIST pidl; LPITEMIDLIST pidl;
@ -245,7 +226,7 @@ static HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags)
*/ */
HRESULT WINAPI CIDLDataObj::GetData(LPFORMATETC pformatetcIn, STGMEDIUM *pmedium) HRESULT WINAPI CIDLDataObj::GetData(LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
{ {
char szTemp[256]; char szTemp[256];
szTemp[0] = 0; szTemp[0] = 0;
GetClipboardFormatNameA (pformatetcIn->cfFormat, szTemp, 256); GetClipboardFormatNameA (pformatetcIn->cfFormat, szTemp, 256);
@ -256,22 +237,22 @@ HRESULT WINAPI CIDLDataObj::GetData(LPFORMATETC pformatetcIn, STGMEDIUM *pmedium
if (cidl < 1) return(E_UNEXPECTED); if (cidl < 1) return(E_UNEXPECTED);
pmedium->hGlobal = RenderSHELLIDLIST(pidl, apidl, cidl); pmedium->hGlobal = RenderSHELLIDLIST(pidl, apidl, cidl);
} }
else if (pformatetcIn->cfFormat == CF_HDROP) else if (pformatetcIn->cfFormat == CF_HDROP)
{ {
if (cidl < 1) return(E_UNEXPECTED); if (cidl < 1) return(E_UNEXPECTED);
pmedium->hGlobal = RenderHDROP(pidl, apidl, cidl); pmedium->hGlobal = RenderHDROP(pidl, apidl, cidl);
} }
else if (pformatetcIn->cfFormat == cfFileNameA) else if (pformatetcIn->cfFormat == cfFileNameA)
{ {
if (cidl < 1) return(E_UNEXPECTED); if (cidl < 1) return(E_UNEXPECTED);
pmedium->hGlobal = RenderFILENAMEA(pidl, apidl, cidl); pmedium->hGlobal = RenderFILENAMEA(pidl, apidl, cidl);
} }
else if (pformatetcIn->cfFormat == cfFileNameW) else if (pformatetcIn->cfFormat == cfFileNameW)
{ {
if (cidl < 1) return(E_UNEXPECTED); if (cidl < 1) return(E_UNEXPECTED);
pmedium->hGlobal = RenderFILENAMEW(pidl, apidl, cidl); pmedium->hGlobal = RenderFILENAMEW(pidl, apidl, cidl);
} }
else if (pformatetcIn->cfFormat == cfPreferredDropEffect) else if (pformatetcIn->cfFormat == cfPreferredDropEffect)
{ {
pmedium->hGlobal = RenderPREFEREDDROPEFFECT(dropeffect); pmedium->hGlobal = RenderPREFEREDDROPEFFECT(dropeffect);
} }
@ -385,7 +366,7 @@ HRESULT WINAPI CIDLDataObj::InOperation(BOOL *pfInAsyncOp)
FIXME("(%p)->()\n", this); FIXME("(%p)->()\n", this);
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT WINAPI CIDLDataObj::SetAsyncMode(BOOL fDoOpAsync) HRESULT WINAPI CIDLDataObj::SetAsyncMode(BOOL fDoOpAsync)
{ {
TRACE("(%p)->()\n", this); TRACE("(%p)->()\n", this);
doasync = fDoOpAsync; doasync = fDoOpAsync;

View file

@ -31,8 +31,8 @@ list(APPEND SOURCE
dialogs/dialogs.cpp dialogs/dialogs.cpp
dialogs/drive.cpp dialogs/drive.cpp
dialogs/drvdefext.cpp dialogs/drvdefext.cpp
dialogs/folder_options.cpp
dialogs/filedefext.cpp dialogs/filedefext.cpp
dialogs/folder_options.cpp
dialogs/fprop.cpp dialogs/fprop.cpp
dialogs/recycler_prop.cpp dialogs/recycler_prop.cpp
CDropTargetHelper.cpp CDropTargetHelper.cpp

View file

@ -65,7 +65,6 @@ void CNewMenu::UnloadAllItems()
{ {
pCurItem = m_pItems; pCurItem = m_pItems;
m_pItems = m_pItems->pNext; m_pItems = m_pItems->pNext;
UnloadItem(pCurItem); UnloadItem(pCurItem);
} }
@ -201,9 +200,9 @@ CNewMenu::CacheItems()
} }
} }
} }
dwSize++; dwSize++;
lpValues = (LPWSTR) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize * sizeof(WCHAR)); lpValues = (LPWSTR) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize * sizeof(WCHAR));
if (!lpValues) if (!lpValues)
return FALSE; return FALSE;
@ -222,17 +221,17 @@ CNewMenu::CacheItems()
HeapFree(GetProcessHeap(), 0, lpValues); HeapFree(GetProcessHeap(), 0, lpValues);
return FALSE; return FALSE;
} }
if (RegSetValueExW(hKey, L"Classes", NULL, REG_MULTI_SZ, (LPBYTE)lpValues, dwSize * sizeof(WCHAR)) != ERROR_SUCCESS) if (RegSetValueExW(hKey, L"Classes", NULL, REG_MULTI_SZ, (LPBYTE)lpValues, dwSize * sizeof(WCHAR)) != ERROR_SUCCESS)
{ {
HeapFree(GetProcessHeap(), 0, lpValues); HeapFree(GetProcessHeap(), 0, lpValues);
RegCloseKey(hKey); RegCloseKey(hKey);
return FALSE; return FALSE;
} }
HeapFree(GetProcessHeap(), 0, lpValues); HeapFree(GetProcessHeap(), 0, lpValues);
RegCloseKey(hKey); RegCloseKey(hKey);
return TRUE; return TRUE;
} }
@ -245,17 +244,17 @@ CNewMenu::LoadCachedItems()
HKEY hKey; HKEY hKey;
SHELLNEW_ITEM *pNewItem; SHELLNEW_ITEM *pNewItem;
SHELLNEW_ITEM *pCurItem = NULL; SHELLNEW_ITEM *pCurItem = NULL;
if (RegOpenKeyExW(HKEY_CURRENT_USER, ShellNewKey, 0, KEY_READ, &hKey) != ERROR_SUCCESS) if (RegOpenKeyExW(HKEY_CURRENT_USER, ShellNewKey, 0, KEY_READ, &hKey) != ERROR_SUCCESS)
return FALSE; return FALSE;
if (RegQueryValueExW(hKey, L"Classes", NULL, NULL, NULL, &dwSize) != ERROR_SUCCESS) if (RegQueryValueExW(hKey, L"Classes", NULL, NULL, NULL, &dwSize) != ERROR_SUCCESS)
return FALSE; return FALSE;
lpValues = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, dwSize); lpValues = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, dwSize);
if (!lpValues) if (!lpValues)
return FALSE; return FALSE;
if (RegQueryValueExW(hKey, L"Classes", NULL, NULL, (LPBYTE)lpValues, &dwSize) != ERROR_SUCCESS) if (RegQueryValueExW(hKey, L"Classes", NULL, NULL, (LPBYTE)lpValues, &dwSize) != ERROR_SUCCESS)
{ {
HeapFree(GetProcessHeap(), 0, lpValues); HeapFree(GetProcessHeap(), 0, lpValues);
@ -287,10 +286,10 @@ CNewMenu::LoadCachedItems()
} }
} }
} }
HeapFree(GetProcessHeap(), 0, lpValues); HeapFree(GetProcessHeap(), 0, lpValues);
RegCloseKey(hKey); RegCloseKey(hKey);
return TRUE; return TRUE;
} }
@ -299,12 +298,12 @@ CNewMenu::LoadAllItems()
{ {
/* If there are any unload them */ /* If there are any unload them */
UnloadAllItems(); UnloadAllItems();
if (!LoadCachedItems()) if (!LoadCachedItems())
{ {
CacheItems(); CacheItems();
} }
if (!m_pLinkItem) if (!m_pLinkItem)
{ {
m_pLinkItem = static_cast<SHELLNEW_ITEM *>(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SHELLNEW_ITEM))); m_pLinkItem = static_cast<SHELLNEW_ITEM *>(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SHELLNEW_ITEM)));
@ -445,7 +444,7 @@ HRESULT CNewMenu::CreateNewFolder(LPCMINVOKECOMMANDINFO lpici)
WCHAR wszName[MAX_PATH]; WCHAR wszName[MAX_PATH];
WCHAR wszNewFolder[25]; WCHAR wszNewFolder[25];
HRESULT hr; HRESULT hr;
/* Get folder path */ /* Get folder path */
hr = SHGetPathFromIDListW(m_pidlFolder, wszPath); hr = SHGetPathFromIDListW(m_pidlFolder, wszPath);
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
@ -708,7 +707,7 @@ CNewMenu::HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plRes
DWORD id = LOWORD(lpdis->itemID); DWORD id = LOWORD(lpdis->itemID);
HICON hIcon = 0; HICON hIcon = 0;
if (id == 0) if (id == 0)
hIcon = m_hiconFolder; hIcon = m_hiconFolder;
else if (id == 1) else if (id == 1)
hIcon = m_hiconLink; hIcon = m_hiconLink;
else else
@ -721,12 +720,12 @@ CNewMenu::HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plRes
if (!hIcon) if (!hIcon)
break; break;
DrawIconEx(lpdis->hDC, DrawIconEx(lpdis->hDC,
2, 2,
lpdis->rcItem.top + (lpdis->rcItem.bottom - lpdis->rcItem.top - 16) / 2, lpdis->rcItem.top + (lpdis->rcItem.bottom - lpdis->rcItem.top - 16) / 2,
hIcon, hIcon,
16, 16,
16, 16,
0, NULL, DI_NORMAL); 0, NULL, DI_NORMAL);
if(plResult) if(plResult)

View file

@ -111,7 +111,7 @@ COpenWithList::~COpenWithList()
BOOL COpenWithList::Load() BOOL COpenWithList::Load()
{ {
HKEY hKey; HKEY hKey;
WCHAR wszName[256], wszBuf[100];; WCHAR wszName[256], wszBuf[100];
DWORD i = 0, cchName, dwSize; DWORD i = 0, cchName, dwSize;
SApp *pApp; SApp *pApp;
@ -696,7 +696,7 @@ BOOL COpenWithList::SetDefaultHandler(SApp *pApp, LPCWSTR pwszFilename)
/* Create file extension key */ /* Create file extension key */
if (RegCreateKeyExW(HKEY_CLASSES_ROOT, pwszExt, 0, NULL, 0, KEY_READ|KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS) if (RegCreateKeyExW(HKEY_CLASSES_ROOT, pwszExt, 0, NULL, 0, KEY_READ|KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS)
{ {
ERR("Cannot open ext key"); ERR("Can't open ext key\n");
return FALSE; return FALSE;
} }
@ -850,7 +850,7 @@ BOOL COpenWithDialog::IsNoOpen(HWND hwnd)
return TRUE; return TRUE;
else if (dReturnValue == -1) else if (dReturnValue == -1)
{ {
ERR("IsNoOpen failed to load the dialog box."); ERR("IsNoOpen failed to load dialog box\n");
return TRUE; return TRUE;
} }
} }

View file

@ -80,17 +80,17 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::Init(
debugstr_w(pszAssoc), debugstr_w(pszAssoc),
hkeyProgid, hkeyProgid,
hWnd); hWnd);
if (hWnd != NULL) if (hWnd != NULL)
{ {
FIXME("hwnd != NULL not supported\n"); FIXME("hwnd != NULL not supported\n");
} }
if (cfFlags != 0) if (cfFlags != 0)
{ {
FIXME("unsupported flags: %x\n", cfFlags); FIXME("unsupported flags: %x\n", cfFlags);
} }
RegCloseKey(this->hkeySource); RegCloseKey(this->hkeySource);
RegCloseKey(this->hkeyProgID); RegCloseKey(this->hkeyProgID);
this->hkeySource = this->hkeyProgID = NULL; this->hkeySource = this->hkeyProgID = NULL;
@ -98,7 +98,7 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::Init(
{ {
WCHAR *progId; WCHAR *progId;
HRESULT hr; HRESULT hr;
LONG ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, LONG ret = RegOpenKeyExW(HKEY_CLASSES_ROOT,
pszAssoc, pszAssoc,
0, 0,
@ -108,7 +108,7 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::Init(
{ {
return S_OK; return S_OK;
} }
/* if this is a progid */ /* if this is a progid */
if (*pszAssoc != '.' && *pszAssoc != '{') if (*pszAssoc != '.' && *pszAssoc != '{')
{ {
@ -195,12 +195,12 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString(
{ {
FIXME("%08x: unimplemented flags\n", flags & unimplemented_flags); FIXME("%08x: unimplemented flags\n", flags & unimplemented_flags);
} }
if (!pcchOut) if (!pcchOut)
{ {
return E_UNEXPECTED; return E_UNEXPECTED;
} }
if (!this->hkeySource && !this->hkeyProgID) if (!this->hkeySource && !this->hkeyProgID)
{ {
return HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION); return HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION);
@ -395,7 +395,7 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString(
hr = CLSIDFromString(pszExtra, &clsid); hr = CLSIDFromString(pszExtra, &clsid);
if (FAILED(hr)) if (FAILED(hr))
{ {
return hr; return hr;
} }
strcpyW(keypath, shellexW); strcpyW(keypath, shellexW);
@ -414,7 +414,7 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetString(
} }
return this->ReturnString(flags, pszOut, pcchOut, guid, size / sizeof(WCHAR)); return this->ReturnString(flags, pszOut, pcchOut, guid, size / sizeof(WCHAR));
} }
default: default:
{ {
FIXME("assocstr %d unimplemented!\n", str); FIXME("assocstr %d unimplemented!\n", str);
@ -476,8 +476,8 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetData(ASSOCF cfFlags, ASSOCDATA
{ {
FIXME("Unsupported flags: %x\n", cfFlags); FIXME("Unsupported flags: %x\n", cfFlags);
} }
switch(assocdata) switch(assocdata)
{ {
case ASSOCDATA_EDITFLAGS: case ASSOCDATA_EDITFLAGS:
{ {
@ -485,7 +485,7 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetData(ASSOCF cfFlags, ASSOCDATA
{ {
return HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION); return HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION);
} }
void *data; void *data;
DWORD size; DWORD size;
HRESULT hres = this->GetValue(this->hkeyProgID, edit_flags, &data, &size); HRESULT hres = this->GetValue(this->hkeyProgID, edit_flags, &data, &size);
@ -493,13 +493,13 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetData(ASSOCF cfFlags, ASSOCDATA
{ {
return hres; return hres;
} }
if (!pcbOut) if (!pcbOut)
{ {
HeapFree(GetProcessHeap(), 0, data); HeapFree(GetProcessHeap(), 0, data);
return hres; return hres;
} }
hres = this->ReturnData(pvOut, pcbOut, data, size); hres = this->ReturnData(pvOut, pcbOut, data, size);
HeapFree(GetProcessHeap(), 0, data); HeapFree(GetProcessHeap(), 0, data);
return hres; return hres;
@ -609,12 +609,12 @@ HRESULT CQueryAssociations::GetCommand(const WCHAR *extra, WCHAR **command)
{ {
ret = RegOpenKeyExW(this->hkeySource, shellW, 0, KEY_READ, &hkeyShell); ret = RegOpenKeyExW(this->hkeySource, shellW, 0, KEY_READ, &hkeyShell);
} }
if (ret) if (ret)
{ {
return HRESULT_FROM_WIN32(ret); return HRESULT_FROM_WIN32(ret);
} }
if (!extra) if (!extra)
{ {
/* check for default verb */ /* check for default verb */
@ -654,7 +654,7 @@ HRESULT CQueryAssociations::GetCommand(const WCHAR *extra, WCHAR **command)
ret = RegOpenKeyExW(hkeyShell, extra, 0, KEY_READ, &hkeyVerb); ret = RegOpenKeyExW(hkeyShell, extra, 0, KEY_READ, &hkeyVerb);
HeapFree(GetProcessHeap(), 0, extra_from_reg); HeapFree(GetProcessHeap(), 0, extra_from_reg);
RegCloseKey(hkeyShell); RegCloseKey(hkeyShell);
if (ret) if (ret)
{ {
return HRESULT_FROM_WIN32(ret); return HRESULT_FROM_WIN32(ret);
} }
@ -662,7 +662,7 @@ HRESULT CQueryAssociations::GetCommand(const WCHAR *extra, WCHAR **command)
ret = RegOpenKeyExW(hkeyVerb, commandW, 0, KEY_READ, &hkeyCommand); ret = RegOpenKeyExW(hkeyVerb, commandW, 0, KEY_READ, &hkeyCommand);
RegCloseKey(hkeyVerb); RegCloseKey(hkeyVerb);
if (ret) if (ret)
{ {
return HRESULT_FROM_WIN32(ret); return HRESULT_FROM_WIN32(ret);
} }
hr = this->GetValue(hkeyCommand, NULL, (void**)command, NULL); hr = this->GetValue(hkeyCommand, NULL, (void**)command, NULL);
@ -681,7 +681,7 @@ HRESULT CQueryAssociations::GetExecutable(LPCWSTR pszExtra, LPWSTR path, DWORD p
{ {
return hr; return hr;
} }
DWORD expLen = ExpandEnvironmentStringsW(pszCommand, NULL, 0); DWORD expLen = ExpandEnvironmentStringsW(pszCommand, NULL, 0);
if (expLen > 0) if (expLen > 0)
{ {
@ -691,7 +691,7 @@ HRESULT CQueryAssociations::GetExecutable(LPCWSTR pszExtra, LPWSTR path, DWORD p
HeapFree(GetProcessHeap(), 0, pszCommand); HeapFree(GetProcessHeap(), 0, pszCommand);
pszCommand = buf; pszCommand = buf;
} }
/* cleanup pszCommand */ /* cleanup pszCommand */
if (pszCommand[0] == '"') if (pszCommand[0] == '"')
{ {
@ -782,11 +782,11 @@ HRESULT CQueryAssociations::ReturnString(ASSOCF flags, LPWSTR out, DWORD *outlen
{ {
len = datalen; len = datalen;
} }
if (len) if (len)
{ {
memcpy(out, data, len*sizeof(WCHAR)); memcpy(out, data, len*sizeof(WCHAR));
} }
return hr; return hr;
} }

View file

@ -14,18 +14,18 @@ private:
HRESULT GetExecutable(LPCWSTR pszExtra, LPWSTR path, DWORD pathlen, DWORD *len); HRESULT GetExecutable(LPCWSTR pszExtra, LPWSTR path, DWORD pathlen, DWORD *len);
HRESULT ReturnData(void *out, DWORD *outlen, const void *data, DWORD datalen); HRESULT ReturnData(void *out, DWORD *outlen, const void *data, DWORD datalen);
HRESULT ReturnString(ASSOCF flags, LPWSTR out, DWORD *outlen, LPCWSTR data, DWORD datalen); HRESULT ReturnString(ASSOCF flags, LPWSTR out, DWORD *outlen, LPCWSTR data, DWORD datalen);
public: public:
CQueryAssociations(); CQueryAssociations();
~CQueryAssociations(); ~CQueryAssociations();
// *** IQueryAssociations methods *** // *** IQueryAssociations methods ***
virtual HRESULT STDMETHODCALLTYPE Init(ASSOCF flags, LPCWSTR pwszAssoc, HKEY hkProgid, HWND hwnd); virtual HRESULT STDMETHODCALLTYPE Init(ASSOCF flags, LPCWSTR pwszAssoc, HKEY hkProgid, HWND hwnd);
virtual HRESULT STDMETHODCALLTYPE GetString(ASSOCF flags, ASSOCSTR str, LPCWSTR pwszExtra, LPWSTR pwszOut, DWORD *pcchOut); virtual HRESULT STDMETHODCALLTYPE GetString(ASSOCF flags, ASSOCSTR str, LPCWSTR pwszExtra, LPWSTR pwszOut, DWORD *pcchOut);
virtual HRESULT STDMETHODCALLTYPE GetKey(ASSOCF flags, ASSOCKEY key, LPCWSTR pwszExtra, HKEY *phkeyOut); virtual HRESULT STDMETHODCALLTYPE GetKey(ASSOCF flags, ASSOCKEY key, LPCWSTR pwszExtra, HKEY *phkeyOut);
virtual HRESULT STDMETHODCALLTYPE GetData(ASSOCF flags, ASSOCDATA data, LPCWSTR pwszExtra, void *pvOut, DWORD *pcbOut); virtual HRESULT STDMETHODCALLTYPE GetData(ASSOCF flags, ASSOCDATA data, LPCWSTR pwszExtra, void *pvOut, DWORD *pcbOut);
virtual HRESULT STDMETHODCALLTYPE GetEnum(ASSOCF cfFlags, ASSOCENUM assocenum, LPCWSTR pszExtra, REFIID riid, LPVOID *ppvOut); virtual HRESULT STDMETHODCALLTYPE GetEnum(ASSOCF cfFlags, ASSOCENUM assocenum, LPCWSTR pszExtra, REFIID riid, LPVOID *ppvOut);
DECLARE_REGISTRY_RESOURCEID(IDR_QUERYASSOCIATIONS) DECLARE_REGISTRY_RESOURCEID(IDR_QUERYASSOCIATIONS)
DECLARE_NOT_AGGREGATABLE(CQueryAssociations) DECLARE_NOT_AGGREGATABLE(CQueryAssociations)
DECLARE_PROTECT_FINAL_CONSTRUCT() DECLARE_PROTECT_FINAL_CONSTRUCT()

View file

@ -1202,7 +1202,6 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetArguments(LPCSTR pszArgs)
if (!m_sArgs) if (!m_sArgs)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
m_bDirty = TRUE; m_bDirty = TRUE;
return S_OK; return S_OK;
@ -1939,7 +1938,7 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetIconLocation(LPCWSTR pszIconPath, INT i
} }
} }
/* Store the original icon path location (this one may contain unexpanded environment strings) */ /* Store the original icon path location (may contain unexpanded environment strings) */
if (pszIconPath) if (pszIconPath)
{ {
m_Header.dwFlags &= ~SLDF_HAS_ICONLOCATION; m_Header.dwFlags &= ~SLDF_HAS_ICONLOCATION;
@ -2427,7 +2426,7 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetPath(LPCWSTR pszFile)
if (hr == S_OK) if (hr == S_OK)
m_Header.dwFlags |= SLDF_HAS_EXP_SZ; m_Header.dwFlags |= SLDF_HAS_EXP_SZ;
/* Now, make pszFile point to the expanded buffer */ /* Now, make pszFile point to the expanded path */
pszFile = szPath; pszFile = szPath;
} }
else else
@ -2607,7 +2606,7 @@ HRESULT STDMETHODCALLTYPE CShellLink::InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
HRESULT hr = Resolve(lpici->hwnd, 0); HRESULT hr = Resolve(lpici->hwnd, 0);
if (FAILED(hr)) if (FAILED(hr))
{ {
TRACE("failed to resolve component with error 0x%08x", hr); TRACE("failed to resolve component error 0x%08x\n", hr);
return hr; return hr;
} }

View file

@ -51,14 +51,12 @@ public:
/* Link file formats */ /* Link file formats */
#include "pshpack1.h" #include "pshpack1.h"
struct volume_info struct volume_info
{ {
DWORD type; DWORD type;
DWORD serial; DWORD serial;
WCHAR label[12]; /* assume 8.3 */ WCHAR label[12]; /* assume 8.3 */
}; };
#include "poppack.h" #include "poppack.h"
private: private:

View file

@ -53,8 +53,7 @@ typedef struct
BOOL CALLBACK EnumPickIconResourceProc(HMODULE hModule, BOOL CALLBACK EnumPickIconResourceProc(HMODULE hModule,
LPCWSTR lpszType, LPCWSTR lpszType,
LPWSTR lpszName, LPWSTR lpszName,
LONG_PTR lParam LONG_PTR lParam)
)
{ {
WCHAR szName[100]; WCHAR szName[100];
int index; int index;
@ -97,8 +96,7 @@ DestroyIconList(HWND hDlgCtrl)
INT_PTR CALLBACK PickIconProc(HWND hwndDlg, INT_PTR CALLBACK PickIconProc(HWND hwndDlg,
UINT uMsg, UINT uMsg,
WPARAM wParam, WPARAM wParam,
LPARAM lParam LPARAM lParam)
)
{ {
LPMEASUREITEMSTRUCT lpmis; LPMEASUREITEMSTRUCT lpmis;
LPDRAWITEMSTRUCT lpdis; LPDRAWITEMSTRUCT lpdis;
@ -147,7 +145,7 @@ INT_PTR CALLBACK PickIconProc(HWND hwndDlg,
break; break;
case IDC_PICKICON_LIST: case IDC_PICKICON_LIST:
if (HIWORD(wParam) == LBN_SELCHANGE) if (HIWORD(wParam) == LBN_SELCHANGE)
InvalidateRect((HWND)lParam, NULL, TRUE); // FIXME USE UPDATE RECT InvalidateRect((HWND)lParam, NULL, TRUE);
break; break;
case IDC_BUTTON_PATH: case IDC_BUTTON_PATH:
szText[0] = 0; szText[0] = 0;
@ -157,9 +155,9 @@ INT_PTR CALLBACK PickIconProc(HWND hwndDlg,
ofn.hwndOwner = hwndDlg; ofn.hwndOwner = hwndDlg;
ofn.lpstrFile = szText; ofn.lpstrFile = szText;
ofn.nMaxFile = MAX_PATH; ofn.nMaxFile = MAX_PATH;
LoadStringW(shell32_hInstance, IDS_PICK_ICON_TITLE, szTitle, sizeof(szTitle) / sizeof(WCHAR)); LoadStringW(shell32_hInstance, IDS_PICK_ICON_TITLE, szTitle, _countof(szTitle));
ofn.lpstrTitle = szTitle; ofn.lpstrTitle = szTitle;
LoadStringW(shell32_hInstance, IDS_PICK_ICON_FILTER, szFilter, sizeof(szFilter) / sizeof(WCHAR)); LoadStringW(shell32_hInstance, IDS_PICK_ICON_FILTER, szFilter, _countof(szFilter));
ofn.lpstrFilter = szFilter; ofn.lpstrFilter = szFilter;
if (GetOpenFileNameW(&ofn)) if (GetOpenFileNameW(&ofn))
{ {
@ -188,16 +186,14 @@ INT_PTR CALLBACK PickIconProc(HWND hwndDlg,
} }
break; break;
case WM_MEASUREITEM: case WM_MEASUREITEM:
lpmis = (LPMEASUREITEMSTRUCT) lParam; lpmis = (LPMEASUREITEMSTRUCT)lParam;
lpmis->itemHeight = 32; lpmis->itemHeight = 32;
lpmis->itemWidth = 64; lpmis->itemWidth = 64;
return TRUE; return TRUE;
case WM_DRAWITEM: case WM_DRAWITEM:
lpdis = (LPDRAWITEMSTRUCT) lParam; lpdis = (LPDRAWITEMSTRUCT)lParam;
if (lpdis->itemID == (UINT)-1) if (lpdis->itemID == (UINT)-1)
{
break; break;
}
switch (lpdis->itemAction) switch (lpdis->itemAction)
{ {
case ODA_SELECT: case ODA_SELECT:

View file

@ -139,7 +139,7 @@ SH_ShowDriveProperties(WCHAR *pwszDrive, LPCITEMIDLIST pidlFolder, PCUITEMID_CHI
psh.pszCaption = wszName; psh.pszCaption = wszName;
psh.dwFlags |= PSH_PROPTITLE; psh.dwFlags |= PSH_PROPTITLE;
} }
ILFree(completePidl); ILFree(completePidl);
CComPtr<IDataObject> pDataObj; CComPtr<IDataObject> pDataObj;
@ -633,5 +633,3 @@ SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options)
return result; return result;
} }

View file

@ -261,7 +261,7 @@ CDrvDefExt::PaintStaticControls(HWND hwndDlg, LPDRAWITEMSTRUCT pDrawItem)
pDrawItem->rcItem.right, pDrawItem->rcItem.bottom - 10); pDrawItem->rcItem.right, pDrawItem->rcItem.bottom - 10);
SelectObject(pDrawItem->hDC, hMagBrush); SelectObject(pDrawItem->hDC, hMagBrush);
if (m_FreeSpacePerc > 0) if (m_FreeSpacePerc > 0)
{ {
Pie(pDrawItem->hDC, pDrawItem->rcItem.left, pDrawItem->rcItem.top, pDrawItem->rcItem.right, Pie(pDrawItem->hDC, pDrawItem->rcItem.left, pDrawItem->rcItem.top, pDrawItem->rcItem.right,
@ -315,14 +315,14 @@ CDrvDefExt::InitGeneralPage(HWND hwndDlg)
{ {
/* volume label textbox */ /* volume label textbox */
SendMessage(GetDlgItem(hwndDlg, 14000), EM_SETREADONLY, TRUE, 0); SendMessage(GetDlgItem(hwndDlg, 14000), EM_SETREADONLY, TRUE, 0);
/* disk compression */ /* disk compression */
ShowWindow(GetDlgItem(hwndDlg, 14011), FALSE); ShowWindow(GetDlgItem(hwndDlg, 14011), FALSE);
/* index */ /* index */
ShowWindow(GetDlgItem(hwndDlg, 14012), FALSE); ShowWindow(GetDlgItem(hwndDlg, 14012), FALSE);
} }
HICON hIcon = (HICON)LoadImage(shell32_hInstance, MAKEINTRESOURCE(IconId), IMAGE_ICON, 32, 32, LR_SHARED); HICON hIcon = (HICON)LoadImage(shell32_hInstance, MAKEINTRESOURCE(IconId), IMAGE_ICON, 32, 32, LR_SHARED);
if (hIcon) if (hIcon)
SendDlgItemMessageW(hwndDlg, 14016, STM_SETICON, (WPARAM)hIcon, 0); SendDlgItemMessageW(hwndDlg, 14016, STM_SETICON, (WPARAM)hIcon, 0);
@ -379,7 +379,7 @@ CDrvDefExt::InitGeneralPage(HWND hwndDlg)
GetDlgItemTextW(hwndDlg, 14009, wszFormat, _countof(wszFormat)); GetDlgItemTextW(hwndDlg, 14009, wszFormat, _countof(wszFormat));
swprintf(wszBuf, wszFormat, m_wszDrive[0]); swprintf(wszBuf, wszFormat, m_wszDrive[0]);
SetDlgItemTextW(hwndDlg, 14009, wszBuf); SetDlgItemTextW(hwndDlg, 14009, wszBuf);
/* show disk cleanup button only for fixed drives */ /* show disk cleanup button only for fixed drives */
ShowWindow(GetDlgItem(hwndDlg, 14010), DriveType == DRIVE_FIXED); ShowWindow(GetDlgItem(hwndDlg, 14010), DriveType == DRIVE_FIXED);
} }

View file

@ -27,7 +27,7 @@ class CFileVersionInfo
PVOID m_pInfo; PVOID m_pInfo;
WORD m_wLang, m_wCode; WORD m_wLang, m_wCode;
WCHAR m_wszLang[64]; WCHAR m_wszLang[64];
typedef struct _LANGANDCODEPAGE_ typedef struct _LANGANDCODEPAGE_
{ {
WORD wLang; WORD wLang;

View file

@ -777,11 +777,11 @@ UpdateGeneralIcons(HWND hDlg)
if (lpTaskIconName) if (lpTaskIconName)
{ {
hTaskIcon = (HICON)LoadImage(shell32_hInstance, hTaskIcon = (HICON)LoadImage(shell32_hInstance,
lpTaskIconName, lpTaskIconName,
IMAGE_ICON, IMAGE_ICON,
0, 0,
0, 0,
LR_DEFAULTCOLOR); LR_DEFAULTCOLOR);
if (hTaskIcon) if (hTaskIcon)
{ {
hwndTaskIcon = GetDlgItem(hDlg, hwndTaskIcon = GetDlgItem(hDlg,
@ -795,21 +795,21 @@ UpdateGeneralIcons(HWND hDlg)
} }
} }
} }
// show Folder setting icons // show Folder setting icons
if(IsDlgButtonChecked(hDlg, IDC_FOLDER_OPTIONS_SAMEWINDOW) == BST_CHECKED) if(IsDlgButtonChecked(hDlg, IDC_FOLDER_OPTIONS_SAMEWINDOW) == BST_CHECKED)
lpFolderIconName = MAKEINTRESOURCE(IDI_SHELL_OPEN_IN_SOME_WINDOW); lpFolderIconName = MAKEINTRESOURCE(IDI_SHELL_OPEN_IN_SOME_WINDOW);
else if(IsDlgButtonChecked(hDlg, IDC_FOLDER_OPTIONS_OWNWINDOW) == BST_CHECKED) else if(IsDlgButtonChecked(hDlg, IDC_FOLDER_OPTIONS_OWNWINDOW) == BST_CHECKED)
lpFolderIconName = MAKEINTRESOURCE(IDI_SHELL_OPEN_IN_NEW_WINDOW); lpFolderIconName = MAKEINTRESOURCE(IDI_SHELL_OPEN_IN_NEW_WINDOW);
if (lpFolderIconName) if (lpFolderIconName)
{ {
hFolderIcon = (HICON)LoadImage(shell32_hInstance, hFolderIcon = (HICON)LoadImage(shell32_hInstance,
lpFolderIconName, lpFolderIconName,
IMAGE_ICON, IMAGE_ICON,
0, 0,
0, 0,
LR_DEFAULTCOLOR); LR_DEFAULTCOLOR);
if (hFolderIcon) if (hFolderIcon)
{ {
hwndFolderIcon = GetDlgItem(hDlg, hwndFolderIcon = GetDlgItem(hDlg,
@ -833,11 +833,11 @@ UpdateGeneralIcons(HWND hDlg)
if (lpClickIconName) if (lpClickIconName)
{ {
hClickIcon = (HICON)LoadImage(shell32_hInstance, hClickIcon = (HICON)LoadImage(shell32_hInstance,
lpClickIconName, lpClickIconName,
IMAGE_ICON, IMAGE_ICON,
0, 0,
0, 0,
LR_DEFAULTCOLOR); LR_DEFAULTCOLOR);
if (hClickIcon) if (hClickIcon)
{ {
hwndClickIcon = GetDlgItem(hDlg, hwndClickIcon = GetDlgItem(hDlg,
@ -859,8 +859,6 @@ UpdateGeneralIcons(HWND hDlg)
DeleteObject(hFolderIcon); DeleteObject(hFolderIcon);
if(hClickIcon) if(hClickIcon)
DeleteObject(hClickIcon); DeleteObject(hClickIcon);
return;
} }
INT_PTR INT_PTR
@ -877,7 +875,6 @@ FolderOptionsGeneralDlg(
case WM_INITDIALOG: case WM_INITDIALOG:
// FIXME // FIXME
break; break;
case WM_COMMAND: case WM_COMMAND:
switch (LOWORD(wParam)) switch (LOWORD(wParam))
{ {
@ -897,7 +894,6 @@ FolderOptionsGeneralDlg(
break; break;
} }
break; break;
case WM_NOTIFY: case WM_NOTIFY:
{ {
LPNMHDR pnmh = (LPNMHDR)lParam; LPNMHDR pnmh = (LPNMHDR)lParam;
@ -912,12 +908,10 @@ FolderOptionsGeneralDlg(
} }
break; break;
} }
case WM_DESTROY: case WM_DESTROY:
break; break;
default:
default: return FALSE;
return FALSE;
} }
return FALSE; return FALSE;
} }
@ -1168,7 +1162,7 @@ static BOOL CALLBACK RefreshBrowsersCallback (HWND hWnd, LPARAM msg)
WCHAR ClassName[100]; WCHAR ClassName[100];
if (GetClassName(hWnd, ClassName, 100)) if (GetClassName(hWnd, ClassName, 100))
{ {
if (!wcscmp(ClassName, L"Progman") || if (!wcscmp(ClassName, L"Progman") ||
!wcscmp(ClassName, L"CabinetWClass") || !wcscmp(ClassName, L"CabinetWClass") ||
!wcscmp(ClassName, L"ExploreWClass")) !wcscmp(ClassName, L"ExploreWClass"))
{ {
@ -1236,7 +1230,7 @@ ViewDlg_Apply(HWND hwndDlg)
// notify all // notify all
SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0, 0); SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0, 0);
EnumWindows(RefreshBrowsersCallback, NULL); EnumWindows(RefreshBrowsersCallback, NULL);
} }
@ -1951,7 +1945,6 @@ FolderOptionsFileTypesDlg(
if (pItem == NULL || (pItem->EditFlags & 0x00000010)) // FTA_NoRemove if (pItem == NULL || (pItem->EditFlags & 0x00000010)) // FTA_NoRemove
EnableWindow(GetDlgItem(hwndDlg, IDC_FILETYPES_DELETE), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_FILETYPES_DELETE), FALSE);
return TRUE; return TRUE;
case WM_COMMAND: case WM_COMMAND:
switch(LOWORD(wParam)) switch(LOWORD(wParam))
{ {
@ -1984,7 +1977,6 @@ FolderOptionsFileTypesDlg(
break; break;
} }
break; break;
case WM_NOTIFY: case WM_NOTIFY:
lppl = (LPNMLISTVIEW) lParam; lppl = (LPNMLISTVIEW) lParam;
@ -2065,8 +2057,8 @@ ShowFolderOptionsDialog(HWND hWnd, HINSTANCE hInst)
hppages[num_pages++] = hpage; hppages[num_pages++] = hpage;
szOptions[0] = L'\0'; szOptions[0] = L'\0';
LoadStringW(shell32_hInstance, IDS_FOLDER_OPTIONS, szOptions, sizeof(szOptions) / sizeof(WCHAR)); LoadStringW(shell32_hInstance, IDS_FOLDER_OPTIONS, szOptions, _countof(szOptions));
szOptions[(sizeof(szOptions)/sizeof(WCHAR))-1] = L'\0'; szOptions[_countof(szOptions) - 1] = L'\0';
memset(&pinfo, 0x0, sizeof(PROPSHEETHEADERW)); memset(&pinfo, 0x0, sizeof(PROPSHEETHEADERW));
pinfo.dwSize = sizeof(PROPSHEETHEADERW); pinfo.dwSize = sizeof(PROPSHEETHEADERW);
@ -2089,7 +2081,7 @@ Options_RunDLLCommon(HWND hWnd, HINSTANCE hInst, int fOptions, DWORD nCmdShow)
break; break;
case 1: case 1:
// show taskbar options dialog // show taskbar options dialog
FIXME("notify explorer to show taskbar options dialog"); FIXME("notify explorer to show taskbar options dlg\n");
//PostMessage(GetShellWindow(), WM_USER+22, fOptions, 0); //PostMessage(GetShellWindow(), WM_USER+22, fOptions, 0);
break; break;
default: default:
@ -2100,7 +2092,8 @@ Options_RunDLLCommon(HWND hWnd, HINSTANCE hInst, int fOptions, DWORD nCmdShow)
/************************************************************************* /*************************************************************************
* Options_RunDLL (SHELL32.@) * Options_RunDLL (SHELL32.@)
*/ */
EXTERN_C VOID WINAPI Options_RunDLL(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow) EXTERN_C VOID WINAPI
Options_RunDLL(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow)
{ {
Options_RunDLLCommon(hWnd, hInst, StrToIntA(cmd), nCmdShow); Options_RunDLLCommon(hWnd, hInst, StrToIntA(cmd), nCmdShow);
} }
@ -2108,7 +2101,8 @@ EXTERN_C VOID WINAPI Options_RunDLL(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWOR
/************************************************************************* /*************************************************************************
* Options_RunDLLA (SHELL32.@) * Options_RunDLLA (SHELL32.@)
*/ */
EXTERN_C VOID WINAPI Options_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow) EXTERN_C VOID WINAPI
Options_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow)
{ {
Options_RunDLLCommon(hWnd, hInst, StrToIntA(cmd), nCmdShow); Options_RunDLLCommon(hWnd, hInst, StrToIntA(cmd), nCmdShow);
} }
@ -2116,7 +2110,8 @@ EXTERN_C VOID WINAPI Options_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWO
/************************************************************************* /*************************************************************************
* Options_RunDLLW (SHELL32.@) * Options_RunDLLW (SHELL32.@)
*/ */
EXTERN_C VOID WINAPI Options_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow) EXTERN_C VOID WINAPI
Options_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
{ {
Options_RunDLLCommon(hWnd, hInst, StrToIntW(cmd), nCmdShow); Options_RunDLLCommon(hWnd, hInst, StrToIntW(cmd), nCmdShow);
} }

View file

@ -46,7 +46,6 @@ static void toggleNukeOnDeleteOption(HWND hwndDlg, BOOL bEnable)
} }
} }
static VOID static VOID
InitializeRecycleBinDlg(HWND hwndDlg, WCHAR DefaultDrive) InitializeRecycleBinDlg(HWND hwndDlg, WCHAR DefaultDrive)
{ {
@ -70,12 +69,12 @@ InitializeRecycleBinDlg(HWND hwndDlg, WCHAR DefaultDrive)
hDlgCtrl = GetDlgItem(hwndDlg, 14000); hDlgCtrl = GetDlgItem(hwndDlg, 14000);
if (!LoadStringW(shell32_hInstance, IDS_RECYCLEBIN_LOCATION, szVolume, sizeof(szVolume) / sizeof(WCHAR))) if (!LoadStringW(shell32_hInstance, IDS_RECYCLEBIN_LOCATION, szVolume, _countof(szVolume)))
szVolume[0] = 0; szVolume[0] = 0;
GetClientRect(hDlgCtrl, &rect); GetClientRect(hDlgCtrl, &rect);
memset(&lc, 0, sizeof(LV_COLUMN) ); memset(&lc, 0, sizeof(lc));
lc.mask = LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM | LVCF_FMT; lc.mask = LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM | LVCF_FMT;
columnSize = 140; //FIXME columnSize = 140; //FIXME
@ -86,7 +85,7 @@ InitializeRecycleBinDlg(HWND hwndDlg, WCHAR DefaultDrive)
lc.pszText = szVolume; lc.pszText = szVolume;
(void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, 0, (LPARAM)&lc); (void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, 0, (LPARAM)&lc);
if (!LoadStringW(shell32_hInstance, IDS_RECYCLEBIN_DISKSPACE, szVolume, sizeof(szVolume) / sizeof(WCHAR))) if (!LoadStringW(shell32_hInstance, IDS_RECYCLEBIN_DISKSPACE, szVolume, _countof(szVolume)))
szVolume[0] = 0; szVolume[0] = 0;
lc.iSubItem = 1; lc.iSubItem = 1;
@ -99,29 +98,28 @@ InitializeRecycleBinDlg(HWND hwndDlg, WCHAR DefaultDrive)
itemCount = 0; itemCount = 0;
do do
{ {
if ((dwDrives & 0x1)) if (dwDrives & 0x1)
{ {
UINT Type = GetDriveTypeW(szDrive); UINT Type = GetDriveTypeW(szDrive);
if (Type == DRIVE_FIXED) //FIXME if (Type == DRIVE_FIXED) //FIXME
{ {
if (!GetVolumeInformationW(szDrive, szName, sizeof(szName) / sizeof(WCHAR), &dwSerial, &MaxComponent, &Flags, NULL, 0)) if (!GetVolumeInformationW(szDrive, szName, _countof(szName), &dwSerial, &MaxComponent, &Flags, NULL, 0))
{ {
szName[0] = 0; szName[0] = 0;
dwSerial = -1; dwSerial = -1;
} }
swprintf(szVolume, L"%s (%c:)", szName, szDrive[0]); swprintf(szVolume, L"%s (%c:)", szName, szDrive[0]);
memset(&li, 0x0, sizeof(LVITEMW)); memset(&li, 0x0, sizeof(li));
li.mask = LVIF_TEXT | LVIF_PARAM; li.mask = LVIF_TEXT | LVIF_PARAM;
li.iSubItem = 0; li.iSubItem = 0;
li.pszText = szVolume; li.pszText = szVolume;
li.iItem = itemCount; li.iItem = itemCount;
SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&li); SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&li);
if (GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailable , &TotalNumberOfBytes, &TotalNumberOfFreeBytes)) if (GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes))
{ {
if (StrFormatByteSizeW(TotalNumberOfFreeBytes.QuadPart, szVolume, sizeof(szVolume) / sizeof(WCHAR))) if (StrFormatByteSizeW(TotalNumberOfFreeBytes.QuadPart, szVolume, _countof(szVolume)))
{ {
pItem = (DRIVE_ITEM_CONTEXT *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DRIVE_ITEM_CONTEXT)); pItem = (DRIVE_ITEM_CONTEXT *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DRIVE_ITEM_CONTEXT));
if (pItem) if (pItem)
{ {
@ -167,11 +165,10 @@ InitializeRecycleBinDlg(HWND hwndDlg, WCHAR DefaultDrive)
} }
ZeroMemory(&li, sizeof(li)); ZeroMemory(&li, sizeof(li));
li.mask = LVIF_STATE; li.mask = LVIF_STATE;
li.stateMask = (UINT) - 1; li.stateMask = (UINT)-1;
li.state = LVIS_FOCUSED | LVIS_SELECTED; li.state = LVIS_FOCUSED | LVIS_SELECTED;
li.iItem = defIndex; li.iItem = defIndex;
(void)SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li); (void)SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
} }
static BOOL StoreDriveSettings(HWND hwndDlg) static BOOL StoreDriveSettings(HWND hwndDlg)
@ -184,7 +181,6 @@ static BOOL StoreDriveSettings(HWND hwndDlg)
WCHAR szSerial[20]; WCHAR szSerial[20];
DWORD dwSize; DWORD dwSize;
if (RegCreateKeyExW(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Bitbucket\\Volume", 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS) if (RegCreateKeyExW(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Bitbucket\\Volume", 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS)
return FALSE; return FALSE;
@ -212,7 +208,6 @@ static BOOL StoreDriveSettings(HWND hwndDlg)
} }
RegCloseKey(hKey); RegCloseKey(hKey);
return TRUE; return TRUE;
} }
static VOID FreeDriveItemContext(HWND hwndDlg) static VOID FreeDriveItemContext(HWND hwndDlg)
@ -231,13 +226,13 @@ static VOID FreeDriveItemContext(HWND hwndDlg)
li.iItem = iIndex; li.iItem = iIndex;
if (SendMessageW(hDlgCtrl, LVM_GETITEMW, 0, (LPARAM)&li)) if (SendMessageW(hDlgCtrl, LVM_GETITEMW, 0, (LPARAM)&li))
{ {
HeapFree(GetProcessHeap(), 0, (LPVOID)li.lParam); HeapFree(GetProcessHeap(), 0, (PVOID)li.lParam);
} }
} }
} }
static INT static INT
GetDefaultItem(HWND hwndDlg, LVITEMW * li) GetDefaultItem(HWND hwndDlg, LVITEMW* li)
{ {
HWND hDlgCtrl; HWND hDlgCtrl;
UINT iItemCount, iIndex; UINT iItemCount, iIndex;
@ -252,7 +247,7 @@ GetDefaultItem(HWND hwndDlg, LVITEMW * li)
ZeroMemory(li, sizeof(LVITEMW)); ZeroMemory(li, sizeof(LVITEMW));
li->mask = LVIF_PARAM | LVIF_STATE; li->mask = LVIF_PARAM | LVIF_STATE;
li->stateMask = (UINT) - 1; li->stateMask = (UINT)-1;
for (iIndex = 0; iIndex < iItemCount; iIndex++) for (iIndex = 0; iIndex < iItemCount; iIndex++)
{ {
li->iItem = iIndex; li->iItem = iIndex;
@ -263,7 +258,6 @@ GetDefaultItem(HWND hwndDlg, LVITEMW * li)
} }
} }
return -1; return -1;
} }
static INT_PTR CALLBACK static INT_PTR CALLBACK
@ -271,8 +265,7 @@ RecycleBinDlg(
HWND hwndDlg, HWND hwndDlg,
UINT uMsg, UINT uMsg,
WPARAM wParam, WPARAM wParam,
LPARAM lParam LPARAM lParam)
)
{ {
LPPSHNOTIFY lppsn; LPPSHNOTIFY lppsn;
LPNMLISTVIEW lppl; LPNMLISTVIEW lppl;
@ -383,12 +376,10 @@ BOOL SH_ShowRecycleBinProperties(WCHAR sDrive)
HPROPSHEETPAGE hpsp[1]; HPROPSHEETPAGE hpsp[1];
PROPSHEETHEADERW psh; PROPSHEETHEADERW psh;
HPROPSHEETPAGE hprop; HPROPSHEETPAGE hprop;
BOOL ret; BOOL ret;
ZeroMemory(&psh, sizeof(psh));
ZeroMemory(&psh, sizeof(PROPSHEETHEADERW)); psh.dwSize = sizeof(psh);
psh.dwSize = sizeof(PROPSHEETHEADERW);
psh.dwFlags = PSP_DEFAULT | PSH_PROPTITLE; psh.dwFlags = PSP_DEFAULT | PSH_PROPTITLE;
psh.pszCaption = MAKEINTRESOURCEW(IDS_RECYCLEBIN_FOLDER_NAME); psh.pszCaption = MAKEINTRESOURCEW(IDS_RECYCLEBIN_FOLDER_NAME);
psh.hwndParent = NULL; psh.hwndParent = NULL;
@ -404,10 +395,6 @@ BOOL SH_ShowRecycleBinProperties(WCHAR sDrive)
hpsp[psh.nPages] = hprop; hpsp[psh.nPages] = hprop;
psh.nPages++; psh.nPages++;
ret = PropertySheetW(&psh); ret = PropertySheetW(&psh);
if (ret < 0) return (ret >= 0);
return FALSE;
else
return TRUE;
} }

View file

@ -67,8 +67,6 @@ HRESULT CFSDropTarget::_CopyItems(IShellFolder * pSFFrom, UINT cidl,
//Double NULL terminate. //Double NULL terminate.
wszTargetPath[wcslen(wszTargetPath) + 1] = '\0'; wszTargetPath[wcslen(wszTargetPath) + 1] = '\0';
TRACE ("(%p)->(%p,%u,%p)\n", this, pSFFrom, cidl, apidl);
STRRET strretFrom; STRRET strretFrom;
hr = pSFFrom->GetDisplayNameOf(NULL, SHGDN_FORPARSING, &strretFrom); hr = pSFFrom->GetDisplayNameOf(NULL, SHGDN_FORPARSING, &strretFrom);
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
@ -446,7 +444,7 @@ HRESULT CFSDropTarget::_DoDrop(IDataObject *pDataObject,
if (SUCCEEDED(pDataObject->QueryGetData(&fmt))) if (SUCCEEDED(pDataObject->QueryGetData(&fmt)))
{ {
hr = pDataObject->GetData(&fmt, &medium); hr = pDataObject->GetData(&fmt, &medium);
TRACE("CFSTR_SHELLIDLIST.\n"); TRACE("CFSTR_SHELLIDLIST\n");
/* lock the handle */ /* lock the handle */
LPIDA lpcida = (LPIDA)GlobalLock(medium.hGlobal); LPIDA lpcida = (LPIDA)GlobalLock(medium.hGlobal);
@ -500,33 +498,26 @@ HRESULT CFSDropTarget::_DoDrop(IDataObject *pDataObject,
if (bLinking) if (bLinking)
{ {
WCHAR wszTargetPath[MAX_PATH];
WCHAR wszPath[MAX_PATH]; WCHAR wszPath[MAX_PATH];
WCHAR wszTarget[MAX_PATH]; WCHAR wszTarget[MAX_PATH];
wcscpy(wszTargetPath, m_sPathTarget); TRACE("target path = %s\n", debugstr_w(m_sPathTarget));
TRACE("target path = %s", debugstr_w(wszTargetPath));
/* We need to create a link for each pidl in the copied items, so step through the pidls from the clipboard */ /* We need to create a link for each pidl in the copied items, so step through the pidls from the clipboard */
for (UINT i = 0; i < lpcida->cidl; i++) for (UINT i = 0; i < lpcida->cidl; i++)
{ {
//Find out which file we're copying //Find out which file we're linking
STRRET strFile; STRRET strFile;
hr = psfFrom->GetDisplayNameOf(apidl[i], SHGDN_FORPARSING, &strFile); hr = psfFrom->GetDisplayNameOf(apidl[i], SHGDN_FORPARSING, &strFile);
if (FAILED(hr)) if (FAILED(hr))
{
ERR("Error source obtaining path");
break; break;
}
hr = StrRetToBufW(&strFile, apidl[i], wszPath, _countof(wszPath)); hr = StrRetToBufW(&strFile, apidl[i], wszPath, _countof(wszPath));
if (FAILED(hr)) if (FAILED(hr))
{ {
ERR("Error putting source path into buffer"); ERR("Error to put source path into buffer\n");
break; break;
} }
TRACE("source path = %s", debugstr_w(wszPath));
// Creating a buffer to hold the combined path // Creating a buffer to hold the combined path
WCHAR buffer_1[MAX_PATH] = L""; WCHAR buffer_1[MAX_PATH] = L"";
@ -544,20 +535,20 @@ HRESULT CFSDropTarget::_DoDrop(IDataObject *pDataObject,
//It's a link so, we create a new one which copies the old. //It's a link so, we create a new one which copies the old.
if(!_GetUniqueFileName(placementPath, pwszExt, wszTarget, TRUE)) if(!_GetUniqueFileName(placementPath, pwszExt, wszTarget, TRUE))
{ {
ERR("Error getting unique file name"); ERR("Error to get unique filename\n");
hr = E_FAIL; hr = E_FAIL;
break; break;
} }
hr = IShellLink_ConstructFromPath(wszPath, IID_PPV_ARG(IPersistFile, &ppf)); hr = IShellLink_ConstructFromPath(wszPath, IID_PPV_ARG(IPersistFile, &ppf));
if (FAILED(hr)) { if (FAILED(hr)) {
ERR("Error constructing link from file"); ERR("Error constructing link from file\n");
break; break;
} }
hr = ppf->Save(wszTarget, FALSE); hr = ppf->Save(wszTarget, FALSE);
if (FAILED(hr)) if (FAILED(hr))
break; break;
SHChangeNotify(SHCNE_CREATE, SHCNF_PATHW, wszTarget, NULL); SHChangeNotify(SHCNE_CREATE, SHCNF_PATHW, wszTarget, NULL);
} }
else else
{ {
@ -565,7 +556,7 @@ HRESULT CFSDropTarget::_DoDrop(IDataObject *pDataObject,
//Create a file name for the link //Create a file name for the link
if (!_GetUniqueFileName(placementPath, L".lnk", wszTarget, TRUE)) if (!_GetUniqueFileName(placementPath, L".lnk", wszTarget, TRUE))
{ {
ERR("Error creating unique file name"); ERR("Error creating unique filename\n");
hr = E_FAIL; hr = E_FAIL;
break; break;
} }
@ -573,7 +564,7 @@ HRESULT CFSDropTarget::_DoDrop(IDataObject *pDataObject,
CComPtr<IShellLinkW> pLink; CComPtr<IShellLinkW> pLink;
hr = CShellLink::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IShellLinkW, &pLink)); hr = CShellLink::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IShellLinkW, &pLink));
if (FAILED(hr)) { if (FAILED(hr)) {
ERR("Error instantiating IShellLinkW"); ERR("Error instantiating IShellLinkW\n");
break; break;
} }
@ -594,9 +585,9 @@ HRESULT CFSDropTarget::_DoDrop(IDataObject *pDataObject,
break; break;
hr = ppf->Save(wszTarget, TRUE); hr = ppf->Save(wszTarget, TRUE);
if (FAILED(hr)) if (FAILED(hr))
break; break;
SHChangeNotify(SHCNE_CREATE, SHCNF_PATHW, wszTarget, NULL); SHChangeNotify(SHCNE_CREATE, SHCNF_PATHW, wszTarget, NULL);
} }
} }
} }
@ -646,7 +637,7 @@ HRESULT CFSDropTarget::_DoDrop(IDataObject *pDataObject,
} }
else else
{ {
ERR("No viable drop format.\n"); ERR("No viable drop format\n");
hr = E_FAIL; hr = E_FAIL;
} }
return hr; return hr;

View file

@ -149,7 +149,7 @@ class CRecyclerDropTarget :
TRACE("(%p)->(DataObject=%p)\n", this, pDataObject); TRACE("(%p)->(DataObject=%p)\n", this, pDataObject);
InitFormatEtc (fmt, cfShellIDList, TYMED_HGLOBAL); InitFormatEtc (fmt, cfShellIDList, TYMED_HGLOBAL);
/* Handle cfShellIDList Drop objects here, otherwise send the approriate message to other software */ /* Handle cfShellIDList Drop objects here, otherwise send the appropriate message to other software */
if (SUCCEEDED(pDataObject->QueryGetData(&fmt))) if (SUCCEEDED(pDataObject->QueryGetData(&fmt)))
{ {
DWORD fMask = 0; DWORD fMask = 0;

View file

@ -55,7 +55,7 @@ HRESULT WINAPI CExeDropHandler::DragLeave()
HRESULT WINAPI CExeDropHandler::Drop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) HRESULT WINAPI CExeDropHandler::Drop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect)
{ {
TRACE ("(%p)\n", this); TRACE ("(%p)\n", this);
FORMATETC fmt; FORMATETC fmt;
STGMEDIUM medium; STGMEDIUM medium;
LPWSTR pszSrcList; LPWSTR pszSrcList;
@ -78,7 +78,7 @@ HRESULT WINAPI CExeDropHandler::Drop(IDataObject *pDataObject, DWORD dwKeyState,
StringCchPrintfExW(pszEnd, cchRemaining, &pszEnd, &cchRemaining, 0, L"\"%ls\" ", pszSrcList); StringCchPrintfExW(pszEnd, cchRemaining, &pszEnd, &cchRemaining, 0, L"\"%ls\" ", pszSrcList);
else else
StringCchPrintfExW(pszEnd, cchRemaining, &pszEnd, &cchRemaining, 0, L"%ls ", pszSrcList); StringCchPrintfExW(pszEnd, cchRemaining, &pszEnd, &cchRemaining, 0, L"%ls ", pszSrcList);
pszSrcList += wcslen(pszSrcList) + 1; pszSrcList += wcslen(pszSrcList) + 1;
} }
} }

View file

@ -68,9 +68,9 @@ HRESULT WINAPI CAdminToolsFolder::CreateViewObject(HWND hwndOwner, REFIID riid,
HRESULT WINAPI CAdminToolsFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) HRESULT WINAPI CAdminToolsFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
{ {
static const DWORD dwAdminToolsAttributes = static const DWORD dwAdminToolsAttributes =
SFGAO_STORAGE | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSANCESTOR | SFGAO_STORAGE | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSANCESTOR |
SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER; SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER;
if(cidl) if(cidl)
return m_pisfInner->GetAttributesOf(cidl, apidl, rgfInOut); return m_pisfInner->GetAttributesOf(cidl, apidl, rgfInOut);
@ -174,7 +174,7 @@ HRESULT WINAPI CAdminToolsFolder::Initialize(LPCITEMIDLIST pidl)
if (!m_pidlInner) if (!m_pidlInner)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
return SHELL32_CoCreateInitSF(m_pidlInner, return SHELL32_CoCreateInitSF(m_pidlInner,
&CLSID_ShellFSFolder, &CLSID_ShellFSFolder,
CSIDL_COMMON_ADMINTOOLS, CSIDL_COMMON_ADMINTOOLS,
IID_PPV_ARG(IShellFolder2, &m_pisfInner)); IID_PPV_ARG(IShellFolder2, &m_pisfInner));

View file

@ -155,9 +155,9 @@ BOOL CControlPanelEnum::RegisterCPanelApp(LPCWSTR wpath)
else else
iconIdx = 0; iconIdx = 0;
LPITEMIDLIST pidl = _ILCreateCPanelApplet(wpath, LPITEMIDLIST pidl = _ILCreateCPanelApplet(wpath,
applet->info[i].name, applet->info[i].name,
applet->info[i].info, applet->info[i].info,
iconIdx); iconIdx);
if (pidl) if (pidl)
@ -328,7 +328,7 @@ HRESULT WINAPI CControlPanelFolder::CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE
return E_INVALIDARG; return E_INVALIDARG;
int result; int result;
switch(LOWORD(lParam)) switch(LOWORD(lParam))
{ {
case 0: /* name */ case 0: /* name */
result = wcsicmp(pData1->szName + pData1->offsDispName, pData2->szName + pData2->offsDispName); result = wcsicmp(pData1->szName + pData1->offsDispName, pData2->szName + pData2->offsDispName);
@ -406,7 +406,7 @@ HRESULT WINAPI CControlPanelFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_A
else if (_ILIsSpecialFolder(*apidl)) else if (_ILIsSpecialFolder(*apidl))
m_regFolder->GetAttributesOf(1, apidl, rgfInOut); m_regFolder->GetAttributesOf(1, apidl, rgfInOut);
else else
ERR("Got an unkown pidl here!\n"); ERR("Got unknown pidl\n");
apidl++; apidl++;
cidl--; cidl--;
} }
@ -443,7 +443,6 @@ HRESULT WINAPI CControlPanelFolder::GetUIObjectOf(HWND hwndOwner,
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID(riid, IID_IContextMenu) && (cidl >= 1)) { if (IsEqualIID(riid, IID_IContextMenu) && (cidl >= 1)) {
/* HACK: We should use callbacks from CDefaultContextMenu instead of creating one on our own */ /* HACK: We should use callbacks from CDefaultContextMenu instead of creating one on our own */
BOOL bHasCpl = FALSE; BOOL bHasCpl = FALSE;
for (UINT i = 0; i < cidl; i++) for (UINT i = 0; i < cidl; i++)
@ -560,7 +559,7 @@ HRESULT WINAPI CControlPanelFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iCol
if (!psd || iColumn >= CONROLPANELSHELLVIEWCOLUMNS) if (!psd || iColumn >= CONROLPANELSHELLVIEWCOLUMNS)
return E_INVALIDARG; return E_INVALIDARG;
if (!pidl) if (!pidl)
{ {
psd->fmt = ControlPanelSFHeader[iColumn].fmt; psd->fmt = ControlPanelSFHeader[iColumn].fmt;
psd->cxChar = ControlPanelSFHeader[iColumn].cxChar; psd->cxChar = ControlPanelSFHeader[iColumn].cxChar;
@ -570,14 +569,14 @@ HRESULT WINAPI CControlPanelFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iCol
{ {
return m_regFolder->GetDetailsOf(pidl, iColumn, psd); return m_regFolder->GetDetailsOf(pidl, iColumn, psd);
} }
else else
{ {
PIDLCPanelStruct *pCPanel = _ILGetCPanelPointer(pidl); PIDLCPanelStruct *pCPanel = _ILGetCPanelPointer(pidl);
if (!pCPanel) if (!pCPanel)
return E_FAIL; return E_FAIL;
switch(iColumn) switch(iColumn)
{ {
case 0: /* name */ case 0: /* name */
return SHSetStrRet(&psd->str, pCPanel->szName + pCPanel->offsDispName); return SHSetStrRet(&psd->str, pCPanel->szName + pCPanel->offsDispName);
@ -626,7 +625,7 @@ HRESULT WINAPI CControlPanelFolder::Initialize(LPCITEMIDLIST pidl)
static const WCHAR* pszCPanelPath = L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"; static const WCHAR* pszCPanelPath = L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}";
hr = CRegFolder_CreateInstance(&CLSID_ControlPanel, hr = CRegFolder_CreateInstance(&CLSID_ControlPanel,
pidlRoot, pidlRoot,
pszCPanelPath, pszCPanelPath,
L"ControlPanel", L"ControlPanel",
IID_PPV_ARG(IShellFolder2, &m_regFolder)); IID_PPV_ARG(IShellFolder2, &m_regFolder));
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))

View file

@ -211,7 +211,7 @@ HRESULT WINAPI CDesktopFolder::FinalConstruct()
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
/* Create the inner fs folder */ /* Create the inner fs folder */
hr = SHELL32_CoCreateInitSF(pidlRoot, hr = SHELL32_CoCreateInitSF(pidlRoot,
&CLSID_ShellFSFolder, &CLSID_ShellFSFolder,
CSIDL_DESKTOPDIRECTORY, CSIDL_DESKTOPDIRECTORY,
IID_PPV_ARG(IShellFolder2, &m_DesktopFSFolder)); IID_PPV_ARG(IShellFolder2, &m_DesktopFSFolder));
@ -219,7 +219,7 @@ HRESULT WINAPI CDesktopFolder::FinalConstruct()
return hr; return hr;
/* Create the inner shared fs folder. Dont fail on failure. */ /* Create the inner shared fs folder. Dont fail on failure. */
hr = SHELL32_CoCreateInitSF(pidlRoot, hr = SHELL32_CoCreateInitSF(pidlRoot,
&CLSID_ShellFSFolder, &CLSID_ShellFSFolder,
CSIDL_COMMON_DESKTOPDIRECTORY, CSIDL_COMMON_DESKTOPDIRECTORY,
IID_PPV_ARG(IShellFolder2, &m_SharedDesktopFSFolder)); IID_PPV_ARG(IShellFolder2, &m_SharedDesktopFSFolder));
@ -229,7 +229,7 @@ HRESULT WINAPI CDesktopFolder::FinalConstruct()
/* Create the inner reg folder */ /* Create the inner reg folder */
hr = CRegFolder_CreateInstance(&CLSID_ShellDesktop, hr = CRegFolder_CreateInstance(&CLSID_ShellDesktop,
pidlRoot, pidlRoot,
L"", L"",
L"Desktop", L"Desktop",
IID_PPV_ARG(IShellFolder2, &m_regFolder)); IID_PPV_ARG(IShellFolder2, &m_regFolder));
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
@ -829,7 +829,7 @@ HRESULT WINAPI CDesktopFolder::GetCurFolder(LPITEMIDLIST * pidl)
{ {
TRACE ("(%p)->(%p)\n", this, pidl); TRACE ("(%p)->(%p)\n", this, pidl);
if (!pidl) if (!pidl)
return E_INVALIDARG; /* xp doesn't have this check and crashes on NULL */ return E_INVALIDARG; /* xp doesn't have this check and crashes on NULL */
*pidl = ILClone (pidlRoot); *pidl = ILClone (pidlRoot);
return S_OK; return S_OK;

View file

@ -23,7 +23,7 @@
#include <precomp.h> #include <precomp.h>
WINE_DEFAULT_DEBUG_CHANNEL (shell); WINE_DEFAULT_DEBUG_CHANNEL(shell);
/* /*
CDrivesFolder should create a CRegFolder to represent the virtual items that exist only in CDrivesFolder should create a CRegFolder to represent the virtual items that exist only in
@ -387,7 +387,7 @@ CDrivesFolder::CDrivesFolder()
CDrivesFolder::~CDrivesFolder() CDrivesFolder::~CDrivesFolder()
{ {
TRACE ("-- destroying IShellFolder(%p)\n", this); TRACE("-- destroying IShellFolder(%p)\n", this);
SHFree(pidlRoot); SHFree(pidlRoot);
} }
@ -397,9 +397,9 @@ HRESULT WINAPI CDrivesFolder::FinalConstruct()
if (pidlRoot == NULL) if (pidlRoot == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
HRESULT hr = CRegFolder_CreateInstance(&CLSID_MyComputer, HRESULT hr = CRegFolder_CreateInstance(&CLSID_MyComputer,
pidlRoot, pidlRoot,
L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
L"MyComputer", L"MyComputer",
IID_PPV_ARG(IShellFolder2, &m_regFolder)); IID_PPV_ARG(IShellFolder2, &m_regFolder));
@ -455,13 +455,13 @@ HRESULT WINAPI CDrivesFolder::ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLEST
else if (_ILIsSpecialFolder(pidlTemp)) else if (_ILIsSpecialFolder(pidlTemp))
m_regFolder->GetAttributesOf(1, &pidlTemp, pdwAttributes); m_regFolder->GetAttributesOf(1, &pidlTemp, pdwAttributes);
else else
ERR("Got an unkown pidl here!\n"); ERR("Got unknown pidl\n");
} }
} }
*ppidl = pidlTemp; *ppidl = pidlTemp;
TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr); TRACE("(%p)->(-- ret=0x%08x)\n", this, hr);
return hr; return hr;
} }
@ -489,7 +489,7 @@ HRESULT WINAPI CDrivesFolder::BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcRese
return m_regFolder->BindToObject(pidl, pbcReserved, riid, ppvOut); return m_regFolder->BindToObject(pidl, pbcReserved, riid, ppvOut);
CHAR* pchDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName; CHAR* pchDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
PERSIST_FOLDER_TARGET_INFO pfti = {0}; PERSIST_FOLDER_TARGET_INFO pfti = {0};
pfti.dwAttributes = -1; pfti.dwAttributes = -1;
pfti.csidl = -1; pfti.csidl = -1;
@ -545,7 +545,7 @@ HRESULT WINAPI CDrivesFolder::CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1
CHAR* pszDrive2 = _ILGetDataPointer(pidl2)->u.drive.szDriveName; CHAR* pszDrive2 = _ILGetDataPointer(pidl2)->u.drive.szDriveName;
int result; int result;
switch(LOWORD(lParam)) switch(LOWORD(lParam))
{ {
case 0: /* name */ case 0: /* name */
{ {
@ -639,7 +639,7 @@ HRESULT WINAPI CDrivesFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVO
SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this}; SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut); hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
} }
TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut); TRACE("-- (%p)->(interface=%p)\n", this, ppvOut);
return hr; return hr;
} }
@ -659,8 +659,8 @@ static BOOL _ILIsControlPanel(LPCITEMIDLIST pidl)
*/ */
HRESULT WINAPI CDrivesFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD * rgfInOut) HRESULT WINAPI CDrivesFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD * rgfInOut)
{ {
TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0); this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
if (cidl && !apidl) if (cidl && !apidl)
return E_INVALIDARG; return E_INVALIDARG;
@ -689,7 +689,7 @@ HRESULT WINAPI CDrivesFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY a
/* make sure SFGAO_VALIDATE is cleared, some apps depend on that */ /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
*rgfInOut &= ~SFGAO_VALIDATE; *rgfInOut &= ~SFGAO_VALIDATE;
TRACE ("-- result=0x%08x\n", *rgfInOut); TRACE("-- result=0x%08x\n", *rgfInOut);
return S_OK; return S_OK;
} }
@ -729,8 +729,8 @@ HRESULT WINAPI CDrivesFolder::GetUIObjectOf(HWND hwndOwner,
} }
else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1)) else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
{ {
hr = IDataObject_Constructor (hwndOwner, hr = IDataObject_Constructor(hwndOwner,
pidlRoot, apidl, cidl, (IDataObject **)&pObj); pidlRoot, apidl, cidl, (IDataObject **)&pObj);
} }
else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1)) else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
{ {
@ -755,7 +755,7 @@ HRESULT WINAPI CDrivesFolder::GetUIObjectOf(HWND hwndOwner,
hr = E_OUTOFMEMORY; hr = E_OUTOFMEMORY;
*ppvOut = pObj; *ppvOut = pObj;
TRACE ("(%p)->hr=0x%08x\n", this, hr); TRACE("(%p)->hr=0x%08x\n", this, hr);
return hr; return hr;
} }
@ -767,7 +767,7 @@ HRESULT WINAPI CDrivesFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFla
LPWSTR pszPath; LPWSTR pszPath;
HRESULT hr = S_OK; HRESULT hr = S_OK;
TRACE ("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet); TRACE("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
pdump (pidl); pdump (pidl);
if (!strRet) if (!strRet)
@ -805,9 +805,9 @@ HRESULT WINAPI CDrivesFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFla
lstrcpynW(wszDrive, pszPath, 4); lstrcpynW(wszDrive, pszPath, 4);
pszPath[0] = L'\0'; pszPath[0] = L'\0';
GetVolumeInformationW(wszDrive, pszPath, GetVolumeInformationW(wszDrive, pszPath,
MAX_PATH - 7, MAX_PATH - 7,
&dwVolumeSerialNumber, &dwVolumeSerialNumber,
&dwMaximumComponentLength, &dwFileSystemFlags, NULL, 0); &dwMaximumComponentLength, &dwFileSystemFlags, NULL, 0);
pszPath[MAX_PATH-1] = L'\0'; pszPath[MAX_PATH-1] = L'\0';
if (!wcslen(pszPath)) if (!wcslen(pszPath))
{ {
@ -834,10 +834,10 @@ HRESULT WINAPI CDrivesFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFla
pszPath[MAX_PATH-7] = L'\0'; pszPath[MAX_PATH-7] = L'\0';
} }
} }
wcscat (pszPath, wszOpenBracket); wcscat(pszPath, wszOpenBracket);
wszDrive[2] = L'\0'; wszDrive[2] = L'\0';
wcscat (pszPath, wszDrive); wcscat(pszPath, wszDrive);
wcscat (pszPath, wszCloseBracket); wcscat(pszPath, wszCloseBracket);
} }
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
@ -883,19 +883,19 @@ HRESULT WINAPI CDrivesFolder::SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl,
HRESULT WINAPI CDrivesFolder::GetDefaultSearchGUID(GUID * pguid) HRESULT WINAPI CDrivesFolder::GetDefaultSearchGUID(GUID * pguid)
{ {
FIXME ("(%p)\n", this); FIXME("(%p)\n", this);
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT WINAPI CDrivesFolder::EnumSearches(IEnumExtraSearch ** ppenum) HRESULT WINAPI CDrivesFolder::EnumSearches(IEnumExtraSearch ** ppenum)
{ {
FIXME ("(%p)\n", this); FIXME("(%p)\n", this);
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT WINAPI CDrivesFolder::GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG *pDisplay) HRESULT WINAPI CDrivesFolder::GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
{ {
TRACE ("(%p)\n", this); TRACE("(%p)\n", this);
if (pSort) if (pSort)
*pSort = 0; *pSort = 0;
@ -906,7 +906,7 @@ HRESULT WINAPI CDrivesFolder::GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG
HRESULT WINAPI CDrivesFolder::GetDefaultColumnState(UINT iColumn, DWORD * pcsFlags) HRESULT WINAPI CDrivesFolder::GetDefaultColumnState(UINT iColumn, DWORD * pcsFlags)
{ {
TRACE ("(%p)\n", this); TRACE("(%p)\n", this);
if (!pcsFlags || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS) if (!pcsFlags || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS)
return E_INVALIDARG; return E_INVALIDARG;
@ -916,7 +916,7 @@ HRESULT WINAPI CDrivesFolder::GetDefaultColumnState(UINT iColumn, DWORD * pcsFla
HRESULT WINAPI CDrivesFolder::GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID * pscid, VARIANT * pv) HRESULT WINAPI CDrivesFolder::GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID * pscid, VARIANT * pv)
{ {
FIXME ("(%p)\n", this); FIXME("(%p)\n", this);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -924,7 +924,7 @@ HRESULT WINAPI CDrivesFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, S
{ {
HRESULT hr; HRESULT hr;
TRACE ("(%p)->(%p %i %p)\n", this, pidl, iColumn, psd); TRACE("(%p)->(%p %i %p)\n", this, pidl, iColumn, psd);
if (!psd || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS) if (!psd || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS)
return E_INVALIDARG; return E_INVALIDARG;
@ -989,7 +989,7 @@ HRESULT WINAPI CDrivesFolder::MapColumnToSCID(UINT column, SHCOLUMNID * pscid)
*/ */
HRESULT WINAPI CDrivesFolder::GetClassID(CLSID *lpClassId) HRESULT WINAPI CDrivesFolder::GetClassID(CLSID *lpClassId)
{ {
TRACE ("(%p)\n", this); TRACE("(%p)\n", this);
if (!lpClassId) if (!lpClassId)
return E_POINTER; return E_POINTER;

View file

@ -132,8 +132,9 @@ HRESULT GetCLSIDForFileType(PCUIDLIST_RELATIVE pidl, LPCWSTR KeyName, CLSID* pcl
return GetCLSIDForFileTypeFromExtension(pExtension, KeyName, pclsid); return GetCLSIDForFileTypeFromExtension(pExtension, KeyName, pclsid);
} }
static HRESULT getIconLocationForFolder(IShellFolder * psf, LPCITEMIDLIST pidl, UINT uFlags, static HRESULT
LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags) getIconLocationForFolder(IShellFolder * psf, LPCITEMIDLIST pidl, UINT uFlags,
LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags)
{ {
static const WCHAR shellClassInfo[] = { '.', 'S', 'h', 'e', 'l', 'l', 'C', 'l', 'a', 's', 's', 'I', 'n', 'f', 'o', 0 }; static const WCHAR shellClassInfo[] = { '.', 'S', 'h', 'e', 'l', 'l', 'C', 'l', 'a', 's', 's', 'I', 'n', 'f', 'o', 0 };
static const WCHAR iconFile[] = { 'I', 'c', 'o', 'n', 'F', 'i', 'l', 'e', 0 }; static const WCHAR iconFile[] = { 'I', 'c', 'o', 'n', 'F', 'i', 'l', 'e', 0 };
@ -209,32 +210,32 @@ HRESULT CFSExtractIcon_CreateInstance(IShellFolder * psf, LPCITEMIDLIST pidl, RE
if (_ILIsFolder (pidl)) if (_ILIsFolder (pidl))
{ {
if (SUCCEEDED(getIconLocationForFolder(psf, if (SUCCEEDED(getIconLocationForFolder(psf,
pidl, 0, wTemp, _countof(wTemp), pidl, 0, wTemp, _countof(wTemp),
&icon_idx, &icon_idx,
&flags))) &flags)))
{ {
initIcon->SetNormalIcon(wTemp, icon_idx); initIcon->SetNormalIcon(wTemp, icon_idx);
// FIXME: if/when getIconLocationForFolder does something for // FIXME: if/when getIconLocationForFolder does something for
// GIL_FORSHORTCUT, code below should be uncommented. and // GIL_FORSHORTCUT, code below should be uncommented. and
// the following line removed. // the following line removed.
initIcon->SetShortcutIcon(wTemp, icon_idx); initIcon->SetShortcutIcon(wTemp, icon_idx);
} }
if (SUCCEEDED(getIconLocationForFolder(psf, if (SUCCEEDED(getIconLocationForFolder(psf,
pidl, GIL_DEFAULTICON, wTemp, _countof(wTemp), pidl, GIL_DEFAULTICON, wTemp, _countof(wTemp),
&icon_idx, &icon_idx,
&flags))) &flags)))
{ {
initIcon->SetDefaultIcon(wTemp, icon_idx); initIcon->SetDefaultIcon(wTemp, icon_idx);
} }
// if (SUCCEEDED(getIconLocationForFolder(psf, // if (SUCCEEDED(getIconLocationForFolder(psf,
// pidl, GIL_FORSHORTCUT, wTemp, _countof(wTemp), // pidl, GIL_FORSHORTCUT, wTemp, _countof(wTemp),
// &icon_idx, // &icon_idx,
// &flags))) // &flags)))
// { // {
// initIcon->SetShortcutIcon(wTemp, icon_idx); // initIcon->SetShortcutIcon(wTemp, icon_idx);
// } // }
if (SUCCEEDED(getIconLocationForFolder(psf, if (SUCCEEDED(getIconLocationForFolder(psf,
pidl, GIL_OPENICON, wTemp, _countof(wTemp), pidl, GIL_OPENICON, wTemp, _countof(wTemp),
&icon_idx, &icon_idx,
&flags))) &flags)))
@ -322,7 +323,7 @@ private:
hr = SHELL32_GetCLSIDForDirectory(Tmp, L"CLSID", &clsidFolder); hr = SHELL32_GetCLSIDForDirectory(Tmp, L"CLSID", &clsidFolder);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
ERR("SHOULD DO SOMETHING WITH CLSID?\n"); ERR("Got CLSID override\n");
} }
} }
} }
@ -706,7 +707,7 @@ HRESULT WINAPI CFSFolder::ParseDisplayName(HWND hwndOwner,
if (pidlTemp != NULL) if (pidlTemp != NULL)
{ {
/* We are creating an id list without ensuring that the items exist. /* We are creating an id list without ensuring that the items exist.
If we have a remaining path, this must be a folder. If we have a remaining path, this must be a folder.
We have to do it now because it is set as a file by default */ We have to do it now because it is set as a file by default */
if (szNext) if (szNext)
{ {
@ -898,7 +899,7 @@ HRESULT WINAPI CFSFolder::CompareIDs(LPARAM lParam,
case 2: /* Type */ case 2: /* Type */
pExtension1 = PathFindExtensionW(pDataW1->wszName); pExtension1 = PathFindExtensionW(pDataW1->wszName);
pExtension2 = PathFindExtensionW(pDataW2->wszName); pExtension2 = PathFindExtensionW(pDataW2->wszName);
result = wcsicmp(pExtension1, pExtension2); result = wcsicmp(pExtension1, pExtension2);
break; break;
case 3: /* Size */ case 3: /* Size */
result = pData1->u.file.dwFileSize - pData2->u.file.dwFileSize; result = pData1->u.file.dwFileSize - pData2->u.file.dwFileSize;
@ -1138,7 +1139,7 @@ HRESULT WINAPI CFSFolder::GetUIObjectOf(HWND hwndOwner,
} }
else if (IsEqualIID (riid, IID_IDataObject)) else if (IsEqualIID (riid, IID_IDataObject))
{ {
if (cidl >= 1) if (cidl >= 1)
{ {
hr = IDataObject_Constructor (hwndOwner, pidlRoot, apidl, cidl, (IDataObject **)&pObj); hr = IDataObject_Constructor (hwndOwner, pidlRoot, apidl, cidl, (IDataObject **)&pObj);
} }
@ -1201,7 +1202,7 @@ BOOL SHELL_FS_HideExtension(LPWSTR szPath)
if (!RegCreateKeyExW(HKEY_CURRENT_USER, AdvancedW, 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0)) { if (!RegCreateKeyExW(HKEY_CURRENT_USER, AdvancedW, 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0)) {
if (!RegQueryValueExW(hKey, HideFileExtW, 0, 0, (LPBYTE) &dwData, &dwDataSize)) if (!RegQueryValueExW(hKey, HideFileExtW, 0, 0, (LPBYTE) &dwData, &dwDataSize))
doHide = dwData; doHide = dwData;
RegCloseKey (hKey); RegCloseKey(hKey);
} }
if (!doHide) { if (!doHide) {
@ -1244,7 +1245,6 @@ void SHELL_FS_ProcessDisplayFilename(LPWSTR szPath, DWORD dwFlags)
* FIXME * FIXME
* if the name is in the pidl the ret value should be a STRRET_OFFSET * if the name is in the pidl the ret value should be a STRRET_OFFSET
*/ */
HRESULT WINAPI CFSFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, HRESULT WINAPI CFSFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl,
DWORD dwFlags, LPSTRRET strRet) DWORD dwFlags, LPSTRRET strRet)
{ {
@ -1259,7 +1259,7 @@ HRESULT WINAPI CFSFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl,
else if (pidl && !pidl->mkid.cb) /* empty pidl */ else if (pidl && !pidl->mkid.cb) /* empty pidl */
{ {
/* If it is an empty pidl return only the path of the folder */ /* If it is an empty pidl return only the path of the folder */
if ((GET_SHGDN_FOR(dwFlags) & SHGDN_FORPARSING) && if ((GET_SHGDN_FOR(dwFlags) & SHGDN_FORPARSING) &&
(GET_SHGDN_RELATION(dwFlags) != SHGDN_INFOLDER) && (GET_SHGDN_RELATION(dwFlags) != SHGDN_INFOLDER) &&
sPathTarget) sPathTarget)
{ {
@ -1267,7 +1267,7 @@ HRESULT WINAPI CFSFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl,
} }
return E_INVALIDARG; return E_INVALIDARG;
} }
int len = 0; int len = 0;
LPWSTR pszPath = (LPWSTR)CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR)); LPWSTR pszPath = (LPWSTR)CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
if (!pszPath) if (!pszPath)
@ -1637,7 +1637,7 @@ HRESULT CFSFolder::_CreateExtensionUIObject(PCUIDLIST_RELATIVE pidl, REFIID riid
return S_OK; return S_OK;
} }
HRESULT CFSFolder::_GetDropTarget(LPCITEMIDLIST pidl, LPVOID *ppvOut) HRESULT CFSFolder::_GetDropTarget(LPCITEMIDLIST pidl, LPVOID *ppvOut)
{ {
HRESULT hr; HRESULT hr;
@ -1665,7 +1665,7 @@ HRESULT CFSFolder::_GetDropTarget(LPCITEMIDLIST pidl, LPVOID *ppvOut)
return S_OK; return S_OK;
} }
HRESULT CFSFolder::_GetIconHandler(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut) HRESULT CFSFolder::_GetIconHandler(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
{ {
CLSID clsid; CLSID clsid;
HRESULT hr; HRESULT hr;

View file

@ -34,7 +34,7 @@ class CFSFolder :
public: public:
CFSFolder(); CFSFolder();
~CFSFolder(); ~CFSFolder();
// IShellFolder // IShellFolder
virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes); virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes);
virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList); virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList);

View file

@ -68,9 +68,9 @@ HRESULT WINAPI CFontsFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOI
HRESULT WINAPI CFontsFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) HRESULT WINAPI CFontsFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
{ {
static const DWORD dwFontsAttributes = static const DWORD dwFontsAttributes =
SFGAO_STORAGE | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSANCESTOR | SFGAO_STORAGE | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSANCESTOR |
SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER; SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER;
if(cidl) if(cidl)
return m_pisfInner->GetAttributesOf(cidl, apidl, rgfInOut); return m_pisfInner->GetAttributesOf(cidl, apidl, rgfInOut);

View file

@ -38,14 +38,14 @@ typedef struct
static const columninfo RecycleBinColumns[] = static const columninfo RecycleBinColumns[] =
{ {
{IDS_SHV_COLUMN_NAME, &FMTID_Storage, PID_STG_NAME, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 30}, {IDS_SHV_COLUMN_NAME, &FMTID_Storage, PID_STG_NAME, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 30},
{IDS_SHV_COLUMN_DELFROM, &FMTID_Displaced, PID_DISPLACED_FROM, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 30}, {IDS_SHV_COLUMN_DELFROM, &FMTID_Displaced, PID_DISPLACED_FROM, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 30},
{IDS_SHV_COLUMN_DELDATE, &FMTID_Displaced, PID_DISPLACED_DATE, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 20}, {IDS_SHV_COLUMN_DELDATE, &FMTID_Displaced, PID_DISPLACED_DATE, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 20},
{IDS_SHV_COLUMN_SIZE, &FMTID_Storage, PID_STG_SIZE, SHCOLSTATE_TYPE_INT | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 20}, {IDS_SHV_COLUMN_SIZE, &FMTID_Storage, PID_STG_SIZE, SHCOLSTATE_TYPE_INT | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 20},
{IDS_SHV_COLUMN_TYPE, &FMTID_Storage, PID_STG_STORAGETYPE, SHCOLSTATE_TYPE_INT | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 20}, {IDS_SHV_COLUMN_TYPE, &FMTID_Storage, PID_STG_STORAGETYPE, SHCOLSTATE_TYPE_INT | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 20},
{IDS_SHV_COLUMN_MODIFIED, &FMTID_Storage, PID_STG_WRITETIME, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 20}, {IDS_SHV_COLUMN_MODIFIED, &FMTID_Storage, PID_STG_WRITETIME, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 20},
/* {"creation time", &FMTID_Storage, PID_STG_CREATETIME, SHCOLSTATE_TYPE_DATE, LVCFMT_LEFT, 20}, */ /* {"creation time", &FMTID_Storage, PID_STG_CREATETIME, SHCOLSTATE_TYPE_DATE, LVCFMT_LEFT, 20}, */
/* {"attribs", &FMTID_Storage, PID_STG_ATTRIBUTES, SHCOLSTATE_TYPE_STR, LVCFMT_LEFT, 20}, */ /* {"attribs", &FMTID_Storage, PID_STG_ATTRIBUTES, SHCOLSTATE_TYPE_STR, LVCFMT_LEFT, 20}, */
}; };
#define COLUMN_NAME 0 #define COLUMN_NAME 0
@ -319,30 +319,30 @@ HRESULT WINAPI CRecycleBinItemContextMenu::QueryContextMenu(HMENU hMenu, UINT in
TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n", this, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags); TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n", this, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
if (LoadStringW(shell32_hInstance, IDS_RESTORE, szBuffer, sizeof(szBuffer) / sizeof(WCHAR))) if (LoadStringW(shell32_hInstance, IDS_RESTORE, szBuffer, _countof(szBuffer)))
{ {
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; szBuffer[_countof(szBuffer)-1] = L'\0';
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED); _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED);
Count++; Count++;
} }
if (LoadStringW(shell32_hInstance, IDS_CUT, szBuffer, sizeof(szBuffer) / sizeof(WCHAR))) if (LoadStringW(shell32_hInstance, IDS_CUT, szBuffer, _countof(szBuffer)))
{ {
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED);
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; szBuffer[_countof(szBuffer)-1] = L'\0';
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED); _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED);
} }
if (LoadStringW(shell32_hInstance, IDS_DELETE, szBuffer, sizeof(szBuffer) / sizeof(WCHAR))) if (LoadStringW(shell32_hInstance, IDS_DELETE, szBuffer, _countof(szBuffer)))
{ {
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; szBuffer[_countof(szBuffer)-1] = L'\0';
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED);
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED); _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED);
} }
if (LoadStringW(shell32_hInstance, IDS_PROPERTIES, szBuffer, sizeof(szBuffer) / sizeof(WCHAR))) if (LoadStringW(shell32_hInstance, IDS_PROPERTIES, szBuffer, _countof(szBuffer)))
{ {
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; szBuffer[_countof(szBuffer)-1] = L'\0';
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED);
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_DEFAULT); _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_DEFAULT);
} }
@ -795,7 +795,7 @@ HRESULT WINAPI CRecycleBin::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT i
mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE; mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
mii.fState = RecycleBinIsEmpty() ? MFS_DISABLED : MFS_ENABLED; mii.fState = RecycleBinIsEmpty() ? MFS_DISABLED : MFS_ENABLED;
szBuffer[0] = L'\0'; szBuffer[0] = L'\0';
LoadStringW(shell32_hInstance, IDS_EMPTY_BITBUCKET, szBuffer, sizeof(szBuffer) / sizeof(WCHAR)); LoadStringW(shell32_hInstance, IDS_EMPTY_BITBUCKET, szBuffer, _countof(szBuffer));
mii.dwTypeData = szBuffer; mii.dwTypeData = szBuffer;
mii.cch = wcslen(mii.dwTypeData); mii.cch = wcslen(mii.dwTypeData);
mii.wID = idCmdFirst + id++; mii.wID = idCmdFirst + id++;
@ -883,7 +883,7 @@ TRASH_CanTrashFile(LPCWSTR wszPath)
return FALSE; return FALSE;
} }
// Only keep the base path. // Only keep the base path
WCHAR wszRootPathName[MAX_PATH]; WCHAR wszRootPathName[MAX_PATH];
strcpyW(wszRootPathName, wszPath); strcpyW(wszRootPathName, wszPath);
PathRemoveFileSpecW(wszRootPathName); PathRemoveFileSpecW(wszRootPathName);
@ -1110,7 +1110,7 @@ HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags)
if (dwType != REG_EXPAND_SZ) /* type dismatch */ if (dwType != REG_EXPAND_SZ) /* type dismatch */
return S_OK; return S_OK;
szPath[(sizeof(szPath)/sizeof(WCHAR))-1] = L'\0'; szPath[_countof(szPath)-1] = L'\0';
PlaySoundW(szPath, NULL, SND_FILENAME); PlaySoundW(szPath, NULL, SND_FILENAME);
} }
return S_OK; return S_OK;
@ -1149,8 +1149,8 @@ HRESULT WINAPI SHQueryRecycleBinW(LPCWSTR pszRootPath, LPSHQUERYRBINFO pSHQueryR
{ {
FIXME("%s, %p - stub\n", debugstr_w(pszRootPath), pSHQueryRBInfo); FIXME("%s, %p - stub\n", debugstr_w(pszRootPath), pSHQueryRBInfo);
if (!(pszRootPath) || (pszRootPath[0] == 0) || if (!pszRootPath || (pszRootPath[0] == 0) ||
!(pSHQueryRBInfo) || (pSHQueryRBInfo->cbSize < sizeof(SHQUERYRBINFO))) !pSHQueryRBInfo || (pSHQueryRBInfo->cbSize < sizeof(SHQUERYRBINFO)))
{ {
return E_INVALIDARG; return E_INVALIDARG;
} }

View file

@ -503,7 +503,7 @@ HRESULT WINAPI CRegFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apid
if (_ILIsSpecialFolder(*apidl)) if (_ILIsSpecialFolder(*apidl))
GetGuidItemAttributes(*apidl, rgfInOut); GetGuidItemAttributes(*apidl, rgfInOut);
else else
ERR("Got an unkown pidl here!\n"); ERR("Got unknown pidl\n");
apidl++; apidl++;
cidl--; cidl--;
} }
@ -593,7 +593,7 @@ HRESULT WINAPI CRegFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags,
GUID const *clsid = _ILGetGUIDPointer (pidl); GUID const *clsid = _ILGetGUIDPointer (pidl);
/* First of all check if we need to query the name from the child item */ /* First of all check if we need to query the name from the child item */
if (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING && if (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING &&
GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL)
{ {
int bWantsForParsing = FALSE; int bWantsForParsing = FALSE;
@ -750,7 +750,7 @@ HRESULT WINAPI CRegFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHEL
if (iColumn >= 3) if (iColumn >= 3)
{ {
/* Return an empty string when we area asked for a column we don't support. /* Return an empty string when we area asked for a column we don't support.
Only the regfolder is supposed to do this as it supports less columns compared to other folder Only the regfolder is supposed to do this as it supports less columns compared to other folder
and its contents are supposed to be presented alongside items that support more columns. */ and its contents are supposed to be presented alongside items that support more columns. */
return SHSetStrRet(&psd->str, ""); return SHSetStrRet(&psd->str, "");

View file

@ -71,9 +71,9 @@ static INT CALLBACK SIC_CompareEntries( LPVOID p1, LPVOID p2, LPARAM lparam)
if (e1->dwSourceIndex != e2->dwSourceIndex) if (e1->dwSourceIndex != e2->dwSourceIndex)
return (e1->dwSourceIndex < e2->dwSourceIndex) ? -1 : 1; return (e1->dwSourceIndex < e2->dwSourceIndex) ? -1 : 1;
if ((e1->dwFlags & GIL_FORSHORTCUT) != (e2->dwFlags & GIL_FORSHORTCUT)) if ((e1->dwFlags & GIL_FORSHORTCUT) != (e2->dwFlags & GIL_FORSHORTCUT))
return ((e1->dwFlags & GIL_FORSHORTCUT) < (e2->dwFlags & GIL_FORSHORTCUT)) ? -1 : 1; return ((e1->dwFlags & GIL_FORSHORTCUT) < (e2->dwFlags & GIL_FORSHORTCUT)) ? -1 : 1;
return wcsicmp(e1->sSourceFile,e2->sSourceFile); return wcsicmp(e1->sSourceFile,e2->sSourceFile);
} }
@ -89,7 +89,7 @@ static int SIC_LoadOverlayIcon(int icon_idx);
* FIXME: This should go to the ImageList implementation! * FIXME: This should go to the ImageList implementation!
*/ */
static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large) static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
{ {
ICONINFO ShortcutIconInfo, TargetIconInfo; ICONINFO ShortcutIconInfo, TargetIconInfo;
HICON ShortcutIcon = NULL, TargetIcon; HICON ShortcutIcon = NULL, TargetIcon;
BITMAP TargetBitmapInfo, ShortcutBitmapInfo; BITMAP TargetBitmapInfo, ShortcutBitmapInfo;
@ -106,7 +106,7 @@ static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
* We will write over the source bitmaps to get the final ones */ * We will write over the source bitmaps to get the final ones */
if (! GetIconInfo(SourceIcon, &TargetIconInfo)) if (! GetIconInfo(SourceIcon, &TargetIconInfo))
return NULL; return NULL;
/* Is it possible with the ImageList implementation? */ /* Is it possible with the ImageList implementation? */
if(!TargetIconInfo.hbmColor) if(!TargetIconInfo.hbmColor)
{ {
@ -114,7 +114,7 @@ static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
FIXME("1bpp icon wants its overlay!\n"); FIXME("1bpp icon wants its overlay!\n");
goto fail; goto fail;
} }
if(!GetObjectW(TargetIconInfo.hbmColor, sizeof(BITMAP), &TargetBitmapInfo)) if(!GetObjectW(TargetIconInfo.hbmColor, sizeof(BITMAP), &TargetBitmapInfo))
{ {
goto fail; goto fail;
@ -140,7 +140,7 @@ static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
{ {
goto fail; goto fail;
} }
/* Is it possible with the ImageLists ? */ /* Is it possible with the ImageLists ? */
if(!ShortcutIconInfo.hbmColor) if(!ShortcutIconInfo.hbmColor)
{ {
@ -148,7 +148,7 @@ static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
FIXME("Should draw 1bpp overlay!\n"); FIXME("Should draw 1bpp overlay!\n");
goto fail; goto fail;
} }
if(!GetObjectW(ShortcutIconInfo.hbmColor, sizeof(BITMAP), &ShortcutBitmapInfo)) if(!GetObjectW(ShortcutIconInfo.hbmColor, sizeof(BITMAP), &ShortcutBitmapInfo))
{ {
goto fail; goto fail;
@ -191,7 +191,7 @@ static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
PVOID bits; PVOID bits;
PULONG pixel; PULONG pixel;
INT i, j; INT i, j;
/* Find if the source bitmap has an alpha channel */ /* Find if the source bitmap has an alpha channel */
if(TargetBitmapInfo.bmBitsPixel != 32) add_alpha = FALSE; if(TargetBitmapInfo.bmBitsPixel != 32) add_alpha = FALSE;
else else
@ -202,21 +202,21 @@ static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
lpbmi->bmiHeader.biHeight = TargetBitmapInfo.bmHeight; lpbmi->bmiHeader.biHeight = TargetBitmapInfo.bmHeight;
lpbmi->bmiHeader.biPlanes = 1; lpbmi->bmiHeader.biPlanes = 1;
lpbmi->bmiHeader.biBitCount = 32; lpbmi->bmiHeader.biBitCount = 32;
bits = HeapAlloc(GetProcessHeap(), 0, TargetBitmapInfo.bmHeight * TargetBitmapInfo.bmWidthBytes); bits = HeapAlloc(GetProcessHeap(), 0, TargetBitmapInfo.bmHeight * TargetBitmapInfo.bmWidthBytes);
if(!bits) goto fail; if(!bits) goto fail;
if(!GetDIBits(TargetDC, TargetIconInfo.hbmColor, 0, TargetBitmapInfo.bmHeight, bits, lpbmi, DIB_RGB_COLORS)) if(!GetDIBits(TargetDC, TargetIconInfo.hbmColor, 0, TargetBitmapInfo.bmHeight, bits, lpbmi, DIB_RGB_COLORS))
{ {
ERR("GetBIBits failed!\n"); ERR("GetBIBits failed!\n");
HeapFree(GetProcessHeap(), 0, bits); HeapFree(GetProcessHeap(), 0, bits);
goto fail; goto fail;
} }
i = j = 0; i = j = 0;
pixel = (PULONG)bits; pixel = (PULONG)bits;
for(i=0; i<TargetBitmapInfo.bmHeight; i++) for(i=0; i<TargetBitmapInfo.bmHeight; i++)
{ {
for(j=0; j<TargetBitmapInfo.bmWidth; j++) for(j=0; j<TargetBitmapInfo.bmWidth; j++)
@ -228,25 +228,25 @@ static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
} }
HeapFree(GetProcessHeap(), 0, bits); HeapFree(GetProcessHeap(), 0, bits);
} }
/* Allocate the bits */ /* Allocate the bits */
bits = HeapAlloc(GetProcessHeap(), 0, ShortcutBitmapInfo.bmHeight*ShortcutBitmapInfo.bmWidthBytes); bits = HeapAlloc(GetProcessHeap(), 0, ShortcutBitmapInfo.bmHeight*ShortcutBitmapInfo.bmWidthBytes);
if(!bits) goto fail; if(!bits) goto fail;
ZeroMemory(buffer, sizeof(buffer)); ZeroMemory(buffer, sizeof(buffer));
lpbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); lpbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
lpbmi->bmiHeader.biWidth = ShortcutBitmapInfo.bmWidth; lpbmi->bmiHeader.biWidth = ShortcutBitmapInfo.bmWidth;
lpbmi->bmiHeader.biHeight = ShortcutBitmapInfo.bmHeight; lpbmi->bmiHeader.biHeight = ShortcutBitmapInfo.bmHeight;
lpbmi->bmiHeader.biPlanes = 1; lpbmi->bmiHeader.biPlanes = 1;
lpbmi->bmiHeader.biBitCount = 32; lpbmi->bmiHeader.biBitCount = 32;
if(!GetDIBits(TargetDC, ShortcutIconInfo.hbmColor, 0, ShortcutBitmapInfo.bmHeight, bits, lpbmi, DIB_RGB_COLORS)) if(!GetDIBits(TargetDC, ShortcutIconInfo.hbmColor, 0, ShortcutBitmapInfo.bmHeight, bits, lpbmi, DIB_RGB_COLORS))
{ {
ERR("GetBIBits failed!\n"); ERR("GetBIBits failed!\n");
HeapFree(GetProcessHeap(), 0, bits); HeapFree(GetProcessHeap(), 0, bits);
goto fail; goto fail;
} }
pixel = (PULONG)bits; pixel = (PULONG)bits;
/* Remove alpha channel component or make it totally opaque */ /* Remove alpha channel component or make it totally opaque */
for(i=0; i<ShortcutBitmapInfo.bmHeight; i++) for(i=0; i<ShortcutBitmapInfo.bmHeight; i++)
@ -257,10 +257,10 @@ static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
else *pixel++ &= 0x00FFFFFF; else *pixel++ &= 0x00FFFFFF;
} }
} }
/* GetDIBits return BI_BITFIELDS with masks set to 0, and SetDIBits fails when masks are 0. The irony... */ /* GetDIBits return BI_BITFIELDS with masks set to 0, and SetDIBits fails when masks are 0. The irony... */
lpbmi->bmiHeader.biCompression = BI_RGB; lpbmi->bmiHeader.biCompression = BI_RGB;
/* Set the bits again */ /* Set the bits again */
if(!SetDIBits(TargetDC, ShortcutIconInfo.hbmColor, 0, ShortcutBitmapInfo.bmHeight, bits, lpbmi, DIB_RGB_COLORS)) if(!SetDIBits(TargetDC, ShortcutIconInfo.hbmColor, 0, ShortcutBitmapInfo.bmHeight, bits, lpbmi, DIB_RGB_COLORS))
{ {
@ -553,7 +553,7 @@ BOOL SIC_Initialize(void)
ERR("Failed to create the big icon list.\n"); ERR("Failed to create the big icon list.\n");
goto end; goto end;
} }
/* Load the document icon, which is used as the default if an icon isn't found. */ /* Load the document icon, which is used as the default if an icon isn't found. */
hSm = (HICON)LoadImageW(shell32_hInstance, hSm = (HICON)LoadImageW(shell32_hInstance,
MAKEINTRESOURCEW(IDI_SHELL_DOCUMENT), MAKEINTRESOURCEW(IDI_SHELL_DOCUMENT),
@ -589,15 +589,15 @@ BOOL SIC_Initialize(void)
ERR("Failed to add IDI_SHELL_DOCUMENT icon to cache.\n"); ERR("Failed to add IDI_SHELL_DOCUMENT icon to cache.\n");
goto end; goto end;
} }
/* Everything went fine */ /* Everything went fine */
result = TRUE; result = TRUE;
end: end:
/* The image list keeps a copy of the icons, we must destroy them */ /* The image list keeps a copy of the icons, we must destroy them */
if(hSm) DestroyIcon(hSm); if(hSm) DestroyIcon(hSm);
if(hLg) DestroyIcon(hLg); if(hLg) DestroyIcon(hLg);
/* Clean everything if something went wrong */ /* Clean everything if something went wrong */
if(!result) if(!result)
{ {
@ -675,13 +675,13 @@ static int SIC_LoadOverlayIcon(int icon_idx)
/* read icon path and index */ /* read icon path and index */
if (RegQueryValueExW(hKeyShellIcons, wszIdx, NULL, NULL, (LPBYTE)buffer, &count) == ERROR_SUCCESS) if (RegQueryValueExW(hKeyShellIcons, wszIdx, NULL, NULL, (LPBYTE)buffer, &count) == ERROR_SUCCESS)
{ {
LPWSTR p = wcschr(buffer, ','); LPWSTR p = wcschr(buffer, ',');
if (p) if (p)
*p++ = 0; *p++ = 0;
iconPath = buffer; iconPath = buffer;
iconIdx = _wtoi(p); iconIdx = _wtoi(p);
} }
RegCloseKey(hKeyShellIcons); RegCloseKey(hKeyShellIcons);
@ -698,13 +698,13 @@ static int SIC_LoadOverlayIcon(int icon_idx)
* *
*/ */
BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList) BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList)
{ TRACE("(%p,%p)\n",lpBigList,lpSmallList); {
TRACE("(%p,%p)\n",lpBigList,lpSmallList);
if (lpBigList) if (lpBigList)
{ *lpBigList = ShellBigIconList; *lpBigList = ShellBigIconList;
}
if (lpSmallList) if (lpSmallList)
{ *lpSmallList = ShellSmallIconList; *lpSmallList = ShellSmallIconList;
}
return TRUE; return TRUE;
} }

View file

@ -1,4 +1,4 @@
The following avi's use icons from the Tango project and are The following avi's use icons from the Tango project and are
released under Creative Commons Attribution-ShareAlike 2.5 License. released under Creative Commons Attribution-ShareAlike 2.5 License.
Please see COPYING for details Please see COPYING for details
@ -7,4 +7,3 @@ Please see COPYING for details
163.avi 163.avi
164+169.avi 164+169.avi
170.avi 170.avi

View file

@ -1,4 +1,4 @@
The following icons are the property of the Tango project and are The following icons are the property of the Tango project and are
released under Creative Commons Attribution-ShareAlike 2.5 License. released under Creative Commons Attribution-ShareAlike 2.5 License.
Please see COPYING for details Please see COPYING for details

View file

@ -18,7 +18,7 @@ HKCR
} }
} }
} }
ForceRemove Applications ForceRemove Applications
{ {
} }

View file

@ -44,9 +44,9 @@ BEGIN
"A", FCIDM_SHVIEW_SELECTALL, VIRTKEY, CONTROL "A", FCIDM_SHVIEW_SELECTALL, VIRTKEY, CONTROL
VK_F1, FCIDM_SHVIEW_HELP, VIRTKEY VK_F1, FCIDM_SHVIEW_HELP, VIRTKEY
/* FIXME: the following accelerator doesn't belong here. This accelerator /* FIXME: the following accelerator doesn't belong here. This accelerator
* table is used by the shell view control. F5 should be handled by the * table is used by the shell view control. F5 should be handled by the
* a different accelerator table thats translated in IShellBrowser::TranslateAcceleratorSB * a different accelerator table thats translated in IShellBrowser::TranslateAcceleratorSB
* but will put it here until the shell work fine */ * but will put it here until the shell work fine */
VK_F5, FCIDM_SHVIEW_REFRESH, VIRTKEY VK_F5, FCIDM_SHVIEW_REFRESH, VIRTKEY
END END

View file

@ -25,8 +25,6 @@
#include <atlcoll.h> #include <atlcoll.h>
#endif #endif
WINE_DEFAULT_DEBUG_CHANNEL(desktop); WINE_DEFAULT_DEBUG_CHANNEL(desktop);
static const WCHAR szProgmanClassName[] = L"Progman"; static const WCHAR szProgmanClassName[] = L"Progman";
@ -104,7 +102,7 @@ END_COM_MAP()
}; };
CDesktopBrowser::CDesktopBrowser(): CDesktopBrowser::CDesktopBrowser():
m_hAccel(NULL), m_hAccel(NULL),
m_hWndShellView(NULL) m_hWndShellView(NULL)
{ {
} }
@ -184,7 +182,7 @@ HRESULT CDesktopBrowser::_Resize()
} }
HRESULT CDesktopBrowser::Initialize(IShellDesktopTray *ShellDesk) HRESULT CDesktopBrowser::Initialize(IShellDesktopTray *ShellDesk)
{ {
CComPtr<IShellFolder> psfDesktop; CComPtr<IShellFolder> psfDesktop;
HRESULT hRet; HRESULT hRet;
hRet = SHGetDesktopFolder(&psfDesktop); hRet = SHGetDesktopFolder(&psfDesktop);
@ -284,7 +282,7 @@ HRESULT STDMETHODCALLTYPE CDesktopBrowser::BrowseObject(LPCITEMIDLIST pidl, UINT
* find an open shell window that shows the requested pidl and activate it * find an open shell window that shows the requested pidl and activate it
*/ */
DWORD dwFlags = ((wFlags & SBSP_EXPLOREMODE) != 0) ? SH_EXPLORER_CMDLINE_FLAG_E : 0; DWORD dwFlags = ((wFlags & SBSP_EXPLOREMODE) != 0) ? SH_EXPLORER_CMDLINE_FLAG_E : 0;
return SHOpenNewFrame(ILClone(pidl), NULL, 0, dwFlags); return SHOpenNewFrame(ILClone(pidl), NULL, 0, dwFlags);
} }

View file

@ -1,4 +1,3 @@
project(SHELL) project(SHELL)
set_cpp(WITH_RUNTIME) set_cpp(WITH_RUNTIME)
add_definitions(-DUNICODE -D_UNICODE) add_definitions(-DUNICODE -D_UNICODE)

View file

@ -203,7 +203,7 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetClient(IUnknown *punkClient)
return hr; return hr;
pDeskBandClient->SetDeskBarSite(NULL); pDeskBandClient->SetDeskBarSite(NULL);
pDeskBandClient = NULL; pDeskBandClient = NULL;
m_Client = NULL; m_Client = NULL;
} }
@ -284,7 +284,7 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetSite(REFIID riid, void **ppvSite)
static void AdjustForExcludeArea(BOOL alignLeft, BOOL alignTop, BOOL preferVertical, PINT px, PINT py, INT cx, INT cy, RECTL rcExclude) { static void AdjustForExcludeArea(BOOL alignLeft, BOOL alignTop, BOOL preferVertical, PINT px, PINT py, INT cx, INT cy, RECTL rcExclude) {
RECT rcWindow = { *px, *py, *px + cx, *py + cy }; RECT rcWindow = { *px, *py, *px + cx, *py + cy };
if (rcWindow.right > rcExclude.left && rcWindow.left < rcExclude.right && if (rcWindow.right > rcExclude.left && rcWindow.left < rcExclude.right &&
rcWindow.bottom > rcExclude.top && rcWindow.top < rcExclude.bottom) rcWindow.bottom > rcExclude.top && rcWindow.top < rcExclude.bottom)
{ {
@ -419,7 +419,7 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBar::Popup(POINTL *ppt, RECTL *prcExclude, MP
AdjustForExcludeArea(alignLeft, alignTop, preferVertical, &x, &y, cx, cy, *prcExclude); AdjustForExcludeArea(alignLeft, alignTop, preferVertical, &x, &y, cx, cy, *prcExclude);
// Verify that it doesn't escape the work area, and flip. // Verify that it doesn't escape the work area, and flip.
if (alignLeft) if (alignLeft)
{ {
if (x < rcWorkArea.left && (ppt->x+cx) <= rcWorkArea.right) if (x < rcWorkArea.left && (ppt->x+cx) <= rcWorkArea.right)
{ {
@ -813,7 +813,7 @@ LRESULT CMenuDeskBar::_OnWinIniChange(UINT uMsg, WPARAM wParam, LPARAM lParam, B
LRESULT CMenuDeskBar::_OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) LRESULT CMenuDeskBar::_OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
{ {
/* If it is a flat style menu we need to handle WM_NCPAINT /* If it is a flat style menu we need to handle WM_NCPAINT
* and paint the border with the right colour */ * and paint the border with the right colour */
if ((GetStyle() & WS_BORDER) == 0) if ((GetStyle() & WS_BORDER) == 0)
{ {

View file

@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/* /*
This file implements the CMenuFocusManager class. This file implements the CMenuFocusManager class.
This class manages the shell menus, by overriding the hot-tracking behaviour. This class manages the shell menus, by overriding the hot-tracking behaviour.
@ -169,7 +169,7 @@ HRESULT CMenuFocusManager::PopFromArray(StackEntryType * pType, CMenuBand ** pMb
{ {
if (pMb) *pMb = m_bandStack[m_bandCount].mb; if (pMb) *pMb = m_bandStack[m_bandCount].mb;
} }
return S_OK; return S_OK;
} }
@ -559,7 +559,7 @@ LRESULT CMenuFocusManager::GetMsgHook(INT nCode, WPARAM hookWParam, LPARAM hookL
BOOL isLButton = FALSE; BOOL isLButton = FALSE;
if (nCode < 0) if (nCode < 0)
return CallNextHookEx(m_hGetMsgHook, nCode, hookWParam, hookLParam); return CallNextHookEx(m_hGetMsgHook, nCode, hookWParam, hookLParam);
if (nCode == HC_ACTION) if (nCode == HC_ACTION)
{ {
BOOL callNext = TRUE; BOOL callNext = TRUE;

View file

@ -92,7 +92,7 @@ public:
virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject); virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject);
// Using custom message map instead // Using custom message map instead
virtual BOOL ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD mapId = 0); virtual BOOL ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD mapId = 0);
// UNIMPLEMENTED // UNIMPLEMENTED

View file

@ -165,7 +165,6 @@ HRESULT CMenuToolbarBase::OnCustomDraw(LPNMTBCUSTOMDRAW cdraw, LRESULT * theResu
return S_OK; return S_OK;
case CDDS_ITEMPREPAINT: case CDDS_ITEMPREPAINT:
HWND tlw; HWND tlw;
m_menuBand->_GetTopLevelWindow(&tlw); m_menuBand->_GetTopLevelWindow(&tlw);
@ -427,7 +426,7 @@ HRESULT CMenuToolbarBase::CreateToolbar(HWND hwndParent, DWORD dwFlags)
m_pager.SubclassWindow(hwndPager); m_pager.SubclassWindow(hwndPager);
::SetParent(m_hWnd, hwndPager); ::SetParent(m_hWnd, hwndPager);
m_pager.SendMessageW(PGM_SETCHILD, 0, reinterpret_cast<LPARAM>(m_hWnd)); m_pager.SendMessageW(PGM_SETCHILD, 0, reinterpret_cast<LPARAM>(m_hWnd));
} }
@ -715,7 +714,7 @@ HRESULT CMenuToolbarBase::PopupSubMenu(UINT iItem, UINT index, IShellMenu* child
if (!GetItemRect(index, &rc)) if (!GetItemRect(index, &rc))
return E_FAIL; return E_FAIL;
POINT a = { rc.left, rc.top }; POINT a = { rc.left, rc.top };
POINT b = { rc.right, rc.bottom }; POINT b = { rc.right, rc.bottom };
@ -847,7 +846,7 @@ HRESULT CMenuToolbarBase::MenuBarMouseDown(INT iIndex, BOOL isLButton)
GetButton(iIndex, &btn); GetButton(iIndex, &btn);
if ((m_initFlags & SMINIT_VERTICAL) if ((m_initFlags & SMINIT_VERTICAL)
|| m_popupBar || m_popupBar
|| m_cancelingPopup) || m_cancelingPopup)
{ {
@ -1042,7 +1041,7 @@ HRESULT CMenuToolbarBase::AddPlaceholder()
{ {
TBBUTTON tbb = { 0 }; TBBUTTON tbb = { 0 };
WCHAR MenuString[128]; WCHAR MenuString[128];
LoadStringW(GetModuleHandle(L"shell32.dll"), IDS_MENU_EMPTY, MenuString, _countof(MenuString)); LoadStringW(GetModuleHandle(L"shell32.dll"), IDS_MENU_EMPTY, MenuString, _countof(MenuString));
tbb.fsState = 0; tbb.fsState = 0;
@ -1251,7 +1250,7 @@ HRESULT CMenuStaticToolbar::OnDeletingButton(const NMTOOLBAR * tb)
HRESULT CMenuStaticToolbar::InternalContextMenu(INT iItem, INT index, DWORD_PTR dwData, POINT pt) HRESULT CMenuStaticToolbar::InternalContextMenu(INT iItem, INT index, DWORD_PTR dwData, POINT pt)
{ {
CComPtr<IContextMenu> contextMenu; CComPtr<IContextMenu> contextMenu;
HRESULT hr = m_menuBand->_CallCBWithItemId(iItem, SMC_GETOBJECT, HRESULT hr = m_menuBand->_CallCBWithItemId(iItem, SMC_GETOBJECT,
reinterpret_cast<WPARAM>(&IID_IContextMenu), reinterpret_cast<LPARAM>(&contextMenu)); reinterpret_cast<WPARAM>(&IID_IContextMenu), reinterpret_cast<LPARAM>(&contextMenu));
if (hr != S_OK) if (hr != S_OK)
return hr; return hr;

View file

@ -88,7 +88,7 @@ public:
HRESULT DisableMouseTrack(BOOL bDisable); HRESULT DisableMouseTrack(BOOL bDisable);
virtual HRESULT FillToolbar(BOOL clearFirst=FALSE) = 0; virtual HRESULT FillToolbar(BOOL clearFirst=FALSE) = 0;
HRESULT CancelCurrentPopup(); HRESULT CancelCurrentPopup();
HRESULT PopupItem(INT iItem, BOOL keyInitiated); HRESULT PopupItem(INT iItem, BOOL keyInitiated);
HRESULT GetDataFromId(INT iItem, INT* pIndex, DWORD_PTR* pData); HRESULT GetDataFromId(INT iItem, INT* pIndex, DWORD_PTR* pData);

View file

@ -90,7 +90,7 @@ CEnumMergedFolder::CEnumMergedFolder() :
m_hDsaCount(0) m_hDsaCount(0)
{ {
} }
CEnumMergedFolder::~CEnumMergedFolder() CEnumMergedFolder::~CEnumMergedFolder()
{ {
DSA_DestroyCallback(m_hDsa, s_DsaDeleteCallback, this); DSA_DestroyCallback(m_hDsa, s_DsaDeleteCallback, this);
@ -104,7 +104,7 @@ int CEnumMergedFolder::DsaDeleteCallback(LocalPidlInfo * info)
CoTaskMemFree((LPVOID)info->parseName); CoTaskMemFree((LPVOID)info->parseName);
return 0; return 0;
} }
int CALLBACK CEnumMergedFolder::s_DsaDeleteCallback(void *pItem, void *pData) int CALLBACK CEnumMergedFolder::s_DsaDeleteCallback(void *pItem, void *pData)
{ {
CEnumMergedFolder * mf = (CEnumMergedFolder*) pData; CEnumMergedFolder * mf = (CEnumMergedFolder*) pData;
@ -270,7 +270,7 @@ HRESULT CEnumMergedFolder::FindPidlInList(HWND hwndOwner, LPCITEMIDLIST pcidl, L
LocalPidlInfo * pInfo = (LocalPidlInfo *) DSA_GetItemPtr(m_hDsa, i); LocalPidlInfo * pInfo = (LocalPidlInfo *) DSA_GetItemPtr(m_hDsa, i);
if (!pInfo) if (!pInfo)
return E_FAIL; return E_FAIL;
TRACE("Comparing with item at %d with parent %p and pidl { cb=%d }\n", i, pInfo->parent, pInfo->pidl->mkid.cb); TRACE("Comparing with item at %d with parent %p and pidl { cb=%d }\n", i, pInfo->parent, pInfo->pidl->mkid.cb);
hr = pInfo->parent->CompareIDs(0, pInfo->pidl, pcidl); hr = pInfo->parent->CompareIDs(0, pInfo->pidl, pcidl);
@ -393,7 +393,7 @@ CMergedFolder::CMergedFolder() :
{ {
} }
CMergedFolder::~CMergedFolder() CMergedFolder::~CMergedFolder()
{ {
if (m_UserLocalPidl) ILFree(m_UserLocalPidl); if (m_UserLocalPidl) ILFree(m_UserLocalPidl);
if (m_AllUsersPidl) ILFree(m_AllUsersPidl); if (m_AllUsersPidl) ILFree(m_AllUsersPidl);
@ -409,7 +409,7 @@ HRESULT STDMETHODCALLTYPE CMergedFolder::AddNameSpace(LPGUID lpGuid, IShellFolde
} }
TRACE("AddNameSpace %p %p\n", m_UserLocal.p, m_AllUsers.p); TRACE("AddNameSpace %p %p\n", m_UserLocal.p, m_AllUsers.p);
// FIXME: Use a DSA to store the list of merged namespaces, together with their related info (psf, pidl, ...) // FIXME: Use a DSA to store the list of merged namespaces, together with their related info (psf, pidl, ...)
// For now, assume only 2 will ever be used, and ignore all the other data. // For now, assume only 2 will ever be used, and ignore all the other data.
if (!m_UserLocal) if (!m_UserLocal)
@ -513,7 +513,7 @@ HRESULT STDMETHODCALLTYPE CMergedFolder::BindToObject(
{ {
LocalPidlInfo info; LocalPidlInfo info;
HRESULT hr; HRESULT hr;
hr = m_EnumSource->FindPidlInList(NULL, pidl, &info); hr = m_EnumSource->FindPidlInList(NULL, pidl, &info);
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
return hr; return hr;

View file

@ -61,7 +61,6 @@ class CShellMenuCallback :
public IShellMenuCallback public IShellMenuCallback
{ {
private: private:
HWND m_hwndTray; HWND m_hwndTray;
CComPtr<IShellMenu> m_pShellMenu; CComPtr<IShellMenu> m_pShellMenu;
CComPtr<IBandSite> m_pBandSite; CComPtr<IBandSite> m_pBandSite;
@ -198,7 +197,6 @@ private:
hr = pShellMenu->SetShellFolder(psfStartMenu, NULL, NULL, 0); hr = pShellMenu->SetShellFolder(psfStartMenu, NULL, NULL, 0);
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
return hr; return hr;
} }
else else
{ {
@ -461,7 +459,7 @@ RSHELL_CStartMenu_CreateInstance(REFIID riid, void **ppv)
hr = SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAMS, &pidlProgramsAbsolute); hr = SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAMS, &pidlProgramsAbsolute);
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
{ {
WARN("USER Programs folder not found."); WARN("USER Programs folder not found\n");
hr = SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_PROGRAMS, &pidlProgramsAbsolute); hr = SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_PROGRAMS, &pidlProgramsAbsolute);
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
return hr; return hr;

View file

@ -181,7 +181,6 @@ RestoreFile(
#undef INTERFACE #undef INTERFACE
#define INTERFACE IRecycleBinFile #define INTERFACE IRecycleBinFile
DECLARE_INTERFACE_(IRecycleBinFile, IUnknown) DECLARE_INTERFACE_(IRecycleBinFile, IUnknown)
{ {
BEGIN_INTERFACE BEGIN_INTERFACE
@ -203,10 +202,9 @@ DECLARE_INTERFACE_(IRecycleBinFile, IUnknown)
END_INTERFACE END_INTERFACE
}; };
#undef INTERFACE #undef INTERFACE
#define INTERFACE IRecycleBinEnumList
#define INTERFACE IRecycleBinEnumList
DECLARE_INTERFACE_(IRecycleBinEnumList, IUnknown) DECLARE_INTERFACE_(IRecycleBinEnumList, IUnknown)
{ {
BEGIN_INTERFACE BEGIN_INTERFACE
@ -223,10 +221,9 @@ DECLARE_INTERFACE_(IRecycleBinEnumList, IUnknown)
END_INTERFACE END_INTERFACE
}; };
#undef INTERFACE #undef INTERFACE
#define INTERFACE IRecycleBin
#define INTERFACE IRecycleBin
DECLARE_INTERFACE_(IRecycleBin, IUnknown) DECLARE_INTERFACE_(IRecycleBin, IUnknown)
{ {
BEGIN_INTERFACE BEGIN_INTERFACE

View file

@ -60,7 +60,7 @@ HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, const GUID* clsid,
HRESULT SHELL32_BindToSF (LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO* ppfti, HRESULT SHELL32_BindToSF (LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO* ppfti,
LPCITEMIDLIST pidl, const GUID* clsid, REFIID riid, LPVOID *ppvOut); LPCITEMIDLIST pidl, const GUID* clsid, REFIID riid, LPVOID *ppvOut);
extern "C" extern "C"
BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey); BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey);

View file

@ -267,7 +267,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR*
if (!done || (*fmt == '1')) if (!done || (*fmt == '1'))
{ {
/*FIXME Is the call to SearchPathW() really needed? We already have separated out the parameter string in args. */ /*FIXME Is the call to SearchPathW() really needed? We already have separated out the parameter string in args. */
if (SearchPathW(lpDir, lpFile, wszExe, sizeof(xlpFile) / sizeof(WCHAR), xlpFile, NULL)) if (SearchPathW(lpDir, lpFile, wszExe, ARRAY_SIZE(xlpFile), xlpFile, NULL))
cmd = xlpFile; cmd = xlpFile;
else else
cmd = lpFile; cmd = lpFile;
@ -314,7 +314,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR*
pv = SHLockShared(hmem, 0); pv = SHLockShared(hmem, 0);
chars = swprintf(buf, L":%p", pv); chars = swprintf(buf, L":%p", pv);
if (chars >= sizeof(buf) / sizeof(WCHAR)) if (chars >= ARRAY_SIZE(buf))
ERR("pidl format buffer too small!\n"); ERR("pidl format buffer too small!\n");
used += chars; used += chars;
@ -630,7 +630,7 @@ static UINT SHELL_FindExecutableByVerb(LPCWSTR lpVerb, LPWSTR key, LPWSTR classn
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, classname, 0, 0x02000000, &hkeyClass)) if (RegOpenKeyExW(HKEY_CLASSES_ROOT, classname, 0, 0x02000000, &hkeyClass))
return SE_ERR_NOASSOC; return SE_ERR_NOASSOC;
if (!HCR_GetDefaultVerbW(hkeyClass, lpVerb, verb, sizeof(verb) / sizeof(verb[0]))) if (!HCR_GetDefaultVerbW(hkeyClass, lpVerb, verb, ARRAY_SIZE(verb)))
return SE_ERR_NOASSOC; return SE_ERR_NOASSOC;
RegCloseKey(hkeyClass); RegCloseKey(hkeyClass);
@ -728,13 +728,13 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
return 33; return 33;
} }
if (SearchPathW(lpPath, lpFile, wszExe, sizeof(xlpFile) / sizeof(WCHAR), xlpFile, NULL)) if (SearchPathW(lpPath, lpFile, wszExe, ARRAY_SIZE(xlpFile), xlpFile, NULL))
{ {
TRACE("SearchPathW returned non-zero\n"); TRACE("SearchPathW returned non-zero\n");
lpFile = xlpFile; lpFile = xlpFile;
/* The file was found in the application-supplied default directory (or the system search path) */ /* The file was found in the application-supplied default directory (or the system search path) */
} }
else if (lpPath && SearchPathW(NULL, lpFile, wszExe, sizeof(xlpFile)/sizeof(WCHAR), xlpFile, NULL)) else if (lpPath && SearchPathW(NULL, lpFile, wszExe, ARRAY_SIZE(xlpFile), xlpFile, NULL))
{ {
TRACE("SearchPathW returned non-zero\n"); TRACE("SearchPathW returned non-zero\n");
lpFile = xlpFile; lpFile = xlpFile;
@ -777,7 +777,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
/* See if it's a program - if GetProfileString fails, we skip this /* See if it's a program - if GetProfileString fails, we skip this
* section. Actually, if GetProfileString fails, we've probably * section. Actually, if GetProfileString fails, we've probably
* got a lot more to worry about than running a program... */ * got a lot more to worry about than running a program... */
if (GetProfileStringW(L"windows", L"programs", L"exe pif bat cmd com", wBuffer, sizeof(wBuffer) / sizeof(WCHAR)) > 0) if (GetProfileStringW(L"windows", L"programs", L"exe pif bat cmd com", wBuffer, ARRAY_SIZE(wBuffer)) > 0)
{ {
CharLowerW(wBuffer); CharLowerW(wBuffer);
tok = wBuffer; tok = wBuffer;
@ -809,7 +809,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
&classnamelen) == ERROR_SUCCESS) &classnamelen) == ERROR_SUCCESS)
{ {
classnamelen /= sizeof(WCHAR); classnamelen /= sizeof(WCHAR);
if (classnamelen == sizeof(classname) / sizeof(WCHAR)) if (classnamelen == ARRAY_SIZE(classname))
classnamelen--; classnamelen--;
classname[classnamelen] = '\0'; classname[classnamelen] = '\0';
@ -857,7 +857,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
{ {
/* Toss the leading dot */ /* Toss the leading dot */
extension++; extension++;
if (GetProfileStringW(L"extensions", extension, L"", command, sizeof(command) / sizeof(WCHAR)) > 0) if (GetProfileStringW(L"extensions", extension, L"", command, ARRAY_SIZE(command)) > 0)
{ {
if (wcslen(command) != 0) if (wcslen(command) != 0)
{ {
@ -926,14 +926,14 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec
unsigned ret = SE_ERR_NOASSOC; unsigned ret = SE_ERR_NOASSOC;
BOOL unicode = !(GetVersion() & 0x80000000); BOOL unicode = !(GetVersion() & 0x80000000);
if (strlenW(key) + 1 > sizeof(regkey) / sizeof(regkey[0])) if (strlenW(key) + 1 > ARRAY_SIZE(regkey))
{ {
FIXME("input parameter %s larger than buffer\n", debugstr_w(key)); FIXME("input parameter %s larger than buffer\n", debugstr_w(key));
return 2; return 2;
} }
wcscpy(regkey, key); wcscpy(regkey, key);
static const WCHAR wApplication[] = L"\\application"; static const WCHAR wApplication[] = L"\\application";
endkeyLen = sizeof(regkey) / sizeof(regkey[0]) - (endkey - regkey); endkeyLen = ARRAY_SIZE(regkey) - (endkey - regkey);
if (strlenW(wApplication) + 1 > endkeyLen) if (strlenW(wApplication) + 1 > endkeyLen)
{ {
FIXME("endkey %s overruns buffer\n", debugstr_w(wApplication)); FIXME("endkey %s overruns buffer\n", debugstr_w(wApplication));
@ -945,14 +945,14 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec
{ {
WCHAR command[1024], fullpath[MAX_PATH]; WCHAR command[1024], fullpath[MAX_PATH];
static const WCHAR wSo[] = L".so"; static const WCHAR wSo[] = L".so";
DWORD sizeSo = sizeof(wSo) / sizeof(WCHAR); DWORD sizeSo = ARRAY_SIZE(wSo);
LPWSTR ptr = NULL; LPWSTR ptr = NULL;
DWORD ret = 0; DWORD ret = 0;
/* Get application command from start string and find filename of application */ /* Get application command from start string and find filename of application */
if (*start == '"') if (*start == '"')
{ {
if (strlenW(start + 1) + 1 > sizeof(command) / sizeof(command[0])) if (strlenW(start + 1) + 1 > ARRAY_SIZE(command))
{ {
FIXME("size of input parameter %s larger than buffer\n", FIXME("size of input parameter %s larger than buffer\n",
debugstr_w(start + 1)); debugstr_w(start + 1));
@ -961,7 +961,7 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec
wcscpy(command, start + 1); wcscpy(command, start + 1);
if ((ptr = wcschr(command, '"'))) if ((ptr = wcschr(command, '"')))
* ptr = 0; * ptr = 0;
ret = SearchPathW(NULL, command, wszExe, sizeof(fullpath) / sizeof(WCHAR), fullpath, &ptr); ret = SearchPathW(NULL, command, wszExe, ARRAY_SIZE(fullpath), fullpath, &ptr);
} }
else else
{ {
@ -972,11 +972,11 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec
int idx = space - start; int idx = space - start;
memcpy(command, start, idx * sizeof(WCHAR)); memcpy(command, start, idx * sizeof(WCHAR));
command[idx] = '\0'; command[idx] = '\0';
if ((ret = SearchPathW(NULL, command, wszExe, sizeof(fullpath) / sizeof(WCHAR), fullpath, &ptr))) if ((ret = SearchPathW(NULL, command, wszExe, ARRAY_SIZE(fullpath), fullpath, &ptr)))
break; break;
} }
if (!ret) if (!ret)
ret = SearchPathW(NULL, start, wszExe, sizeof(fullpath) / sizeof(WCHAR), fullpath, &ptr); ret = SearchPathW(NULL, start, wszExe, ARRAY_SIZE(fullpath), fullpath, &ptr);
} }
if (!ret) if (!ret)
@ -984,7 +984,7 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec
ERR("Unable to find application path for command %s\n", debugstr_w(start)); ERR("Unable to find application path for command %s\n", debugstr_w(start));
return ERROR_ACCESS_DENIED; return ERROR_ACCESS_DENIED;
} }
if (strlenW(ptr) + 1 > sizeof(app) / sizeof(app[0])) if (strlenW(ptr) + 1 > ARRAY_SIZE(app))
{ {
FIXME("size of found path %s larger than buffer\n", debugstr_w(ptr)); FIXME("size of found path %s larger than buffer\n", debugstr_w(ptr));
return 2; return 2;
@ -1078,8 +1078,8 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec
} }
} }
SHELL_ArgifyW(static_res, sizeof(static_res)/sizeof(WCHAR), exec, lpFile, pidl, szCommandline, &resultLen, NULL); SHELL_ArgifyW(static_res, ARRAY_SIZE(static_res), exec, lpFile, pidl, szCommandline, &resultLen, NULL);
if (resultLen > sizeof(static_res)/sizeof(WCHAR)) if (resultLen > ARRAY_SIZE(static_res))
{ {
res = dynamic_res = static_cast<WCHAR *>(HeapAlloc(GetProcessHeap(), 0, resultLen * sizeof(WCHAR))); res = dynamic_res = static_cast<WCHAR *>(HeapAlloc(GetProcessHeap(), 0, resultLen * sizeof(WCHAR)));
SHELL_ArgifyW(dynamic_res, resultLen, exec, lpFile, pidl, szCommandline, NULL, NULL); SHELL_ArgifyW(dynamic_res, resultLen, exec, lpFile, pidl, szCommandline, NULL, NULL);
@ -1145,12 +1145,12 @@ static UINT_PTR execute_from_key(LPCWSTR key, LPCWSTR lpFile, WCHAR *env,
/* Is there a replace() function anywhere? */ /* Is there a replace() function anywhere? */
cmdlen /= sizeof(WCHAR); cmdlen /= sizeof(WCHAR);
if (cmdlen >= sizeof(cmd) / sizeof(WCHAR)) if (cmdlen >= ARRAY_SIZE(cmd))
cmdlen = sizeof(cmd) / sizeof(WCHAR) - 1; cmdlen = ARRAY_SIZE(cmd) - 1;
cmd[cmdlen] = '\0'; cmd[cmdlen] = '\0';
SHELL_ArgifyW(param, sizeof(param) / sizeof(WCHAR), cmd, lpFile, (LPITEMIDLIST)psei->lpIDList, szCommandline, &resultLen, SHELL_ArgifyW(param, ARRAY_SIZE(param), cmd, lpFile, (LPITEMIDLIST)psei->lpIDList, szCommandline, &resultLen,
(psei->lpDirectory && *psei->lpDirectory) ? psei->lpDirectory : NULL); (psei->lpDirectory && *psei->lpDirectory) ? psei->lpDirectory : NULL);
if (resultLen > sizeof(param) / sizeof(WCHAR)) if (resultLen > ARRAY_SIZE(param))
ERR("Argify buffer not large enough, truncating\n"); ERR("Argify buffer not large enough, truncating\n");
} }
@ -1237,7 +1237,7 @@ HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpR
if (lpDirectory) if (lpDirectory)
{ {
GetCurrentDirectoryW(sizeof(old_dir) / sizeof(WCHAR), old_dir); GetCurrentDirectoryW(ARRAY_SIZE(old_dir), old_dir);
SetCurrentDirectoryW(lpDirectory); SetCurrentDirectoryW(lpDirectory);
} }
@ -1482,7 +1482,7 @@ static LONG ShellExecute_FromContextMenu( LPSHELLEXECUTEINFOW sei )
i = 0; i = 0;
while (1) while (1)
{ {
r = RegEnumKeyW(hkeycm, i++, szguid, sizeof(szguid) / sizeof(szguid[0])); r = RegEnumKeyW(hkeycm, i++, szguid, ARRAY_SIZE(szguid));
if (r != ERROR_SUCCESS) if (r != ERROR_SUCCESS)
break; break;
@ -1529,7 +1529,7 @@ static UINT_PTR SHELL_execute_class(LPCWSTR wszApplicationName, LPSHELLEXECUTEIN
TRACE("SEE_MASK_CLASSNAME->%s, doc->%s\n", debugstr_w(execCmd), debugstr_w(wszApplicationName)); TRACE("SEE_MASK_CLASSNAME->%s, doc->%s\n", debugstr_w(execCmd), debugstr_w(wszApplicationName));
wcmd[0] = '\0'; wcmd[0] = '\0';
done = SHELL_ArgifyW(wcmd, sizeof(wcmd) / sizeof(WCHAR), execCmd, wszApplicationName, (LPITEMIDLIST)psei->lpIDList, NULL, &resultLen, done = SHELL_ArgifyW(wcmd, ARRAY_SIZE(wcmd), execCmd, wszApplicationName, (LPITEMIDLIST)psei->lpIDList, NULL, &resultLen,
(psei->lpDirectory && *psei->lpDirectory) ? psei->lpDirectory : NULL); (psei->lpDirectory && *psei->lpDirectory) ? psei->lpDirectory : NULL);
if (!done && wszApplicationName[0]) if (!done && wszApplicationName[0])
{ {
@ -1543,7 +1543,7 @@ static UINT_PTR SHELL_execute_class(LPCWSTR wszApplicationName, LPSHELLEXECUTEIN
else else
strcatW(wcmd, wszApplicationName); strcatW(wcmd, wszApplicationName);
} }
if (resultLen > sizeof(wcmd) / sizeof(WCHAR)) if (resultLen > ARRAY_SIZE(wcmd))
ERR("Argify buffer not large enough... truncating\n"); ERR("Argify buffer not large enough... truncating\n");
return execfunc(wcmd, NULL, FALSE, psei, psei_out); return execfunc(wcmd, NULL, FALSE, psei, psei_out);
} }
@ -1568,7 +1568,7 @@ static BOOL SHELL_translate_idlist(LPSHELLEXECUTEINFOW sei, LPWSTR wszParameters
BOOL appKnownSingular = FALSE; BOOL appKnownSingular = FALSE;
/* last chance to translate IDList: now also allow CLSID paths */ /* last chance to translate IDList: now also allow CLSID paths */
if (SUCCEEDED(SHELL_GetPathFromIDListForExecuteW((LPCITEMIDLIST)sei->lpIDList, buffer, sizeof(buffer)/sizeof(WCHAR)))) { if (SUCCEEDED(SHELL_GetPathFromIDListForExecuteW((LPCITEMIDLIST)sei->lpIDList, buffer, ARRAY_SIZE(buffer)))) {
if (buffer[0] == ':' && buffer[1] == ':') { if (buffer[0] == ':' && buffer[1] == ':') {
/* open shell folder for the specified class GUID */ /* open shell folder for the specified class GUID */
if (strlenW(buffer) + 1 > parametersLen) if (strlenW(buffer) + 1 > parametersLen)
@ -1688,14 +1688,14 @@ static void do_error_dialog(UINT_PTR retval, HWND hwnd, WCHAR* filename)
error_code = GetLastError(); error_code = GetLastError();
if (retval == SE_ERR_NOASSOC) if (retval == SE_ERR_NOASSOC)
LoadStringW(shell32_hInstance, IDS_SHLEXEC_NOASSOC, msg, sizeof(msg) / sizeof(WCHAR)); LoadStringW(shell32_hInstance, IDS_SHLEXEC_NOASSOC, msg, ARRAY_SIZE(msg));
else else
FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY, FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY,
NULL, NULL,
error_code, error_code,
LANG_USER_DEFAULT, LANG_USER_DEFAULT,
msg, msg,
sizeof(msg) / sizeof(WCHAR), ARRAY_SIZE(msg),
(va_list*)msgArguments); (va_list*)msgArguments);
MessageBoxW(hwnd, msg, NULL, MB_ICONERROR); MessageBoxW(hwnd, msg, NULL, MB_ICONERROR);
@ -1734,9 +1734,9 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc)
WCHAR parametersBuffer[1024], dirBuffer[MAX_PATH], wcmdBuffer[1024]; WCHAR parametersBuffer[1024], dirBuffer[MAX_PATH], wcmdBuffer[1024];
WCHAR *wszApplicationName, *wszParameters, *wszDir, *wcmd; WCHAR *wszApplicationName, *wszParameters, *wszDir, *wcmd;
DWORD dwApplicationNameLen = MAX_PATH + 2; DWORD dwApplicationNameLen = MAX_PATH + 2;
DWORD parametersLen = sizeof(parametersBuffer) / sizeof(WCHAR); DWORD parametersLen = ARRAY_SIZE(parametersBuffer);
DWORD dirLen = sizeof(dirBuffer) / sizeof(WCHAR); DWORD dirLen = ARRAY_SIZE(dirBuffer);
DWORD wcmdLen = sizeof(wcmdBuffer) / sizeof(WCHAR); DWORD wcmdLen = ARRAY_SIZE(wcmdBuffer);
DWORD len; DWORD len;
SHELLEXECUTEINFOW sei_tmp; /* modifiable copy of SHELLEXECUTEINFO struct */ SHELLEXECUTEINFOW sei_tmp; /* modifiable copy of SHELLEXECUTEINFO struct */
WCHAR wfileName[MAX_PATH]; WCHAR wfileName[MAX_PATH];

View file

@ -164,10 +164,10 @@ HRESULT SHELL32_BindToSF (LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO* pp
return E_FAIL; return E_FAIL;
CComPtr<IShellFolder> psf; CComPtr<IShellFolder> psf;
HRESULT hr = SHELL32_CoCreateInitSF(pidlRoot, HRESULT hr = SHELL32_CoCreateInitSF(pidlRoot,
ppfti, ppfti,
pidlChild, pidlChild,
clsid, clsid,
IID_PPV_ARG(IShellFolder, &psf)); IID_PPV_ARG(IShellFolder, &psf));
ILFree(pidlChild); ILFree(pidlChild);

View file

@ -372,7 +372,7 @@
#define IDD_FORMAT_DRIVE 25 #define IDD_FORMAT_DRIVE 25
#define IDD_CHECK_DISK 26 #define IDD_CHECK_DISK 26
#define IDD_NOOPEN 27 #define IDD_NOOPEN 27
#define IDD_NEWEXTENSION 28 #define IDD_NEWEXTENSION 28
/* Not used dialogs */ /* Not used dialogs */
#define IDD_SHUTDOWN 29 #define IDD_SHUTDOWN 29
@ -702,8 +702,6 @@
#define IDM_MOVEHERE 0x8 #define IDM_MOVEHERE 0x8
#define IDM_LINKHERE 0xB #define IDM_LINKHERE 0xB
/* Registrar scripts (RGS) */ /* Registrar scripts (RGS) */
#define IDR_ADMINFOLDERSHORTCUT 128 #define IDR_ADMINFOLDERSHORTCUT 128
#define IDR_CONTROLPANEL 130 #define IDR_CONTROLPANEL 130

View file

@ -11,8 +11,6 @@
* 20050502 Fireball imported some stuff from WINE * 20050502 Fireball imported some stuff from WINE
*/ */
/* FIXME: This file should go away once we properly handle Vista+ APIs */
#include <stdarg.h> #include <stdarg.h>
#define WIN32_NO_STATUS #define WIN32_NO_STATUS

View file

@ -373,11 +373,11 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID
return; return;
} }
if( ( ( wEventId & SHCNE_NOITEMEVENTS ) && if( ( ( wEventId & SHCNE_NOITEMEVENTS ) &&
( wEventId & ~(SHCNE_NOITEMEVENTS | SHCNE_INTERRUPT) ) ) || ( wEventId & ~(SHCNE_NOITEMEVENTS | SHCNE_INTERRUPT) ) ) ||
( ( wEventId & SHCNE_ONEITEMEVENTS ) && ( ( wEventId & SHCNE_ONEITEMEVENTS ) &&
( wEventId & ~(SHCNE_ONEITEMEVENTS | SHCNE_INTERRUPT) ) ) || ( wEventId & ~(SHCNE_ONEITEMEVENTS | SHCNE_INTERRUPT) ) ) ||
( ( wEventId & SHCNE_TWOITEMEVENTS ) && ( ( wEventId & SHCNE_TWOITEMEVENTS ) &&
( wEventId & ~(SHCNE_TWOITEMEVENTS | SHCNE_INTERRUPT) ) ) ) ( wEventId & ~(SHCNE_TWOITEMEVENTS | SHCNE_INTERRUPT) ) ) )
{ {
WARN("mutually incompatible events listed\n"); WARN("mutually incompatible events listed\n");

View file

@ -293,7 +293,7 @@ static BOOL HCR_RegGetIconA(HKEY hkey, LPSTR szDest, LPCSTR szName, DWORD len, i
BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx) BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx)
{ {
static const WCHAR swDefaultIcon[] = {'\\','D','e','f','a','u','l','t','I','c','o','n',0}; static const WCHAR swDefaultIcon[] = {'\\','D','e','f','a','u','l','t','I','c','o','n',0};
HKEY hkey; HKEY hkey;
WCHAR sTemp[MAX_PATH]; WCHAR sTemp[MAX_PATH];
BOOL ret = FALSE; BOOL ret = FALSE;
@ -371,7 +371,7 @@ BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
if (HCR_RegOpenClassIDKey(riid, &hkey)) if (HCR_RegOpenClassIDKey(riid, &hkey))
#endif #endif
{ {
static const WCHAR wszLocalizedString[] = static const WCHAR wszLocalizedString[] =
{ 'L','o','c','a','l','i','z','e','d','S','t','r','i','n','g', 0 }; { 'L','o','c','a','l','i','z','e','d','S','t','r','i','n','g', 0 };
if (!RegLoadMUIStringW(hkey, wszLocalizedString, szDest, len, NULL, 0, NULL) || if (!RegLoadMUIStringW(hkey, wszLocalizedString, szDest, len, NULL, 0, NULL) ||
!RegQueryValueExW(hkey, swEmpty, 0, NULL, (LPBYTE)szDest, &len)) !RegQueryValueExW(hkey, swEmpty, 0, NULL, (LPBYTE)szDest, &len))
@ -520,7 +520,7 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes)
LONG lResult; LONG lResult;
DWORD dwTemp, dwLen; DWORD dwTemp, dwLen;
static const WCHAR wszAttributes[] = { 'A','t','t','r','i','b','u','t','e','s',0 }; static const WCHAR wszAttributes[] = { 'A','t','t','r','i','b','u','t','e','s',0 };
static const WCHAR wszCallForAttributes[] = { static const WCHAR wszCallForAttributes[] = {
'C','a','l','l','F','o','r','A','t','t','r','i','b','u','t','e','s',0 }; 'C','a','l','l','F','o','r','A','t','t','r','i','b','u','t','e','s',0 };
WCHAR wszShellFolderKey[] = { 'C','L','S','I','D','\\','{','0','0','0','2','1','4','0','0','-', WCHAR wszShellFolderKey[] = { 'C','L','S','I','D','\\','{','0','0','0','2','1','4','0','0','-',
'0','0','0','0','-','0','0','0','0','-','C','0','0','0','-','0','0','0','0','0','0','0', '0','0','0','0','-','0','0','0','0','-','C','0','0','0','-','0','0','0','0','0','0','0',

View file

@ -1306,7 +1306,7 @@ BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
IShellFolder_Release(psfFolder); IShellFolder_Release(psfFolder);
return FALSE; return FALSE;
} }
hr = IShellFolder_GetDisplayNameOf(psfFolder, pidlLast, SHGDN_FORPARSING, &strret); hr = IShellFolder_GetDisplayNameOf(psfFolder, pidlLast, SHGDN_FORPARSING, &strret);
IShellFolder_Release(psfFolder); IShellFolder_Release(psfFolder);
if (FAILED(hr)) return FALSE; if (FAILED(hr)) return FALSE;

View file

@ -1098,7 +1098,7 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM
{ {
BITMAP bmpLogo; BITMAP bmpLogo;
GetObject( hLogoBmp, sizeof(BITMAP), &bmpLogo ); GetObject(hLogoBmp, sizeof(BITMAP), &bmpLogo);
cxLogoBmp = bmpLogo.bmWidth; cxLogoBmp = bmpLogo.bmWidth;
cyLogoBmp = bmpLogo.bmHeight; cyLogoBmp = bmpLogo.bmHeight;
@ -1107,28 +1107,28 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM
// Set App-specific stuff (icon, app name, szOtherStuff string) // Set App-specific stuff (icon, app name, szOtherStuff string)
SendDlgItemMessageW(hWnd, IDC_ABOUT_ICON, STM_SETICON, (WPARAM)info->hIcon, 0); SendDlgItemMessageW(hWnd, IDC_ABOUT_ICON, STM_SETICON, (WPARAM)info->hIcon, 0);
GetWindowTextW( hWnd, szAppTitleTemplate, sizeof(szAppTitleTemplate) / sizeof(WCHAR) ); GetWindowTextW(hWnd, szAppTitleTemplate, ARRAY_SIZE(szAppTitleTemplate));
swprintf( szAppTitle, szAppTitleTemplate, info->szApp ); swprintf(szAppTitle, szAppTitleTemplate, info->szApp);
SetWindowTextW( hWnd, szAppTitle ); SetWindowTextW(hWnd, szAppTitle);
SetDlgItemTextW( hWnd, IDC_ABOUT_APPNAME, info->szApp ); SetDlgItemTextW(hWnd, IDC_ABOUT_APPNAME, info->szApp);
#ifdef __REACTOS__ #ifdef __REACTOS__
SetDlgItemTextW( hWnd, IDC_ABOUT_VERSION, info->szOSVersion ); SetDlgItemTextW(hWnd, IDC_ABOUT_VERSION, info->szOSVersion);
#endif #endif
SetDlgItemTextW( hWnd, IDC_ABOUT_OTHERSTUFF, info->szOtherStuff ); SetDlgItemTextW(hWnd, IDC_ABOUT_OTHERSTUFF, info->szOtherStuff);
// Set the registered user and organization name // Set the registered user and organization name
if(RegOpenKeyExW( HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_QUERY_VALUE, &hRegKey ) == ERROR_SUCCESS) if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_QUERY_VALUE, &hRegKey) == ERROR_SUCCESS)
{ {
SetRegTextData( hWnd, hRegKey, L"RegisteredOwner", IDC_ABOUT_REG_USERNAME ); SetRegTextData(hWnd, hRegKey, L"RegisteredOwner", IDC_ABOUT_REG_USERNAME);
SetRegTextData( hWnd, hRegKey, L"RegisteredOrganization", IDC_ABOUT_REG_ORGNAME ); SetRegTextData(hWnd, hRegKey, L"RegisteredOrganization", IDC_ABOUT_REG_ORGNAME);
RegCloseKey( hRegKey ); RegCloseKey(hRegKey);
} }
// Set the value for the installed physical memory // Set the value for the installed physical memory
MemStat.dwLength = sizeof(MemStat); MemStat.dwLength = sizeof(MemStat);
if( GlobalMemoryStatusEx(&MemStat) ) if(GlobalMemoryStatusEx(&MemStat))
{ {
WCHAR szBuf[12]; WCHAR szBuf[12];
@ -1152,24 +1152,24 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM
MemStat.ullTotalPhys /= 1024; MemStat.ullTotalPhys /= 1024;
dTotalPhys = (double)MemStat.ullTotalPhys / 1024; dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
wcscpy( szUnits, L"PB" ); wcscpy(szUnits, L"PB");
} }
else else
{ {
dTotalPhys = (double)MemStat.ullTotalPhys / 1024; dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
wcscpy( szUnits, L"TB" ); wcscpy(szUnits, L"TB");
} }
} }
else else
{ {
dTotalPhys = (double)MemStat.ullTotalPhys / 1024; dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
wcscpy( szUnits, L"GB" ); wcscpy(szUnits, L"GB");
} }
// We need the decimal point of the current locale to display the RAM size correctly // We need the decimal point of the current locale to display the RAM size correctly
if (GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, if (GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL,
szDecimalSeparator, szDecimalSeparator,
sizeof(szDecimalSeparator) / sizeof(WCHAR)) > 0) ARRAY_SIZE(szDecimalSeparator)) > 0)
{ {
UCHAR uDecimals; UCHAR uDecimals;
UINT uIntegral; UINT uIntegral;
@ -1184,16 +1184,16 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM
else else
{ {
// We're dealing with MBs, don't show any decimals // We're dealing with MBs, don't show any decimals
swprintf( szBuf, L"%u MB", (UINT)MemStat.ullTotalPhys / 1024 / 1024 ); swprintf(szBuf, L"%u MB", (UINT)MemStat.ullTotalPhys / 1024 / 1024);
} }
SetDlgItemTextW( hWnd, IDC_ABOUT_PHYSMEM, szBuf); SetDlgItemTextW(hWnd, IDC_ABOUT_PHYSMEM, szBuf);
} }
// Add the Authors dialog // Add the Authors dialog
hWndAuthors = CreateDialogW( shell32_hInstance, MAKEINTRESOURCEW(IDD_ABOUT_AUTHORS), hWnd, AboutAuthorsDlgProc ); hWndAuthors = CreateDialogW(shell32_hInstance, MAKEINTRESOURCEW(IDD_ABOUT_AUTHORS), hWnd, AboutAuthorsDlgProc);
LoadStringW( shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, sizeof(szAuthorsText) / sizeof(WCHAR) ); LoadStringW(shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, ARRAY_SIZE(szAuthorsText));
SetDlgItemTextW( hWnd, IDC_ABOUT_AUTHORS, szAuthorsText ); SetDlgItemTextW(hWnd, IDC_ABOUT_AUTHORS, szAuthorsText);
} }
return TRUE; return TRUE;
@ -1238,16 +1238,16 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM
if(bShowingAuthors) if(bShowingAuthors)
{ {
LoadStringW( shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, sizeof(szAuthorsText) / sizeof(WCHAR) ); LoadStringW(shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, ARRAY_SIZE(szAuthorsText));
ShowWindow( hWndAuthors, SW_HIDE ); ShowWindow(hWndAuthors, SW_HIDE);
} }
else else
{ {
LoadStringW( shell32_hInstance, IDS_SHELL_ABOUT_BACK, szAuthorsText, sizeof(szAuthorsText) / sizeof(WCHAR) ); LoadStringW(shell32_hInstance, IDS_SHELL_ABOUT_BACK, szAuthorsText, ARRAY_SIZE(szAuthorsText));
ShowWindow( hWndAuthors, SW_SHOW ); ShowWindow(hWndAuthors, SW_SHOW);
} }
SetDlgItemTextW( hWnd, IDC_ABOUT_AUTHORS, szAuthorsText ); SetDlgItemTextW(hWnd, IDC_ABOUT_AUTHORS, szAuthorsText);
bShowingAuthors = !bShowingAuthors; bShowingAuthors = !bShowingAuthors;
return TRUE; return TRUE;
} }

View file

@ -26,6 +26,8 @@
extern "C" { extern "C" {
#endif #endif
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
/******************************************* /*******************************************
* global SHELL32.DLL variables * global SHELL32.DLL variables
*/ */

View file

@ -144,7 +144,7 @@ HRESULT WINAPI SHCoCreateInstance(
} }
/* we look up the dll path in the registry */ /* we look up the dll path in the registry */
SHStringFromGUIDW(myclsid, sClassID, sizeof(sClassID)/sizeof(WCHAR)); SHStringFromGUIDW(myclsid, sClassID, ARRAY_SIZE(sClassID));
lstrcpyW(sKeyName, sCLSID); lstrcpyW(sKeyName, sCLSID);
lstrcatW(sKeyName, sClassID); lstrcatW(sKeyName, sClassID);
lstrcatW(sKeyName, sInProcServer32); lstrcatW(sKeyName, sInProcServer32);

View file

@ -355,12 +355,12 @@ int ShellMessageBoxW(
hInstance,hWnd,lpText,lpCaption,uType); hInstance,hWnd,lpText,lpCaption,uType);
if (IS_INTRESOURCE(lpCaption)) if (IS_INTRESOURCE(lpCaption))
LoadStringW(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle)/sizeof(szTitle[0])); LoadStringW(hInstance, LOWORD(lpCaption), szTitle, ARRAY_SIZE(szTitle));
else else
pszTitle = lpCaption; pszTitle = lpCaption;
if (IS_INTRESOURCE(lpText)) if (IS_INTRESOURCE(lpText))
LoadStringW(hInstance, LOWORD(lpText), szText, sizeof(szText)/sizeof(szText[0])); LoadStringW(hInstance, LOWORD(lpText), szText, ARRAY_SIZE(szText));
else else
pszText = lpText; pszText = lpText;
@ -1322,11 +1322,8 @@ BOOL WINAPI IsUserAnAdmin(VOID)
DWORD i; DWORD i;
BOOL bResult = FALSE; BOOL bResult = FALSE;
TRACE("\n");
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken)) if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken))
{
return FALSE; return FALSE;
}
if (!GetTokenInformation(hToken, TokenGroups, NULL, 0, &dwSize)) if (!GetTokenInformation(hToken, TokenGroups, NULL, 0, &dwSize))
{ {
@ -1900,7 +1897,7 @@ HRESULT WINAPI SHCreateStdEnumFmtEtc(
*/ */
BOOL WINAPI SHFindFiles( LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile ) BOOL WINAPI SHFindFiles( LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile )
{ {
FIXME("%p %p\n", pidlFolder, pidlSaveFile ); FIXME("%p %p\n", pidlFolder, pidlSaveFile);
return FALSE; return FALSE;
} }

View file

@ -574,7 +574,6 @@ static const WCHAR MusicW[] = {'M','u','s','i','c','\0'};
static const WCHAR Music_PlaylistsW[] = {'M','u','s','i','c','\\','P','l','a','y','l','i','s','t','s','\0'}; static const WCHAR Music_PlaylistsW[] = {'M','u','s','i','c','\\','P','l','a','y','l','i','s','t','s','\0'};
static const WCHAR Music_Sample_MusicW[] = {'M','u','s','i','c','\\','S','a','m','p','l','e',' ','M','u','s','i','c','\0'}; static const WCHAR Music_Sample_MusicW[] = {'M','u','s','i','c','\\','S','a','m','p','l','e',' ','M','u','s','i','c','\0'};
static const WCHAR Music_Sample_PlaylistsW[] = {'M','u','s','i','c','\\','S','a','m','p','l','e',' ','P','l','a','y','l','i','s','t','s','\0'}; static const WCHAR Music_Sample_PlaylistsW[] = {'M','u','s','i','c','\\','S','a','m','p','l','e',' ','P','l','a','y','l','i','s','t','s','\0'};
static const WCHAR My_DocumentsW[] = {'M','y',' ','D','o','c','u','m','e','n','t','s','\0'};
#endif #endif
static const WCHAR My_MusicW[] = {'M','y',' ','M','u','s','i','c','\0'}; static const WCHAR My_MusicW[] = {'M','y',' ','M','u','s','i','c','\0'};
static const WCHAR My_PicturesW[] = {'M','y',' ','P','i','c','t','u','r','e','s','\0'}; static const WCHAR My_PicturesW[] = {'M','y',' ','P','i','c','t','u','r','e','s','\0'};
@ -1484,7 +1483,7 @@ static HRESULT _SHGetDefaultValue(HANDLE hToken, BYTE folder, LPWSTR pszPath)
TRACE("0x%02x,%p\n", folder, pszPath); TRACE("0x%02x,%p\n", folder, pszPath);
if (folder >= sizeof(CSIDL_Data) / sizeof(CSIDL_Data[0])) if (folder >= ARRAY_SIZE(CSIDL_Data))
return E_INVALIDARG; return E_INVALIDARG;
if (!pszPath) if (!pszPath)
return E_INVALIDARG; return E_INVALIDARG;
@ -1566,7 +1565,7 @@ static HRESULT _SHGetCurrentVersionPath(DWORD dwFlags, BYTE folder,
TRACE("0x%08x,0x%02x,%p\n", dwFlags, folder, pszPath); TRACE("0x%08x,0x%02x,%p\n", dwFlags, folder, pszPath);
if (folder >= sizeof(CSIDL_Data) / sizeof(CSIDL_Data[0])) if (folder >= ARRAY_SIZE(CSIDL_Data))
return E_INVALIDARG; return E_INVALIDARG;
if (CSIDL_Data[folder].type != CSIDL_Type_CurrVer) if (CSIDL_Data[folder].type != CSIDL_Type_CurrVer)
return E_INVALIDARG; return E_INVALIDARG;
@ -1670,7 +1669,7 @@ static HRESULT _SHGetUserProfilePath(HANDLE hToken, DWORD dwFlags, BYTE folder,
TRACE("%p,0x%08x,0x%02x,%p\n", hToken, dwFlags, folder, pszPath); TRACE("%p,0x%08x,0x%02x,%p\n", hToken, dwFlags, folder, pszPath);
if (folder >= sizeof(CSIDL_Data) / sizeof(CSIDL_Data[0])) if (folder >= ARRAY_SIZE(CSIDL_Data))
return E_INVALIDARG; return E_INVALIDARG;
if (CSIDL_Data[folder].type != CSIDL_Type_User) if (CSIDL_Data[folder].type != CSIDL_Type_User)
return E_INVALIDARG; return E_INVALIDARG;
@ -1737,7 +1736,7 @@ static HRESULT _SHGetAllUsersProfilePath(DWORD dwFlags, BYTE folder,
TRACE("0x%08x,0x%02x,%p\n", dwFlags, folder, pszPath); TRACE("0x%08x,0x%02x,%p\n", dwFlags, folder, pszPath);
if (folder >= sizeof(CSIDL_Data) / sizeof(CSIDL_Data[0])) if (folder >= ARRAY_SIZE(CSIDL_Data))
return E_INVALIDARG; return E_INVALIDARG;
if (CSIDL_Data[folder].type != CSIDL_Type_AllUsers) if (CSIDL_Data[folder].type != CSIDL_Type_AllUsers)
return E_INVALIDARG; return E_INVALIDARG;
@ -1961,7 +1960,6 @@ HRESULT WINAPI SHGetFolderPathAndSubDirA(
HRESULT hr = S_OK; HRESULT hr = S_OK;
LPWSTR pszSubPathW = NULL; LPWSTR pszSubPathW = NULL;
LPWSTR pszPathW = NULL; LPWSTR pszPathW = NULL;
TRACE("%08x,%08x,%s\n",nFolder, dwFlags, debugstr_w(pszSubPathW));
if(pszPath) { if(pszPath) {
pszPathW = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR)); pszPathW = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
@ -2013,8 +2011,6 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW(
DWORD folder = nFolder & CSIDL_FOLDER_MASK; DWORD folder = nFolder & CSIDL_FOLDER_MASK;
CSIDL_Type type; CSIDL_Type type;
int ret; int ret;
TRACE("%p,%p,nFolder=0x%04x,%s\n", hwndOwner,pszPath,nFolder,debugstr_w(pszSubPath));
/* Windows always NULL-terminates the resulting path regardless of success /* Windows always NULL-terminates the resulting path regardless of success
* or failure, so do so first * or failure, so do so first
@ -2022,7 +2018,7 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW(
if (pszPath) if (pszPath)
*pszPath = '\0'; *pszPath = '\0';
if (folder >= sizeof(CSIDL_Data) / sizeof(CSIDL_Data[0])) if (folder >= ARRAY_SIZE(CSIDL_Data))
return E_INVALIDARG; return E_INVALIDARG;
if ((SHGFP_TYPE_CURRENT != dwFlags) && (SHGFP_TYPE_DEFAULT != dwFlags)) if ((SHGFP_TYPE_CURRENT != dwFlags) && (SHGFP_TYPE_DEFAULT != dwFlags))
return E_INVALIDARG; return E_INVALIDARG;
@ -2150,8 +2146,6 @@ HRESULT WINAPI SHGetFolderPathA(
WCHAR szTemp[MAX_PATH]; WCHAR szTemp[MAX_PATH];
HRESULT hr; HRESULT hr;
TRACE("%p,%p,nFolder=0x%04x\n",hwndOwner,pszPath,nFolder);
if (pszPath) if (pszPath)
*pszPath = '\0'; *pszPath = '\0';
hr = SHGetFolderPathW(hwndOwner, nFolder, hToken, dwFlags, szTemp); hr = SHGetFolderPathW(hwndOwner, nFolder, hToken, dwFlags, szTemp);
@ -2319,7 +2313,7 @@ static HRESULT _SHRegisterUserShellFolders(BOOL bDefault)
} }
hr = _SHRegisterFolders(hRootKey, hToken, pUserShellFolderPath, hr = _SHRegisterFolders(hRootKey, hToken, pUserShellFolderPath,
pShellFolderPath, folders, sizeof(folders) / sizeof(folders[0])); pShellFolderPath, folders, ARRAY_SIZE(folders));
TRACE("returning 0x%08x\n", hr); TRACE("returning 0x%08x\n", hr);
return hr; return hr;
} }
@ -2344,7 +2338,7 @@ static HRESULT _SHRegisterCommonShellFolders(void)
TRACE("\n"); TRACE("\n");
hr = _SHRegisterFolders(HKEY_LOCAL_MACHINE, NULL, szSHUserFolders, hr = _SHRegisterFolders(HKEY_LOCAL_MACHINE, NULL, szSHUserFolders,
szSHFolders, folders, sizeof(folders) / sizeof(folders[0])); szSHFolders, folders, ARRAY_SIZE(folders));
TRACE("returning 0x%08x\n", hr); TRACE("returning 0x%08x\n", hr);
return hr; return hr;
} }

View file

@ -82,7 +82,7 @@ HRESULT WINAPI SHRegQueryValueExA(
LPDWORD lpcbData) LPDWORD lpcbData)
{ {
TRACE("%p %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData); TRACE("%p %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData); return RegQueryValueExA(hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
} }
/************************************************************************* /*************************************************************************
@ -107,7 +107,7 @@ HRESULT WINAPI SHRegQueryValueW(
* if the datatype REG_EXPAND_SZ then expand the string and change * if the datatype REG_EXPAND_SZ then expand the string and change
* *pdwType to REG_SZ. * *pdwType to REG_SZ.
*/ */
HRESULT WINAPI SHRegQueryValueExW ( HRESULT WINAPI SHRegQueryValueExW(
HKEY hkey, HKEY hkey,
LPWSTR pszValue, LPWSTR pszValue,
LPDWORD pdwReserved, LPDWORD pdwReserved,
@ -116,9 +116,9 @@ HRESULT WINAPI SHRegQueryValueExW (
LPDWORD pcbData) LPDWORD pcbData)
{ {
DWORD ret; DWORD ret;
WARN("%p %s %p %p %p %p semi-stub\n", TRACE("%p %s %p %p %p %p\n",
hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData); hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
ret = RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData); ret = RegQueryValueExW(hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
return ret; return ret;
} }