From 7ee8514f7e2cd0a3079225e8fdd5d4bc4c6f6d0e Mon Sep 17 00:00:00 2001 From: SimonNyvall Date: Sat, 4 May 2024 00:31:52 +0200 Subject: [PATCH] Add SupportedOSPlatform attribute to Windows-specific classes --- Duplicati/Library/Utility/Win32.cs | 42 ++++++++++++++------------- Duplicati/Library/Utility/WinTools.cs | 2 ++ 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/Duplicati/Library/Utility/Win32.cs b/Duplicati/Library/Utility/Win32.cs index 2099c0854..68ff58205 100644 --- a/Duplicati/Library/Utility/Win32.cs +++ b/Duplicati/Library/Utility/Win32.cs @@ -1,33 +1,35 @@ -// Copyright (C) 2024, The Duplicati Team -// https://duplicati.com, hello@duplicati.com -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. +// Copyright (C) 2024, The Duplicati Team +// https://duplicati.com, hello@duplicati.com +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; +using System.Runtime.Versioning; namespace Duplicati.Library.Utility { //The signatures in this file are from http://pinvoke.net + [SupportedOSPlatform("windows")] /// /// Various Windows specific calls /// diff --git a/Duplicati/Library/Utility/WinTools.cs b/Duplicati/Library/Utility/WinTools.cs index 78500a617..4e7c3f932 100644 --- a/Duplicati/Library/Utility/WinTools.cs +++ b/Duplicati/Library/Utility/WinTools.cs @@ -19,10 +19,12 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +using System.Runtime.Versioning; using Duplicati.Library.Common; namespace Duplicati.Library.Utility { + [SupportedOSPlatform("windows")] public static class WinTools { public static string GetWindowsGpgExePath()