/// <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))); }