[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

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

View file

@ -1,24 +1,5 @@
/*
* IEnumFORMATETC, IDataObject
*
* 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
*/
// LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
// COPYRIGHT: 1998-1999 <juergen.schmied@metronet.de>
#include "precomp.h"

View file

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

View file

@ -65,7 +65,6 @@ void CNewMenu::UnloadAllItems()
{
pCurItem = m_pItems;
m_pItems = m_pItems->pNext;
UnloadItem(pCurItem);
}

View file

@ -111,7 +111,7 @@ COpenWithList::~COpenWithList()
BOOL COpenWithList::Load()
{
HKEY hKey;
WCHAR wszName[256], wszBuf[100];;
WCHAR wszName[256], wszBuf[100];
DWORD i = 0, cchName, dwSize;
SApp *pApp;
@ -696,7 +696,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");
ERR("Can't open ext key\n");
return FALSE;
}
@ -850,7 +850,7 @@ BOOL COpenWithDialog::IsNoOpen(HWND hwnd)
return TRUE;
else if (dReturnValue == -1)
{
ERR("IsNoOpen failed to load the dialog box.");
ERR("IsNoOpen failed to load dialog box\n");
return TRUE;
}
}

View file

@ -1202,7 +1202,6 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetArguments(LPCSTR pszArgs)
if (!m_sArgs)
return E_OUTOFMEMORY;
}
m_bDirty = TRUE;
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)
{
m_Header.dwFlags &= ~SLDF_HAS_ICONLOCATION;
@ -2427,7 +2426,7 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetPath(LPCWSTR pszFile)
if (hr == S_OK)
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;
}
else
@ -2607,7 +2606,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", hr);
TRACE("failed to resolve component error 0x%08x\n", hr);
return hr;
}

View file

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

View file

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

View file

@ -633,5 +633,3 @@ SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options)
return result;
}

View file

@ -859,8 +859,6 @@ UpdateGeneralIcons(HWND hDlg)
DeleteObject(hFolderIcon);
if(hClickIcon)
DeleteObject(hClickIcon);
return;
}
INT_PTR
@ -877,7 +875,6 @@ FolderOptionsGeneralDlg(
case WM_INITDIALOG:
// FIXME
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
@ -897,7 +894,6 @@ FolderOptionsGeneralDlg(
break;
}
break;
case WM_NOTIFY:
{
LPNMHDR pnmh = (LPNMHDR)lParam;
@ -912,10 +908,8 @@ FolderOptionsGeneralDlg(
}
break;
}
case WM_DESTROY:
break;
default:
return FALSE;
}
@ -1951,7 +1945,6 @@ FolderOptionsFileTypesDlg(
if (pItem == NULL || (pItem->EditFlags & 0x00000010)) // FTA_NoRemove
EnableWindow(GetDlgItem(hwndDlg, IDC_FILETYPES_DELETE), FALSE);
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{
@ -1984,7 +1977,6 @@ FolderOptionsFileTypesDlg(
break;
}
break;
case WM_NOTIFY:
lppl = (LPNMLISTVIEW) lParam;
@ -2065,8 +2057,8 @@ ShowFolderOptionsDialog(HWND hWnd, HINSTANCE hInst)
hppages[num_pages++] = hpage;
szOptions[0] = L'\0';
LoadStringW(shell32_hInstance, IDS_FOLDER_OPTIONS, szOptions, sizeof(szOptions) / sizeof(WCHAR));
szOptions[(sizeof(szOptions)/sizeof(WCHAR))-1] = L'\0';
LoadStringW(shell32_hInstance, IDS_FOLDER_OPTIONS, szOptions, _countof(szOptions));
szOptions[_countof(szOptions) - 1] = L'\0';
memset(&pinfo, 0x0, sizeof(PROPSHEETHEADERW));
pinfo.dwSize = sizeof(PROPSHEETHEADERW);
@ -2089,7 +2081,7 @@ Options_RunDLLCommon(HWND hWnd, HINSTANCE hInst, int fOptions, DWORD nCmdShow)
break;
case 1:
// 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);
break;
default:
@ -2100,7 +2092,8 @@ Options_RunDLLCommon(HWND hWnd, HINSTANCE hInst, int fOptions, DWORD nCmdShow)
/*************************************************************************
* 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);
}
@ -2108,7 +2101,8 @@ EXTERN_C VOID WINAPI Options_RunDLL(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWOR
/*************************************************************************
* 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);
}
@ -2116,7 +2110,8 @@ EXTERN_C VOID WINAPI Options_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWO
/*************************************************************************
* 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);
}

View file

@ -46,7 +46,6 @@ static void toggleNukeOnDeleteOption(HWND hwndDlg, BOOL bEnable)
}
}
static VOID
InitializeRecycleBinDlg(HWND hwndDlg, WCHAR DefaultDrive)
{
@ -70,12 +69,12 @@ InitializeRecycleBinDlg(HWND hwndDlg, WCHAR DefaultDrive)
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;
GetClientRect(hDlgCtrl, &rect);
memset(&lc, 0, sizeof(LV_COLUMN) );
memset(&lc, 0, sizeof(lc));
lc.mask = LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM | LVCF_FMT;
columnSize = 140; //FIXME
@ -86,7 +85,7 @@ InitializeRecycleBinDlg(HWND hwndDlg, WCHAR DefaultDrive)
lc.pszText = szVolume;
(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;
lc.iSubItem = 1;
@ -99,29 +98,28 @@ InitializeRecycleBinDlg(HWND hwndDlg, WCHAR DefaultDrive)
itemCount = 0;
do
{
if ((dwDrives & 0x1))
if (dwDrives & 0x1)
{
UINT Type = GetDriveTypeW(szDrive);
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;
dwSerial = -1;
}
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.iSubItem = 0;
li.pszText = szVolume;
li.iItem = itemCount;
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));
if (pItem)
{
@ -167,11 +165,10 @@ InitializeRecycleBinDlg(HWND hwndDlg, WCHAR DefaultDrive)
}
ZeroMemory(&li, sizeof(li));
li.mask = LVIF_STATE;
li.stateMask = (UINT) - 1;
li.stateMask = (UINT)-1;
li.state = LVIS_FOCUSED | LVIS_SELECTED;
li.iItem = defIndex;
(void)SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
}
static BOOL StoreDriveSettings(HWND hwndDlg)
@ -184,7 +181,6 @@ static BOOL StoreDriveSettings(HWND hwndDlg)
WCHAR szSerial[20];
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)
return FALSE;
@ -212,7 +208,6 @@ static BOOL StoreDriveSettings(HWND hwndDlg)
}
RegCloseKey(hKey);
return TRUE;
}
static VOID FreeDriveItemContext(HWND hwndDlg)
@ -231,13 +226,13 @@ static VOID FreeDriveItemContext(HWND hwndDlg)
li.iItem = iIndex;
if (SendMessageW(hDlgCtrl, LVM_GETITEMW, 0, (LPARAM)&li))
{
HeapFree(GetProcessHeap(), 0, (LPVOID)li.lParam);
HeapFree(GetProcessHeap(), 0, (PVOID)li.lParam);
}
}
}
static INT
GetDefaultItem(HWND hwndDlg, LVITEMW * li)
GetDefaultItem(HWND hwndDlg, LVITEMW* li)
{
HWND hDlgCtrl;
UINT iItemCount, iIndex;
@ -252,7 +247,7 @@ GetDefaultItem(HWND hwndDlg, LVITEMW * li)
ZeroMemory(li, sizeof(LVITEMW));
li->mask = LVIF_PARAM | LVIF_STATE;
li->stateMask = (UINT) - 1;
li->stateMask = (UINT)-1;
for (iIndex = 0; iIndex < iItemCount; iIndex++)
{
li->iItem = iIndex;
@ -263,7 +258,6 @@ GetDefaultItem(HWND hwndDlg, LVITEMW * li)
}
}
return -1;
}
static INT_PTR CALLBACK
@ -271,8 +265,7 @@ RecycleBinDlg(
HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
LPARAM lParam)
{
LPPSHNOTIFY lppsn;
LPNMLISTVIEW lppl;
@ -383,12 +376,10 @@ BOOL SH_ShowRecycleBinProperties(WCHAR sDrive)
HPROPSHEETPAGE hpsp[1];
PROPSHEETHEADERW psh;
HPROPSHEETPAGE hprop;
BOOL ret;
ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
psh.dwSize = sizeof(PROPSHEETHEADERW);
ZeroMemory(&psh, sizeof(psh));
psh.dwSize = sizeof(psh);
psh.dwFlags = PSP_DEFAULT | PSH_PROPTITLE;
psh.pszCaption = MAKEINTRESOURCEW(IDS_RECYCLEBIN_FOLDER_NAME);
psh.hwndParent = NULL;
@ -404,10 +395,6 @@ BOOL SH_ShowRecycleBinProperties(WCHAR sDrive)
hpsp[psh.nPages] = hprop;
psh.nPages++;
ret = PropertySheetW(&psh);
if (ret < 0)
return FALSE;
else
return TRUE;
return (ret >= 0);
}

View file

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

View file

@ -149,7 +149,7 @@ class CRecyclerDropTarget :
TRACE("(%p)->(DataObject=%p)\n", this, pDataObject);
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)))
{
DWORD fMask = 0;

View file

@ -406,7 +406,7 @@ HRESULT WINAPI CControlPanelFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_A
else if (_ILIsSpecialFolder(*apidl))
m_regFolder->GetAttributesOf(1, apidl, rgfInOut);
else
ERR("Got an unkown pidl here!\n");
ERR("Got unknown pidl\n");
apidl++;
cidl--;
}
@ -443,7 +443,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++)

View file

@ -23,7 +23,7 @@
#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
@ -387,7 +387,7 @@ CDrivesFolder::CDrivesFolder()
CDrivesFolder::~CDrivesFolder()
{
TRACE ("-- destroying IShellFolder(%p)\n", this);
TRACE("-- destroying IShellFolder(%p)\n", this);
SHFree(pidlRoot);
}
@ -455,13 +455,13 @@ HRESULT WINAPI CDrivesFolder::ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLEST
else if (_ILIsSpecialFolder(pidlTemp))
m_regFolder->GetAttributesOf(1, &pidlTemp, pdwAttributes);
else
ERR("Got an unkown 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;
}
@ -639,7 +639,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;
}
@ -659,7 +659,7 @@ static BOOL _ILIsControlPanel(LPCITEMIDLIST pidl)
*/
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);
if (cidl && !apidl)
@ -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 */
*rgfInOut &= ~SFGAO_VALIDATE;
TRACE ("-- result=0x%08x\n", *rgfInOut);
TRACE("-- result=0x%08x\n", *rgfInOut);
return S_OK;
}
@ -729,7 +729,7 @@ HRESULT WINAPI CDrivesFolder::GetUIObjectOf(HWND hwndOwner,
}
else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
{
hr = IDataObject_Constructor (hwndOwner,
hr = IDataObject_Constructor(hwndOwner,
pidlRoot, apidl, cidl, (IDataObject **)&pObj);
}
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;
*ppvOut = pObj;
TRACE ("(%p)->hr=0x%08x\n", this, hr);
TRACE("(%p)->hr=0x%08x\n", this, hr);
return hr;
}
@ -767,7 +767,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)
@ -834,10 +834,10 @@ HRESULT WINAPI CDrivesFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFla
pszPath[MAX_PATH-7] = L'\0';
}
}
wcscat (pszPath, wszOpenBracket);
wcscat(pszPath, wszOpenBracket);
wszDrive[2] = L'\0';
wcscat (pszPath, wszDrive);
wcscat (pszPath, wszCloseBracket);
wcscat(pszPath, wszDrive);
wcscat(pszPath, wszCloseBracket);
}
if (SUCCEEDED(hr))
@ -883,19 +883,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;
@ -906,7 +906,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 >= MYCOMPUTERSHELLVIEWCOLUMNS)
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)
{
FIXME ("(%p)\n", this);
FIXME("(%p)\n", this);
return E_NOTIMPL;
}
@ -924,7 +924,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 >= MYCOMPUTERSHELLVIEWCOLUMNS)
return E_INVALIDARG;
@ -989,7 +989,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;

View file

@ -132,7 +132,8 @@ HRESULT GetCLSIDForFileType(PCUIDLIST_RELATIVE pidl, LPCWSTR KeyName, CLSID* pcl
return GetCLSIDForFileTypeFromExtension(pExtension, KeyName, pclsid);
}
static HRESULT getIconLocationForFolder(IShellFolder * psf, LPCITEMIDLIST pidl, UINT uFlags,
static HRESULT
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 };
@ -322,7 +323,7 @@ private:
hr = SHELL32_GetCLSIDForDirectory(Tmp, L"CLSID", &clsidFolder);
if (SUCCEEDED(hr))
{
ERR("SHOULD DO SOMETHING WITH CLSID?\n");
ERR("Got CLSID override\n");
}
}
}
@ -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 (!RegQueryValueExW(hKey, HideFileExtW, 0, 0, (LPBYTE) &dwData, &dwDataSize))
doHide = dwData;
RegCloseKey (hKey);
RegCloseKey(hKey);
}
if (!doHide) {
@ -1244,7 +1245,6 @@ void SHELL_FS_ProcessDisplayFilename(LPWSTR szPath, DWORD dwFlags)
* FIXME
* if the name is in the pidl the ret value should be a STRRET_OFFSET
*/
HRESULT WINAPI CFSFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl,
DWORD dwFlags, LPSTRRET strRet)
{

View file

@ -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);
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);
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);
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);
}
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_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_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.fState = RecycleBinIsEmpty() ? MFS_DISABLED : MFS_ENABLED;
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.cch = wcslen(mii.dwTypeData);
mii.wID = idCmdFirst + id++;
@ -883,7 +883,7 @@ TRASH_CanTrashFile(LPCWSTR wszPath)
return FALSE;
}
// Only keep the base path.
// Only keep the base path
WCHAR wszRootPathName[MAX_PATH];
strcpyW(wszRootPathName, wszPath);
PathRemoveFileSpecW(wszRootPathName);
@ -1110,7 +1110,7 @@ HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags)
if (dwType != REG_EXPAND_SZ) /* type dismatch */
return S_OK;
szPath[(sizeof(szPath)/sizeof(WCHAR))-1] = L'\0';
szPath[_countof(szPath)-1] = L'\0';
PlaySoundW(szPath, NULL, SND_FILENAME);
}
return S_OK;
@ -1149,8 +1149,8 @@ HRESULT WINAPI SHQueryRecycleBinW(LPCWSTR pszRootPath, LPSHQUERYRBINFO pSHQueryR
{
FIXME("%s, %p - stub\n", debugstr_w(pszRootPath), pSHQueryRBInfo);
if (!(pszRootPath) || (pszRootPath[0] == 0) ||
!(pSHQueryRBInfo) || (pSHQueryRBInfo->cbSize < sizeof(SHQUERYRBINFO)))
if (!pszRootPath || (pszRootPath[0] == 0) ||
!pSHQueryRBInfo || (pSHQueryRBInfo->cbSize < sizeof(SHQUERYRBINFO)))
{
return E_INVALIDARG;
}

View file

@ -503,7 +503,7 @@ HRESULT WINAPI CRegFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apid
if (_ILIsSpecialFolder(*apidl))
GetGuidItemAttributes(*apidl, rgfInOut);
else
ERR("Got an unkown pidl here!\n");
ERR("Got unknown pidl\n");
apidl++;
cidl--;
}

View file

@ -698,13 +698,13 @@ static int SIC_LoadOverlayIcon(int icon_idx)
*
*/
BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList)
{ TRACE("(%p,%p)\n",lpBigList,lpSmallList);
{
TRACE("(%p,%p)\n",lpBigList,lpSmallList);
if (lpBigList)
{ *lpBigList = ShellBigIconList;
}
*lpBigList = ShellBigIconList;
if (lpSmallList)
{ *lpSmallList = ShellSmallIconList;
}
*lpSmallList = ShellSmallIconList;
return TRUE;
}

View file

@ -7,4 +7,3 @@ Please see COPYING for details
163.avi
164+169.avi
170.avi

View file

@ -25,8 +25,6 @@
#include <atlcoll.h>
#endif
WINE_DEFAULT_DEBUG_CHANNEL(desktop);
static const WCHAR szProgmanClassName[] = L"Progman";

View file

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

View file

@ -165,7 +165,6 @@ HRESULT CMenuToolbarBase::OnCustomDraw(LPNMTBCUSTOMDRAW cdraw, LRESULT * theResu
return S_OK;
case CDDS_ITEMPREPAINT:
HWND tlw;
m_menuBand->_GetTopLevelWindow(&tlw);

View file

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

View file

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

View file

@ -267,7 +267,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR*
if (!done || (*fmt == '1'))
{
/*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;
else
cmd = lpFile;
@ -314,7 +314,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR*
pv = SHLockShared(hmem, 0);
chars = swprintf(buf, L":%p", pv);
if (chars >= sizeof(buf) / sizeof(WCHAR))
if (chars >= ARRAY_SIZE(buf))
ERR("pidl format buffer too small!\n");
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))
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;
RegCloseKey(hkeyClass);
@ -728,13 +728,13 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
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");
lpFile = xlpFile;
/* 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");
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
* section. Actually, if GetProfileString fails, we've probably
* 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);
tok = wBuffer;
@ -809,7 +809,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
&classnamelen) == ERROR_SUCCESS)
{
classnamelen /= sizeof(WCHAR);
if (classnamelen == sizeof(classname) / sizeof(WCHAR))
if (classnamelen == ARRAY_SIZE(classname))
classnamelen--;
classname[classnamelen] = '\0';
@ -857,7 +857,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
{
/* Toss the leading dot */
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)
{
@ -926,14 +926,14 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec
unsigned ret = SE_ERR_NOASSOC;
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));
return 2;
}
wcscpy(regkey, key);
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)
{
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];
static const WCHAR wSo[] = L".so";
DWORD sizeSo = sizeof(wSo) / sizeof(WCHAR);
DWORD sizeSo = ARRAY_SIZE(wSo);
LPWSTR ptr = NULL;
DWORD ret = 0;
/* Get application command from start string and find filename of application */
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",
debugstr_w(start + 1));
@ -961,7 +961,7 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec
wcscpy(command, start + 1);
if ((ptr = wcschr(command, '"')))
* ptr = 0;
ret = SearchPathW(NULL, command, wszExe, sizeof(fullpath) / sizeof(WCHAR), fullpath, &ptr);
ret = SearchPathW(NULL, command, wszExe, ARRAY_SIZE(fullpath), fullpath, &ptr);
}
else
{
@ -972,11 +972,11 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec
int idx = space - start;
memcpy(command, start, idx * sizeof(WCHAR));
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;
}
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)
@ -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));
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));
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);
if (resultLen > sizeof(static_res)/sizeof(WCHAR))
SHELL_ArgifyW(static_res, ARRAY_SIZE(static_res), exec, lpFile, pidl, szCommandline, &resultLen, NULL);
if (resultLen > ARRAY_SIZE(static_res))
{
res = dynamic_res = static_cast<WCHAR *>(HeapAlloc(GetProcessHeap(), 0, resultLen * sizeof(WCHAR)));
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? */
cmdlen /= sizeof(WCHAR);
if (cmdlen >= sizeof(cmd) / sizeof(WCHAR))
cmdlen = sizeof(cmd) / sizeof(WCHAR) - 1;
if (cmdlen >= ARRAY_SIZE(cmd))
cmdlen = ARRAY_SIZE(cmd) - 1;
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);
if (resultLen > sizeof(param) / sizeof(WCHAR))
if (resultLen > ARRAY_SIZE(param))
ERR("Argify buffer not large enough, truncating\n");
}
@ -1237,7 +1237,7 @@ HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpR
if (lpDirectory)
{
GetCurrentDirectoryW(sizeof(old_dir) / sizeof(WCHAR), old_dir);
GetCurrentDirectoryW(ARRAY_SIZE(old_dir), old_dir);
SetCurrentDirectoryW(lpDirectory);
}
@ -1482,7 +1482,7 @@ static LONG ShellExecute_FromContextMenu( LPSHELLEXECUTEINFOW sei )
i = 0;
while (1)
{
r = RegEnumKeyW(hkeycm, i++, szguid, sizeof(szguid) / sizeof(szguid[0]));
r = RegEnumKeyW(hkeycm, i++, szguid, ARRAY_SIZE(szguid));
if (r != ERROR_SUCCESS)
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));
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);
if (!done && wszApplicationName[0])
{
@ -1543,7 +1543,7 @@ static UINT_PTR SHELL_execute_class(LPCWSTR wszApplicationName, LPSHELLEXECUTEIN
else
strcatW(wcmd, wszApplicationName);
}
if (resultLen > sizeof(wcmd) / sizeof(WCHAR))
if (resultLen > ARRAY_SIZE(wcmd))
ERR("Argify buffer not large enough... truncating\n");
return execfunc(wcmd, NULL, FALSE, psei, psei_out);
}
@ -1568,7 +1568,7 @@ static BOOL SHELL_translate_idlist(LPSHELLEXECUTEINFOW sei, LPWSTR wszParameters
BOOL appKnownSingular = FALSE;
/* 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] == ':') {
/* open shell folder for the specified class GUID */
if (strlenW(buffer) + 1 > parametersLen)
@ -1688,14 +1688,14 @@ static void do_error_dialog(UINT_PTR retval, HWND hwnd, WCHAR* filename)
error_code = GetLastError();
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
FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY,
NULL,
error_code,
LANG_USER_DEFAULT,
msg,
sizeof(msg) / sizeof(WCHAR),
ARRAY_SIZE(msg),
(va_list*)msgArguments);
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 *wszApplicationName, *wszParameters, *wszDir, *wcmd;
DWORD dwApplicationNameLen = MAX_PATH + 2;
DWORD parametersLen = sizeof(parametersBuffer) / sizeof(WCHAR);
DWORD dirLen = sizeof(dirBuffer) / sizeof(WCHAR);
DWORD wcmdLen = sizeof(wcmdBuffer) / sizeof(WCHAR);
DWORD parametersLen = ARRAY_SIZE(parametersBuffer);
DWORD dirLen = ARRAY_SIZE(dirBuffer);
DWORD wcmdLen = ARRAY_SIZE(wcmdBuffer);
DWORD len;
SHELLEXECUTEINFOW sei_tmp; /* modifiable copy of SHELLEXECUTEINFO struct */
WCHAR wfileName[MAX_PATH];

View file

@ -702,8 +702,6 @@
#define IDM_MOVEHERE 0x8
#define IDM_LINKHERE 0xB
/* Registrar scripts (RGS) */
#define IDR_ADMINFOLDERSHORTCUT 128
#define IDR_CONTROLPANEL 130

View file

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

View file

@ -1098,7 +1098,7 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM
{
BITMAP bmpLogo;
GetObject( hLogoBmp, sizeof(BITMAP), &bmpLogo );
GetObject(hLogoBmp, sizeof(BITMAP), &bmpLogo);
cxLogoBmp = bmpLogo.bmWidth;
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)
SendDlgItemMessageW(hWnd, IDC_ABOUT_ICON, STM_SETICON, (WPARAM)info->hIcon, 0);
GetWindowTextW( hWnd, szAppTitleTemplate, sizeof(szAppTitleTemplate) / sizeof(WCHAR) );
swprintf( szAppTitle, szAppTitleTemplate, info->szApp );
SetWindowTextW( hWnd, szAppTitle );
GetWindowTextW(hWnd, szAppTitleTemplate, ARRAY_SIZE(szAppTitleTemplate));
swprintf(szAppTitle, szAppTitleTemplate, info->szApp);
SetWindowTextW(hWnd, szAppTitle);
SetDlgItemTextW( hWnd, IDC_ABOUT_APPNAME, info->szApp );
SetDlgItemTextW(hWnd, IDC_ABOUT_APPNAME, info->szApp);
#ifdef __REACTOS__
SetDlgItemTextW( hWnd, IDC_ABOUT_VERSION, info->szOSVersion );
SetDlgItemTextW(hWnd, IDC_ABOUT_VERSION, info->szOSVersion);
#endif
SetDlgItemTextW( hWnd, IDC_ABOUT_OTHERSTUFF, info->szOtherStuff );
SetDlgItemTextW(hWnd, IDC_ABOUT_OTHERSTUFF, info->szOtherStuff);
// 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"RegisteredOrganization", IDC_ABOUT_REG_ORGNAME );
SetRegTextData(hWnd, hRegKey, L"RegisteredOwner", IDC_ABOUT_REG_USERNAME);
SetRegTextData(hWnd, hRegKey, L"RegisteredOrganization", IDC_ABOUT_REG_ORGNAME);
RegCloseKey( hRegKey );
RegCloseKey(hRegKey);
}
// Set the value for the installed physical memory
MemStat.dwLength = sizeof(MemStat);
if( GlobalMemoryStatusEx(&MemStat) )
if(GlobalMemoryStatusEx(&MemStat))
{
WCHAR szBuf[12];
@ -1152,24 +1152,24 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM
MemStat.ullTotalPhys /= 1024;
dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
wcscpy( szUnits, L"PB" );
wcscpy(szUnits, L"PB");
}
else
{
dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
wcscpy( szUnits, L"TB" );
wcscpy(szUnits, L"TB");
}
}
else
{
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
if (GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL,
szDecimalSeparator,
sizeof(szDecimalSeparator) / sizeof(WCHAR)) > 0)
ARRAY_SIZE(szDecimalSeparator)) > 0)
{
UCHAR uDecimals;
UINT uIntegral;
@ -1184,16 +1184,16 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM
else
{
// 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
hWndAuthors = CreateDialogW( shell32_hInstance, MAKEINTRESOURCEW(IDD_ABOUT_AUTHORS), hWnd, AboutAuthorsDlgProc );
LoadStringW( shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, sizeof(szAuthorsText) / sizeof(WCHAR) );
SetDlgItemTextW( hWnd, IDC_ABOUT_AUTHORS, szAuthorsText );
hWndAuthors = CreateDialogW(shell32_hInstance, MAKEINTRESOURCEW(IDD_ABOUT_AUTHORS), hWnd, AboutAuthorsDlgProc);
LoadStringW(shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, ARRAY_SIZE(szAuthorsText));
SetDlgItemTextW(hWnd, IDC_ABOUT_AUTHORS, szAuthorsText);
}
return TRUE;
@ -1238,16 +1238,16 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM
if(bShowingAuthors)
{
LoadStringW( shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, sizeof(szAuthorsText) / sizeof(WCHAR) );
ShowWindow( hWndAuthors, SW_HIDE );
LoadStringW(shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, ARRAY_SIZE(szAuthorsText));
ShowWindow(hWndAuthors, SW_HIDE);
}
else
{
LoadStringW( shell32_hInstance, IDS_SHELL_ABOUT_BACK, szAuthorsText, sizeof(szAuthorsText) / sizeof(WCHAR) );
ShowWindow( hWndAuthors, SW_SHOW );
LoadStringW(shell32_hInstance, IDS_SHELL_ABOUT_BACK, szAuthorsText, ARRAY_SIZE(szAuthorsText));
ShowWindow(hWndAuthors, SW_SHOW);
}
SetDlgItemTextW( hWnd, IDC_ABOUT_AUTHORS, szAuthorsText );
SetDlgItemTextW(hWnd, IDC_ABOUT_AUTHORS, szAuthorsText);
bShowingAuthors = !bShowingAuthors;
return TRUE;
}

View file

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

View file

@ -144,7 +144,7 @@ HRESULT WINAPI SHCoCreateInstance(
}
/* 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);
lstrcatW(sKeyName, sClassID);
lstrcatW(sKeyName, sInProcServer32);

View file

@ -355,12 +355,12 @@ int ShellMessageBoxW(
hInstance,hWnd,lpText,lpCaption,uType);
if (IS_INTRESOURCE(lpCaption))
LoadStringW(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle)/sizeof(szTitle[0]));
LoadStringW(hInstance, LOWORD(lpCaption), szTitle, ARRAY_SIZE(szTitle));
else
pszTitle = lpCaption;
if (IS_INTRESOURCE(lpText))
LoadStringW(hInstance, LOWORD(lpText), szText, sizeof(szText)/sizeof(szText[0]));
LoadStringW(hInstance, LOWORD(lpText), szText, ARRAY_SIZE(szText));
else
pszText = lpText;
@ -1322,11 +1322,8 @@ BOOL WINAPI IsUserAnAdmin(VOID)
DWORD i;
BOOL bResult = FALSE;
TRACE("\n");
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken))
{
return FALSE;
}
if (!GetTokenInformation(hToken, TokenGroups, NULL, 0, &dwSize))
{
@ -1900,7 +1897,7 @@ HRESULT WINAPI SHCreateStdEnumFmtEtc(
*/
BOOL WINAPI SHFindFiles( LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile )
{
FIXME("%p %p\n", pidlFolder, pidlSaveFile );
FIXME("%p %p\n", pidlFolder, pidlSaveFile);
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_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 My_DocumentsW[] = {'M','y',' ','D','o','c','u','m','e','n','t','s','\0'};
#endif
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'};
@ -1484,7 +1483,7 @@ static HRESULT _SHGetDefaultValue(HANDLE hToken, BYTE folder, LPWSTR 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;
if (!pszPath)
return E_INVALIDARG;
@ -1566,7 +1565,7 @@ static HRESULT _SHGetCurrentVersionPath(DWORD dwFlags, BYTE folder,
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;
if (CSIDL_Data[folder].type != CSIDL_Type_CurrVer)
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);
if (folder >= sizeof(CSIDL_Data) / sizeof(CSIDL_Data[0]))
if (folder >= ARRAY_SIZE(CSIDL_Data))
return E_INVALIDARG;
if (CSIDL_Data[folder].type != CSIDL_Type_User)
return E_INVALIDARG;
@ -1737,7 +1736,7 @@ static HRESULT _SHGetAllUsersProfilePath(DWORD dwFlags, BYTE folder,
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;
if (CSIDL_Data[folder].type != CSIDL_Type_AllUsers)
return E_INVALIDARG;
@ -1961,7 +1960,6 @@ HRESULT WINAPI SHGetFolderPathAndSubDirA(
HRESULT hr = S_OK;
LPWSTR pszSubPathW = NULL;
LPWSTR pszPathW = NULL;
TRACE("%08x,%08x,%s\n",nFolder, dwFlags, debugstr_w(pszSubPathW));
if(pszPath) {
pszPathW = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
@ -2014,15 +2012,13 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW(
CSIDL_Type type;
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
* or failure, so do so first
*/
if (pszPath)
*pszPath = '\0';
if (folder >= sizeof(CSIDL_Data) / sizeof(CSIDL_Data[0]))
if (folder >= ARRAY_SIZE(CSIDL_Data))
return E_INVALIDARG;
if ((SHGFP_TYPE_CURRENT != dwFlags) && (SHGFP_TYPE_DEFAULT != dwFlags))
return E_INVALIDARG;
@ -2150,8 +2146,6 @@ HRESULT WINAPI SHGetFolderPathA(
WCHAR szTemp[MAX_PATH];
HRESULT hr;
TRACE("%p,%p,nFolder=0x%04x\n",hwndOwner,pszPath,nFolder);
if (pszPath)
*pszPath = '\0';
hr = SHGetFolderPathW(hwndOwner, nFolder, hToken, dwFlags, szTemp);
@ -2319,7 +2313,7 @@ static HRESULT _SHRegisterUserShellFolders(BOOL bDefault)
}
hr = _SHRegisterFolders(hRootKey, hToken, pUserShellFolderPath,
pShellFolderPath, folders, sizeof(folders) / sizeof(folders[0]));
pShellFolderPath, folders, ARRAY_SIZE(folders));
TRACE("returning 0x%08x\n", hr);
return hr;
}
@ -2344,7 +2338,7 @@ static HRESULT _SHRegisterCommonShellFolders(void)
TRACE("\n");
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);
return hr;
}

View file

@ -82,7 +82,7 @@ HRESULT WINAPI SHRegQueryValueExA(
LPDWORD 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
* *pdwType to REG_SZ.
*/
HRESULT WINAPI SHRegQueryValueExW (
HRESULT WINAPI SHRegQueryValueExW(
HKEY hkey,
LPWSTR pszValue,
LPDWORD pdwReserved,
@ -116,9 +116,9 @@ HRESULT WINAPI SHRegQueryValueExW (
LPDWORD pcbData)
{
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);
ret = RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
ret = RegQueryValueExW(hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
return ret;
}