From 34e9e2f288e071e911d8f48c8bd08b4d56c91964 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Mon, 17 Aug 2020 20:35:39 +0200 Subject: [PATCH] Cleanup Windows shell extensions Signed-off-by: Michael Schuster --- .../windows/OCContextMenu/CMakeLists.txt | 1 - .../OCContextMenu/OCClientInterface.cpp | 2 -- .../windows/OCContextMenu/OCContextMenu.cpp | 3 +- .../OCContextMenu/OCContextMenuFactory.cpp | 2 -- .../OCContextMenu/OCContextMenuRegHandler.cpp | 2 -- .../OCContextMenu/OCContextMenuRegHandler.h | 2 +- .../windows/OCContextMenu/dllmain.cpp | 2 -- .../windows/OCContextMenu/stdafx.cpp | 8 ----- .../windows/OCContextMenu/stdafx.h | 17 ---------- .../windows/OCContextMenu/targetver.h | 12 ------- .../windows/OCOverlays/CMakeLists.txt | 1 - .../windows/OCOverlays/DllMain.cpp | 3 +- .../windows/OCOverlays/OCOverlay.cpp | 4 --- .../windows/OCOverlays/OCOverlay.h | 2 ++ .../windows/OCOverlays/OCOverlayFactory.cpp | 3 +- .../OCOverlayRegistrationHandler.cpp | 4 +-- .../OCOverlays/OCOverlayRegistrationHandler.h | 2 ++ .../OCOverlays/OverlayConstants.h.original | 32 ----------------- .../windows/OCOverlays/stdafx.cpp | 1 - shell_integration/windows/OCOverlays/stdafx.h | 34 ------------------- .../windows/OCUtil/CMakeLists.txt | 1 - .../windows/OCUtil/CommunicationSocket.cpp | 2 -- shell_integration/windows/OCUtil/FileUtil.cpp | 2 -- .../windows/OCUtil/RegistryUtil.cpp | 2 +- .../windows/OCUtil/RemotePathChecker.cpp | 2 -- .../windows/OCUtil/StringUtil.cpp | 2 -- shell_integration/windows/OCUtil/StringUtil.h | 1 + shell_integration/windows/OCUtil/stdafx.cpp | 1 - shell_integration/windows/OCUtil/stdafx.h | 9 ----- 29 files changed, 13 insertions(+), 146 deletions(-) delete mode 100644 shell_integration/windows/OCContextMenu/stdafx.cpp delete mode 100644 shell_integration/windows/OCContextMenu/stdafx.h delete mode 100644 shell_integration/windows/OCContextMenu/targetver.h delete mode 100644 shell_integration/windows/OCOverlays/OverlayConstants.h.original delete mode 100644 shell_integration/windows/OCOverlays/stdafx.cpp delete mode 100644 shell_integration/windows/OCOverlays/stdafx.h delete mode 100644 shell_integration/windows/OCUtil/stdafx.cpp delete mode 100644 shell_integration/windows/OCUtil/stdafx.h diff --git a/shell_integration/windows/OCContextMenu/CMakeLists.txt b/shell_integration/windows/OCContextMenu/CMakeLists.txt index badfbb638..74c12621b 100644 --- a/shell_integration/windows/OCContextMenu/CMakeLists.txt +++ b/shell_integration/windows/OCContextMenu/CMakeLists.txt @@ -4,7 +4,6 @@ add_library(OCContextMenu MODULE OCContextMenu.cpp OCContextMenuFactory.cpp OCContextMenuRegHandler.cpp - stdafx.cpp OCContextMenu.rc OCContextMenu.def ) diff --git a/shell_integration/windows/OCContextMenu/OCClientInterface.cpp b/shell_integration/windows/OCContextMenu/OCClientInterface.cpp index f855310e5..ad7a35564 100644 --- a/shell_integration/windows/OCContextMenu/OCClientInterface.cpp +++ b/shell_integration/windows/OCContextMenu/OCClientInterface.cpp @@ -12,8 +12,6 @@ * details. */ -#include "stdafx.h" - #include "OCClientInterface.h" #include "CommunicationSocket.h" diff --git a/shell_integration/windows/OCContextMenu/OCContextMenu.cpp b/shell_integration/windows/OCContextMenu/OCContextMenu.cpp index a5cab4ff1..1e9168af5 100644 --- a/shell_integration/windows/OCContextMenu/OCContextMenu.cpp +++ b/shell_integration/windows/OCContextMenu/OCContextMenu.cpp @@ -12,8 +12,6 @@ * details. */ -#include "stdafx.h" - #include "OCContextMenu.h" #include "OCClientInterface.h" @@ -21,6 +19,7 @@ #include #include #include +#include extern long g_cDllRef; diff --git a/shell_integration/windows/OCContextMenu/OCContextMenuFactory.cpp b/shell_integration/windows/OCContextMenu/OCContextMenuFactory.cpp index e9652b3c7..e3e6ff6b6 100644 --- a/shell_integration/windows/OCContextMenu/OCContextMenuFactory.cpp +++ b/shell_integration/windows/OCContextMenu/OCContextMenuFactory.cpp @@ -12,8 +12,6 @@ * details. */ -#include "stdafx.h" - #include "OCContextMenuFactory.h" #include "OCContextMenu.h" #include diff --git a/shell_integration/windows/OCContextMenu/OCContextMenuRegHandler.cpp b/shell_integration/windows/OCContextMenu/OCContextMenuRegHandler.cpp index 38e1d5e06..43fb46a3b 100644 --- a/shell_integration/windows/OCContextMenu/OCContextMenuRegHandler.cpp +++ b/shell_integration/windows/OCContextMenu/OCContextMenuRegHandler.cpp @@ -12,8 +12,6 @@ * details. */ -#include "stdafx.h" - #include "OCContextMenuRegHandler.h" #include "RegDelnode.h" #include diff --git a/shell_integration/windows/OCContextMenu/OCContextMenuRegHandler.h b/shell_integration/windows/OCContextMenu/OCContextMenuRegHandler.h index 061ee545d..91c2c9e81 100644 --- a/shell_integration/windows/OCContextMenu/OCContextMenuRegHandler.h +++ b/shell_integration/windows/OCContextMenu/OCContextMenuRegHandler.h @@ -18,7 +18,7 @@ #pragma once -#include "stdafx.h" +#include class __declspec(dllexport) OCContextMenuRegHandler { diff --git a/shell_integration/windows/OCContextMenu/dllmain.cpp b/shell_integration/windows/OCContextMenu/dllmain.cpp index 8cd31fea4..924f3a4e5 100644 --- a/shell_integration/windows/OCContextMenu/dllmain.cpp +++ b/shell_integration/windows/OCContextMenu/dllmain.cpp @@ -12,8 +12,6 @@ * details. */ -#include "stdafx.h" - #include #include #include "OCContextMenuRegHandler.h" diff --git a/shell_integration/windows/OCContextMenu/stdafx.cpp b/shell_integration/windows/OCContextMenu/stdafx.cpp deleted file mode 100644 index 2a649474d..000000000 --- a/shell_integration/windows/OCContextMenu/stdafx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// OCContextMenu.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/shell_integration/windows/OCContextMenu/stdafx.h b/shell_integration/windows/OCContextMenu/stdafx.h deleted file mode 100644 index e8b07f4f9..000000000 --- a/shell_integration/windows/OCContextMenu/stdafx.h +++ /dev/null @@ -1,17 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#pragma once - -#include "targetver.h" - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -// Windows Header Files: -#include -#include -#include - - -// TODO: reference additional headers your program requires here diff --git a/shell_integration/windows/OCContextMenu/targetver.h b/shell_integration/windows/OCContextMenu/targetver.h deleted file mode 100644 index e233d3572..000000000 --- a/shell_integration/windows/OCContextMenu/targetver.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -// Including SDKDDKVer.h defines the highest available Windows platform. - -// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and -// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. - -// Note: Here was a #define for windows target version -// e.g. WINVER / _WIN32_WINNT, see https://devblogs.microsoft.com/oldnewthing/20070411-00/?p=27283 -// Unnecessary because we define both in desktop/CMakeLists.txt - -#include diff --git a/shell_integration/windows/OCOverlays/CMakeLists.txt b/shell_integration/windows/OCOverlays/CMakeLists.txt index 13526b749..60d4a3748 100644 --- a/shell_integration/windows/OCOverlays/CMakeLists.txt +++ b/shell_integration/windows/OCOverlays/CMakeLists.txt @@ -3,7 +3,6 @@ add_library(OCOverlays MODULE OCOverlay.cpp OCOverlayFactory.cpp OCOverlayRegistrationHandler.cpp - stdafx.cpp OCOverlay.rc OCOverlays.def ) diff --git a/shell_integration/windows/OCOverlays/DllMain.cpp b/shell_integration/windows/OCOverlays/DllMain.cpp index 00195b6e5..c52f367f5 100644 --- a/shell_integration/windows/OCOverlays/DllMain.cpp +++ b/shell_integration/windows/OCOverlays/DllMain.cpp @@ -12,10 +12,9 @@ * details. */ -#include "stdafx.h" - #include "OCOverlayRegistrationHandler.h" #include "OCOverlayFactory.h" +#include "OverlayConstants.h" HINSTANCE instanceHandle = nullptr; diff --git a/shell_integration/windows/OCOverlays/OCOverlay.cpp b/shell_integration/windows/OCOverlays/OCOverlay.cpp index f7ff64f5b..cd36d605d 100644 --- a/shell_integration/windows/OCOverlays/OCOverlay.cpp +++ b/shell_integration/windows/OCOverlays/OCOverlay.cpp @@ -12,8 +12,6 @@ * details. */ -#include "stdafx.h" - #include "OCOverlay.h" #include "OCOverlayFactory.h" @@ -23,8 +21,6 @@ #include "UtilConstants.h" #include "RemotePathChecker.h" -#include "resource.h" - #include #include #include diff --git a/shell_integration/windows/OCOverlays/OCOverlay.h b/shell_integration/windows/OCOverlays/OCOverlay.h index af1aaf696..80aaa7882 100644 --- a/shell_integration/windows/OCOverlays/OCOverlay.h +++ b/shell_integration/windows/OCOverlays/OCOverlay.h @@ -17,6 +17,8 @@ #pragma once +#include + class OCOverlay : public IShellIconOverlayIdentifier { diff --git a/shell_integration/windows/OCOverlays/OCOverlayFactory.cpp b/shell_integration/windows/OCOverlays/OCOverlayFactory.cpp index a1c095f92..58b569e1c 100644 --- a/shell_integration/windows/OCOverlays/OCOverlayFactory.cpp +++ b/shell_integration/windows/OCOverlays/OCOverlayFactory.cpp @@ -12,7 +12,8 @@ * details. */ -#include "stdafx.h" +#include +#include #include "OCOverlayFactory.h" #include "OCOverlay.h" diff --git a/shell_integration/windows/OCOverlays/OCOverlayRegistrationHandler.cpp b/shell_integration/windows/OCOverlays/OCOverlayRegistrationHandler.cpp index d7d1fa40a..1b7452a43 100644 --- a/shell_integration/windows/OCOverlays/OCOverlayRegistrationHandler.cpp +++ b/shell_integration/windows/OCOverlays/OCOverlayRegistrationHandler.cpp @@ -12,10 +12,10 @@ * details. */ -#include "stdafx.h" - #include "OCOverlayRegistrationHandler.h" +#include "OverlayConstants.h" +#include #include #include diff --git a/shell_integration/windows/OCOverlays/OCOverlayRegistrationHandler.h b/shell_integration/windows/OCOverlays/OCOverlayRegistrationHandler.h index 098ac6921..2ab8f702f 100644 --- a/shell_integration/windows/OCOverlays/OCOverlayRegistrationHandler.h +++ b/shell_integration/windows/OCOverlays/OCOverlayRegistrationHandler.h @@ -17,6 +17,8 @@ #pragma once +#include + class __declspec(dllexport) OCOverlayRegistrationHandler { public: diff --git a/shell_integration/windows/OCOverlays/OverlayConstants.h.original b/shell_integration/windows/OCOverlays/OverlayConstants.h.original deleted file mode 100644 index e244e1515..000000000 --- a/shell_integration/windows/OCOverlays/OverlayConstants.h.original +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. - * - * 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. - */ - -#define OVERLAY_ID [$overlay.id$] -#define OVERLAY_GUID L"[$overlay.guid$]" -#define OVERLAY_NAME L"[$overlay.name$]" - -#define REGISTRY_OVERLAY_KEY L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ShellIconOverlayIdentifiers" -#define REGISTRY_CLSID L"CLSID" -#define REGISTRY_IN_PROCESS L"InprocServer32" -#define REGISTRY_THREADING L"ThreadingModel" -#define REGISTRY_APARTMENT L"Apartment" -#define REGISTRY_VERSION L"Version" -#define REGISTRY_VERSION_NUMBER L"1.0" - -//Registry values for running -#define REGISTRY_ENABLE_OVERLAY L"EnableOverlay" - -#define GET_FILE_OVERLAY_ID L"getFileIconId" - -#define PORT 33001 diff --git a/shell_integration/windows/OCOverlays/stdafx.cpp b/shell_integration/windows/OCOverlays/stdafx.cpp deleted file mode 100644 index fd4f341c7..000000000 --- a/shell_integration/windows/OCOverlays/stdafx.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "stdafx.h" diff --git a/shell_integration/windows/OCOverlays/stdafx.h b/shell_integration/windows/OCOverlays/stdafx.h deleted file mode 100644 index 5eacb4552..000000000 --- a/shell_integration/windows/OCOverlays/stdafx.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. - * - * 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. - */ - -#define WIN32_LEAN_AND_MEAN - -// Note: Here was a #define for windows target version -// e.g. WINVER / _WIN32_WINNT, see https://devblogs.microsoft.com/oldnewthing/20070411-00/?p=27283 -// Unnecessary because we define both in desktop/CMakeLists.txt - -#include "CommunicationSocket.h" -#include "RegistryUtil.h" -#include "OverlayConstants.h" -#include "FileUtil.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/shell_integration/windows/OCUtil/CMakeLists.txt b/shell_integration/windows/OCUtil/CMakeLists.txt index d353422f4..cf31dd3da 100644 --- a/shell_integration/windows/OCUtil/CMakeLists.txt +++ b/shell_integration/windows/OCUtil/CMakeLists.txt @@ -3,7 +3,6 @@ add_library(OCUtil STATIC FileUtil.cpp RegistryUtil.cpp RemotePathChecker.cpp - stdafx.cpp StringUtil.cpp OCUtil.rc ) diff --git a/shell_integration/windows/OCUtil/CommunicationSocket.cpp b/shell_integration/windows/OCUtil/CommunicationSocket.cpp index 649a9a145..10f95159e 100644 --- a/shell_integration/windows/OCUtil/CommunicationSocket.cpp +++ b/shell_integration/windows/OCUtil/CommunicationSocket.cpp @@ -12,8 +12,6 @@ * details. */ -#include "stdafx.h" - #include "CommunicationSocket.h" #include "UtilConstants.h" #include "StringUtil.h" diff --git a/shell_integration/windows/OCUtil/FileUtil.cpp b/shell_integration/windows/OCUtil/FileUtil.cpp index 9bb27af92..6230e17d5 100644 --- a/shell_integration/windows/OCUtil/FileUtil.cpp +++ b/shell_integration/windows/OCUtil/FileUtil.cpp @@ -12,8 +12,6 @@ * details. */ -#include "stdafx.h" - #include "FileUtil.h" #include "RegistryUtil.h" #include "UtilConstants.h" diff --git a/shell_integration/windows/OCUtil/RegistryUtil.cpp b/shell_integration/windows/OCUtil/RegistryUtil.cpp index 29a8c8903..b5be8f2f6 100644 --- a/shell_integration/windows/OCUtil/RegistryUtil.cpp +++ b/shell_integration/windows/OCUtil/RegistryUtil.cpp @@ -12,7 +12,7 @@ * details. */ -#include "stdafx.h" +#include #include "RegistryUtil.h" diff --git a/shell_integration/windows/OCUtil/RemotePathChecker.cpp b/shell_integration/windows/OCUtil/RemotePathChecker.cpp index 99b46d3ba..5d004d567 100644 --- a/shell_integration/windows/OCUtil/RemotePathChecker.cpp +++ b/shell_integration/windows/OCUtil/RemotePathChecker.cpp @@ -11,8 +11,6 @@ * details. */ -#include "stdafx.h" - #include "CommunicationSocket.h" #include "RemotePathChecker.h" diff --git a/shell_integration/windows/OCUtil/StringUtil.cpp b/shell_integration/windows/OCUtil/StringUtil.cpp index bd056ba68..e23030e02 100644 --- a/shell_integration/windows/OCUtil/StringUtil.cpp +++ b/shell_integration/windows/OCUtil/StringUtil.cpp @@ -11,8 +11,6 @@ * details. */ -#include "stdafx.h" - #include #include #include diff --git a/shell_integration/windows/OCUtil/StringUtil.h b/shell_integration/windows/OCUtil/StringUtil.h index c0cef5851..180d7c80a 100644 --- a/shell_integration/windows/OCUtil/StringUtil.h +++ b/shell_integration/windows/OCUtil/StringUtil.h @@ -16,6 +16,7 @@ #pragma once +#include #include #include diff --git a/shell_integration/windows/OCUtil/stdafx.cpp b/shell_integration/windows/OCUtil/stdafx.cpp deleted file mode 100644 index fd4f341c7..000000000 --- a/shell_integration/windows/OCUtil/stdafx.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "stdafx.h" diff --git a/shell_integration/windows/OCUtil/stdafx.h b/shell_integration/windows/OCUtil/stdafx.h deleted file mode 100644 index 532ea3e54..000000000 --- a/shell_integration/windows/OCUtil/stdafx.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#define WIN32_LEAN_AND_MEAN - -// Note: Here was a #define for windows target version -// e.g. WINVER / _WIN32_WINNT, see https://devblogs.microsoft.com/oldnewthing/20070411-00/?p=27283 -// Unnecessary because we define both in desktop/CMakeLists.txt - -#include