mirror of
https://github.com/reactos/reactos.git
synced 2024-11-23 11:33:31 +08:00
[SHELL32] Tweak formatting and logging
Some style-improvements I wanted to apply before a planned backport. E.g. The biggest source-file CDefView.cpp in [SHELL32] can be shrinked considerably by stripping some outdated comments from 10 and more years ago, when this class was still non-OOP and named ShellView. Less excessive line-lengths also here and there. In case it is not obvious when reviewing: In the beginning of CDevView.cpp in the declaration-part I just reduced the indentation-level by 4 spaces for a big block. Some shell classes were touched during 0.4.15-dev'ing for fixes like the 'unkown'-typo in 0.4.15-dev-6323-g3854a5d8e9
for example or missing \n were added to dbgprints like in 0.4.15-dev-4492-g03422451b3
Touched again here, because I want to port those improvements back, but don't intend to increase the size in older releases. The commit looks big, but does consist solely of trivialities. There is no functional change in this commit, aside the logging ofc.
This commit is contained in:
parent
b02dd8eb22
commit
6f91b6c0fe
File diff suppressed because it is too large
Load Diff
@ -1193,7 +1193,7 @@ CDefaultContextMenu::TryToBrowse(
|
||||
hr = SHILCombine(m_pidlFolder, pidlChild, &pidl);
|
||||
if (FAILED_UNEXPECTEDLY(hr))
|
||||
return hr;
|
||||
|
||||
|
||||
hr = psb->BrowseObject(pidl, wFlags & ~SBSP_RELATIVE);
|
||||
ILFree(pidl);
|
||||
return hr;
|
||||
|
@ -716,7 +716,7 @@ BOOL COpenWithList::SetDefaultHandler(SApp *pApp, LPCWSTR pwszFilename)
|
||||
/* Create file extension key */
|
||||
if (RegCreateKeyExW(HKEY_CLASSES_ROOT, pwszExt, 0, NULL, 0, KEY_READ|KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS)
|
||||
{
|
||||
ERR("Cannot open ext key\n");
|
||||
ERR("Can't open ext key\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -870,7 +870,7 @@ BOOL COpenWithDialog::IsNoOpen(HWND hwnd)
|
||||
return TRUE;
|
||||
else if (dReturnValue == -1)
|
||||
{
|
||||
ERR("IsNoOpen failed to load the dialog box.\n");
|
||||
ERR("IsNoOpen failed to load dialog box\n");
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -2572,7 +2572,7 @@ HRESULT STDMETHODCALLTYPE CShellLink::InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
|
||||
HRESULT hr = Resolve(lpici->hwnd, 0);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
TRACE("failed to resolve component with error 0x%08x\n", hr);
|
||||
TRACE("failed to resolve component error 0x%08x\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
@ -283,7 +283,7 @@ Options_RunDLLCommon(HWND hWnd, HINSTANCE hInst, int fOptions, DWORD nCmdShow)
|
||||
|
||||
case 1:
|
||||
// show taskbar options dialog
|
||||
FIXME("notify explorer to show taskbar options dialog\n");
|
||||
FIXME("notify explorer to show taskbar options dlg\n");
|
||||
//PostMessage(GetShellWindow(), WM_USER+22, fOptions, 0);
|
||||
break;
|
||||
|
||||
|
@ -491,7 +491,7 @@ HRESULT CFSDropTarget::_DoDrop(IDataObject *pDataObject,
|
||||
if (SUCCEEDED(pDataObject->QueryGetData(&fmt)))
|
||||
{
|
||||
hr = pDataObject->GetData(&fmt, &medium);
|
||||
TRACE("CFSTR_SHELLIDLIST.\n");
|
||||
TRACE("CFSTR_SHELLIDLIST\n");
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("CFSTR_SHELLIDLIST failed\n");
|
||||
@ -721,7 +721,7 @@ HRESULT CFSDropTarget::_DoDrop(IDataObject *pDataObject,
|
||||
}
|
||||
else
|
||||
{
|
||||
ERR("No viable drop format.\n");
|
||||
ERR("No viable drop format\n");
|
||||
hr = E_FAIL;
|
||||
}
|
||||
return hr;
|
||||
|
@ -411,7 +411,7 @@ HRESULT WINAPI CControlPanelFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_A
|
||||
else if (_ILIsSpecialFolder(*apidl))
|
||||
m_regFolder->GetAttributesOf(1, apidl, rgfInOut);
|
||||
else
|
||||
ERR("Got an unknown pidl here!\n");
|
||||
ERR("Got unknown pidl\n");
|
||||
apidl++;
|
||||
cidl--;
|
||||
}
|
||||
@ -448,7 +448,6 @@ HRESULT WINAPI CControlPanelFolder::GetUIObjectOf(HWND hwndOwner,
|
||||
*ppvOut = NULL;
|
||||
|
||||
if (IsEqualIID(riid, IID_IContextMenu) && (cidl >= 1)) {
|
||||
|
||||
/* HACK: We should use callbacks from CDefaultContextMenu instead of creating one on our own */
|
||||
BOOL bHasCpl = FALSE;
|
||||
for (UINT i = 0; i < cidl; i++)
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <precomp.h>
|
||||
#include <process.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
|
||||
@ -599,7 +599,7 @@ CDrivesFolder::CDrivesFolder()
|
||||
|
||||
CDrivesFolder::~CDrivesFolder()
|
||||
{
|
||||
TRACE ("-- destroying IShellFolder(%p)\n", this);
|
||||
TRACE("-- destroying IShellFolder(%p)\n", this);
|
||||
SHFree(pidlRoot);
|
||||
}
|
||||
|
||||
@ -680,13 +680,13 @@ HRESULT WINAPI CDrivesFolder::ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLEST
|
||||
else if (_ILIsSpecialFolder(pidlTemp))
|
||||
m_regFolder->GetAttributesOf(1, &pidlTemp, pdwAttributes);
|
||||
else
|
||||
ERR("Got an unknown pidl here!\n");
|
||||
ERR("Got unknown pidl\n");
|
||||
}
|
||||
}
|
||||
|
||||
*ppidl = pidlTemp;
|
||||
|
||||
TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
|
||||
TRACE("(%p)->(-- ret=0x%08x)\n", this, hr);
|
||||
|
||||
return hr;
|
||||
}
|
||||
@ -867,7 +867,7 @@ HRESULT WINAPI CDrivesFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVO
|
||||
SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
|
||||
hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
|
||||
}
|
||||
TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
|
||||
TRACE("-- (%p)->(interface=%p)\n", this, ppvOut);
|
||||
return hr;
|
||||
}
|
||||
|
||||
@ -876,8 +876,8 @@ HRESULT WINAPI CDrivesFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVO
|
||||
*/
|
||||
HRESULT WINAPI CDrivesFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD * rgfInOut)
|
||||
{
|
||||
TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
|
||||
this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
|
||||
TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
|
||||
this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
|
||||
|
||||
if (cidl && !apidl)
|
||||
return E_INVALIDARG;
|
||||
@ -911,7 +911,7 @@ HRESULT WINAPI CDrivesFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY a
|
||||
/* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
|
||||
*rgfInOut &= ~SFGAO_VALIDATE;
|
||||
|
||||
TRACE ("-- result=0x%08x\n", *rgfInOut);
|
||||
TRACE("-- result=0x%08x\n", *rgfInOut);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -951,8 +951,8 @@ HRESULT WINAPI CDrivesFolder::GetUIObjectOf(HWND hwndOwner,
|
||||
}
|
||||
else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
|
||||
{
|
||||
hr = IDataObject_Constructor (hwndOwner,
|
||||
pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
|
||||
hr = IDataObject_Constructor(hwndOwner,
|
||||
pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
|
||||
}
|
||||
else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
|
||||
{
|
||||
@ -977,7 +977,7 @@ HRESULT WINAPI CDrivesFolder::GetUIObjectOf(HWND hwndOwner,
|
||||
hr = E_OUTOFMEMORY;
|
||||
|
||||
*ppvOut = pObj;
|
||||
TRACE ("(%p)->hr=0x%08x\n", this, hr);
|
||||
TRACE("(%p)->hr=0x%08x\n", this, hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
@ -989,7 +989,7 @@ HRESULT WINAPI CDrivesFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFla
|
||||
LPWSTR pszPath;
|
||||
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);
|
||||
|
||||
if (!strRet)
|
||||
@ -1029,9 +1029,9 @@ HRESULT WINAPI CDrivesFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFla
|
||||
DWORD dwVolumeSerialNumber, dwMaximumComponentLength, dwFileSystemFlags;
|
||||
|
||||
GetVolumeInformationW(wszDrive, pszPath,
|
||||
MAX_PATH - 7,
|
||||
&dwVolumeSerialNumber,
|
||||
&dwMaximumComponentLength, &dwFileSystemFlags, NULL, 0);
|
||||
MAX_PATH - 7,
|
||||
&dwVolumeSerialNumber,
|
||||
&dwMaximumComponentLength, &dwFileSystemFlags, NULL, 0);
|
||||
pszPath[MAX_PATH-1] = L'\0';
|
||||
|
||||
if (!wcslen(pszPath))
|
||||
@ -1062,10 +1062,10 @@ HRESULT WINAPI CDrivesFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFla
|
||||
}
|
||||
}
|
||||
}
|
||||
wcscat (pszPath, L" (");
|
||||
wcscat(pszPath, L" (");
|
||||
wszDrive[2] = L'\0';
|
||||
wcscat (pszPath, wszDrive);
|
||||
wcscat (pszPath, L")");
|
||||
wcscat(pszPath, wszDrive);
|
||||
wcscat(pszPath, L")");
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
@ -1111,19 +1111,19 @@ HRESULT WINAPI CDrivesFolder::SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl,
|
||||
|
||||
HRESULT WINAPI CDrivesFolder::GetDefaultSearchGUID(GUID * pguid)
|
||||
{
|
||||
FIXME ("(%p)\n", this);
|
||||
FIXME("(%p)\n", this);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT WINAPI CDrivesFolder::EnumSearches(IEnumExtraSearch ** ppenum)
|
||||
{
|
||||
FIXME ("(%p)\n", this);
|
||||
FIXME("(%p)\n", this);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT WINAPI CDrivesFolder::GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
|
||||
{
|
||||
TRACE ("(%p)\n", this);
|
||||
TRACE("(%p)\n", this);
|
||||
|
||||
if (pSort)
|
||||
*pSort = 0;
|
||||
@ -1134,7 +1134,7 @@ HRESULT WINAPI CDrivesFolder::GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG
|
||||
|
||||
HRESULT WINAPI CDrivesFolder::GetDefaultColumnState(UINT iColumn, DWORD * pcsFlags)
|
||||
{
|
||||
TRACE ("(%p)\n", this);
|
||||
TRACE("(%p)\n", this);
|
||||
|
||||
if (!pcsFlags || iColumn >= _countof(MyComputerSFHeader))
|
||||
return E_INVALIDARG;
|
||||
@ -1144,7 +1144,7 @@ HRESULT WINAPI CDrivesFolder::GetDefaultColumnState(UINT iColumn, DWORD * pcsFla
|
||||
|
||||
HRESULT WINAPI CDrivesFolder::GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID * pscid, VARIANT * pv)
|
||||
{
|
||||
FIXME ("(%p)\n", this);
|
||||
FIXME("(%p)\n", this);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
@ -1152,7 +1152,7 @@ HRESULT WINAPI CDrivesFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, S
|
||||
{
|
||||
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 >= _countof(MyComputerSFHeader))
|
||||
return E_INVALIDARG;
|
||||
@ -1232,7 +1232,7 @@ HRESULT WINAPI CDrivesFolder::MapColumnToSCID(UINT column, SHCOLUMNID * pscid)
|
||||
*/
|
||||
HRESULT WINAPI CDrivesFolder::GetClassID(CLSID *lpClassId)
|
||||
{
|
||||
TRACE ("(%p)\n", this);
|
||||
TRACE("(%p)\n", this);
|
||||
|
||||
if (!lpClassId)
|
||||
return E_POINTER;
|
||||
|
@ -513,7 +513,7 @@ HRESULT WINAPI CRegFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apid
|
||||
if (_ILIsSpecialFolder(*apidl))
|
||||
GetGuidItemAttributes(*apidl, rgfInOut);
|
||||
else
|
||||
ERR("Got an unknown pidl here!\n");
|
||||
ERR("Got unknown pidl\n");
|
||||
apidl++;
|
||||
cidl--;
|
||||
}
|
||||
|
@ -533,7 +533,7 @@ RSHELL_CStartMenu_CreateInstance(REFIID riid, void **ppv)
|
||||
hr = SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAMS, &pidlProgramsAbsolute);
|
||||
if (FAILED_UNEXPECTEDLY(hr))
|
||||
{
|
||||
WARN("USER Programs folder not found.\n");
|
||||
WARN("USER Programs folder not found\n");
|
||||
hr = SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_PROGRAMS, &pidlProgramsAbsolute);
|
||||
if (FAILED_UNEXPECTEDLY(hr))
|
||||
return hr;
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* GetNextElement (internal function)
|
||||
*
|
||||
@ -424,8 +423,6 @@ SHOpenFolderAndSelectItems(PCIDLIST_ABSOLUTE pidlFolder,
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static
|
||||
DWORD WINAPI
|
||||
_ShowPropertiesDialogThread(LPVOID lpParameter)
|
||||
|
Loading…
Reference in New Issue
Block a user