Skip to content

Commit 370a238

Browse files
Fix TransactionInterop.GetDtcTransaction() (#74821)
Incorrect COM interop definition Fixes #74745 Co-authored-by: Shay Rojansky <roji@roji.org>
1 parent b705274 commit 370a238

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ namespace System.Transactions.DtcProxyShim.DtcInterfaces;
1111
[ComImport, Guid(Guids.IID_ITransaction), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
1212
internal interface ITransaction
1313
{
14-
void Commit([MarshalAs(UnmanagedType.Bool)] bool fRetainingt, [MarshalAs(UnmanagedType.U4)] OletxXacttc grfTC, uint grfRM);
14+
void Commit(
15+
[MarshalAs(UnmanagedType.Bool)] bool fRetainingt,
16+
[MarshalAs(UnmanagedType.U4)] OletxXacttc grfTC,
17+
uint grfRM);
1518

16-
void Abort(IntPtr reason, [MarshalAs(UnmanagedType.Bool)] bool retaining, [MarshalAs(UnmanagedType.Bool)] bool async);
19+
void Abort(
20+
IntPtr reason,
21+
[MarshalAs(UnmanagedType.Bool)] bool retaining,
22+
[MarshalAs(UnmanagedType.Bool)] bool async);
1723

1824
void GetTransactionInfo(out OletxXactTransInfo xactInfo);
1925
}

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,17 @@ namespace System.Transactions.DtcProxyShim.DtcInterfaces;
1010
[ComImport, Guid("02656950-2152-11d0-944C-00A0C905416E"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
1111
internal interface ITransactionCloner
1212
{
13+
void Commit(
14+
[MarshalAs(UnmanagedType.Bool)] bool fRetainingt,
15+
[MarshalAs(UnmanagedType.U4)] OletxXacttc grfTC,
16+
uint grfRM);
17+
18+
void Abort(
19+
IntPtr reason,
20+
[MarshalAs(UnmanagedType.Bool)] bool retaining,
21+
[MarshalAs(UnmanagedType.Bool)] bool async);
22+
23+
void GetTransactionInfo(out OletxXactTransInfo xactInfo);
24+
1325
void CloneWithCommitDisabled([MarshalAs(UnmanagedType.Interface)] out ITransaction ppITransaction);
1426
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ public void GetExportCookie()
433433
Assert.Equal(tx.TransactionInformation.DistributedIdentifier, tx2.TransactionInformation.DistributedIdentifier);
434434
});
435435

436-
// Test currently skipped, #74745
437-
private void GetDtcTransaction()
436+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))]
437+
public void GetDtcTransaction()
438438
=> Test(() =>
439439
{
440440
using var tx = new CommittableTransaction();

0 commit comments

Comments
 (0)