win32-process 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f5cdcabac1da0aebf77bd252b0647899dfee2632e34e626f18a9951a9d17e62
4
- data.tar.gz: 39382a91f43eba2e0c00f1b92e3f53de3a49b87e689b22683cf5c08f395077b7
3
+ metadata.gz: 3fd3c8fe142d9a0f3c256f86f5e069eedff5f706ba99520ae4ed3e14d325b194
4
+ data.tar.gz: a97625f848a5b37bc167c3bebaa88a6265d3222f1e4ec529b7f8dd14f60400b4
5
5
  SHA512:
6
- metadata.gz: fe1ba6453b70b3712322a588b83708c2eb5f657d97e443c974162be290f009488c28ddb57de1212bcb141a57006f6d0db2e59244b19583da21265df2cab35d83
7
- data.tar.gz: b38df396da190521cbf3fa0975e8087d6f7435956996716b3fe3416ae0d5565e32787c3794a943a7f74c98cb4d31b8c704882b53f6a88d265c7e334a1da1923b
6
+ metadata.gz: 555adadd2da8b60c2343f1b0499ccb32adcfd5d928271146a23b22f41e6e71386cae8cd6e0214a8faeb2a10768d3373364806aff68fc1e75b049c0e55c4f9d20
7
+ data.tar.gz: c2e792c58f3310b4bcd3d14e2c662abe0088ee136c1bea2679a1b07fd4e85a7725e564a78fcd931c1a54dbca70845acdf415f2bfa2a357b5c21cb743ec65da4f
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.10.0
@@ -1,10 +1,8 @@
1
- require 'ffi'
1
+ require "ffi" unless defined?(FFI)
2
2
 
3
3
  module Process::Constants
4
4
  include FFI::Library
5
5
 
6
- private
7
-
8
6
  # Priority constants
9
7
 
10
8
  ABOVE_NORMAL_PRIORITY_CLASS = 0x0008000
@@ -1,9 +1,9 @@
1
- if RUBY_PLATFORM == 'java'
2
- require 'rubygems'
3
- gem 'ffi'
1
+ if RUBY_PLATFORM == "java"
2
+ require "rubygems" unless defined?(Gem)
3
+ gem "ffi"
4
4
  end
5
5
 
6
- require 'ffi'
6
+ require "ffi" unless defined?(FFI)
7
7
 
8
8
  module Process::Functions
9
9
  module FFI::Library
@@ -26,58 +26,58 @@ module Process::Functions
26
26
  ffi_lib :kernel32
27
27
 
28
28
  attach_pfunc :CloseHandle, [:handle], :bool
29
- attach_pfunc :CreateToolhelp32Snapshot, [:dword, :dword], :handle
30
- attach_pfunc :GenerateConsoleCtrlEvent, [:dword, :dword], :bool
29
+ attach_pfunc :CreateToolhelp32Snapshot, %i{dword dword}, :handle
30
+ attach_pfunc :GenerateConsoleCtrlEvent, %i{dword dword}, :bool
31
31
  attach_pfunc :GetCurrentProcess, [], :handle
32
32
  attach_pfunc :GetModuleHandle, :GetModuleHandleA, [:string], :hmodule
33
- attach_pfunc :GetProcessAffinityMask, [:handle, :pointer, :pointer], :bool
33
+ attach_pfunc :GetProcessAffinityMask, %i{handle pointer pointer}, :bool
34
34
  attach_pfunc :GetPriorityClass, [:handle], :dword
35
- attach_pfunc :GetProcAddress, [:hmodule, :string], :pointer
35
+ attach_pfunc :GetProcAddress, %i{hmodule string}, :pointer
36
36
  attach_pfunc :GetVersionExA, [:pointer], :bool
37
- attach_pfunc :Heap32ListFirst, [:handle, :pointer], :bool
38
- attach_pfunc :Heap32ListNext, [:handle, :pointer], :bool
39
- attach_pfunc :Heap32First, [:pointer, :dword, :uintptr_t], :bool
37
+ attach_pfunc :Heap32ListFirst, %i{handle pointer}, :bool
38
+ attach_pfunc :Heap32ListNext, %i{handle pointer}, :bool
39
+ attach_pfunc :Heap32First, %i{pointer dword uintptr_t}, :bool
40
40
  attach_pfunc :Heap32Next, [:pointer], :bool
41
- attach_pfunc :Module32First, [:handle, :pointer], :bool
42
- attach_pfunc :Module32Next, [:handle, :pointer], :bool
43
- attach_pfunc :IsProcessInJob, [:handle, :pointer, :pointer], :bool # 2nd arg optional
44
- attach_pfunc :OpenProcess, [:dword, :int, :dword], :handle
45
- attach_pfunc :Process32First, [:handle, :pointer], :bool
46
- attach_pfunc :Process32Next, [:handle, :pointer], :bool
47
- attach_pfunc :SetHandleInformation, [:handle, :dword, :dword], :bool
41
+ attach_pfunc :Module32First, %i{handle pointer}, :bool
42
+ attach_pfunc :Module32Next, %i{handle pointer}, :bool
43
+ attach_pfunc :IsProcessInJob, %i{handle pointer pointer}, :bool # 2nd arg optional
44
+ attach_pfunc :OpenProcess, %i{dword int dword}, :handle
45
+ attach_pfunc :Process32First, %i{handle pointer}, :bool
46
+ attach_pfunc :Process32Next, %i{handle pointer}, :bool
47
+ attach_pfunc :SetHandleInformation, %i{handle dword dword}, :bool
48
48
  attach_pfunc :SetErrorMode, [:uint], :uint
49
- attach_pfunc :SetPriorityClass, [:handle, :dword], :bool
50
- attach_pfunc :TerminateProcess, [:handle, :uint], :bool
51
- attach_pfunc :Thread32First, [:handle, :pointer], :bool
52
- attach_pfunc :Thread32Next, [:handle, :pointer], :bool
53
- attach_pfunc :WaitForSingleObject, [:handle, :dword], :dword
49
+ attach_pfunc :SetPriorityClass, %i{handle dword}, :bool
50
+ attach_pfunc :TerminateProcess, %i{handle uint}, :bool
51
+ attach_pfunc :Thread32First, %i{handle pointer}, :bool
52
+ attach_pfunc :Thread32Next, %i{handle pointer}, :bool
53
+ attach_pfunc :WaitForSingleObject, %i{handle dword}, :dword
54
54
 
55
55
  attach_pfunc :CreateRemoteThread,
56
- [:handle, :pointer, :size_t, :pointer, :pointer, :dword, :pointer], :handle
56
+ %i{handle pointer size_t pointer pointer dword pointer}, :handle
57
57
 
58
58
  attach_pfunc :GetVolumeInformationA,
59
- [:string, :pointer, :dword, :pointer, :pointer, :pointer, :pointer, :dword], :bool
59
+ %i{string pointer dword pointer pointer pointer pointer dword}, :bool
60
60
 
61
61
  attach_pfunc :CreateProcessW,
62
- [:buffer_in, :buffer_inout, :pointer, :pointer, :int,
63
- :dword, :buffer_in, :buffer_in, :pointer, :pointer], :bool
62
+ %i{buffer_in buffer_inout pointer pointer int
63
+ dword buffer_in buffer_in pointer pointer}, :bool
64
64
 
65
- attach_pfunc :AssignProcessToJobObject, [:handle, :handle], :bool
66
- attach_pfunc :CreateJobObjectA, [:pointer, :string], :handle
67
- attach_pfunc :OpenJobObjectA, [:dword, :int, :string], :handle
68
- attach_pfunc :QueryInformationJobObject, [:handle, :int, :pointer, :dword, :pointer], :bool
69
- attach_pfunc :SetInformationJobObject, [:handle, :int, :pointer, :dword], :bool
70
- attach_pfunc :GetExitCodeProcess, [:handle, :pointer], :bool
65
+ attach_pfunc :AssignProcessToJobObject, %i{handle handle}, :bool
66
+ attach_pfunc :CreateJobObjectA, %i{pointer string}, :handle
67
+ attach_pfunc :OpenJobObjectA, %i{dword int string}, :handle
68
+ attach_pfunc :QueryInformationJobObject, %i{handle int pointer dword pointer}, :bool
69
+ attach_pfunc :SetInformationJobObject, %i{handle int pointer dword}, :bool
70
+ attach_pfunc :GetExitCodeProcess, %i{handle pointer}, :bool
71
71
 
72
72
  ffi_lib :advapi32
73
73
 
74
- attach_pfunc :ConvertSidToStringSidA, [:buffer_in, :pointer], :bool
75
- attach_pfunc :GetTokenInformation, [:handle, :int, :pointer, :dword, :pointer], :bool
76
- attach_pfunc :OpenProcessToken, [:handle, :dword, :pointer], :bool
74
+ attach_pfunc :ConvertSidToStringSidA, %i{buffer_in pointer}, :bool
75
+ attach_pfunc :GetTokenInformation, %i{handle int pointer dword pointer}, :bool
76
+ attach_pfunc :OpenProcessToken, %i{handle dword pointer}, :bool
77
77
 
78
78
  attach_pfunc :CreateProcessWithLogonW,
79
- [:buffer_in, :buffer_in, :buffer_in, :dword, :buffer_in, :buffer_inout,
80
- :dword, :buffer_in, :buffer_in, :pointer, :pointer], :bool
79
+ %i{buffer_in buffer_in buffer_in dword buffer_in buffer_inout
80
+ dword buffer_in buffer_in pointer pointer}, :bool
81
81
 
82
82
  ffi_lib FFI::Library::LIBC
83
83
 
@@ -2,12 +2,12 @@ class String
2
2
  # Convert a regular string to a wide character string. This does not
3
3
  # modify the receiver.
4
4
  def to_wide_string
5
- (self + 0.chr).encode('UTF-16LE')
5
+ (self + 0.chr).encode("UTF-16LE")
6
6
  end
7
7
 
8
8
  # Convert a regular string to a wide character string. This modifies
9
9
  # the receiver.
10
10
  def to_wide_string!
11
- replace((self + 0.chr).encode('UTF-16LE'))
11
+ replace((self + 0.chr).encode("UTF-16LE"))
12
12
  end
13
13
  end
@@ -1,9 +1,9 @@
1
- if RUBY_PLATFORM == 'java'
2
- require 'rubygems'
3
- gem 'ffi'
1
+ if RUBY_PLATFORM == "java"
2
+ require "rubygems" unless defined?(Gem)
3
+ gem "ffi"
4
4
  end
5
5
 
6
- require 'ffi'
6
+ require "ffi" unless defined?(FFI)
7
7
 
8
8
  module Process::Structs
9
9
  extend FFI::Library
@@ -12,8 +12,6 @@ module Process::Structs
12
12
  typedef :uintptr_t, :handle
13
13
  typedef :short, :word
14
14
 
15
- private
16
-
17
15
  # sizeof(LARGE_INTEGER) == 8
18
16
  class LARGE_INTEGER < FFI::Union
19
17
  layout(:QuadPart, :long_long)
@@ -179,24 +177,21 @@ module Process::Structs
179
177
  :process_handle,
180
178
  :thread_handle,
181
179
  :process_id,
182
- :thread_id
183
- )
180
+ :thread_id)
184
181
 
185
182
  # Used by Process.snapshot
186
183
 
187
184
  ThreadSnapInfo = Struct.new("ThreadSnapInfo",
188
185
  :thread_id,
189
186
  :process_id,
190
- :base_priority
191
- )
187
+ :base_priority)
192
188
 
193
189
  HeapSnapInfo = Struct.new("HeapSnapInfo",
194
190
  :address,
195
191
  :block_size,
196
192
  :flags,
197
193
  :process_id,
198
- :heap_id
199
- )
194
+ :heap_id)
200
195
 
201
196
  ModuleSnapInfo = Struct.new("ModuleSnapInfo",
202
197
  :process_id,
@@ -204,8 +199,7 @@ module Process::Structs
204
199
  :module_size,
205
200
  :handle,
206
201
  :name,
207
- :path
208
- )
202
+ :path)
209
203
 
210
204
  ProcessSnapInfo = Struct.new("ProcessSnapInfo",
211
205
  :process_id,
@@ -213,6 +207,5 @@ module Process::Structs
213
207
  :parent_process_id,
214
208
  :priority,
215
209
  :flags,
216
- :path
217
- )
210
+ :path)
218
211
  end
@@ -0,0 +1,6 @@
1
+ module Win32
2
+ class Process
3
+ # The version of the win32-process library
4
+ VERSION = "0.10.0".freeze
5
+ end
6
+ end