class ChildProcess::Windows::Process::Job
Public Class Methods
new(detach, leader)
click to toggle source
# File lib/childprocess/windows/process.rb, line 96 def initialize(detach, leader) @pointer = Lib.create_job_object(nil, nil) if @pointer.nil? || @pointer.null? raise Error, "unable to create job object" end basic = JobObjectBasicLimitInformation.new basic[:LimitFlags] |= JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if !detach basic[:LimitFlags] |= JOB_OBJECT_LIMIT_BREAKAWAY_OK if leader extended = JobObjectExtendedLimitInformation.new extended[:BasicLimitInformation] = basic ret = Lib.set_information_job_object( @pointer, JOB_OBJECT_EXTENDED_LIMIT_INFORMATION, extended, extended.size ) Lib.check_error ret end
Public Instance Methods
<<(handle)
click to toggle source
# File lib/childprocess/windows/process.rb, line 120 def <<(handle) Lib.check_error Lib.assign_process_to_job_object(@pointer, handle.pointer) end
close()
click to toggle source
# File lib/childprocess/windows/process.rb, line 124 def close Lib.close_handle @pointer end