/// <summary>
 /// Get a list of all accessible transaction objects owned by this transaction manager.
 /// </summary>
 /// <param name="desired_access">The access for the transaction objects.</param>
 /// <returns>The list of all accessible transaction objects.</returns>
 public IEnumerable <NtTransaction> GetAccessibleTransaction(TransactionAccessRights desired_access)
 {
     return(NtTransactionManagerUtils.GetAccessibleTransactionObjects(
                Handle,
                KtmObjectType.Transaction,
                id => NtTransaction.Open(null, desired_access, id, null, false)));
 }
 /// <summary>
 /// Create a new enlistment object.
 /// </summary>
 /// <param name="object_attributes">The object attributes</param>
 /// <param name="desired_access">Desired access for the handle</param>
 /// <param name="resource_manager">Resource manager to handle the enlistment.</param>
 /// <param name="transaction">The transaction to enlist.</param>
 /// <param name="create_options">Optional create options.</param>
 /// <param name="notification_mask">Notification mask.</param>
 /// <param name="enlistment_key">Enlistment key returned during notification.</param>
 /// <returns>The created enlistment.</returns>
 public static NtEnlistment Create(
     ObjectAttributes object_attributes,
     EnlistmentAccessRights desired_access,
     NtResourceManager resource_manager,
     NtTransaction transaction,
     EnlistmentCreateOptions create_options,
     TransactionNotificationMask notification_mask,
     IntPtr enlistment_key
     )
 {
     return(Create(object_attributes, desired_access,
                   resource_manager, transaction,
                   create_options, notification_mask,
                   enlistment_key, true).Result);
 }
 /// <summary>
 /// Create a new enlistment object.
 /// </summary>
 /// <param name="object_attributes">The object attributes</param>
 /// <param name="desired_access">Desired access for the handle</param>
 /// <param name="resource_manager">Resource manager to handle the enlistment.</param>
 /// <param name="transaction">The transaction to enlist.</param>
 /// <param name="create_options">Optional create options.</param>
 /// <param name="notification_mask">Notification mask.</param>
 /// <param name="enlistment_key">Enlistment key returned during notification.</param>
 /// <param name="throw_on_error">True to throw an exception on error.</param>
 /// <returns>The created enlistment and NT status code.</returns>
 public static NtResult <NtEnlistment> Create(
     ObjectAttributes object_attributes,
     EnlistmentAccessRights desired_access,
     NtResourceManager resource_manager,
     NtTransaction transaction,
     EnlistmentCreateOptions create_options,
     TransactionNotificationMask notification_mask,
     IntPtr enlistment_key,
     bool throw_on_error
     )
 {
     return(NtSystemCalls.NtCreateEnlistment(out SafeKernelObjectHandle handle,
                                             desired_access,
                                             resource_manager.GetHandle(),
                                             transaction.GetHandle(),
                                             object_attributes,
                                             create_options,
                                             notification_mask,
                                             enlistment_key).CreateResult(throw_on_error, () => new NtEnlistment(handle)));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Create an enlistment in this resource manager.
 /// </summary>
 /// <param name="transaction">The transaction to enlist.</param>
 /// <param name="enlistment_key">Enlistment key returned during notification.</param>
 /// <returns>The created enlistment.</returns>
 public NtEnlistment CreateEnlistment(NtTransaction transaction, IntPtr enlistment_key)
 {
     return(CreateEnlistment(EnlistmentAccessRights.MaximumAllowed, transaction,
                             EnlistmentCreateOptions.None, NtEnlistment.GetDefaultMaskForCreateOption(EnlistmentCreateOptions.None),
                             enlistment_key, true).Result);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Create an enlistment in this resource manager.
 /// </summary>
 /// <param name="transaction">The transaction to enlist.</param>
 /// <param name="notification_mask">Notification mask.</param>
 /// <param name="enlistment_key">Enlistment key returned during notification.</param>
 /// <returns>The created enlistment.</returns>
 public NtEnlistment CreateEnlistment(NtTransaction transaction,
                                      TransactionNotificationMask notification_mask, IntPtr enlistment_key)
 {
     return(CreateEnlistment(EnlistmentAccessRights.MaximumAllowed, transaction,
                             EnlistmentCreateOptions.None, notification_mask, enlistment_key, true).Result);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Create an enlistment in this resource manager.
 /// </summary>
 /// <param name="desired_access">Desired access for the handle</param>
 /// <param name="transaction">The transaction to enlist.</param>
 /// <param name="create_options">Optional create options.</param>
 /// <param name="notification_mask">Notification mask.</param>
 /// <param name="enlistment_key">Enlistment key returned during notification.</param>
 /// <returns>The created enlistment.</returns>
 public NtEnlistment CreateEnlistment(EnlistmentAccessRights desired_access, NtTransaction transaction,
                                      EnlistmentCreateOptions create_options, TransactionNotificationMask notification_mask, IntPtr enlistment_key)
 {
     return(CreateEnlistment(desired_access, transaction,
                             create_options, notification_mask, enlistment_key, true).Result);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Create an enlistment in this resource manager.
 /// </summary>
 /// <param name="desired_access">Desired access for the handle</param>
 /// <param name="transaction">The transaction to enlist.</param>
 /// <param name="create_options">Optional create options.</param>
 /// <param name="notification_mask">Notification mask.</param>
 /// <param name="enlistment_key">Enlistment key returned during notification.</param>
 /// <param name="throw_on_error">True to throw an exception on error.</param>
 /// <returns>The created enlistment and NT status code.</returns>
 public NtResult <NtEnlistment> CreateEnlistment(EnlistmentAccessRights desired_access, NtTransaction transaction,
                                                 EnlistmentCreateOptions create_options, TransactionNotificationMask notification_mask, IntPtr enlistment_key, bool throw_on_error)
 {
     return(NtEnlistment.Create(null, desired_access, this, transaction,
                                create_options, notification_mask, enlistment_key, throw_on_error));
 }
 protected override sealed NtResult <NtTransaction> OpenInternal(ObjectAttributes obj_attributes,
                                                                 TransactionAccessRights desired_access, bool throw_on_error)
 {
     return(NtTransaction.Open(obj_attributes, desired_access, throw_on_error));
 }