Skip to content

Commit d170a14

Browse files
rojigithub-actions
authored and
github-actions
committed
Fix GUID interop in distributed transactions
And disable tests on ARM for now. Works around #74170
1 parent 7fac450 commit d170a14

18 files changed

+75
-45
lines changed

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/IPrepareInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
54
using System.Runtime.InteropServices;
65

76
namespace System.Transactions.DtcProxyShim.DtcInterfaces;

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/IResourceManagerFactory2.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ namespace System.Transactions.DtcProxyShim.DtcInterfaces;
1010
internal interface IResourceManagerFactory2
1111
{
1212
internal void Create(
13-
Guid pguidRM,
13+
in Guid pguidRM,
1414
[MarshalAs(UnmanagedType.LPStr)] string pszRMName,
1515
[MarshalAs(UnmanagedType.Interface)] IResourceManagerSink pIResMgrSink,
1616
[MarshalAs(UnmanagedType.Interface)] out IResourceManager rm);
1717

1818
internal void CreateEx(
19-
Guid pguidRM,
19+
in Guid pguidRM,
2020
[MarshalAs(UnmanagedType.LPStr)] string pszRMName,
2121
[MarshalAs(UnmanagedType.Interface)] IResourceManagerSink pIResMgrSink,
22-
Guid riidRequested,
22+
in Guid riidRequested,
2323
[MarshalAs(UnmanagedType.Interface)] out object rm);
2424
}
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
54
using System.Runtime.InteropServices;
6-
using System.Transactions.Oletx;
75

86
namespace System.Transactions.DtcProxyShim.DtcInterfaces;
97

108
// https://docs.microsoft.com/previous-versions/windows/desktop/ms686531(v=vs.85)
119
[ComImport, Guid(Guids.IID_ITransaction), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
1210
internal interface ITransaction
1311
{
14-
void Commit([MarshalAs(UnmanagedType.Bool)] bool fRetainingt, [MarshalAs(UnmanagedType.U4)] OletxXacttc grfTC, uint grfRM);
12+
void Commit(
13+
[MarshalAs(UnmanagedType.Bool)] bool fRetaining,
14+
[MarshalAs(UnmanagedType.U4)] OletxXacttc grfTC,
15+
uint grfRM);
1516

16-
void Abort(IntPtr reason, [MarshalAs(UnmanagedType.Bool)] bool retaining, [MarshalAs(UnmanagedType.Bool)] bool async);
17+
void Abort(
18+
IntPtr reason,
19+
[MarshalAs(UnmanagedType.Bool)] bool retaining,
20+
[MarshalAs(UnmanagedType.Bool)] bool async);
1721

1822
void GetTransactionInfo(out OletxXactTransInfo xactInfo);
1923
}

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionCloner.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
54
using System.Runtime.InteropServices;
65

76
namespace System.Transactions.DtcProxyShim.DtcInterfaces;

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionDispenser.cs

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

88
namespace System.Transactions.DtcProxyShim.DtcInterfaces;
99

10-
// https://docs.microsoft.com/previous-versions/windows/desktop/ms679525(v=vs.85)
10+
// https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms687604(v=vs.85)
1111
[ComImport, Guid(Guids.IID_ITransactionDispenser), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
1212
internal interface ITransactionDispenser
1313
{

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionEnlistmentAsync.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
54
using System.Runtime.InteropServices;
65

76
namespace System.Transactions.DtcProxyShim.DtcInterfaces;

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionExport.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
54
using System.Runtime.InteropServices;
65

76
namespace System.Transactions.DtcProxyShim.DtcInterfaces;

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionExportFactory.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
54
using System.Runtime.InteropServices;
65

76
namespace System.Transactions.DtcProxyShim.DtcInterfaces;

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionImport.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
54
using System.Runtime.InteropServices;
65

76
namespace System.Transactions.DtcProxyShim.DtcInterfaces;
@@ -13,6 +12,6 @@ internal interface ITransactionImport
1312
void Import(
1413
uint cbTransactionCookie,
1514
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] byte[] rgbTransactionCookie,
16-
Guid piid,
15+
in Guid piid,
1716
[MarshalAs(UnmanagedType.Interface)] out object ppvTransaction);
1817
}

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionOptions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
54
using System.Runtime.InteropServices;
65

76
namespace System.Transactions.DtcProxyShim.DtcInterfaces;

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionOutcomeEvents.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,21 @@ namespace System.Transactions.DtcProxyShim.DtcInterfaces;
1010
[ComImport, Guid("3A6AD9E2-23B9-11cf-AD60-00AA00A74CCD"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
1111
internal interface ITransactionOutcomeEvents
1212
{
13-
void Committed([MarshalAs(UnmanagedType.Bool)] bool fRetaining, IntPtr pNewUOW /* always null? */, int hresult);
13+
void Committed(
14+
[MarshalAs(UnmanagedType.Bool)] bool fRetaining,
15+
IntPtr pNewUOW,
16+
int hresult);
1417

15-
void Aborted(IntPtr pboidReason, [MarshalAs(UnmanagedType.Bool)] bool fRetaining, IntPtr pNewUOW, int hresult);
18+
void Aborted(
19+
IntPtr pboidReason,
20+
[MarshalAs(UnmanagedType.Bool)] bool fRetaining,
21+
IntPtr pNewUOW,
22+
int hresult);
1623

17-
void HeuristicDecision([MarshalAs(UnmanagedType.U4)] OletxTransactionHeuristic dwDecision, IntPtr pboidReason, int hresult);
24+
void HeuristicDecision(
25+
[MarshalAs(UnmanagedType.U4)] OletxTransactionHeuristic dwDecision,
26+
IntPtr pboidReason,
27+
int hresult);
1828

1929
void Indoubt();
2030
}

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionReceiver.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
54
using System.Runtime.InteropServices;
65

76
namespace System.Transactions.DtcProxyShim.DtcInterfaces;

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionReceiverFactory.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
54
using System.Runtime.InteropServices;
65

76
namespace System.Transactions.DtcProxyShim.DtcInterfaces;

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionResourceAsync.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
54
using System.Runtime.InteropServices;
6-
using System.Transactions.Oletx;
75

86
namespace System.Transactions.DtcProxyShim.DtcInterfaces;
97

@@ -19,7 +17,10 @@ void PrepareRequest(
1917

2018
void CommitRequest(OletxXactRm grfRM, IntPtr pNewUOW);
2119

22-
void AbortRequest(IntPtr pboidReason, [MarshalAs(UnmanagedType.Bool)] bool fRetaining, IntPtr pNewUOW);
20+
void AbortRequest(
21+
IntPtr pboidReason,
22+
[MarshalAs(UnmanagedType.Bool)] bool fRetaining,
23+
IntPtr pNewUOW);
2324

2425
void TMDown();
2526
}

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionTransmitter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
54
using System.Runtime.InteropServices;
65

76
namespace System.Transactions.DtcProxyShim.DtcInterfaces;

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionTransmitterFactory.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System;
54
using System.Runtime.InteropServices;
65

76
namespace System.Transactions.DtcProxyShim.DtcInterfaces;

src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionVoterNotifyAsync2.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,21 @@ namespace System.Transactions.DtcProxyShim.DtcInterfaces;
1010
[ComImport, Guid("5433376B-414D-11d3-B206-00C04FC2F3EF"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
1111
internal interface ITransactionVoterNotifyAsync2
1212
{
13-
void Committed([MarshalAs(UnmanagedType.Bool)] bool fRetaining, IntPtr pNewUOW /* always null? */, uint hresult);
13+
void Committed(
14+
[MarshalAs(UnmanagedType.Bool)] bool fRetaining,
15+
IntPtr pNewUOW,
16+
uint hresult);
1417

15-
void Aborted(IntPtr pboidReason, [MarshalAs(UnmanagedType.Bool)] bool fRetaining, IntPtr pNewUOW, uint hresult);
18+
void Aborted(
19+
IntPtr pboidReason,
20+
[MarshalAs(UnmanagedType.Bool)] bool fRetaining,
21+
IntPtr pNewUOW,
22+
uint hresult);
1623

17-
void HeuristicDecision([MarshalAs(UnmanagedType.U4)] OletxTransactionHeuristic dwDecision, IntPtr pboidReason, uint hresult);
24+
void HeuristicDecision(
25+
[MarshalAs(UnmanagedType.U4)] OletxTransactionHeuristic dwDecision,
26+
IntPtr pboidReason,
27+
uint hresult);
1828

1929
void Indoubt();
2030

src/libraries/System.Transactions.Local/tests/OleTxTests.cs

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ public OleTxTests(OleTxFixture fixture)
2828
[InlineData(Phase1Vote.ForceRollback, Phase1Vote.Prepared, EnlistmentOutcome.Aborted, EnlistmentOutcome.Aborted, TransactionStatus.Aborted)]
2929
public void Two_durable_enlistments_commit(Phase1Vote vote1, Phase1Vote vote2, EnlistmentOutcome expectedOutcome1, EnlistmentOutcome expectedOutcome2, TransactionStatus expectedTxStatus)
3030
{
31-
if (!Environment.Is64BitProcess)
31+
if (!Environment.Is64BitProcess || PlatformDetection.IsArm64Process)
3232
{
33-
return; // Temporarily skip on 32-bit where we have an issue
33+
// Temporarily skip on 32-bit where we have an issue
34+
// ARM64 issue: https://github.com/dotnet/runtime/issues/74170
35+
return;
3436
}
3537

3638
using var tx = new CommittableTransaction();
@@ -61,9 +63,11 @@ public void Two_durable_enlistments_commit(Phase1Vote vote1, Phase1Vote vote2, E
6163
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))]
6264
public void Two_durable_enlistments_rollback()
6365
{
64-
if (!Environment.Is64BitProcess)
66+
if (!Environment.Is64BitProcess || PlatformDetection.IsArm64Process)
6567
{
66-
return; // Temporarily skip on 32-bit where we have an issue
68+
// Temporarily skip on 32-bit where we have an issue
69+
// ARM64 issue: https://github.com/dotnet/runtime/issues/74170
70+
return;
6771
}
6872

6973
using var tx = new CommittableTransaction();
@@ -89,9 +93,11 @@ public void Two_durable_enlistments_rollback()
8993
[InlineData(2)]
9094
public void Volatile_and_durable_enlistments(int volatileCount)
9195
{
92-
if (!Environment.Is64BitProcess)
96+
if (!Environment.Is64BitProcess || PlatformDetection.IsArm64Process)
9397
{
94-
return; // Temporarily skip on 32-bit where we have an issue
98+
// Temporarily skip on 32-bit where we have an issue
99+
// ARM64 issue: https://github.com/dotnet/runtime/issues/74170
100+
return;
95101
}
96102

97103
using var tx = new CommittableTransaction();
@@ -122,9 +128,11 @@ public void Volatile_and_durable_enlistments(int volatileCount)
122128
[ConditionalFact(nameof(IsRemoteExecutorSupportedAndNotNano))]
123129
public void Promotion()
124130
{
125-
if (!Environment.Is64BitProcess)
131+
if (!Environment.Is64BitProcess || PlatformDetection.IsArm64Process)
126132
{
127-
return; // Temporarily skip on 32-bit where we have an issue
133+
// Temporarily skip on 32-bit where we have an issue
134+
// ARM64 issue: https://github.com/dotnet/runtime/issues/74170
135+
return;
128136
}
129137

130138
// This simulates the full promotable flow, as implemented for SQL Server.
@@ -301,9 +309,11 @@ public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
301309
[ConditionalFact(nameof(IsRemoteExecutorSupportedAndNotNano))]
302310
public void Recovery()
303311
{
304-
if (!Environment.Is64BitProcess)
312+
if (!Environment.Is64BitProcess || PlatformDetection.IsArm64Process)
305313
{
306-
return; // Temporarily skip on 32-bit where we have an issue
314+
// Temporarily skip on 32-bit where we have an issue
315+
// ARM64 issue: https://github.com/dotnet/runtime/issues/74170
316+
return;
307317
}
308318

309319
// We are going to spin up an external process to also enlist in the transaction, and then to crash when it
@@ -413,9 +423,11 @@ public void InDoubt(Enlistment enlistment)
413423
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))]
414424
public void TransmitterPropagationToken()
415425
{
416-
if (!Environment.Is64BitProcess)
426+
if (!Environment.Is64BitProcess || PlatformDetection.IsArm64Process)
417427
{
418-
return; // Temporarily skip on 32-bit where we have an issue
428+
// Temporarily skip on 32-bit where we have an issue
429+
// ARM64 issue: https://github.com/dotnet/runtime/issues/74170
430+
return;
419431
}
420432

421433
using var tx = new CommittableTransaction();
@@ -434,9 +446,11 @@ public void TransmitterPropagationToken()
434446
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))]
435447
public void GetExportCookie()
436448
{
437-
if (!Environment.Is64BitProcess)
449+
if (!Environment.Is64BitProcess || PlatformDetection.IsArm64Process)
438450
{
439-
return; // Temporarily skip on 32-bit where we have an issue
451+
// Temporarily skip on 32-bit where we have an issue
452+
// ARM64 issue: https://github.com/dotnet/runtime/issues/74170
453+
return;
440454
}
441455

442456
using var tx = new CommittableTransaction();
@@ -483,9 +497,11 @@ public class OleTxFixture
483497
{
484498
public OleTxFixture()
485499
{
486-
if (!Environment.Is64BitProcess)
500+
if (!Environment.Is64BitProcess || PlatformDetection.IsArm64Process)
487501
{
488-
return; // Temporarily skip on 32-bit where we have an issue
502+
// Temporarily skip on 32-bit where we have an issue
503+
// ARM64 issue: https://github.com/dotnet/runtime/issues/74170
504+
return;
489505
}
490506

491507
// In CI, we sometimes get XACT_E_TMNOTAVAILABLE on the very first attempt to connect to MSDTC;

0 commit comments

Comments
 (0)