diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2022-08-30 23:14:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-30 23:14:26 +0300 |
commit | 370a2389e07d4a80402ba82c59a80c94fce71d7a (patch) | |
tree | 787bf874cce6e7244a860359983098be8b1b6175 /src | |
parent | b705274e02a230dc05e338592a482d84bd4529ad (diff) |
Fix TransactionInterop.GetDtcTransaction() (#74821)
Incorrect COM interop definition
Fixes #74745
Co-authored-by: Shay Rojansky <roji@roji.org>
Diffstat (limited to 'src')
3 files changed, 22 insertions, 4 deletions
diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransaction.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransaction.cs index e516d2c0d03..a06acb7668a 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransaction.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransaction.cs @@ -11,9 +11,15 @@ namespace System.Transactions.DtcProxyShim.DtcInterfaces; [ComImport, Guid(Guids.IID_ITransaction), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface ITransaction { - void Commit([MarshalAs(UnmanagedType.Bool)] bool fRetainingt, [MarshalAs(UnmanagedType.U4)] OletxXacttc grfTC, uint grfRM); + void Commit( + [MarshalAs(UnmanagedType.Bool)] bool fRetainingt, + [MarshalAs(UnmanagedType.U4)] OletxXacttc grfTC, + uint grfRM); - void Abort(IntPtr reason, [MarshalAs(UnmanagedType.Bool)] bool retaining, [MarshalAs(UnmanagedType.Bool)] bool async); + void Abort( + IntPtr reason, + [MarshalAs(UnmanagedType.Bool)] bool retaining, + [MarshalAs(UnmanagedType.Bool)] bool async); void GetTransactionInfo(out OletxXactTransInfo xactInfo); } diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionCloner.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionCloner.cs index 7ce0b361bdf..731e72214f4 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionCloner.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcInterfaces/ITransactionCloner.cs @@ -10,5 +10,17 @@ namespace System.Transactions.DtcProxyShim.DtcInterfaces; [ComImport, Guid("02656950-2152-11d0-944C-00A0C905416E"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface ITransactionCloner { + void Commit( + [MarshalAs(UnmanagedType.Bool)] bool fRetainingt, + [MarshalAs(UnmanagedType.U4)] OletxXacttc grfTC, + uint grfRM); + + void Abort( + IntPtr reason, + [MarshalAs(UnmanagedType.Bool)] bool retaining, + [MarshalAs(UnmanagedType.Bool)] bool async); + + void GetTransactionInfo(out OletxXactTransInfo xactInfo); + void CloneWithCommitDisabled([MarshalAs(UnmanagedType.Interface)] out ITransaction ppITransaction); } diff --git a/src/libraries/System.Transactions.Local/tests/OleTxTests.cs b/src/libraries/System.Transactions.Local/tests/OleTxTests.cs index e646c09a593..eaf2d1b972b 100644 --- a/src/libraries/System.Transactions.Local/tests/OleTxTests.cs +++ b/src/libraries/System.Transactions.Local/tests/OleTxTests.cs @@ -433,8 +433,8 @@ public class OleTxTests : IClassFixture<OleTxTests.OleTxFixture> Assert.Equal(tx.TransactionInformation.DistributedIdentifier, tx2.TransactionInformation.DistributedIdentifier); }); - // Test currently skipped, #74745 - private void GetDtcTransaction() + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] + public void GetDtcTransaction() => Test(() => { using var tx = new CommittableTransaction(); |