예제 #1
0
 /// <summary>
 /// Create an IO Completion Port object
 /// </summary>
 /// <param name="name">The path to the IO Completion Port</param>
 /// <param name="root">The root object for relative path names</param>
 /// <param name="desired_access">The desired access for the event</param>
 /// <param name="concurrent_threads">Number of concurrent threads to process I/O packets. 0 for CPU count.</param>
 /// <returns>The IO Completion Port object.</returns>
 /// <exception cref="NtException">Thrown on error.</exception>
 public static NtIoCompletion Create(string name, NtObject root, IoCompletionAccessRights desired_access, int concurrent_threads)
 {
     using (ObjectAttributes obj_attr = new ObjectAttributes(name, AttributeFlags.CaseInsensitive, root)) {
         return(Create(obj_attr, desired_access, concurrent_threads));
     }
 }
예제 #2
0
 /// <summary>
 /// Open an NT object with a specified type.
 /// </summary>
 /// <param name="typename">The name of the type to open (e.g. Event). If null the method will try and lookup the appropriate type.</param>
 /// <param name="path">The path to the object to open.</param>
 /// <param name="root">A root directory to open from.</param>
 /// <param name="access">Generic access rights to the object.</param>
 /// <param name="attributes">Attributes to open the object.</param>
 /// <param name="security_quality_of_service">Security quality of service.</param>
 /// <returns>The opened object.</returns>
 /// <exception cref="NtException">Thrown if an error occurred opening the object.</exception>
 public static NtObject OpenWithType(string typename, string path, NtObject root,
                                     AttributeFlags attributes, AccessMask access, SecurityQualityOfService security_quality_of_service)
 {
     return(OpenWithType(typename, path, root, attributes, access, security_quality_of_service, true).Result);
 }
예제 #3
0
 /// <summary>
 /// Open an existing transaction manager object.
 /// </summary>
 /// <param name="path">The path to the transaction manager.</param>
 /// <param name="root">The root if path is relative.</param>
 /// <returns>The object result.</returns>
 public static NtTransactionManager Open(string path, NtObject root)
 {
     return(Open(path, root, TransactionManagerAccessRights.MaximumAllowed));
 }
예제 #4
0
 /// <summary>
 /// Open an IO Completion Port object
 /// </summary>
 /// <param name="name">The path to the IO Completion Port</param>
 /// <param name="root">The root object for relative path names</param>
 /// <param name="desired_access">The desired access for the event</param>
 /// <returns>The IO Completion Port object.</returns>
 /// <exception cref="NtException">Thrown on error.</exception>
 public static NtIoCompletion Open(string name, NtObject root, IoCompletionAccessRights desired_access)
 {
     using (ObjectAttributes obj_attr = new ObjectAttributes(name, AttributeFlags.CaseInsensitive, root)) {
         return(Open(obj_attr, desired_access));
     }
 }
예제 #5
0
 /// <summary>
 /// Create a new volatile transaction manager object.
 /// </summary>
 /// <param name="path">The path to the transaction manager.</param>
 /// <param name="root">The root if path is relative.</param>
 /// <returns>The object result.</returns>
 public static NtTransactionManager CreateVolatile(string path, NtObject root)
 {
     return(CreateVolatile(path, root, TransactionManagerAccessRights.MaximumAllowed));
 }
예제 #6
0
 /// <summary>
 /// Open an existing transaction manager object.
 /// </summary>
 /// <param name="path">The path to the transaction manager.</param>
 /// <param name="root">The root if path is relative.</param>
 /// <param name="desired_access">Desired access for the handle</param>
 /// <returns>The object result.</returns>
 public static NtTransactionManager Open(string path, NtObject root,
                                         TransactionManagerAccessRights desired_access)
 {
     return(Open(path, root, desired_access, null, null, TransactionManagerOpenOptions.None));
 }
예제 #7
0
 internal static SafeKernelObjectHandle GetHandle(this NtObject obj)
 {
     return(obj?.Handle ?? SafeKernelObjectHandle.Null);
 }
예제 #8
0
 /// <summary>
 /// Create a new volatile transaction manager object.
 /// </summary>
 /// <param name="path">The path to the transaction manager.</param>
 /// <param name="root">The root if path is relative.</param>
 /// <param name="desired_access">Desired access for the handle</param>
 /// <returns>The object result.</returns>
 public static NtTransactionManager CreateVolatile(string path, NtObject root,
                                                   TransactionManagerAccessRights desired_access)
 {
     return(Create(path, root, desired_access, null, TransactionManagerCreateOptions.Volatile));
 }
예제 #9
0
 /// <summary>
 /// Open a directory object by name
 /// </summary>
 /// <param name="name">The directory object to open</param>
 /// <param name="root">Optional root directory to parse from</param>
 /// <param name="desired_access">Access rights for directory object</param>
 /// <returns>The directory object</returns>
 /// <exception cref="NtException">Throw on error</exception>
 public static NtDirectory Open(string name, NtObject root, DirectoryAccessRights desired_access)
 {
     return(Open(name, root, desired_access, true).Result);
 }
예제 #10
0
 /// <summary>
 /// Create a directory object
 /// </summary>
 /// <param name="name">The directory object to create, if null will create a unnamed directory object</param>
 /// <param name="desired_access">The desired access to the directory</param>
 /// <param name="root">Root directory from where to start the creation operation</param>
 /// <returns>The directory object</returns>
 /// <exception cref="NtException">Thrown on error</exception>
 public static NtDirectory Create(string name, NtObject root,
                                  DirectoryAccessRights desired_access)
 {
     return(Create(name, root, desired_access, null));
 }
 public NtObject Open(GenericAccessRights access)
 {
     return NtObject.OpenWithType(TypeName, Name, _root, access);
 }
 /// <summary>
 /// Open a job object
 /// </summary>
 /// <param name="path">The path to the job object</param>
 /// <param name="root">The root object when path is relative</param>
 /// <returns>The Job object</returns>
 public static NtJob Open(string path, NtObject root)
 {
     return(Open(path, root, JobAccessRights.MaximumAllowed));
 }
예제 #13
0
 /// <summary>
 /// Open this NT type by name (if CanOpen is true)
 /// </summary>
 /// <param name="name">The name of the object to open.</param>
 /// <param name="root">The root object for opening, if name is relative</param>
 /// <returns>The created object.</returns>
 /// <exception cref="NtException">Thrown on error</exception>
 public NtObject Open(string name, NtObject root)
 {
     return(Open(name, root, GenericAccessRights.MaximumAllowed));
 }