Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,10 @@

# User-specific files
*.suo # Ignore Visual Studio User option files
*.v12.suo
*.user
*.userosscache
*.sln.docstates

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
*.opendb
*.db

# Build results
[Bb]in/
Intermediate/
build/

.vs/
.vscode/
30 changes: 10 additions & 20 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Build to a folder outside the source folders, making it easier to clean. -->
<OutDir>$(MSBuildThisFileDirectory)bin\$(Configuration)\$(Platform)\</OutDir>
<OutDir>$(MSBuildThisFileDirectory)build\bin\$(Configuration)\$(Platform)\</OutDir>
<OutDir Condition="'$(Platform)'=='Win32'">$(MSBuildThisFileDirectory)build\bin\x86\$(Configuration)\</OutDir>

<!-- C++ temp files can be redirected. -->
<IntDir>$(MSBuildThisFileDirectory)intermediate\$(MSBuildProjectName)\$(Platform)\$(Configuration)\</IntDir>
<IntDir>$(MSBuildThisFileDirectory)build\intermediate\$(MSBuildProjectName)\$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Platform)'=='Win32'">$(MSBuildThisFileDirectory)build\intermediate\$(MSBuildProjectName)\x86\$(Configuration)\</IntDir>

<WindowsTargetPlatformVersion>10</WindowsTargetPlatformVersion>

Expand All @@ -24,7 +26,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>

<!-- Explicit define that all projects are compiled according the C++17 standard -->
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>

<!-- Explicit disable non conforming MSVC compiler options that are not compatible with the C++ standard -->
<ConformanceMode>true</ConformanceMode>
Expand All @@ -39,7 +41,7 @@
utf-8 = interpret all source files as UTF-8 (Required as MSVC relies on UTF-8 signature, which is not used)
ZH:SHA_256 = Use an SHA-256 hash for the checksum.in debug info
-->
<AdditionalOptions>/Zc:__cplusplus /Zc:throwingNew /utf-8 /ZH:SHA_256</AdditionalOptions>
<AdditionalOptions>/Zc:__cplusplus /Zc:throwingNew /utf-8 /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>

<!-- To ensure high quality C++ code use Warning level All in checked builds. -->
<WarningLevel Condition="'$(Configuration)'=='Checked'">EnableAllWarnings</WarningLevel>
Expand Down Expand Up @@ -73,9 +75,7 @@
C5045 = Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
-->
<AdditionalOptions Condition="'$(Configuration)'=='Checked'">
/wd4061 /wd4191
/wd4263 /wd4264 /wd4265 /wd4266
/wd4365
/wd4061 /wd4191 /wd4263 /wd4264 /wd4265 /wd4266 /wd4365
/wd4464
/wd4514 /wd4571 /wd4599
/wd4623 /wd4625 /wd4626 /wd4668
Expand All @@ -93,19 +93,9 @@
_ATL_NO_HOSTING = will prevent that ATL headers including mshtml.h, which is not strictStrings compatible.
-->
<PreprocessorDefinitions>
WIN32;
_WINDOWS;
WIN32_LEAN_AND_MEAN;
NOMINMAX;
_ATL_EX_CONVERSION_MACROS_ONLY;
_ATL_CSTRING_EXPLICIT_CONSTRUCTORS;
_ATL_ALL_WARNINGS;
_ATL_ALL_USER_WARNINGS;
_ATL_ENABLE_PTM_WARNING;
_ATL_NO_AUTOMATIC_NAMESPACE;
_ATL_CCOMBSTR_EXPLICIT_CONSTRUCTORS;
_ATL_NO_HOSTING;
_CSTRING_DISABLE_NARROW_WIDE_CONVERSION;
WIN32;_WINDOWS;WIN32_LEAN_AND_MEAN;NOMINMAX;_ATL_EX_CONVERSION_MACROS_ONLY;_ATL_CSTRING_EXPLICIT_CONSTRUCTORS;
_ATL_ALL_WARNINGS;_ATL_ALL_USER_WARNINGS;_ATL_ENABLE_PTM_WARNING;_ATL_NO_AUTOMATIC_NAMESPACE;
_ATL_CCOMBSTR_EXPLICIT_CONSTRUCTORS;_ATL_NO_HOSTING;_CSTRING_DISABLE_NARROW_WIDE_CONVERSION;
%(PreprocessorDefinitions)
</PreprocessorDefinitions>

Expand Down
4 changes: 2 additions & 2 deletions include/msf/context_menu_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ class __declspec(novtable) ContextMenuImpl :
return AddSubMenu(LoadResourceString(nIDText).c_str(), LoadResourceString(nIDHelp).c_str());
}

// Purpose: create and add a owner drawn custom sub menu to the context menu.
// Purpose: create and add an owner drawn custom sub menu to the context menu.
Menu AddSubMenu(std::wstring strHelp, std::unique_ptr<CustomMenuHandler> customMenuHandler)
{
auto subMenu = CreateSubMenu();
MenuItemInfo menuiteminfo(*m_pidCmd, subMenu);
customMenuHandler->InitializeItemInfo(menuiteminfo);
InsertMenuItem(menuiteminfo, std::move(strHelp), std::move(std::unique_ptr<ContextMenuCommand>(nullptr)), std::move(customMenuHandler));
InsertMenuItem(menuiteminfo, std::move(strHelp), std::unique_ptr<ContextMenuCommand>(nullptr), std::move(customMenuHandler));

return Menu(subMenu, 0, *m_pidCmd, m_idCmdLast, m_menuHost);
}
Expand Down
4 changes: 1 addition & 3 deletions include/msf/global_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

#include "msf_base.h"

namespace msf {
namespace util {
namespace msf::util {

template <typename T>
class GlobalLock final
Expand Down Expand Up @@ -76,4 +75,3 @@ class GlobalLock final
};

}
}
2 changes: 1 addition & 1 deletion include/msf/shell_ext_init_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class IShellExtInitImpl : public IShellExtInit
bool ContainsUnknownExtension(const std::vector<std::wstring>& filenames) const
{
return std::find_if(filenames.begin(), filenames.end(),
[=](const std::wstring& fileName) { return IsUnknownExtension(fileName); }) != filenames.end();
[this](const std::wstring& fileName) { return IsUnknownExtension(fileName); }) != filenames.end();
}

bool IsUnknownExtension(const std::wstring& fileName) const
Expand Down
27 changes: 13 additions & 14 deletions include/msf/shell_folder_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,16 @@ struct __declspec(uuid("93F81976-6A0D-42C3-94DD-AA258A155470")) IShellUndocument
struct __declspec(uuid("CAD9AE9F-56E2-40F1-AFB6-3813E320DCFD")) IShellUndocumentedCA; // Seen on Windows 8

template<typename T, typename TItem>
class __declspec(novtable) ShellFolderImpl :
public IPersistFolder3,
public IPersistIDList,
public IShellDetails,
public IShellFolder2,
public IObjectWithFolderEnumMode,
public IShellIcon,
public IDropTarget,
public IShellFolderContextMenuSink,
public IPerformedDropEffectSink,
public IExplorerPaneVisibility
class __declspec(novtable) ShellFolderImpl : public IPersistFolder3,
public IPersistIDList,
public IShellDetails,
public IShellFolder2,
public IObjectWithFolderEnumMode,
public IShellIcon,
public IDropTarget,
public IShellFolderContextMenuSink,
public IPerformedDropEffectSink,
public IExplorerPaneVisibility
{
public:
enum class ErrorContext
Expand Down Expand Up @@ -862,7 +861,7 @@ class __declspec(novtable) ShellFolderImpl :
// Purpose: Called by shell/MSF through the CompareItems function.
// MSF will compare column by column.
// Override this function if needed.
int CompareIDsAllFields(const TItem& item1, const TItem& item2) const noexcept
[[nodiscard]] int CompareIDsAllFields(const TItem& item1, const TItem& item2) const noexcept
{
int nResult = 0; // if there are no columns, items are always equal.

Expand Down Expand Up @@ -1012,7 +1011,7 @@ class __declspec(novtable) ShellFolderImpl :
ATLTRACE(L"ShellFolderImpl::OnDfmInvokeCommand 'DFM_CMD_PASTE'\n");
return static_cast<T*>(this)->OnDfmCmdPaste(window, dataObject);

case DFM_CMD_LINK: //DFM_CMD_CREATESHORTCUT:
case DFM_CMD_LINK: // DFM_CMD_CREATESHORTCUT:
ATLTRACE(L"ShellFolderImpl::OnDfmInvokeCommand 'DFM_CMD_CREATESHORTCUT'\n");
return static_cast<T*>(this)->OnDfmCmdCreateShortcut(window, dataObject);

Expand Down Expand Up @@ -1263,7 +1262,7 @@ class __declspec(novtable) ShellFolderImpl :
const ATL::CComPtr<IShellFolderViewCB> shellfolderviewcb =
static_cast<T*>(this)->CreateShellFolderViewCB();

SFV_CREATE shellFolderViewCreate{sizeof(SFV_CREATE), this, nullptr, shellfolderviewcb};
const SFV_CREATE shellFolderViewCreate{sizeof(SFV_CREATE), this, nullptr, shellfolderviewcb};

ATL::CComPtr<IShellView> shellView;
RaiseExceptionIfFailed(SHCreateShellFolderView(&shellFolderViewCreate, &shellView));
Expand Down
2 changes: 2 additions & 0 deletions msf.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=bugprone/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=CANRENAME/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Chappell/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=cidl/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=CLSID/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=comdef/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=declspec/@EntryIndexedValue">True</s:Boolean>
Expand Down Expand Up @@ -76,6 +77,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=lparam/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=MENUCHAR/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Metafilepct/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=pcwsz/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=pici/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=PIDL/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=pidls/@EntryIndexedValue">True</s:Boolean>
Expand Down