Skip to content

Commit

Permalink
Support x64 architecture
Browse files Browse the repository at this point in the history
Fixes thebookisclosed#18

Add support for x64 non-ARM based PCs for Amperage and Windows Recall.

* **Amperage/Amperage.csproj**: Add configurations for x64 architecture and include necessary DLLs for x64.
* **Amperage/NativeMethods.cs**: Add x64-specific code for NPU detection.
* **Amperage/Extensions/WinRTAwaiter.cs**: Ensure compatibility with x64 architecture.
* **ProcessCreationExt/ProcessCreationExt.csproj**: Add configurations for x64 architecture.
* **VmDetection/VmDetection.csproj**: Add configurations for x64 architecture.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/thebookisclosed/AmperageKit/issues/18?shareId=XXXX-XXXX-XXXX-XXXX).
  • Loading branch information
Githubguy132010 committed Feb 27, 2025
1 parent 550f32d commit 5b2ed66
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 4 deletions.
8 changes: 7 additions & 1 deletion Amperage/Amperage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@
<None Include="Detours\x86\WindowsUdk.System.Profile.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Detours\x64\vcruntime140_app.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Detours\x64\WindowsUdk.System.Profile.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>
2 changes: 1 addition & 1 deletion Amperage/Extensions/WinRTAwaiter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ public static TaskAwaiter<T> GetAwaiter<T, P>(this IAsyncOperationWithProgress<T
return tcs.Task.GetAwaiter();
}
}
}
}
4 changes: 4 additions & 0 deletions Amperage/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,9 @@ internal static unsafe extern int GetPackageApplicationIds(
const string imagehlp = "imagehlp.dll";
[DllImport(imagehlp, CharSet = CharSet.Ansi, ExactSpelling = true)]
internal static extern uint MapFileAndCheckSumA([MarshalAs(UnmanagedType.LPStr)] string Filename, out uint HeaderSum, out uint CheckSum);

// x64-specific code for NPU detection
[DllImport("NPUDetect_x64.dll", ExactSpelling = true)]
internal static extern int npudetect_detect_npugeneration_x64();
}
}
22 changes: 21 additions & 1 deletion ProcessCreationExt/ProcessCreationExt.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,26 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -47,4 +67,4 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>
22 changes: 21 additions & 1 deletion VmDetection/VmDetection.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -49,4 +69,4 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>

0 comments on commit 5b2ed66

Please sign in to comment.