Skip to content

Commit 39d092a

Browse files
Fix regression bugs
1 parent 5ee81ed commit 39d092a

File tree

7 files changed

+255
-255
lines changed

7 files changed

+255
-255
lines changed

Src/DSInternals.Common.Test/Cryptography/GPPrefPwdObfuscatorTester.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public void GPPrefPwdObfuscator_Decrypt_NullInput()
3232
[TestMethod]
3333
public void GPPrefPwdObfuscator_Decrypt_EmptyInput()
3434
{
35-
Assert.ThrowsExactly<ArgumentNullException>(() => GPPrefPwdObfuscator.Decrypt(String.Empty));
35+
Assert.ThrowsExactly<ArgumentException>(() => GPPrefPwdObfuscator.Decrypt(String.Empty));
3636
}
3737
[TestMethod]
3838
public void GPPrefPwdObfuscator_Encrypt_Test1()

Src/DSInternals.Common.Test/DNWithBinaryTester.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public void DNWithBinary_NullInput()
2424
[TestMethod]
2525
public void DNWithBinary_EmptyInput()
2626
{
27-
Assert.ThrowsExactly<ArgumentNullException>(() => DNWithBinary.Parse(String.Empty));
27+
Assert.ThrowsExactly<ArgumentException>(() => DNWithBinary.Parse(String.Empty));
2828
}
2929

3030
[TestMethod]

Src/DSInternals.Common/Cryptography/Asn1/asn.xslt

Lines changed: 233 additions & 238 deletions
Large diffs are not rendered by default.

Src/DSInternals.Common/Cryptography/SortedFileSearcher.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ public bool FindString(string query)
5353
break;
5454
}
5555

56-
switch (String.Compare(line, 0, query, 0, query.Length, StringComparison.OrdinalIgnoreCase))
56+
int compareResult = string.Compare(line, 0, query, 0, query.Length, StringComparison.OrdinalIgnoreCase);
57+
58+
// In .NET Core, OrdinalIgnoreCase comparison might return values other than -1, 0, or 1.
59+
switch (Math.Sign(compareResult))
5760
{
5861
case -1:
5962
// Continue with the right half

Src/DSInternals.PowerShell/DSInternals.PowerShell.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
</ItemGroup>
6868

6969
<!-- Bundle the platform-specific DSInternals.Replication.Interop libraries and Visual C and C++ runtimes -->
70-
<Target Name="CopyInteropLibraries" AfterTargets="Build">
70+
<Target Name="CopyInteropLibraries" AfterTargets="PostBuildEvent">
7171
<PropertyGroup>
7272
<ReplicationInteropRootDir>$(ArtifactsPath)\bin\DSInternals.Replication.Interop\$(Configuration.ToLower())_$(TargetFramework)\</ReplicationInteropRootDir>
7373
</PropertyGroup>
@@ -99,7 +99,7 @@
9999
</Target>
100100

101101
<!-- Remove platform-specific files from the AnyCPU root -->
102-
<Target Name="RemoveRootInteropDll" AfterTargets="Build">
102+
<Target Name="RemoveRootInteropDll" AfterTargets="PostBuildEvent">
103103
<!-- Remove DSInternals.Replication.Interop DLL and PDB from module root. Only keep it in the architecture-specific subdirectories. -->
104104
<Delete Files="$(OutDir)DSInternals.Replication.Interop.dll" />
105105
<Delete Files="$(OutDir)DSInternals.Replication.Interop.pdb" />

Src/DSInternals.Replication.Interop/DSInternals.Replication.Interop.Shared.vcxitems

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
</ItemDefinitionGroup>
1616
<ItemGroup>
1717
<Midl Include="$(MSBuildThisFileDirectory)drsr.idl">
18+
<!-- MIDL compilation randomly fails and causes build errors. -->
19+
<!-- When this starts happening, the file can temporarily be excluded from compilation. -->
1820
<ExcludedFromBuild>false</ExcludedFromBuild>
1921
</Midl>
2022
<Midl Include="$(MSBuildThisFileDirectory)drsr_imports.idl">
23+
<!-- This file should never be compiled by MIDL directly. It should only be imported into drsr.idl. -->
2124
<ExcludedFromBuild>true</ExcludedFromBuild>
2225
</Midl>
2326
</ItemGroup>
@@ -60,4 +63,4 @@
6063
<ItemGroup>
6164
<ResourceCompile Include="$(MSBuildThisFileDirectory)version.rc" />
6265
</ItemGroup>
63-
</Project>
66+
</Project>

Src/DSInternals.SAM.Test/LSAPolicyTester.cs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,20 +113,19 @@ public void LsaPolicy_LsaRetrievePrivateData_Existing()
113113
[TestMethod]
114114
public void LsaPolicy_LsaRetrievePrivateData_NonExisting()
115115
{
116-
Assert.ThrowsExactly<FileNotFoundException>(() =>
116+
try
117117
{
118-
try
118+
using (var policy = new LsaPolicy(LsaPolicyAccessMask.GetPrivateInformation))
119119
{
120-
using (var policy = new LsaPolicy(LsaPolicyAccessMask.GetPrivateInformation))
121-
{
120+
Assert.ThrowsExactly<FileNotFoundException>(() => {
122121
policy.RetrievePrivateData("bflmpsvz");
123-
}
122+
});
124123
}
125-
catch (UnauthorizedAccessException e)
126-
{
127-
// This is expected.
128-
throw new AssertInconclusiveException("LSA-related tests require admin rights.", e);
129-
}
130-
});
124+
}
125+
catch (UnauthorizedAccessException e)
126+
{
127+
// This is expected.
128+
throw new AssertInconclusiveException("LSA-related tests require admin rights.", e);
129+
}
131130
}
132131
}

0 commit comments

Comments
 (0)