Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix TransactionInterop.GetDtcTransaction()
Incorrect COM interop definition

Fixes #74745
  • Loading branch information
roji authored and github-actions committed Aug 30, 2022
commit 1b250b39a190eac6aade69074cea3663b4d52ce6
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