Ejemplo n.º 1
0
 /// <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>
 /// <param name="desired_access">Desired access for the job object</param>
 /// <returns>The Job object</returns>
 public static NtJob Open(string path, NtObject root, JobAccessRights desired_access)
 {
     using (ObjectAttributes obja = new ObjectAttributes(path, AttributeFlags.CaseInsensitive, root))
     {
         SafeKernelObjectHandle handle;
         NtSystemCalls.NtOpenJobObject(out handle, desired_access, obja).ToNtException();
         return(new NtJob(handle));
     }
 }
Ejemplo n.º 2
0
        public static unsafe NativeJob Open(string jobName, JobAccessRights accessRights = JobAccessRights.All, bool inheritHandle = false)
        {
            SafeJobHandle handle = OpenJobObjectW((uint)accessRights, inheritHandle, jobName);

            if (handle.IsInvalid)
            {
                throw new Win32Exception();
            }
            return(new NativeJob(handle));
        }
 protected override sealed NtResult <NtJob> OpenInternal(ObjectAttributes obj_attributes,
                                                         JobAccessRights desired_access, bool throw_on_error)
 {
     return(NtJob.Open(obj_attributes, desired_access, throw_on_error));
 }
Ejemplo n.º 4
0
 public static extern NtStatus NtOpenJobObject(out SafeKernelObjectHandle JobHandle, JobAccessRights DesiredAccess, [In] ObjectAttributes ObjectAttributes);