Class: Win32::ProcessInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/Win32/Process.rb

Overview



This class contains the process info created by Win32::Process

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(p_hProcess = nil, p_hThread = nil, p_pid = nil, p_tid = nil) ⇒ ProcessInfo


class methodsFor: “initialization”



31
32
33
34
35
36
# File 'lib/Win32/Process.rb', line 31

def initialize(p_hProcess = nil, p_hThread = nil, p_pid = nil, p_tid = nil)
	@hProcess = p_hProcess
	@hThread  = p_hThread
	@pid      = p_pid
	@tid      = p_tid
end

Instance Attribute Details

#hProcessObject


attributesFor: “process handles”



20
21
22
# File 'lib/Win32/Process.rb', line 20

def hProcess
  @hProcess
end

#hThreadObject


attributesFor: “process handles”



20
21
22
# File 'lib/Win32/Process.rb', line 20

def hThread
  @hThread
end

#pidObject


attributesFor: “process handles”



20
21
22
# File 'lib/Win32/Process.rb', line 20

def pid
  @pid
end

#tidObject


attributesFor: “process handles”



20
21
22
# File 'lib/Win32/Process.rb', line 20

def tid
  @tid
end

Class Method Details

.sizeofObject


class methodsFor: “Data sizing”



25
26
27
# File 'lib/Win32/Process.rb', line 25

def ProcessInfo.sizeof
	return 16			# 4 longs
end

.unpack(p_pData) ⇒ Object


class methodsFor: “unpacking data”



40
41
42
43
# File 'lib/Win32/Process.rb', line 40

def ProcessInfo.unpack(p_pData)
	pData = p_pData.unpack("L4")
	return ProcessInfo.new(pData[0], pData[1], pData[2], pData[3])
end

Instance Method Details

#packObject


methodsFor: “packing data”



47
48
49
# File 'lib/Win32/Process.rb', line 47

def pack
	return [@hProcess, @hThread, @pid, @tid].pack("L*")
end

#to_sObject


methodsFor: “printing”



53
54
55
# File 'lib/Win32/Process.rb', line 53

def to_s
	return "hProcess: #{@hProcess}, hThread: #{@hThread}, pid: #{@pid}, thread id: #{@tid}"
end