Esempio n. 1
0
 public static extern NtStatus NtCreateResourceManager(
     out SafeKernelObjectHandle ResourceManagerHandle,
     ResourceManagerAccessRights DesiredAccess,
     SafeKernelObjectHandle TmHandle,
     ref Guid RmGuid,
     ObjectAttributes ObjectAttributes,
     ResourceManagerCreateOptions CreateOptions,
     UnicodeString Description
     );
Esempio n. 2
0
 /// <summary>
 /// Create a new resource manager object.
 /// </summary>
 /// <param name="object_attributes">The object attributes</param>
 /// <param name="desired_access">Desired access for the handle</param>
 /// <param name="create_options">Creation options flags.</param>
 /// <param name="transaction_manager">Optional transaction manager to assign the resource manager to.</param>
 /// <param name="resource_manager_guid">Resource manager GUID.</param>
 /// <param name="description">Optional description.</param>
 /// <returns>The object result.</returns>
 /// <exception cref="NtException">Thrown on error.</exception>
 public static NtResourceManager Create(ObjectAttributes object_attributes,
                                        ResourceManagerAccessRights desired_access,
                                        NtTransactionManager transaction_manager,
                                        Guid resource_manager_guid,
                                        ResourceManagerCreateOptions create_options,
                                        string description)
 {
     return(Create(object_attributes, desired_access, transaction_manager,
                   resource_manager_guid, create_options, description, true).Result);
 }
Esempio n. 3
0
 /// <summary>
 /// Create a new resource manager object.
 /// </summary>
 /// <param name="path">The path to the resource manager.</param>
 /// <param name="root">The root if path is relative.</param>
 /// <param name="desired_access">Desired access for the handle</param>
 /// <param name="create_options">Creation options flags.</param>
 /// <param name="transaction_manager">Optional transaction manager to assign the resource manager to.</param>
 /// <param name="resource_manager_guid">Resource manager GUID.</param>
 /// <param name="description">Optional description.</param>
 /// <returns>The object result.</returns>
 /// <exception cref="NtException">Thrown on error.</exception>
 public static NtResourceManager Create(string path,
                                        NtObject root,
                                        ResourceManagerAccessRights desired_access,
                                        NtTransactionManager transaction_manager,
                                        Guid resource_manager_guid,
                                        ResourceManagerCreateOptions create_options = ResourceManagerCreateOptions.None,
                                        string description = null)
 {
     return(Create(path, root, desired_access, transaction_manager,
                   resource_manager_guid, create_options, description, true).Result);
 }
Esempio n. 4
0
 /// <summary>
 /// Create a new resource manager object.
 /// </summary>
 /// <param name="object_attributes">The object attributes</param>
 /// <param name="desired_access">Desired access for the handle</param>
 /// <param name="create_options">Creation options flags.</param>
 /// <param name="transaction_manager">Optional transaction manager to assign the resource manager to.</param>
 /// <param name="resource_manager_guid">Resource manager GUID.</param>
 /// <param name="description">Optional description.</param>
 /// <param name="throw_on_error">True to throw an exception on error.</param>
 /// <returns>The NT status code and object result.</returns>
 public static NtResult <NtResourceManager> Create(ObjectAttributes object_attributes,
                                                   ResourceManagerAccessRights desired_access,
                                                   NtTransactionManager transaction_manager,
                                                   Guid resource_manager_guid,
                                                   ResourceManagerCreateOptions create_options,
                                                   string description,
                                                   bool throw_on_error)
 {
     return(NtSystemCalls.NtCreateResourceManager(out SafeKernelObjectHandle handle,
                                                  desired_access, transaction_manager.GetHandle(), ref resource_manager_guid,
                                                  object_attributes, create_options, description.ToUnicodeString())
            .CreateResult(throw_on_error, () => new NtResourceManager(handle)));
 }
Esempio n. 5
0
 /// <summary>
 /// Create a new resource manager object.
 /// </summary>
 /// <param name="path">The path to the resource manager.</param>
 /// <param name="root">The root if path is relative.</param>
 /// <param name="desired_access">Desired access for the handle</param>
 /// <param name="create_options">Creation options flags.</param>
 /// <param name="transaction_manager">Optional transaction manager to assign the resource manager to.</param>
 /// <param name="resource_manager_guid">Resource manager GUID.</param>
 /// <param name="description">Optional description.</param>
 /// <param name="throw_on_error">True to throw an exception on error.</param>
 /// <returns>The NT status code and object result.</returns>
 public static NtResult <NtResourceManager> Create(string path,
                                                   NtObject root,
                                                   ResourceManagerAccessRights desired_access,
                                                   NtTransactionManager transaction_manager,
                                                   Guid resource_manager_guid,
                                                   ResourceManagerCreateOptions create_options,
                                                   string description,
                                                   bool throw_on_error)
 {
     using (var obj_attr = new ObjectAttributes(path, AttributeFlags.CaseInsensitive, root)) {
         return(Create(obj_attr, desired_access, transaction_manager,
                       resource_manager_guid, create_options, description, throw_on_error));
     }
 }
 /// <summary>
 /// Create a resource manager for this transaction manager.
 /// </summary>
 /// <param name="resource_manager_guid">The resource manager GUID to assign.</param>
 /// <param name="create_options">Creation options.</param>
 /// <returns>The resource manager .</returns>
 public NtResourceManager CreateResourceManager(Guid resource_manager_guid, ResourceManagerCreateOptions create_options)
 {
     return(CreateResourceManager(resource_manager_guid, create_options, true).Result);
 }
 /// <summary>
 /// Create a resource manager for this transaction manager.
 /// </summary>
 /// <param name="resource_manager_guid">The resource manager GUID to assign.</param>
 /// <param name="create_options">Creation options.</param>
 /// <param name="throw_on_error">True to throw on error.</param>
 /// <returns>The resource manager and NT status.</returns>
 public NtResult <NtResourceManager> CreateResourceManager(Guid resource_manager_guid, ResourceManagerCreateOptions create_options, bool throw_on_error)
 {
     return(NtResourceManager.Create(null, ResourceManagerAccessRights.MaximumAllowed, this, resource_manager_guid, create_options, null, throw_on_error));
 }