Skip to content

Commit

Permalink
Fix TransactionInterop.GetDtcTransaction() (#74776)
Browse files Browse the repository at this point in the history
Incorrect COM interop definition

Fixes #74745
  • Loading branch information
roji committed Aug 30, 2022
1 parent 704c739 commit 28aa861
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
4 changes: 2 additions & 2 deletions src/libraries/System.Transactions.Local/tests/OleTxTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,8 @@ public void GetExportCookie()
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();
Expand Down

0 comments on commit 28aa861

Please sign in to comment.