Skip to content

Commit

Permalink
Switching withdll to use the Microsoft.Win32Metadata nuget package.
Browse files Browse the repository at this point in the history
  • Loading branch information
lowleveldesign committed Jun 20, 2024
1 parent b23c8a2 commit 6f68d8e
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 194 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,6 @@ jobs:
run: nmake
working-directory: detours

- name: Build the detours DLL
working-directory: detours-dll
run: |
mkdir bin.${{ matrix.arch }}
pushd bin.${{ matrix.arch }}
cl.exe /nologo /LD /TP /DUNICODE /DWIN32 /D_WINDOWS /EHsc /W4 /WX /Zi /O2 /Ob1 /DNDEBUG /Fodetours.obj /Fddetours.pdb ..\detours.cpp ^
/link /def:..\detours.def "%GITHUB_WORKSPACE%\detours\lib.${{ matrix.arch }}\detours.lib"
popd
- name: Apply detours.h patch
if: ${{ matrix.arch == 'x64' }}
shell: pwsh
run: "@(Get-Content \".\\detours\\src\\detours.h\")[0..866+920..1234] | Set-Content \".\\detours\\include\\detours.h\""

- name: Build detours metadata
if: ${{ matrix.arch == 'x64' }}
working-directory: detours-meta
run: dotnet build /p:BuildConfig=""

- name: Build and publish withdll
if: ${{ matrix.arch == 'x64' }}
working-directory: withdll
Expand Down
5 changes: 3 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "detours"]
path = detours
[submodule "Detours"]
path = Detours
url = https://github.com/microsoft/Detours.git
shallow = true
1 change: 1 addition & 0 deletions Detours
Submodule Detours added at 4b8c65
48 changes: 0 additions & 48 deletions build-all.bat

This file was deleted.

54 changes: 0 additions & 54 deletions build-detours.bat

This file was deleted.

1 change: 0 additions & 1 deletion detours
Submodule detours deleted from 734ac6
16 changes: 0 additions & 16 deletions detours-dll/detours.cpp

This file was deleted.

20 changes: 0 additions & 20 deletions detours-dll/detours.def

This file was deleted.

21 changes: 0 additions & 21 deletions detours-meta/generate.proj

This file was deleted.

2 changes: 0 additions & 2 deletions detours-meta/main.cpp

This file was deleted.

17 changes: 6 additions & 11 deletions withdll/withdll.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand All @@ -12,16 +12,11 @@
</PropertyGroup>

<ItemGroup>
<ProjectionMetadataWinmd Include="../detours-meta/winmd/*.winmd" />

<DirectPInvoke Include="detours" />
<NativeLibrary Include="../detours/lib.X64/detours.lib" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.46-beta">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Detours.Win32Metadata" Version="4.0.1.8" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>

0 comments on commit 6f68d8e

Please sign in to comment.