public static EnlistmentHandle Create(
            EnlistmentAccess access,
            string name,
            ObjectFlags objectFlags,
            DirectoryHandle rootDirectory,
            ResourceManagerHandle resourceManagerHandle,
            TransactionHandle transactionHandle,
            EnlistmentOptions createOptions,
            NotificationMask notificationMask,
            IntPtr enlistmentKey
            )
        {
            ObjectAttributes oa = new ObjectAttributes(name, objectFlags, rootDirectory);
            IntPtr           handle;

            try
            {
                Win32.NtCreateEnlistment(
                    out handle,
                    access,
                    resourceManagerHandle,
                    transactionHandle,
                    ref oa,
                    createOptions,
                    notificationMask,
                    enlistmentKey
                    ).ThrowIf();
            }
            finally
            {
                oa.Dispose();
            }

            return(new EnlistmentHandle(handle, true));
        }
Exemple #2
0
 internal CurrentTransactionContext(TransactionHandle handle)
 {
     _oldHandle = GetCurrent();
     SetCurrent(handle);
     _disposed = false;
 }
Exemple #3
0
 public static CurrentTransactionContext SetCurrentContext(TransactionHandle transactionHandle)
 {
     return(new CurrentTransactionContext(transactionHandle));
 }
Exemple #4
0
 public static void SetCurrent(TransactionHandle transactionHandle)
 {
     Win32.RtlSetCurrentTransaction(transactionHandle ?? IntPtr.Zero);
 }