diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp index d2c41bf5b30..3ea7e4f2eb8 100644 --- a/dll/win32/shell32/CDefView.cpp +++ b/dll/win32/shell32/CDefView.cpp @@ -518,7 +518,7 @@ public: return wc; } - virtual WNDPROC GetWindowProc() + virtual WNDPROC GetWindowProc() override { return WindowProc; } @@ -1059,7 +1059,7 @@ HRESULT CDefView::GetDetailsByFolderColumn(PCUITEMID_CHILD pidl, UINT FoldCol, S { // According to learn.microsoft.com/en-us/windows/win32/shell/sfvm-getdetailsof // the query order is IShellFolder2, IShellDetails, SFVM_GETDETAILSOF. - HRESULT hr; + HRESULT hr = E_FAIL; if (m_pSF2Parent) { hr = m_pSF2Parent->GetDetailsOf(pidl, FoldCol, &sd); @@ -1230,6 +1230,7 @@ void CDefView::ColumnListChanged() break; HRESULT foldCol = MapListColumnToFolderColumn(listCol); assert(SUCCEEDED(foldCol)); + DBG_UNREFERENCED_LOCAL_VARIABLE(foldCol); AppendMenuItem(m_hMenuArrangeModes, MF_STRING, DVIDM_ARRANGESORT_FIRST + listCol, lvc.pszText, listCol); } @@ -3373,7 +3374,7 @@ HRESULT CDefView::LoadViewState() m_LoadColumnsList = NULL; } } - m_sortInfo.bLoadedFromViewState = !fallback && m_LoadColumnsList && cvs.SortColId != LISTVIEW_SORT_INFO::UNSPECIFIEDCOLUMN; + m_sortInfo.bLoadedFromViewState = !fallback && m_LoadColumnsList && (int)cvs.SortColId != LISTVIEW_SORT_INFO::UNSPECIFIEDCOLUMN; m_sortInfo.bColumnIsFolderColumn = TRUE; m_sortInfo.Direction = cvs.SortDir > 0 ? 1 : -1; m_sortInfo.ListColumn = cvs.SortColId; diff --git a/dll/win32/shell32/CDefaultContextMenu.cpp b/dll/win32/shell32/CDefaultContextMenu.cpp index 17cffeef96f..65363744934 100644 --- a/dll/win32/shell32/CDefaultContextMenu.cpp +++ b/dll/win32/shell32/CDefaultContextMenu.cpp @@ -219,7 +219,7 @@ class CDefaultContextMenu : STDMETHOD(GetSite)(REFIID riid, void **ppvSite) override; // IServiceProvider - virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID svc, REFIID riid, void**ppv) + virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID svc, REFIID riid, void**ppv) override { return IUnknown_QueryService(m_site, svc, riid, ppv); } diff --git a/dll/win32/shell32/CRecycleBinCleaner.cpp b/dll/win32/shell32/CRecycleBinCleaner.cpp index e8cdaf31dbe..72a99cfc9d6 100644 --- a/dll/win32/shell32/CRecycleBinCleaner.cpp +++ b/dll/win32/shell32/CRecycleBinCleaner.cpp @@ -10,7 +10,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); -CLSID CLSID_RecycleBinCleaner = { 0x5ef4af3a, 0xf726, 0x11d0, 0xb8, 0xa2, 0x00, 0xc0, 0x4f, 0xc3, 0x09, 0xa4 }; +CLSID CLSID_RecycleBinCleaner = { 0x5ef4af3a, 0xf726, 0x11d0, { 0xb8, 0xa2, 0x00, 0xc0, 0x4f, 0xc3, 0x09, 0xa4 } }; struct CRecycleBinCleaner : public CComObjectRootEx, diff --git a/dll/win32/shell32/debughlp.cpp b/dll/win32/shell32/debughlp.cpp index f57d399789b..79e314c8b00 100644 --- a/dll/win32/shell32/debughlp.cpp +++ b/dll/win32/shell32/debughlp.cpp @@ -452,7 +452,7 @@ const char * shdebugstr_guid( const struct _GUID *id ) } return wine_dbg_sprintf( "\n\t{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x} (%s)", - id->Data1, id->Data2, id->Data3, + (UINT)id->Data1, id->Data2, id->Data3, id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3], id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7], name ? name : "unknown" ); } diff --git a/dll/win32/shell32/dialogs/drive.cpp b/dll/win32/shell32/dialogs/drive.cpp index 5de42ddfa3f..37175a05b83 100644 --- a/dll/win32/shell32/dialogs/drive.cpp +++ b/dll/win32/shell32/dialogs/drive.cpp @@ -374,7 +374,7 @@ InitializeFormatDriveDlg(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext) { WCHAR szDrive[] = { WCHAR(pContext->Drive + 'A'), ':', '\\', '\0' }; WCHAR szText[120], szFs[30]; - INT cchText; + SIZE_T cchText; ULARGE_INTEGER TotalNumberOfBytes; DWORD dwIndex, dwDefault; UCHAR uMinor, uMajor; @@ -398,8 +398,6 @@ InitializeFormatDriveDlg(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext) SendMessageW(pContext->hWndTipTrigger, STM_SETICON, (WPARAM)hIco, 0); cchText = GetWindowTextW(hwndDlg, szText, _countof(szText) - 1); - if (cchText < 0) - cchText = 0; szText[cchText++] = L' '; szFs[0] = UNICODE_NULL; if (GetVolumeInformationW(szDrive, &szText[cchText], _countof(szText) - cchText, NULL, NULL, NULL, szFs, _countof(szFs))) diff --git a/dll/win32/shell32/dialogs/filetypes.cpp b/dll/win32/shell32/dialogs/filetypes.cpp index a2206ad9fe9..851e7fa2f72 100644 --- a/dll/win32/shell32/dialogs/filetypes.cpp +++ b/dll/win32/shell32/dialogs/filetypes.cpp @@ -334,6 +334,7 @@ InitializeDefaultIcons(PFILE_TYPE_GLOBALS pG) { int idx = ImageList_AddIcon(pG->himlSmall, pG->hDefExtIconSmall); ASSERT(idx == 0); + DBG_UNREFERENCED_LOCAL_VARIABLE(idx); } } diff --git a/dll/win32/shell32/dialogs/view.cpp b/dll/win32/shell32/dialogs/view.cpp index 4dd3e8801bc..87f4c270497 100644 --- a/dll/win32/shell32/dialogs/view.cpp +++ b/dll/win32/shell32/dialogs/view.cpp @@ -249,7 +249,7 @@ ViewTree_InsertAll(HWND hwndTreeView) static BOOL ViewTree_LoadTree(HKEY hKey, LPCWSTR pszKeyName, DWORD dwParentID) { - DWORD dwIndex; + DWORD dwIndex = ~0UL; WCHAR szKeyName[64], szText[MAX_PATH], *pch; DWORD Size, Value; PVIEWTREE_ENTRY pAllocated; diff --git a/dll/win32/shell32/droptargets/CFSDropTarget.cpp b/dll/win32/shell32/droptargets/CFSDropTarget.cpp index bc84e7ec939..48d9c4f97a3 100644 --- a/dll/win32/shell32/droptargets/CFSDropTarget.cpp +++ b/dll/win32/shell32/droptargets/CFSDropTarget.cpp @@ -544,7 +544,7 @@ HRESULT CFSDropTarget::_DoDrop(IDataObject *pDataObject, bLinking = TRUE; } - if (SUCCEEDED(pDataObject->QueryGetData(&fmt))) + if (SUCCEEDED(hr = pDataObject->QueryGetData(&fmt))) { hr = pDataObject->GetData(&fmt, &medium); TRACE("CFSTR_SHELLIDLIST\n"); @@ -698,7 +698,7 @@ HRESULT CFSDropTarget::_DoDrop(IDataObject *pDataObject, _ILFreeaPidl(apidl, lpcida->cidl); ReleaseStgMedium(&medium); } - else if (SUCCEEDED(pDataObject->QueryGetData(&fmt2))) + else if (SUCCEEDED(hr = pDataObject->QueryGetData(&fmt2))) { FORMATETC fmt2; InitFormatEtc (fmt2, CF_HDROP, TYMED_HGLOBAL); diff --git a/dll/win32/shell32/folders/CRecycleBin.cpp b/dll/win32/shell32/folders/CRecycleBin.cpp index 5051c619d7e..b335fa36ac5 100644 --- a/dll/win32/shell32/folders/CRecycleBin.cpp +++ b/dll/win32/shell32/folders/CRecycleBin.cpp @@ -186,11 +186,13 @@ static inline LPCWSTR GetItemRecycledFullPath(const BBITEMDATA &Data) return (LPCWSTR)((BYTE*)&Data + Data.RecycledPathOffset); } +#if UNUSED && FALSE static inline LPCWSTR GetItemRecycledFileName(LPCITEMIDLIST pidl, const BBITEMDATA &Data) { C_ASSERT(BBITEMFILETYPE & PT_FS_UNICODE_FLAG); return (LPCWSTR)((LPPIDLDATA)pidl->mkid.abID)->u.file.szNames; } +#endif static int GetItemDriveNumber(LPCITEMIDLIST pidl) { diff --git a/dll/win32/shell32/shellmenu/CMenuSite.cpp b/dll/win32/shell32/shellmenu/CMenuSite.cpp index 7596237b596..9ccb55d42d5 100644 --- a/dll/win32/shell32/shellmenu/CMenuSite.cpp +++ b/dll/win32/shell32/shellmenu/CMenuSite.cpp @@ -85,7 +85,7 @@ HRESULT STDMETHODCALLTYPE CMenuSite::AddBand(IUnknown * punk) HRESULT STDMETHODCALLTYPE CMenuSite::EnumBands(UINT uBand, DWORD* pdwBandID) { - if (uBand == -1ul) + if (uBand == UINT(-1)) return GetBandCount(); if (uBand != 0) diff --git a/dll/win32/shell32/shellrecyclebin/recyclebin_v5.cpp b/dll/win32/shell32/shellrecyclebin/recyclebin_v5.cpp index c32f9c8d630..08146caca74 100644 --- a/dll/win32/shell32/shellrecyclebin/recyclebin_v5.cpp +++ b/dll/win32/shell32/shellrecyclebin/recyclebin_v5.cpp @@ -559,7 +559,8 @@ RecycleBin5_Create( LPWSTR FileName; /* Pointer into BufferName buffer */ LPCSTR DesktopIniContents = "[.ShellClassInfo]\r\nCLSID={645FF040-5081-101B-9F08-00AA002F954E}\r\n"; INFO2_HEADER Info2Contents[] = { { 5, 0, 0, 0x320, 0 } }; - DWORD BytesToWrite, BytesWritten, Needed; + DWORD BytesToWrite, BytesWritten; + SIZE_T Needed; HANDLE hFile = INVALID_HANDLE_VALUE; HRESULT hr; @@ -623,7 +624,7 @@ RecycleBin5_Create( hr = HRESULT_FROM_WIN32(GetLastError()); goto cleanup; } - BytesToWrite = strlen(DesktopIniContents); + BytesToWrite = (UINT)strlen(DesktopIniContents); if (!WriteFile(hFile, DesktopIniContents, (DWORD)BytesToWrite, &BytesWritten, NULL)) { hr = HRESULT_FROM_WIN32(GetLastError()); diff --git a/dll/win32/shell32/wine/classes.c b/dll/win32/shell32/wine/classes.c index 6138fdac267..e6f23070c2e 100644 --- a/dll/win32/shell32/wine/classes.c +++ b/dll/win32/shell32/wine/classes.c @@ -254,7 +254,7 @@ BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey) { char xriid[50]; sprintf( xriid, "CLSID\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", - riid->Data1, riid->Data2, riid->Data3, + (UINT)riid->Data1, riid->Data2, riid->Data3, riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] ); diff --git a/dll/win32/shell32/wine/shellord.c b/dll/win32/shell32/wine/shellord.c index 063678000b0..376d96e7b16 100644 --- a/dll/win32/shell32/wine/shellord.c +++ b/dll/win32/shell32/wine/shellord.c @@ -334,6 +334,7 @@ VOID WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet) else { DWORD read = 0, data, cb, dummy = 0; + DBG_UNREFERENCED_LOCAL_VARIABLE(dummy); if (SHELL_GlobalCounterChanged(&g_ShellStateCounter, SHELL_GCOUNTER_SHELLSTATE)) g_CachedSSF = 0; diff --git a/dll/win32/shlwapi/ordinal.c b/dll/win32/shlwapi/ordinal.c index 3646c54153c..17223417254 100644 --- a/dll/win32/shlwapi/ordinal.c +++ b/dll/win32/shlwapi/ordinal.c @@ -633,7 +633,7 @@ INT WINAPI SHStringFromGUIDA(REFGUID guid, LPSTR lpszDest, INT cchMax) TRACE("(%s,%p,%d)\n", debugstr_guid(guid), lpszDest, cchMax); sprintf(xguid, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", - guid->Data1, guid->Data2, guid->Data3, + (UINT)guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);