win32-pipe 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +4 -0
- data/lib/win32/pipe.rb +1 -1
- data/lib/win32/pipe/windows/constants.rb +37 -37
- data/lib/win32/pipe/windows/functions.rb +37 -31
- data/test/test_win32_pipe.rb +1 -1
- data/win32-pipe.gemspec +2 -2
- metadata +3 -3
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
@@ -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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
attach_pfunc :
|
23
|
-
attach_pfunc :
|
24
|
-
attach_pfunc :
|
25
|
-
attach_pfunc :
|
26
|
-
attach_pfunc :
|
27
|
-
attach_pfunc :
|
28
|
-
attach_pfunc :
|
29
|
-
attach_pfunc :
|
30
|
-
|
31
|
-
|
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
|
data/test/test_win32_pipe.rb
CHANGED
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.
|
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 = '
|
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.
|
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:
|
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:
|
74
|
+
homepage: https://github.com/djberg96/win32-pipe
|
75
75
|
licenses:
|
76
76
|
- Artistic 2.0
|
77
77
|
post_install_message:
|