windows-pr 0.6.6 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +7 -0
- data/MANIFEST +1 -0
- data/lib/windows/clipboard.rb +17 -52
- data/lib/windows/com.rb +54 -0
- data/lib/windows/console.rb +62 -281
- data/lib/windows/debug.rb +36 -0
- data/lib/windows/device_io.rb +9 -7
- data/lib/windows/directory.rb +20 -75
- data/lib/windows/error.rb +51 -36
- data/lib/windows/eventlog.rb +20 -101
- data/lib/windows/file.rb +59 -295
- data/lib/windows/file_mapping.rb +14 -32
- data/lib/windows/filesystem.rb +8 -10
- data/lib/windows/handle.rb +15 -11
- data/lib/windows/library.rb +21 -63
- data/lib/windows/memory.rb +28 -106
- data/lib/windows/msvcrt/buffer.rb +20 -15
- data/lib/windows/msvcrt/file.rb +38 -7
- data/lib/windows/msvcrt/io.rb +180 -80
- data/lib/windows/msvcrt/string.rb +20 -15
- data/lib/windows/national.rb +16 -39
- data/lib/windows/network_management.rb +93 -92
- data/lib/windows/nio.rb +26 -0
- data/lib/windows/path.rb +68 -349
- data/lib/windows/pipe.rb +18 -56
- data/lib/windows/process.rb +28 -110
- data/lib/windows/registry.rb +27 -142
- data/lib/windows/security.rb +34 -142
- data/lib/windows/service.rb +34 -80
- data/lib/windows/shell.rb +10 -16
- data/lib/windows/sound.rb +17 -31
- data/lib/windows/synchronize.rb +24 -90
- data/lib/windows/system_info.rb +16 -47
- data/lib/windows/unicode.rb +21 -41
- data/lib/windows/volume.rb +23 -83
- data/lib/windows/window.rb +11 -17
- data/windows-pr.gemspec +3 -2
- metadata +17 -5
data/lib/windows/volume.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
-
require '
|
1
|
+
require 'windows/api'
|
2
|
+
include Windows
|
2
3
|
|
3
4
|
module Windows
|
4
5
|
module Volume
|
6
|
+
API.auto_namespace = 'Windows::Volume'
|
7
|
+
API.auto_constant = true
|
8
|
+
API.auto_method = true
|
9
|
+
API.auto_unicode = true
|
10
|
+
|
5
11
|
DRIVE_UNKNOWN = 0
|
6
12
|
DRIVE_NO_ROOT_DIR = 1
|
7
13
|
DRIVE_REMOVABLE = 2
|
@@ -10,93 +16,27 @@ module Windows
|
|
10
16
|
DRIVE_CDROM = 5
|
11
17
|
DRIVE_RAMDISK = 6
|
12
18
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
SetVolumeLabel = Win32API.new('kernel32', 'SetVolumeLabel', 'PP', 'I')
|
28
|
-
SetVolumeMountPoint = Win32API.new('kernel32', 'SetVolumeMountPoint', 'PP', 'I')
|
19
|
+
API.new('FindFirstVolume', 'PL', 'L')
|
20
|
+
API.new('FindFirstVolumeMountPoint', 'PPL', 'L')
|
21
|
+
API.new('FindNextVolume', 'LPL', 'B')
|
22
|
+
API.new('FindNextVolumeMountPoint', 'LPL', 'B')
|
23
|
+
API.new('FindVolumeClose', 'L', 'B')
|
24
|
+
API.new('FindVolumeMountPointClose', 'L', 'B')
|
25
|
+
API.new('GetDriveType', 'P', 'I')
|
26
|
+
API.new('GetLogicalDrives', 'V', 'L')
|
27
|
+
API.new('GetLogicalDriveStrings', 'LP', 'L')
|
28
|
+
API.new('GetVolumeInformation', 'PPLPPPPL', 'B')
|
29
|
+
API.new('GetVolumeNameForVolumeMountPoint', 'PPL', 'B')
|
30
|
+
API.new('GetVolumePathName', 'PPL', 'B')
|
31
|
+
API.new('SetVolumeLabel', 'PP', 'B')
|
32
|
+
API.new('SetVolumeMountPoint', 'PP', 'B')
|
29
33
|
|
30
34
|
# Windows XP or later
|
31
35
|
begin
|
32
|
-
|
36
|
+
API.new('GetVolumePathNamesForVolumeName', 'PPLL', 'B')
|
33
37
|
rescue
|
34
38
|
# Do nothing - not supported on current platform. It's up to you to
|
35
39
|
# check for the existence of the constant in your code.
|
36
40
|
end
|
37
|
-
|
38
|
-
def FindFirstVolume(name, length=name.size)
|
39
|
-
FindFirstVolume.call(name, length)
|
40
|
-
end
|
41
|
-
|
42
|
-
def FindFirstVolumeMountPoint(name, volume, length=volume.size)
|
43
|
-
FindFirstVolumeMountPoint.call(name, volume, length)
|
44
|
-
end
|
45
|
-
|
46
|
-
def FindNextVolume(handle, name, length=name.size)
|
47
|
-
FindNextVolume.call(handle, name, length) != 0
|
48
|
-
end
|
49
|
-
|
50
|
-
def FindNextVolumeMountPoint(handle, name, length=name.size)
|
51
|
-
FindNextVolumeMountPoint.call(handle, name, length) != 0
|
52
|
-
end
|
53
|
-
|
54
|
-
def FindVolumeClose(handle)
|
55
|
-
FindVolumeClose.call(handle) != 0
|
56
|
-
end
|
57
|
-
|
58
|
-
def FindVolumeMountPointClose(handle)
|
59
|
-
FindVolumeMountPointClose.call(handle) != 0
|
60
|
-
end
|
61
|
-
|
62
|
-
def GetDriveType(path)
|
63
|
-
GetDriveType.call(path)
|
64
|
-
end
|
65
|
-
|
66
|
-
def GetLogicalDrives()
|
67
|
-
GetLogicalDrives.call()
|
68
|
-
end
|
69
|
-
|
70
|
-
def GetLogicalDriveStrings(length, buffer)
|
71
|
-
GetLogicalDriveStrings.call(length, buffer)
|
72
|
-
end
|
73
|
-
|
74
|
-
def GetVolumeInformation(path, v_buf, v_size, serial, length, flags, fs_buf, fs_size)
|
75
|
-
GetVolumeInformation.call(path, v_buf, v_size, serial, length, flags, fs_buf, fs_size) != 0
|
76
|
-
end
|
77
|
-
|
78
|
-
def GetVolumeNameForVolumeMountPoint(mount, name, length=name.size)
|
79
|
-
GetVolumeNameForVolumeMountPoint.call(mount, name, length) != 0
|
80
|
-
end
|
81
|
-
|
82
|
-
def GetVolumePathName(file, name, length = name.size)
|
83
|
-
GetVolumePathName.call(file, name, length) != 0
|
84
|
-
end
|
85
|
-
|
86
|
-
def SetVolumeLabel(label, volume)
|
87
|
-
SetVolumeLabel.call(label, volume) != 0
|
88
|
-
end
|
89
|
-
|
90
|
-
def SetVolumeMountPoint(mount, name)
|
91
|
-
SetVolumeMountPoint.call(mount, name) != 0
|
92
|
-
end
|
93
|
-
|
94
|
-
begin
|
95
|
-
def GetVolumePathNamesForVolumeName(volume, paths, buf_len, return_len)
|
96
|
-
GetVolumePathNamesForVolumeName.call(volume, paths, buf_len, return_len) != 0
|
97
|
-
end
|
98
|
-
rescue Exception
|
99
|
-
# Windows XP or later
|
100
|
-
end
|
101
41
|
end
|
102
|
-
end
|
42
|
+
end
|
data/lib/windows/window.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
-
require '
|
1
|
+
require 'windows/api'
|
2
|
+
include Windows
|
2
3
|
|
3
4
|
module Windows
|
4
5
|
module Window
|
6
|
+
API.auto_namespace = 'Windows::Window'
|
7
|
+
API.auto_constant = true
|
8
|
+
API.auto_method = true
|
9
|
+
API.auto_unicode = false
|
10
|
+
|
5
11
|
# ShowWindow() constants
|
6
12
|
SW_HIDE = 0
|
7
13
|
SW_SHOWNORMAL = 1
|
@@ -19,20 +25,8 @@ module Windows
|
|
19
25
|
SW_FORCEMINIMIZE = 11
|
20
26
|
SW_MAX = 11
|
21
27
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
def GetClientRect(hwnd, rect)
|
27
|
-
GetClientRect.call(hwnd, rect) != 0
|
28
|
-
end
|
29
|
-
|
30
|
-
def GetForegroundWindow
|
31
|
-
GetForegroundWindow.call
|
32
|
-
end
|
33
|
-
|
34
|
-
def GetWindowRect(hwnd, rect)
|
35
|
-
GetWindowRect.call(hwnd, rect) != 0
|
36
|
-
end
|
28
|
+
API.new('GetClientRect', 'LP', 'B', 'user32')
|
29
|
+
API.new('GetForegroundWindow', 'V', 'L', 'user32')
|
30
|
+
API.new('GetWindowRect', 'LP', 'B', 'user32')
|
37
31
|
end
|
38
|
-
end
|
32
|
+
end
|
data/windows-pr.gemspec
CHANGED
@@ -2,7 +2,7 @@ require "rubygems"
|
|
2
2
|
|
3
3
|
spec = Gem::Specification.new do |gem|
|
4
4
|
gem.name = "windows-pr"
|
5
|
-
gem.version = "0.
|
5
|
+
gem.version = "0.7.0"
|
6
6
|
gem.author = "Daniel J. Berger"
|
7
7
|
gem.email = "djberg96@gmail.com"
|
8
8
|
gem.homepage = "http://www.rubyforge.org/projects/win32utils"
|
@@ -16,7 +16,8 @@ spec = Gem::Specification.new do |gem|
|
|
16
16
|
gem.files += Dir["test/*"] + Dir["[A-Z]*"]
|
17
17
|
gem.files.reject! { |fn| fn.include? "CVS" }
|
18
18
|
gem.require_path = "lib"
|
19
|
-
gem.extra_rdoc_files = ["README", "CHANGES"]
|
19
|
+
gem.extra_rdoc_files = ["MANIFEST", "README", "CHANGES"]
|
20
|
+
gem.add_dependency("windows-api", ">= 0.1.1")
|
20
21
|
end
|
21
22
|
|
22
23
|
if $0 == __FILE__
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
rubygems_version: 0.9.2
|
3
3
|
specification_version: 1
|
4
4
|
name: windows-pr
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.7.0
|
7
|
+
date: 2007-08-09 00:00:00 -06:00
|
8
8
|
summary: Windows functions and constants predefined via Win32API
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -31,7 +31,9 @@ authors:
|
|
31
31
|
files:
|
32
32
|
- doc/conversion_guide.txt
|
33
33
|
- lib/windows/clipboard.rb
|
34
|
+
- lib/windows/com.rb
|
34
35
|
- lib/windows/console.rb
|
36
|
+
- lib/windows/debug.rb
|
35
37
|
- lib/windows/device_io.rb
|
36
38
|
- lib/windows/directory.rb
|
37
39
|
- lib/windows/error.rb
|
@@ -45,6 +47,7 @@ files:
|
|
45
47
|
- lib/windows/memory.rb
|
46
48
|
- lib/windows/national.rb
|
47
49
|
- lib/windows/network_management.rb
|
50
|
+
- lib/windows/nio.rb
|
48
51
|
- lib/windows/path.rb
|
49
52
|
- lib/windows/pipe.rb
|
50
53
|
- lib/windows/process.rb
|
@@ -94,6 +97,7 @@ test_files:
|
|
94
97
|
rdoc_options: []
|
95
98
|
|
96
99
|
extra_rdoc_files:
|
100
|
+
- MANIFEST
|
97
101
|
- README
|
98
102
|
- CHANGES
|
99
103
|
executables: []
|
@@ -102,5 +106,13 @@ extensions: []
|
|
102
106
|
|
103
107
|
requirements: []
|
104
108
|
|
105
|
-
dependencies:
|
106
|
-
|
109
|
+
dependencies:
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: windows-api
|
112
|
+
version_requirement:
|
113
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.1.1
|
118
|
+
version:
|