Example #1
0
 protected void AddProcessToJob(IntPtr hProcess)
 {
     if (!NativeJob.AssignProcessToJobObject(_hJob, hProcess))
     {
         throw new InvalidOperationException("Failed to add process to job");
     }
 }
Example #2
0
 protected void AddProcessToJob(IntPtr hProcess)
 {
     CheckIfDisposed();
     if (!NativeJob.AssignProcessToJobObject(_hJob, hProcess))
     {
         throw new InvalidOperationException("Adding process to job failed!!");
     }
 }
Example #3
0
        protected void AddProcessToJob(IntPtr hProcess)
        {
            try
            {
                CheckIfDisposed();
            }
            catch (ObjectDisposedException ex)
            {
                Trace.TraceError(ex.Message);
            }

            if (!NativeJob.AssignProcessToJobObject(_hJob, hProcess))
            {
                throw new InvalidOperationException("Failed to add process to job");
            }
        }