Move OS detection to common and PowerToysInterop (#5120)

* Remove os-detection project

* Removed os-detection project from sln

* Added os-detection to PowerToysInterop

* Removed references to os-detection and added PowerToysInterop.dll to the ImageResizer folder
This commit is contained in:
Arjun Balgovind
2020-07-21 12:01:59 -07:00
committed by GitHub
parent b31d9761fa
commit d01b93ae5f
23 changed files with 37 additions and 274 deletions

View File

@@ -4,7 +4,7 @@
#include <interface/powertoy_module_interface.h>
#include "trace.h"
#include <common\settings_objects.h>
#include <common\os-detection\os-detect.h>
#include <common\os-detect.h>
extern "C" IMAGE_DOS_HEADER __ImageBase;

View File

@@ -225,6 +225,12 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\common\interop\interop.vcxproj">
<Project>{f055103b-f80b-4d0c-bf48-057c55620033}</Project>
<Name>interop</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<TargetFrameworkSDKToolsDirectory Condition=" '$(Platform)' == 'x64'">$(TargetFrameworkSDKToolsDirectory)$(Platform)\</TargetFrameworkSDKToolsDirectory>

View File

@@ -7,7 +7,9 @@ namespace ImageResizer.Models
{
public class AdvancedSettings
{
[DllImport("../../os-detection.dll", EntryPoint = "UseNewSettings", ExactSpelling = false)]
public static extern bool UseNewSettings();
public static bool UseNewSettings()
{
return interop.CommonManaged.ShouldNewSettingsBeUsed();
}
}
}

View File

@@ -6,7 +6,7 @@
#include <common/common.h>
#include "trace.h"
#include "resource.h"
#include <common/os-detection/os-detect.h>
#include <common/os-detect.h>
extern "C" IMAGE_DOS_HEADER __ImageBase;