Method: ChildProcess::Windows::Handle#initialize

Defined in:
lib/childprocess/windows/handle.rb

#initialize(pointer, pid) ⇒ Handle

Returns a new instance of Handle.



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/childprocess/windows/handle.rb', line 28

def initialize(pointer, pid)
  unless pointer.kind_of?(FFI::Pointer)
    raise TypeError, "invalid handle: #{pointer.inspect}"
  end

  if pointer.null?
    raise ArgumentError, "handle is null: #{pointer.inspect}"
  end

  @pid     = pid
  @pointer = pointer
  @closed  = false
end