Class: ChildProcess::Windows::Process::Job

### Home Classes Methods

### In Files

- lib/childprocess/windows/process.rb

### Parent

Object

### Methods

- ::new
- #<<
- #close

### Class/Module Index

Quicksearch

- ChildProcess
- ChildProcess::AbstractIO
- ChildProcess::AbstractProcess
- ChildProcess::Error
- ChildProcess::InvalidEnvironmentVariable
- ChildProcess::JRuby
- ChildProcess::JRuby::IO
- ChildProcess::JRuby::Process
- ChildProcess::JRuby::Pump
- ChildProcess::LaunchError
- ChildProcess::MissingPlatformError
- ChildProcess::SubclassResponsibility
- ChildProcess::TimeoutError
- ChildProcess::Tools
- ChildProcess::Tools::Generator
- ChildProcess::Unix
- ChildProcess::Unix::ForkExecProcess
- ChildProcess::Unix::IO
- ChildProcess::Unix::Lib
- ChildProcess::Unix::Lib::Attrs
- ChildProcess::Unix::Lib::FileActions
- ChildProcess::Unix::Platform
- ChildProcess::Unix::PosixSpawnProcess
- ChildProcess::Unix::PosixSpawnProcess::Argv
- ChildProcess::Unix::PosixSpawnProcess::Envp
- ChildProcess::Unix::Process
- ChildProcess::Windows
- ChildProcess::Windows::Handle
- ChildProcess::Windows::IO
- ChildProcess::Windows::IoCounters
- ChildProcess::Windows::JobObjectBasicLimitInformation
- ChildProcess::Windows::JobObjectExtendedLimitInformation
- ChildProcess::Windows::Lib
- ChildProcess::Windows::Process
- ChildProcess::Windows::Process::Job
- ChildProcess::Windows::ProcessBuilder
- ChildProcess::Windows::ProcessInfo
- ChildProcess::Windows::SecurityAttributes
- ChildProcess::Windows::StartupInfo
- Java
- Java::JavaIo
- Java::JavaIo::FileDescriptor
- Java::SunNioCh
- Java::SunNioCh::FileChannelImpl
- FFI
- FFI::MemoryPointer

No matching classes.

# ChildProcess::Windows::Process::Job

### Public Class Methods

new() click to toggle source

    # File lib/childprocess/windows/process.rb, line 94
    def initialize
      @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

      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 117
    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 121
    def close
      Lib.close_handle @pointer
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.