Skip to content

Commit 16c0b49

Browse files
Consolidated project files
1 parent b0d3741 commit 16c0b49

16 files changed

+165
-147
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ If you want to build the module from source code yourself, you need to install t
6060
* Git for Windows (optional)
6161
* GitHub Extension for Visual Studio (optional)
6262

63-
To make IntelliSense work with *.psm1 files, the following code needs to be added to the `C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Xml\Schemas\catalog.xml` file:
63+
To make IntelliSense work with `*.ps1xml` files, the following code needs to be added to the `C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Xml\Schemas\catalog.xml` file:
6464

6565
```xml
6666
<Association extension="ps1xml" schema="https://raw.githubusercontent.com/PowerShell/PowerShell/master/src/Schemas/Format.xsd" enableValidation="true"/>

.github/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
[![.NET Framework 4.8+](https://img.shields.io/badge/Framework-4.8%2B-007FFF.svg?logo=.net)](#)
1111
[![.NET 8.0+](https://img.shields.io/badge/Runtime-8.0%2B-007FFF.svg?logo=.net)](#)
12-
[![Architecture x64 | x86](https://img.shields.io/badge/Architecture-x64%20|%20x86-0071c5.svg?logo=cplusplus)](#)
12+
[![Architecture x64 | x86 | ARM64](https://img.shields.io/badge/Architecture-x64%20|%20x86%20|%20ARM64-0071c5.svg?logo=cplusplus)](#)
1313

1414
## Introduction
1515

.github/workflows/autobuild.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,28 @@ jobs:
2929
- name: Setup .NET
3030
uses: actions/setup-dotnet@v4
3131
with:
32+
# .NET SDK 9 is used for build. Platform-specific IJW hosts from .NET SDK 8 are used when building C++/CLI projects.
33+
dotnet-version: |
34+
8.0.x
35+
9.0.x
3236
cache: true
3337
cache-dependency-path: 'Src/*/packages.lock.json'
3438

3539
- name: Restore NuGet Packages
3640
working-directory: Src
37-
run: msbuild.exe -target:Restore -property:RestorePackagesConfig=true
41+
run: msbuild.exe DSInternals.slnx -target:Restore -property:RestorePackagesConfig=true -property:Configuration=Debug -property:Platform=x64
3842

3943
- name: Build x86
4044
working-directory: Src
41-
run: msbuild.exe -target:Build -property:Configuration=Debug -property:Platform=Win32 -property:RestorePackages=false
45+
run: msbuild.exe DSInternals.ArchitectureSpecific.slnf -target:Build -property:Configuration=Debug -property:Platform=Win32 -property:RestorePackages=false
4246

4347
- name: Build ARM64
4448
working-directory: Src
45-
run: msbuild.exe -target:Build -property:Configuration=Debug -property:Platform=ARM64 -property:RestorePackages=false
49+
run: msbuild.exe DSInternals.ArchitectureSpecific.slnf -target:Build -property:Configuration=Debug -property:Platform=ARM64 -property:RestorePackages=false
4650

4751
- name: Build AMD64
4852
working-directory: Src
49-
run: msbuild.exe -target:Build -property:Configuration=Debug -property:Platform=x64 -property:RestorePackages=false
53+
run: msbuild.exe DSInternals.slnx -target:Build -property:Configuration=Debug -property:Platform=x64 -property:RestorePackages=false
5054

5155
- name: Create Module Catalog
5256
shell: powershell

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
- name: Restore NuGet Packages
6464
if: matrix.build-mode == 'manual'
6565
working-directory: Src
66-
run: msbuild.exe -target:Restore -property:RestorePackagesConfig=true
66+
run: msbuild.exe -target:Restore -property:RestorePackagesConfig=true -property:Configuration=Debug -property:Platform=x64
6767

6868
- name: Build All Projects
6969
if: matrix.build-mode == 'manual'

.github/workflows/release.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ jobs:
8282
- name: Setup .NET
8383
uses: actions/setup-dotnet@v4
8484
with:
85+
# .NET SDK 9 is used for build. Platform-specific IJW hosts from .NET SDK 8 are used when building C++/CLI projects.
86+
dotnet-version: |
87+
8.0.x
88+
9.0.x
8589
cache: true
8690
cache-dependency-path: 'Src/*/packages.lock.json'
8791

@@ -101,19 +105,19 @@ jobs:
101105
102106
- name: Restore NuGet Packages
103107
working-directory: Src
104-
run: msbuild.exe -target:Restore -property:RestorePackagesConfig=true
108+
run: msbuild.exe DSInternals.SkipTests.slnf -target:Restore -property:RestorePackagesConfig=true -property:Configuration=Release -property:Platform=x64
105109

106110
- name: Build x86
107111
working-directory: Src
108-
run: msbuild.exe -target:Build -property:Configuration=Release -property:Platform=Win32 -property:RestorePackages=false
112+
run: msbuild.exe DSInternals.ArchitectureSpecific.slnf -target:Build -property:Configuration=Release -property:Platform=Win32 -property:RestorePackages=false
109113

110-
#- name: Build ARM64
111-
# working-directory: Src
112-
# run: msbuild.exe -target:Build -property:Configuration=Release -property:Platform=ARM64 -property:RestorePackages=false
114+
- name: Build ARM64
115+
working-directory: Src
116+
run: msbuild.exe DSInternals.ArchitectureSpecific.slnf -target:Build -property:Configuration=Release -property:Platform=ARM64 -property:RestorePackages=false
113117

114118
- name: Build AMD64
115119
working-directory: Src
116-
run: msbuild.exe -target:Build -property:Configuration=Release -property:Platform=x64 -property:RestorePackages=false
120+
run: msbuild.exe DSInternals.SkipTests.slnf -target:Build -property:Configuration=Release -property:Platform=x64 -property:RestorePackages=false
117121

118122
- name: Azure Login
119123
uses: azure/login@v2
@@ -164,10 +168,10 @@ jobs:
164168
copy /Y "DSInternals.Replication.Model\release_net8.0-windows\DSInternals.Replication.Model.dll" "DSInternals.PowerShell\Release\DSInternals\net8.0-windows\"
165169
copy /Y "DSInternals.Replication.Interop\Release_net4.8-Win32\DSInternals.Replication.Interop.dll" "DSInternals.PowerShell\Release\DSInternals\net48\x86\"
166170
copy /Y "DSInternals.Replication.Interop\Release_net4.8-x64\DSInternals.Replication.Interop.dll" "DSInternals.PowerShell\Release\DSInternals\net48\amd64\"
167-
REM copy /Y "DSInternals.Replication.Interop\Release_net4.8-ARM64\DSInternals.Replication.Interop.dll" "DSInternals.PowerShell\Release\DSInternals\net48\arm64\"
171+
copy /Y "DSInternals.Replication.Interop\Release_net4.8-ARM64\DSInternals.Replication.Interop.dll" "DSInternals.PowerShell\Release\DSInternals\net48\arm64\"
168172
copy /Y "DSInternals.Replication.Interop\Release_net8.0-Win32\DSInternals.Replication.Interop.dll" "DSInternals.PowerShell\Release\DSInternals\net8.0-windows\x86\"
169173
copy /Y "DSInternals.Replication.Interop\Release_net8.0-x64\DSInternals.Replication.Interop.dll" "DSInternals.PowerShell\Release\DSInternals\net8.0-windows\amd64\"
170-
REM copy /Y "DSInternals.Replication.Interop\Release_net8.0-ARM64\DSInternals.Replication.Interop.dll" "DSInternals.PowerShell\Release\DSInternals\net8.0-windows\arm64\"
174+
copy /Y "DSInternals.Replication.Interop\Release_net8.0-ARM64\DSInternals.Replication.Interop.dll" "DSInternals.PowerShell\Release\DSInternals\net8.0-windows\arm64\"
171175
copy /Y "DSInternals.SAM\release_net48\DSInternals.SAM.dll" "DSInternals.PowerShell\Release\DSInternals\net48\"
172176
copy /Y "DSInternals.SAM\release_net8.0-windows\DSInternals.SAM.dll" "DSInternals.PowerShell\Release\DSInternals\net8.0-windows\"
173177
@@ -179,9 +183,7 @@ jobs:
179183
- name: Create Managed NuGet Packages
180184
working-directory: Src
181185
run: |
182-
dotnet pack DSInternals.Common --configuration Release --no-build
183-
dotnet pack DSInternals.DataStore --configuration Release --no-build
184-
dotnet pack DSInternals.SAM --configuration Release --no-build
186+
dotnet pack DSInternals.DotNetSdk.slnf --configuration Release --no-build
185187
186188
- name: Create Mixed NuGet Package
187189
working-directory: Src

Documentation/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55

66
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
77

8+
## [Unreleased]
9+
10+
### Fixed
11+
12+
- Re-enabled native ARM64 support in the PowerShell module.
13+
814
## [6.0.1] - 2025-08-14
915

1016
### Fixed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "Schema/SolutionFilter.schema.json",
3+
"$comment": "This file is a MSBuild solution filter, which only targets architecture-specific binaries and their dependencies.",
4+
"solution": {
5+
"path": "DSInternals.slnx",
6+
"projects": [
7+
"DSInternals.Common\\DSInternals.Common.csproj",
8+
"DSInternals.Replication.Interop\\NetCore\\DSInternals.Replication.Interop.NetCore.vcxproj",
9+
"DSInternals.Replication.Interop\\NetFramework\\DSInternals.Replication.Interop.NetFramework.vcxproj"
10+
]
11+
}
12+
}

Src/DSInternals.PowerShell/DSInternals.psd1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
RootModule = 'DSInternals.Bootstrap.psm1'
99

1010
# Version number of this module.
11-
ModuleVersion = '6.0.1'
11+
ModuleVersion = '6.0.2'
1212

1313
# Supported PSEditions
1414
CompatiblePSEditions = @('Desktop', 'Core')
@@ -182,7 +182,7 @@ FileList = @(
182182
'net48\DSInternals.Replication.Model.dll',
183183
'net48\DSInternals.SAM.dll',
184184
'net48\amd64\DSInternals.Replication.Interop.dll',
185-
# 'net48\arm64\DSInternals.Replication.Interop.dll',
185+
'net48\arm64\DSInternals.Replication.Interop.dll',
186186
'net48\x86\DSInternals.Replication.Interop.dll',
187187
'net48\Esent.Interop.dll',
188188
'net48\Esent.Isam.dll',
@@ -200,7 +200,7 @@ FileList = @(
200200
'net8.0-windows\DSInternals.Replication.Model.dll',
201201
'net8.0-windows\DSInternals.SAM.dll',
202202
'net8.0-windows\amd64\DSInternals.Replication.Interop.dll',
203-
# 'net8.0-windows\arm64\DSInternals.Replication.Interop.dll',
203+
'net8.0-windows\arm64\DSInternals.Replication.Interop.dll',
204204
'net8.0-windows\x86\DSInternals.Replication.Interop.dll',
205205
'net8.0-windows\Esent.Interop.dll',
206206
'net8.0-windows\Esent.Isam.dll',
@@ -234,6 +234,7 @@ PrivateData = @{
234234
- Implemented full support for ntds.dit files originating from RODCs.
235235
- Improved the performance of schema loading and account retrieval from ntds.dit files.
236236
- Version 6.0.1 fixes a bug with misplaced .NET IJW host files in the PowerShell module directory structure.
237+
- Version 6.0.2 re-adds native ARM64 support.
237238
"@
238239
} # End of PSData hashtable
239240

Src/DSInternals.Replication.Interop/Directory.Build.Props

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
66
<WindowsTargetPlatformMinVersion>7.0</WindowsTargetPlatformMinVersion>
77
<VCProjectVersion>17.0</VCProjectVersion>
8+
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
89
<ConfigurationType>DynamicLibrary</ConfigurationType>
910
<CharacterSet>Unicode</CharacterSet>
1011
<RootNamespace>DSInternals.Replication.Interop</RootNamespace>
1112
<TargetName>DSInternals.Replication.Interop</TargetName>
13+
<!-- Incremental linking is not supported for mixed native and managed code projects. -->
14+
<LinkIncremental>false</LinkIncremental>
15+
<!-- Copy C and C++ runtimes to the output directory, from which they will be copied to PowerShell. -->
16+
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
1217
</PropertyGroup>
1318
<ItemDefinitionGroup>
1419
<ClCompile>
@@ -17,9 +22,12 @@
1722
<LanguageStandard_C>stdc17</LanguageStandard_C>
1823
<LanguageStandard>stdcpp20</LanguageStandard>
1924
<WarningLevel>Level3</WarningLevel>
25+
<PreprocessorDefinitions Condition="'$(Platform)'=='Win32'">WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
2026
</ClCompile>
2127
<Link>
22-
<AdditionalDependencies>Rpcrt4.lib;Secur32.lib</AdditionalDependencies>
28+
<!-- Include RPC support -->
29+
<AdditionalDependencies>$(CoreLibraryDependencies);%(AdditionalDependencies);Rpcrt4.lib;Secur32.lib</AdditionalDependencies>
30+
<TargetMachine Condition="'$(Platform)'=='ARM64'">MachineARM64</TargetMachine>
2331
</Link>
2432
<!-- Override the MIDL compiler settings -->
2533
<Midl>
@@ -32,17 +40,21 @@
3240
<EnableErrorChecks>All</EnableErrorChecks>
3341
</Midl>
3442
</ItemDefinitionGroup>
35-
<PropertyGroup Condition="'$(Configuration)' =='Debug'" Label="Configuration">
43+
<PropertyGroup Condition="'$(Configuration)' =='Debug'">
3644
<UseDebugLibraries>true</UseDebugLibraries>
45+
<!-- Enable code analysis for Debug configuration -->
46+
<RunCodeAnalysis>true</RunCodeAnalysis>
47+
<EnableMicrosoftCodeAnalysis>true</EnableMicrosoftCodeAnalysis>
3748
</PropertyGroup>
38-
<PropertyGroup Condition="'$(Configuration)' =='Release'" Label="Configuration">
49+
<PropertyGroup Condition="'$(Configuration)' =='Release'">
3950
<UseDebugLibraries>false</UseDebugLibraries>
4051
</PropertyGroup>
4152
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
4253
<ClCompile>
4354
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
4455
<Optimization>Disabled</Optimization>
4556
<ExceptionHandling>false</ExceptionHandling>
57+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
4658
</ClCompile>
4759
<Link>
4860
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
@@ -53,6 +65,7 @@
5365
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
5466
<ExceptionHandling>Async</ExceptionHandling>
5567
<GenerateXMLDocumentationFiles>true</GenerateXMLDocumentationFiles>
68+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
5669
</ClCompile>
5770
</ItemDefinitionGroup>
5871
<!-- Configure strong name signing if the private key exists -->

Src/DSInternals.Replication.Interop/Directory.Build.Targets

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,29 @@
66
<TargetProcessorArchitecture Condition="'$(Platform)'=='x64'">amd64</TargetProcessorArchitecture>
77
<TargetProcessorArchitecture Condition="'$(Platform)'=='Win32'">x86</TargetProcessorArchitecture>
88
<TargetProcessorArchitecture Condition="'$(Platform)'=='ARM64'">arm64</TargetProcessorArchitecture>
9-
<!-- Sample path: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.34.31931\arm64\Microsoft.VC143.CRT\msvcp140.dll -->
10-
<CppRuntimeRedistPath>$(CppRuntimeFilesPath.Replace(';',''))\Microsoft.VC$(PlatformToolsetVersion).CRT\</CppRuntimeRedistPath>
119
<!-- DotNet Framework variable -->
1210
<PowerShellModulePath Condition="'$(CLRSupport)' == 'true'">$(MSBuildThisFileDirectory)..\..\Build\bin\DSInternals.PowerShell\$(Configuration)\DSInternals\net48\$(TargetProcessorArchitecture)\</PowerShellModulePath>
1311
<!-- DotNet Core variable -->
1412
<PowerShellModulePath Condition="'$(CLRSupport)' == 'NetCore'">$(MSBuildThisFileDirectory)..\..\Build\bin\DSInternals.PowerShell\$(Configuration)\DSInternals\$(TargetFramework)-$(TargetPlatformIdentifier)\$(TargetProcessorArchitecture)\</PowerShellModulePath>
1513
</PropertyGroup>
1614
<ItemGroup>
17-
<!-- Note: The msvcr140.dll file has been replaced by vcruntime140.dll since Visual Studio 2017. The vcruntime140_1.dll file is also required.
18-
Moreover, $(PlatformToolsetVersion) equals to 150 instead of 140 and thus does not match the names of the runtime files.-->
19-
<CppRuntimeBinaries Include="$(CppRuntimeRedistPath)msvc????.dll;$(CppRuntimeRedistPath)vcruntime???.dll;$(CppRuntimeRedistPath)vcruntime???_?.dll" />
15+
<!--
16+
The C runtime library (vcruntime<version>.dll or legacy msvcr<version>.dll) and the C++ standard library (msvcp<version>.dll) cannot be statically linked to mixed native and managed DLLs.
17+
Thanks to the CopyCppRuntimeToOutputDir setting, we can copy the correct runtime libraries from the output directory, instead of looking for them in "C:\Program Files\...".
18+
The msvcr140.dll / msvcr140d.dll files have been replaced by vcruntime140.dll / vcruntime140d.dll since Visual Studio 2017.
19+
The vcruntime140_1.dll / vcruntime140_1d.dll file is also required when not statically linked.
20+
Moreover, $(PlatformToolsetVersion) equals to 150 instead of 140 and thus does not match the names of the runtime files.
21+
-->
22+
<CppRuntimeBinaries Include="$(OutDir)msvc????.dll;$(OutDir)vcruntime???.dll;$(OutDir)vcruntime???_?.dll" Condition="'$(Configuration)' == 'Release'" />
23+
<CppRuntimeBinaries Include="$(OutDir)msvc????d.dll;$(OutDir)vcruntime???d.dll;$(OutDir)vcruntime???_?d.dll" Condition="'$(Configuration)' == 'Debug'" />
2024
</ItemGroup>
21-
<!-- Copy the C++ runtime files to the PowerShell module. -->
25+
<!-- Copy the C and C++ runtime files to the PowerShell module. -->
2226
<Copy SourceFiles="@(CppRuntimeBinaries)" DestinationFolder="$(PowerShellModulePath)" />
2327
<!-- Copy the .NET IJW host to the PowerShell module. -->
2428
<Copy SourceFiles="$(OutDir)Ijwhost.dll" DestinationFolder="$(PowerShellModulePath)" Condition="'$(CLRSupport)' == 'NetCore'" />
2529
<!-- Copy the compiled DLLs to the PowerShell module. -->
26-
<Copy SourceFiles="$(OutDir)$(TargetFileName)" DestinationFolder="$(PowerShellModulePath)" />
27-
<!-- Include the debug symbols -->
30+
<Copy SourceFiles="$(OutDir)$(TargetName).dll" DestinationFolder="$(PowerShellModulePath)" />
31+
<!-- Include the debug symbols as well. -->
2832
<Copy SourceFiles="$(OutDir)$(TargetName).pdb" DestinationFolder="$(PowerShellModulePath)" />
2933
</Target>
3034
<!-- This is a dummy NuGet pack target to avoid error MSB4057: The target "Pack" does not exist in the project. -->

0 commit comments

Comments
 (0)