windows-pr 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +7 -0
- data/lib/windows/console.rb +2 -2
- data/lib/windows/debug.rb +1 -1
- data/lib/windows/file.rb +29 -3
- data/lib/windows/nio.rb +9 -1
- data/windows-pr.gemspec +1 -1
- metadata +2 -2
data/CHANGES
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
= 0.9.5 - 21-Oct-2008
|
2
|
+
* Fixed the rescue clauses for unsupported functions for the Windows::Console
|
3
|
+
and Windows::Debug modules. Thanks go to an anonymous user for the spot.
|
4
|
+
* Added a couple functions to the Windows::File and Windows::NIO modules.
|
5
|
+
* Removed the SetFilePointer and SetFilePointerEx functions from the
|
6
|
+
Windows::File module since they're already in the Windows::NIO module.
|
7
|
+
|
1
8
|
= 0.9.4 - 27-Sep-2008
|
2
9
|
* Added some macros from windef.h to the Windows::SystemInfo module.
|
3
10
|
* Added the windows_2000?, windows_xp?, windows_2003? and windows_vista?
|
data/lib/windows/console.rb
CHANGED
@@ -105,7 +105,7 @@ module Windows
|
|
105
105
|
API.new('GetConsoleSelectionInfo', 'P', 'B')
|
106
106
|
API.new('GetCurrentConsoleFont' , 'LIP', 'B')
|
107
107
|
API.new('SetConsoleDisplayMode', 'LLP', 'B')
|
108
|
-
rescue Windows::API::
|
108
|
+
rescue Windows::API::Error
|
109
109
|
# Do nothing - not supported on current platform. It's up to you to
|
110
110
|
# check for the existence of the constant in your code.
|
111
111
|
end
|
@@ -113,7 +113,7 @@ module Windows
|
|
113
113
|
# Windows 2000 or later
|
114
114
|
begin
|
115
115
|
API.new('GetConsoleWindow', 'V', 'L')
|
116
|
-
rescue Windows::API::
|
116
|
+
rescue Windows::API::Error
|
117
117
|
# Do nothing - not supported on current platform. It's up to you to
|
118
118
|
# check for the existence of the constant in your code.
|
119
119
|
end
|
data/lib/windows/debug.rb
CHANGED
@@ -27,7 +27,7 @@ module Windows
|
|
27
27
|
API.new('DebugActiveProcessStop', 'L', 'B')
|
28
28
|
API.new('DebugBreakProcess', 'L', 'B')
|
29
29
|
API.new('DebugSetProcessKillOnExit', 'I', 'B')
|
30
|
-
rescue Windows::API::
|
30
|
+
rescue Windows::API::Error
|
31
31
|
# Do nothing - not supported on current platform. It's up to you to
|
32
32
|
# check for the existence of the constant in your code.
|
33
33
|
end
|
data/lib/windows/file.rb
CHANGED
@@ -170,6 +170,23 @@ module Windows
|
|
170
170
|
MOVEFILE_CREATE_HARDLINK = 0x00000010
|
171
171
|
MOVEFILE_FAIL_IF_NOT_TRACKABLE = 0x00000020
|
172
172
|
SYMBOLIC_LINK_FLAG_DIRECTORY = 0x1
|
173
|
+
|
174
|
+
# FILE_INFO_BY_HANDLE_CLASS enum
|
175
|
+
|
176
|
+
FileBasicInfo = 0
|
177
|
+
FileStandardInfo = 1
|
178
|
+
FileNameInfo = 2
|
179
|
+
FileRenameInfo = 3
|
180
|
+
FileDispositionInfo = 4
|
181
|
+
FileAllocationInfo = 5
|
182
|
+
FileEndOfFileInfo = 6
|
183
|
+
FileStreamInfo = 7
|
184
|
+
FileCompressionInfo = 8
|
185
|
+
FileAttributeTagInfo = 9
|
186
|
+
FileIdBothDirectoryInfo = 10
|
187
|
+
FileIdBothDirectoryRestartInfo = 11
|
188
|
+
FileIoPriorityHintInfo = 12
|
189
|
+
MaximumFileInfoByHandleClass = 13
|
173
190
|
|
174
191
|
API.new('CopyFile', 'PPI', 'B')
|
175
192
|
API.new('CopyFileEx', 'PPKPPL', 'B')
|
@@ -186,6 +203,7 @@ module Windows
|
|
186
203
|
API.new('GetBinaryType', 'PP', 'B')
|
187
204
|
API.new('GetFileAttributes', 'P', 'L')
|
188
205
|
API.new('GetFileAttributesEx', 'PPP', 'I')
|
206
|
+
API.new('GetFileInformationByHandle', 'LP', 'B')
|
189
207
|
API.new('GetFileSize', 'LP', 'L')
|
190
208
|
API.new('GetFileSizeEx', 'LP', 'B')
|
191
209
|
API.new('GetFileType', 'L', 'L')
|
@@ -200,13 +218,19 @@ module Windows
|
|
200
218
|
API.new('ReadFileEx', 'LPLPK', 'B')
|
201
219
|
API.new('SetEndOfFile', 'L', 'B')
|
202
220
|
API.new('SetFileAttributes', 'PL', 'B')
|
203
|
-
API.new('SetFilePointer', 'LLPL', 'L')
|
204
|
-
API.new('SetFilePointerEx', 'LLPL', 'B')
|
205
221
|
API.new('UnlockFile', 'LLLLL', 'B')
|
206
222
|
API.new('UnlockFileEx', 'LLLLL', 'B')
|
207
223
|
API.new('WriteFile', 'LPLPP', 'B')
|
208
224
|
API.new('WriteFileEx', 'LPLPK', 'B')
|
209
225
|
|
226
|
+
# XP or later
|
227
|
+
begin
|
228
|
+
API.new('SetFileShortName', 'LP', 'B')
|
229
|
+
API.new('SetFileValidData', 'LL', 'B')
|
230
|
+
rescue
|
231
|
+
# Do nothing. Not supported by your platform.
|
232
|
+
end
|
233
|
+
|
210
234
|
# XP 64-bit and later
|
211
235
|
begin
|
212
236
|
API.new('Wow64DisableWow64FsRedirection', 'P', 'B')
|
@@ -220,8 +244,10 @@ module Windows
|
|
220
244
|
begin
|
221
245
|
API.new('CreateSymbolicLink', 'PPL', 'B')
|
222
246
|
API.new('CreateSymbolicLinkTransacted', 'PPLL', 'B')
|
247
|
+
API.new('GetFileInformationByHandleEx', 'LLPL', 'B')
|
223
248
|
API.new('GetFinalPathNameByHandle', 'LPLL', 'L')
|
224
|
-
|
249
|
+
API.new('SetFileInformationByHandle', 'LLPL', 'B')
|
250
|
+
rescue Windows::API::Error
|
225
251
|
# Do nothing - unsupported on your system
|
226
252
|
end
|
227
253
|
end
|
data/lib/windows/nio.rb
CHANGED
@@ -34,7 +34,15 @@ module Windows
|
|
34
34
|
API.new('ReadFileScatter', 'LPLPP', 'B')
|
35
35
|
API.new('SetEndOfFile', 'L', 'B')
|
36
36
|
API.new('SetFilePointer', 'LLPL', 'L')
|
37
|
-
API.new('SetFilePointerEx', 'LLPL', '
|
37
|
+
API.new('SetFilePointerEx', 'LLPL', 'B')
|
38
38
|
API.new('WriteFileGather', 'LPLPP', 'B')
|
39
|
+
|
40
|
+
# Windows Vista or later
|
41
|
+
begin
|
42
|
+
API.new('CancelIoEx', 'LP', 'B')
|
43
|
+
API.new('CancelSynchronousIo', 'L', 'B')
|
44
|
+
rescue Windows::API::Error
|
45
|
+
# Do nothing. Not supported on your platform.
|
46
|
+
end
|
39
47
|
end
|
40
48
|
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.9.
|
5
|
+
gem.version = "0.9.5"
|
6
6
|
gem.authors = ["Daniel J. Berger", "Park Heesob"]
|
7
7
|
gem.email = "djberg96@gmail.com"
|
8
8
|
gem.homepage = "http://www.rubyforge.org/projects/win32utils"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: windows-pr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2008-
|
13
|
+
date: 2008-10-24 00:00:00 -06:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|