win32-pipe 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.3.1 - 8-Apr-2013
2
+ * Fixed the HANDLE protype declarations in the underlying FFI code. This
3
+ addresses a bug in 64 bit versions of Ruby.
4
+
1
5
  == 0.3.0 - 8-Sep-2012
2
6
  * Converted to FFI. Now works with JRuby, too.
3
7
  * Native errors are now raised as SystemCallErrors.
data/lib/win32/pipe.rb CHANGED
@@ -14,7 +14,7 @@ module Win32
14
14
  class Error < StandardError; end
15
15
 
16
16
  # The version of this library
17
- VERSION = '0.3.0'
17
+ VERSION = '0.3.1'
18
18
 
19
19
  PIPE_BUFFER_SIZE = 512 #:nodoc:
20
20
  PIPE_TIMEOUT = 5000 #:nodoc:
@@ -1,37 +1,37 @@
1
- module Windows
2
- module Constants
3
- PIPE_WAIT = 0x00000000
4
- PIPE_NOWAIT = 0x00000001
5
- PIPE_ACCESS_INBOUND = 0x00000001
6
- PIPE_ACCESS_OUTBOUND = 0x00000002
7
- PIPE_ACCESS_DUPLEX = 0x00000003
8
- PIPE_TYPE_BYTE = 0x00000000
9
- PIPE_TYPE_MESSAGE = 0x00000004
10
- PIPE_READMODE_BYTE = 0x00000000
11
- PIPE_READMODE_MESSAGE = 0x00000002
12
- PIPE_CLIENT_END = 0x00000000
13
- PIPE_SERVER_END = 0x00000001
14
-
15
- PIPE_UNLIMITED_INSTANCES = 255
16
-
17
- FILE_FLAG_OVERLAPPED = 0x40000000
18
- FILE_FLAG_FIRST_PIPE_INSTANCE = 0x00080000
19
- FILE_FLAG_WRITE_THROUGH = 0x80000000
20
- FILE_ATTRIBUTE_NORMAL = 0x00000080
21
-
22
- INFINITE = 0xFFFFFFFF
23
- INVALID_HANDLE_VALUE = 0xFFFFFFFF
24
- NMPWAIT_WAIT_FOREVER = 0xFFFFFFFF
25
- ERROR_PIPE_BUSY = 231
26
- ERROR_IO_PENDING = 997
27
-
28
- WAIT_TIMEOUT = 0x102
29
- WAIT_OBJECT_0 = 0
30
-
31
- GENERIC_READ = 0x80000000
32
- GENERIC_WRITE = 0x40000000
33
- FILE_SHARE_READ = 1
34
- FILE_SHARE_WRITE = 2
35
- OPEN_EXISTING = 3
36
- end
37
- end
1
+ module Windows
2
+ module Constants
3
+ PIPE_WAIT = 0x00000000
4
+ PIPE_NOWAIT = 0x00000001
5
+ PIPE_ACCESS_INBOUND = 0x00000001
6
+ PIPE_ACCESS_OUTBOUND = 0x00000002
7
+ PIPE_ACCESS_DUPLEX = 0x00000003
8
+ PIPE_TYPE_BYTE = 0x00000000
9
+ PIPE_TYPE_MESSAGE = 0x00000004
10
+ PIPE_READMODE_BYTE = 0x00000000
11
+ PIPE_READMODE_MESSAGE = 0x00000002
12
+ PIPE_CLIENT_END = 0x00000000
13
+ PIPE_SERVER_END = 0x00000001
14
+
15
+ PIPE_UNLIMITED_INSTANCES = 255
16
+
17
+ FILE_FLAG_OVERLAPPED = 0x40000000
18
+ FILE_FLAG_FIRST_PIPE_INSTANCE = 0x00080000
19
+ FILE_FLAG_WRITE_THROUGH = 0x80000000
20
+ FILE_ATTRIBUTE_NORMAL = 0x00000080
21
+
22
+ INFINITE = 0xFFFFFFFF
23
+ INVALID_HANDLE_VALUE = 0xFFFFFFFF
24
+ NMPWAIT_WAIT_FOREVER = 0xFFFFFFFF
25
+ ERROR_PIPE_BUSY = 231
26
+ ERROR_IO_PENDING = 997
27
+
28
+ WAIT_TIMEOUT = 0x102
29
+ WAIT_OBJECT_0 = 0
30
+
31
+ GENERIC_READ = 0x80000000
32
+ GENERIC_WRITE = 0x40000000
33
+ FILE_SHARE_READ = 1
34
+ FILE_SHARE_WRITE = 2
35
+ OPEN_EXISTING = 3
36
+ end
37
+ end
@@ -1,31 +1,37 @@
1
- require 'ffi'
2
-
3
- module Windows
4
- module Functions
5
- extend FFI::Library
6
- ffi_lib :kernel32
7
-
8
- module FFI::Library
9
- # Wrapper method for attach_function + private
10
- def attach_pfunc(*args)
11
- attach_function(*args)
12
- private args[0]
13
- end
14
- end
15
-
16
- attach_pfunc :CloseHandle, [:ulong], :bool
17
- attach_pfunc :ConnectNamedPipe, [:ulong, :pointer], :bool
18
- attach_pfunc :CreateEvent, :CreateEventA, [:pointer, :bool, :bool, :string], :ulong
19
- attach_pfunc :CreateFile, :CreateFileA, [:string, :ulong, :ulong, :pointer, :ulong, :ulong, :ulong], :ulong
20
- attach_pfunc :CreateNamedPipe, :CreateNamedPipeA, [:string, :ulong, :ulong, :ulong, :ulong, :ulong, :ulong, :pointer], :ulong
21
- attach_pfunc :CreatePipe, [:pointer, :pointer, :pointer, :ulong], :bool
22
- attach_pfunc :DisconnectNamedPipe, [:ulong], :bool
23
- attach_pfunc :FlushFileBuffers, [:ulong], :bool
24
- attach_pfunc :GetLastError, [], :ulong
25
- attach_pfunc :GetOverlappedResult, [:ulong, :pointer, :pointer, :bool], :bool
26
- attach_pfunc :ReadFile, [:ulong, :buffer_out, :ulong, :pointer, :pointer], :bool
27
- attach_pfunc :WaitForSingleObject, [:ulong, :ulong], :ulong
28
- attach_pfunc :WaitNamedPipe, :WaitNamedPipeA, [:string, :ulong], :bool
29
- attach_pfunc :WriteFile, [:ulong, :buffer_in, :ulong, :pointer, :pointer], :bool
30
- end
31
- end
1
+ require 'ffi'
2
+
3
+ module Windows
4
+ module Functions
5
+ extend FFI::Library
6
+
7
+ typedef :ulong, :dword
8
+ typedef :uintptr_t, :handle
9
+ typedef :pointer, :ptr
10
+ typedef :string, :str
11
+
12
+ ffi_lib :kernel32
13
+
14
+ module FFI::Library
15
+ # Wrapper method for attach_function + private
16
+ def attach_pfunc(*args)
17
+ attach_function(*args)
18
+ private args[0]
19
+ end
20
+ end
21
+
22
+ attach_pfunc :CloseHandle, [:handle], :bool
23
+ attach_pfunc :ConnectNamedPipe, [:handle, :ptr], :bool
24
+ attach_pfunc :CreateEvent, :CreateEventA, [:ptr, :bool, :bool, :str], :handle
25
+ attach_pfunc :CreateFile, :CreateFileA, [:str, :dword, :dword, :ptr, :dword, :dword, :handle], :handle
26
+ attach_pfunc :CreateNamedPipe, :CreateNamedPipeA, [:str, :dword, :dword, :dword, :dword, :dword, :dword, :ptr], :handle
27
+ attach_pfunc :CreatePipe, [:ptr, :ptr, :ptr, :dword], :bool
28
+ attach_pfunc :DisconnectNamedPipe, [:handle], :bool
29
+ attach_pfunc :FlushFileBuffers, [:handle], :bool
30
+ attach_pfunc :GetLastError, [], :dword
31
+ attach_pfunc :GetOverlappedResult, [:handle, :ptr, :ptr, :bool], :bool
32
+ attach_pfunc :ReadFile, [:handle, :buffer_out, :dword, :ptr, :ptr], :bool
33
+ attach_pfunc :WaitForSingleObject, [:handle, :dword], :dword
34
+ attach_pfunc :WaitNamedPipe, :WaitNamedPipeA, [:str, :dword], :bool
35
+ attach_pfunc :WriteFile, [:handle, :buffer_in, :dword, :ptr, :ptr], :bool
36
+ end
37
+ end
@@ -14,7 +14,7 @@ class TC_Win32_Pipe < Test::Unit::TestCase
14
14
  end
15
15
 
16
16
  test "version is set to expected value" do
17
- assert_equal('0.3.0', Pipe::VERSION)
17
+ assert_equal('0.3.1', Pipe::VERSION)
18
18
  end
19
19
 
20
20
  test "name method basic functionality" do
data/win32-pipe.gemspec CHANGED
@@ -2,11 +2,11 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'win32-pipe'
5
- spec.version = '0.3.0'
5
+ spec.version = '0.3.1'
6
6
  spec.author = 'Daniel J. Berger'
7
7
  spec.license = 'Artistic 2.0'
8
8
  spec.email = 'djberg96@gmail.com'
9
- spec.homepage = 'http://www.rubyforge.org/projects/win32utils'
9
+ spec.homepage = 'https://github.com/djberg96/win32-pipe'
10
10
  spec.summary = 'An interface for named pipes on MS Windows'
11
11
  spec.test_files = Dir['test/test_*.rb']
12
12
  spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: win32-pipe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-08 00:00:00.000000000 Z
12
+ date: 2013-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -71,7 +71,7 @@ files:
71
71
  - test/test_win32_pipe_client.rb
72
72
  - test/test_win32_pipe_server.rb
73
73
  - win32-pipe.gemspec
74
- homepage: http://www.rubyforge.org/projects/win32utils
74
+ homepage: https://github.com/djberg96/win32-pipe
75
75
  licenses:
76
76
  - Artistic 2.0
77
77
  post_install_message: