-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detecting available processor features. See https://learn.microsoft.c…
- Loading branch information
Showing
13 changed files
with
213 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#include "pch.h" | ||
|
||
extern "C" UINT __stdcall ListProcessorFeatures(MSIHANDLE hInstall) | ||
{ | ||
HRESULT hr = S_OK; | ||
UINT er = ERROR_SUCCESS; | ||
BOOL bRes = TRUE; | ||
|
||
hr = WcaInitialize(hInstall, __FUNCTION__); | ||
ExitOnFailure(hr, "Failed to initialize"); | ||
WcaLog(LOGMSG_STANDARD, "Initialized from PanelSwCustomActions " FullVersion); | ||
|
||
WcaSetIntProperty(L"PF_ARM_64BIT_LOADSTORE_ATOMIC", ::IsProcessorFeaturePresent(PF_ARM_64BIT_LOADSTORE_ATOMIC) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE", ::IsProcessorFeaturePresent(PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_ARM_EXTERNAL_CACHE_AVAILABLE", ::IsProcessorFeaturePresent(PF_ARM_EXTERNAL_CACHE_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_ARM_VFP_32_REGISTERS_AVAILABLE", ::IsProcessorFeaturePresent(PF_ARM_VFP_32_REGISTERS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_3DNOW_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_3DNOW_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_CHANNELS_ENABLED", ::IsProcessorFeaturePresent(PF_CHANNELS_ENABLED) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_COMPARE_EXCHANGE_DOUBLE", ::IsProcessorFeaturePresent(PF_COMPARE_EXCHANGE_DOUBLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_COMPARE_EXCHANGE128", ::IsProcessorFeaturePresent(PF_COMPARE_EXCHANGE128) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_COMPARE64_EXCHANGE128", ::IsProcessorFeaturePresent(PF_COMPARE64_EXCHANGE128) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_FASTFAIL_AVAILABLE", ::IsProcessorFeaturePresent(PF_FASTFAIL_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_FLOATING_POINT_EMULATED", ::IsProcessorFeaturePresent(PF_FLOATING_POINT_EMULATED) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_FLOATING_POINT_PRECISION_ERRATA", ::IsProcessorFeaturePresent(PF_FLOATING_POINT_PRECISION_ERRATA) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_MMX_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_MMX_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_NX_ENABLED", ::IsProcessorFeaturePresent(PF_NX_ENABLED) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_PAE_ENABLED", ::IsProcessorFeaturePresent(PF_PAE_ENABLED) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_RDTSC_INSTRUCTION_AVAILABLE", ::IsProcessorFeaturePresent(PF_RDTSC_INSTRUCTION_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_RDWRFSGSBASE_AVAILABLE", ::IsProcessorFeaturePresent(PF_RDWRFSGSBASE_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_SECOND_LEVEL_ADDRESS_TRANSLATION", ::IsProcessorFeaturePresent(PF_SECOND_LEVEL_ADDRESS_TRANSLATION) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_SSE3_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_SSSE3_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_SSSE3_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_SSE4_1_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_SSE4_1_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_SSE4_2_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_SSE4_2_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_AVX_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_AVX_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_AVX2_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_AVX2_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_AVX512F_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_AVX512F_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_VIRT_FIRMWARE_ENABLED", ::IsProcessorFeaturePresent(PF_VIRT_FIRMWARE_ENABLED) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_XMMI_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_XMMI_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_XMMI64_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_XMMI64_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_XSAVE_ENABLED", ::IsProcessorFeaturePresent(PF_XSAVE_ENABLED) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_ARM_V8_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_ARM_V8_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
WcaSetIntProperty(L"PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE", ::IsProcessorFeaturePresent(PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE) ? 1 : 0); | ||
|
||
LExit: | ||
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; | ||
return WcaFinalize(er); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,3 +56,4 @@ EXPORTS | |
FolderPaths | ||
PromptFileDowngrades | ||
IsWindowsVersionOrGreater | ||
ListProcessorFeatures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
UnitTests/ListProcessorFeaturesUT/ListProcessorFeaturesUT.wixproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="WixToolset.Sdk"> | ||
<PropertyGroup> | ||
<EnableDefaultCompileItems>true</EnableDefaultCompileItems> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<WixExtension Include="PanelSwWixExtension"> | ||
<HintPath>$(BuildFolder)..\Any CPU\bin\$(Configuration)\PanelSwWixExtension\PanelSwWixExtension.dll</HintPath> | ||
<Name>PanelSwWixExtension</Name> | ||
</WixExtension> | ||
<PackageReference Include="TidyBuild" /> | ||
</ItemGroup> | ||
</Project> |
27 changes: 27 additions & 0 deletions
27
UnitTests/ListProcessorFeaturesUT/ListProcessorFeaturesUT.wxs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.panel-sw.co.il/wix/WixExtension ../../PanelSwWixExtension/XSD/PanelSwWixExtension.xsd"> | ||
<Package Name="ListProcessorFeaturesUT" Language="1033" Version="$(var.JetVersion)" Manufacturer="$(var.JetManufacturer)" UpgradeCode="{B997AF76-8F98-40D1-B123-552C82C40B37}" InstallerVersion="200" ProductCode="{B7318C42-2252-44B9-A1E5-47CCD5163D9D}"> | ||
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | ||
|
||
<Feature Id="ProductFeature" Title="UnitTestSetup" Level="1"> | ||
<Component Directory="INSTALLFOLDER"> | ||
<File Source="$(sys.SOURCEFILEPATH)"/> | ||
</Component> | ||
</Feature> | ||
|
||
<Property Id="MSIFASTINSTALL" Value="1"></Property> | ||
<PropertyRef Id="PF_ARM_64BIT_LOADSTORE_ATOMIC" /> | ||
|
||
<Launch Condition="Installed Or PF_NX_ENABLED=1" Message="Surely 'Data execution prevention' processor feature is enabled." /> | ||
<CustomActionRef Id="TerminateSuccessfully_Immediate" /> | ||
<InstallUISequence> | ||
<Custom Action="TerminateSuccessfully_Immediate" After="LaunchConditions"></Custom> | ||
</InstallUISequence> | ||
<InstallExecuteSequence> | ||
<Custom Action="TerminateSuccessfully_Immediate" After="LaunchConditions"></Custom> | ||
</InstallExecuteSequence> | ||
|
||
<StandardDirectory Id="ProgramFiles6432Folder"> | ||
<Directory Id="INSTALLFOLDER" Name="UnitTestSetup" /> | ||
</StandardDirectory> | ||
</Package> | ||
</Wix> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters