Skip to content

Commit 6f91b6c

Browse files
committed
[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-g 3854a5d for example or missing \n were added to dbgprints like in 0.4.15-dev-4492-g 0342245 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.
1 parent b02dd8e commit 6f91b6c

File tree

11 files changed

+467
-654
lines changed

11 files changed

+467
-654
lines changed

dll/win32/shell32/CDefView.cpp

Lines changed: 432 additions & 615 deletions
Large diffs are not rendered by default.

dll/win32/shell32/CDefaultContextMenu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ CDefaultContextMenu::TryToBrowse(
11931193
hr = SHILCombine(m_pidlFolder, pidlChild, &pidl);
11941194
if (FAILED_UNEXPECTEDLY(hr))
11951195
return hr;
1196-
1196+
11971197
hr = psb->BrowseObject(pidl, wFlags & ~SBSP_RELATIVE);
11981198
ILFree(pidl);
11991199
return hr;

dll/win32/shell32/COpenWithMenu.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ BOOL COpenWithList::SetDefaultHandler(SApp *pApp, LPCWSTR pwszFilename)
716716
/* Create file extension key */
717717
if (RegCreateKeyExW(HKEY_CLASSES_ROOT, pwszExt, 0, NULL, 0, KEY_READ|KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS)
718718
{
719-
ERR("Cannot open ext key\n");
719+
ERR("Can't open ext key\n");
720720
return FALSE;
721721
}
722722

@@ -870,7 +870,7 @@ BOOL COpenWithDialog::IsNoOpen(HWND hwnd)
870870
return TRUE;
871871
else if (dReturnValue == -1)
872872
{
873-
ERR("IsNoOpen failed to load the dialog box.\n");
873+
ERR("IsNoOpen failed to load dialog box\n");
874874
return TRUE;
875875
}
876876
}

dll/win32/shell32/CShellLink.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2572,7 +2572,7 @@ HRESULT STDMETHODCALLTYPE CShellLink::InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
25722572
HRESULT hr = Resolve(lpici->hwnd, 0);
25732573
if (FAILED(hr))
25742574
{
2575-
TRACE("failed to resolve component with error 0x%08x\n", hr);
2575+
TRACE("failed to resolve component error 0x%08x\n", hr);
25762576
return hr;
25772577
}
25782578

dll/win32/shell32/dialogs/folder_options.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ Options_RunDLLCommon(HWND hWnd, HINSTANCE hInst, int fOptions, DWORD nCmdShow)
283283

284284
case 1:
285285
// show taskbar options dialog
286-
FIXME("notify explorer to show taskbar options dialog\n");
286+
FIXME("notify explorer to show taskbar options dlg\n");
287287
//PostMessage(GetShellWindow(), WM_USER+22, fOptions, 0);
288288
break;
289289

dll/win32/shell32/droptargets/CFSDropTarget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ HRESULT CFSDropTarget::_DoDrop(IDataObject *pDataObject,
491491
if (SUCCEEDED(pDataObject->QueryGetData(&fmt)))
492492
{
493493
hr = pDataObject->GetData(&fmt, &medium);
494-
TRACE("CFSTR_SHELLIDLIST.\n");
494+
TRACE("CFSTR_SHELLIDLIST\n");
495495
if (FAILED(hr))
496496
{
497497
ERR("CFSTR_SHELLIDLIST failed\n");
@@ -721,7 +721,7 @@ HRESULT CFSDropTarget::_DoDrop(IDataObject *pDataObject,
721721
}
722722
else
723723
{
724-
ERR("No viable drop format.\n");
724+
ERR("No viable drop format\n");
725725
hr = E_FAIL;
726726
}
727727
return hr;

dll/win32/shell32/folders/CControlPanelFolder.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ HRESULT WINAPI CControlPanelFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_A
411411
else if (_ILIsSpecialFolder(*apidl))
412412
m_regFolder->GetAttributesOf(1, apidl, rgfInOut);
413413
else
414-
ERR("Got an unknown pidl here!\n");
414+
ERR("Got unknown pidl\n");
415415
apidl++;
416416
cidl--;
417417
}
@@ -448,7 +448,6 @@ HRESULT WINAPI CControlPanelFolder::GetUIObjectOf(HWND hwndOwner,
448448
*ppvOut = NULL;
449449

450450
if (IsEqualIID(riid, IID_IContextMenu) && (cidl >= 1)) {
451-
452451
/* HACK: We should use callbacks from CDefaultContextMenu instead of creating one on our own */
453452
BOOL bHasCpl = FALSE;
454453
for (UINT i = 0; i < cidl; i++)

dll/win32/shell32/folders/CDrivesFolder.cpp

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <precomp.h>
2525
#include <process.h>
2626

27-
WINE_DEFAULT_DEBUG_CHANNEL (shell);
27+
WINE_DEFAULT_DEBUG_CHANNEL(shell);
2828

2929
/*
3030
CDrivesFolder should create a CRegFolder to represent the virtual items that exist only in
@@ -599,7 +599,7 @@ CDrivesFolder::CDrivesFolder()
599599

600600
CDrivesFolder::~CDrivesFolder()
601601
{
602-
TRACE ("-- destroying IShellFolder(%p)\n", this);
602+
TRACE("-- destroying IShellFolder(%p)\n", this);
603603
SHFree(pidlRoot);
604604
}
605605

@@ -680,13 +680,13 @@ HRESULT WINAPI CDrivesFolder::ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLEST
680680
else if (_ILIsSpecialFolder(pidlTemp))
681681
m_regFolder->GetAttributesOf(1, &pidlTemp, pdwAttributes);
682682
else
683-
ERR("Got an unknown pidl here!\n");
683+
ERR("Got unknown pidl\n");
684684
}
685685
}
686686

687687
*ppidl = pidlTemp;
688688

689-
TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
689+
TRACE("(%p)->(-- ret=0x%08x)\n", this, hr);
690690

691691
return hr;
692692
}
@@ -867,7 +867,7 @@ HRESULT WINAPI CDrivesFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVO
867867
SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
868868
hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
869869
}
870-
TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
870+
TRACE("-- (%p)->(interface=%p)\n", this, ppvOut);
871871
return hr;
872872
}
873873

@@ -876,8 +876,8 @@ HRESULT WINAPI CDrivesFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVO
876876
*/
877877
HRESULT WINAPI CDrivesFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD * rgfInOut)
878878
{
879-
TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
880-
this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
879+
TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
880+
this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
881881

882882
if (cidl && !apidl)
883883
return E_INVALIDARG;
@@ -911,7 +911,7 @@ HRESULT WINAPI CDrivesFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY a
911911
/* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
912912
*rgfInOut &= ~SFGAO_VALIDATE;
913913

914-
TRACE ("-- result=0x%08x\n", *rgfInOut);
914+
TRACE("-- result=0x%08x\n", *rgfInOut);
915915
return S_OK;
916916
}
917917

@@ -951,8 +951,8 @@ HRESULT WINAPI CDrivesFolder::GetUIObjectOf(HWND hwndOwner,
951951
}
952952
else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
953953
{
954-
hr = IDataObject_Constructor (hwndOwner,
955-
pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
954+
hr = IDataObject_Constructor(hwndOwner,
955+
pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
956956
}
957957
else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
958958
{
@@ -977,7 +977,7 @@ HRESULT WINAPI CDrivesFolder::GetUIObjectOf(HWND hwndOwner,
977977
hr = E_OUTOFMEMORY;
978978

979979
*ppvOut = pObj;
980-
TRACE ("(%p)->hr=0x%08x\n", this, hr);
980+
TRACE("(%p)->hr=0x%08x\n", this, hr);
981981
return hr;
982982
}
983983

@@ -989,7 +989,7 @@ HRESULT WINAPI CDrivesFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFla
989989
LPWSTR pszPath;
990990
HRESULT hr = S_OK;
991991

992-
TRACE ("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
992+
TRACE("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
993993
pdump (pidl);
994994

995995
if (!strRet)
@@ -1029,9 +1029,9 @@ HRESULT WINAPI CDrivesFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFla
10291029
DWORD dwVolumeSerialNumber, dwMaximumComponentLength, dwFileSystemFlags;
10301030

10311031
GetVolumeInformationW(wszDrive, pszPath,
1032-
MAX_PATH - 7,
1033-
&dwVolumeSerialNumber,
1034-
&dwMaximumComponentLength, &dwFileSystemFlags, NULL, 0);
1032+
MAX_PATH - 7,
1033+
&dwVolumeSerialNumber,
1034+
&dwMaximumComponentLength, &dwFileSystemFlags, NULL, 0);
10351035
pszPath[MAX_PATH-1] = L'\0';
10361036

10371037
if (!wcslen(pszPath))
@@ -1062,10 +1062,10 @@ HRESULT WINAPI CDrivesFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFla
10621062
}
10631063
}
10641064
}
1065-
wcscat (pszPath, L" (");
1065+
wcscat(pszPath, L" (");
10661066
wszDrive[2] = L'\0';
1067-
wcscat (pszPath, wszDrive);
1068-
wcscat (pszPath, L")");
1067+
wcscat(pszPath, wszDrive);
1068+
wcscat(pszPath, L")");
10691069
}
10701070

10711071
if (SUCCEEDED(hr))
@@ -1111,19 +1111,19 @@ HRESULT WINAPI CDrivesFolder::SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl,
11111111

11121112
HRESULT WINAPI CDrivesFolder::GetDefaultSearchGUID(GUID * pguid)
11131113
{
1114-
FIXME ("(%p)\n", this);
1114+
FIXME("(%p)\n", this);
11151115
return E_NOTIMPL;
11161116
}
11171117

11181118
HRESULT WINAPI CDrivesFolder::EnumSearches(IEnumExtraSearch ** ppenum)
11191119
{
1120-
FIXME ("(%p)\n", this);
1120+
FIXME("(%p)\n", this);
11211121
return E_NOTIMPL;
11221122
}
11231123

11241124
HRESULT WINAPI CDrivesFolder::GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
11251125
{
1126-
TRACE ("(%p)\n", this);
1126+
TRACE("(%p)\n", this);
11271127

11281128
if (pSort)
11291129
*pSort = 0;
@@ -1134,7 +1134,7 @@ HRESULT WINAPI CDrivesFolder::GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG
11341134

11351135
HRESULT WINAPI CDrivesFolder::GetDefaultColumnState(UINT iColumn, DWORD * pcsFlags)
11361136
{
1137-
TRACE ("(%p)\n", this);
1137+
TRACE("(%p)\n", this);
11381138

11391139
if (!pcsFlags || iColumn >= _countof(MyComputerSFHeader))
11401140
return E_INVALIDARG;
@@ -1144,15 +1144,15 @@ HRESULT WINAPI CDrivesFolder::GetDefaultColumnState(UINT iColumn, DWORD * pcsFla
11441144

11451145
HRESULT WINAPI CDrivesFolder::GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID * pscid, VARIANT * pv)
11461146
{
1147-
FIXME ("(%p)\n", this);
1147+
FIXME("(%p)\n", this);
11481148
return E_NOTIMPL;
11491149
}
11501150

11511151
HRESULT WINAPI CDrivesFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
11521152
{
11531153
HRESULT hr;
11541154

1155-
TRACE ("(%p)->(%p %i %p)\n", this, pidl, iColumn, psd);
1155+
TRACE("(%p)->(%p %i %p)\n", this, pidl, iColumn, psd);
11561156

11571157
if (!psd || iColumn >= _countof(MyComputerSFHeader))
11581158
return E_INVALIDARG;
@@ -1232,7 +1232,7 @@ HRESULT WINAPI CDrivesFolder::MapColumnToSCID(UINT column, SHCOLUMNID * pscid)
12321232
*/
12331233
HRESULT WINAPI CDrivesFolder::GetClassID(CLSID *lpClassId)
12341234
{
1235-
TRACE ("(%p)\n", this);
1235+
TRACE("(%p)\n", this);
12361236

12371237
if (!lpClassId)
12381238
return E_POINTER;

dll/win32/shell32/folders/CRegFolder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ HRESULT WINAPI CRegFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apid
513513
if (_ILIsSpecialFolder(*apidl))
514514
GetGuidItemAttributes(*apidl, rgfInOut);
515515
else
516-
ERR("Got an unknown pidl here!\n");
516+
ERR("Got unknown pidl\n");
517517
apidl++;
518518
cidl--;
519519
}

dll/win32/shell32/shellmenu/CStartMenu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ RSHELL_CStartMenu_CreateInstance(REFIID riid, void **ppv)
533533
hr = SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAMS, &pidlProgramsAbsolute);
534534
if (FAILED_UNEXPECTEDLY(hr))
535535
{
536-
WARN("USER Programs folder not found.\n");
536+
WARN("USER Programs folder not found\n");
537537
hr = SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_PROGRAMS, &pidlProgramsAbsolute);
538538
if (FAILED_UNEXPECTEDLY(hr))
539539
return hr;

dll/win32/shell32/shlfolder.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
WINE_DEFAULT_DEBUG_CHANNEL(shell);
2828

29-
3029
/***************************************************************************
3130
* GetNextElement (internal function)
3231
*
@@ -424,8 +423,6 @@ SHOpenFolderAndSelectItems(PCIDLIST_ABSOLUTE pidlFolder,
424423
return E_FAIL;
425424
}
426425

427-
428-
429426
static
430427
DWORD WINAPI
431428
_ShowPropertiesDialogThread(LPVOID lpParameter)

0 commit comments

Comments
 (0)