windows-pr 0.9.1 → 0.9.2

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,8 @@
1
+ = 0.9.2 - 5-Sep-2008
2
+ * Added some WoW64 functions to Windows::File and Windows::SystemInfo.
3
+ * All modules now rescue Windows::API::Error for failed function loads.
4
+ I was previously inconsistent on just what error I was rescuing.
5
+
1
6
  = 0.9.1 - 28-Jul-2008
2
7
  * Yet another refactoring of the multi_to_wide and wide_to_multi helper
3
8
  methods in the Windows::Unicode module. In addition to a bug fix, they
data/lib/windows/com.rb CHANGED
@@ -164,7 +164,7 @@ module Windows
164
164
  # Windows Vista
165
165
  begin
166
166
  API.new('CoDisconnectContext', 'L', 'L', 'ole32')
167
- rescue RuntimeError
167
+ rescue Windows::API::Error
168
168
  # Ignore - you must check for these methods via 'defined?'
169
169
  end
170
170
  end
@@ -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 Exception
108
+ rescue Windows::API::LoadError
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 Exception
116
+ rescue Windows::API::LoadError
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 Exception
30
+ rescue Windows::API::LoadError
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/error.rb CHANGED
@@ -410,7 +410,7 @@ module Windows
410
410
 
411
411
  begin
412
412
  API.new('SetLastErrorEx', 'LL', 'V', 'user32')
413
- rescue Exception
413
+ rescue Windows::API::Error
414
414
  # VC++ 7.0 or later
415
415
  end
416
416
 
data/lib/windows/file.rb CHANGED
@@ -201,5 +201,15 @@ module Windows
201
201
  API.new('UnlockFileEx', 'LLLLL', 'B')
202
202
  API.new('WriteFile', 'LPLPP', 'B')
203
203
  API.new('WriteFileEx', 'LPLPK', 'B')
204
+
205
+ # XP 64-bit and later
206
+ begin
207
+ API.new('Wow64DisableWow64FsRedirection', 'P', 'B')
208
+ API.new('Wow64EnableWow64FsRedirection', 'I', 'I')
209
+ API.new('Wow64RevertWow64FsRedirection', 'L', 'B')
210
+ rescue Windows::API::Error
211
+ # Do nothing - not supported on current platform. It's up to you to
212
+ # check for the existence of the constant in your code.
213
+ end
204
214
  end
205
215
  end
@@ -36,7 +36,7 @@ module Windows
36
36
  API.new('GetDllDirectory', 'LP', 'L')
37
37
  API.new('GetModuleHandleEx', 'LPP', 'I')
38
38
  API.new('SetDllDirectory', 'P', 'I')
39
- rescue Exception
39
+ rescue Windows::API::Error
40
40
  # Do nothing - not supported on current platform. It's up to you to
41
41
  # check for the existence of the constant in your code.
42
42
  end
@@ -119,7 +119,7 @@ module Windows
119
119
  begin
120
120
  API.new('HeapQueryInformation', 'LIPLL', 'B')
121
121
  API.new('HeapSetInformation', 'LIPL', 'B')
122
- rescue Exception
122
+ rescue Windows::API::Error
123
123
  # Do nothing - you must check for their existence
124
124
  end
125
125
  end
@@ -32,7 +32,7 @@ module Windows
32
32
  API.new('_chsize_s', 'IL', 'I', MSVCRT_DLL)
33
33
  API.new('_mktemp_s', 'PL', 'L', MSVCRT_DLL)
34
34
  API.new('_wmktemp_s', 'PL', 'L', MSVCRT_DLL)
35
- rescue RuntimeError
35
+ rescue Windows::API::Error
36
36
  # Ignore - you must check for it via 'defined?'
37
37
  end
38
38
  end
@@ -53,7 +53,7 @@ module Windows
53
53
  # VC++ 8.0 or later
54
54
  begin
55
55
  API.new('_tmpfile_s', 'P', 'L', MSVCRT_DLL)
56
- rescue RuntimeError
56
+ rescue Windows::API::Error
57
57
  # Ignore - you must check for it via 'defined?'
58
58
  end
59
59
  end
@@ -33,7 +33,7 @@ module Windows
33
33
 
34
34
  begin
35
35
  Strtok_s = API.new('strtok_s', 'PPI', 'P', MSVCRT_DLL)
36
- rescue RuntimeError
36
+ rescue Windows::API::Error
37
37
  # Do nothing. Not supported on your system.
38
38
  end
39
39
 
@@ -190,7 +190,7 @@ module Windows
190
190
  begin
191
191
  API.new('GetNetScheduleAccountInformation', 'PLP', 'L', 'mstask')
192
192
  API.new('SetNetScheduleAccountInformation', 'PPP', 'L', 'netapi32')
193
- rescue Exception
193
+ rescue Windows::API::Error
194
194
  # Do nothing. Not supported on current platform.
195
195
  end
196
196
 
@@ -515,7 +515,7 @@ module Windows
515
515
  def SetNetScheduleAccountInformation(server, account, password)
516
516
  SetNetScheduleAccountInformation.call(server, account, password) == NERR_Success
517
517
  end
518
- rescue Exception
518
+ rescue Windows::API::Error
519
519
  # Do nothing. It's up to you to check for their existence.
520
520
  end
521
521
  end
@@ -79,10 +79,10 @@ module Windows
79
79
 
80
80
  # Windows 2003 Server or later and/or WinSNMP 2.0 or later
81
81
  begin
82
- API.new('SnmpCreateSession', 'LLKP', 'wsnmp32')
82
+ API.new('SnmpCreateSession', 'LLKP', 'L', 'wsnmp32')
83
83
  API.new('SnmpCleanupEx', 'V', 'I', 'wsnmp32')
84
84
  API.new('SnmpStartupEx', 'PPPPP', 'L', 'wsnmp32')
85
- rescue Exception
85
+ rescue Windows::API::Error
86
86
  # Do nothing. It's up to you to check for their existence.
87
87
  end
88
88
  end
@@ -120,7 +120,7 @@ module Windows
120
120
  # Windows XP or later
121
121
  begin
122
122
  API.new('RegSaveKeyEx', 'LPPL', 'L', 'advapi32')
123
- rescue Exception
123
+ rescue Windows::API::Error
124
124
  # Do nothing - not supported on current platform. It's up to you to
125
125
  # check for the existence of the constant in your code.
126
126
  end
@@ -372,7 +372,7 @@ module Windows
372
372
  # Windows XP or later
373
373
  begin
374
374
  API.new('CreateWellKnownSid', 'IPPP', 'B', 'advapi32')
375
- rescue LoadError
375
+ rescue Windows::API::Error
376
376
  # Do nothing. It's up to you to check for it.
377
377
  end
378
378
  end
@@ -34,5 +34,12 @@ module Windows
34
34
  API.new('GetVersion', 'V', 'L')
35
35
  API.new('GetVersionEx', 'P', 'B')
36
36
  API.new('GetWindowsDirectory', 'PI', 'I')
37
+
38
+ # XP or later
39
+ begin
40
+ API.new('GetSystemWow64Directory', 'PI', 'I')
41
+ rescue Windows::API::Error
42
+ # Do nothing. Users must check for function.
43
+ end
37
44
  end
38
45
  end
@@ -56,7 +56,7 @@ module Windows
56
56
  begin
57
57
  API.new('AttachThreadInput', 'LLI', 'B')
58
58
  API.new('GetThreadIOPendingFlag', 'LP', 'B')
59
- rescue Exception
59
+ rescue Windows::API::Error
60
60
  # Do nothing. It's up to you to check for its existence.
61
61
  end
62
62
  end
data/lib/windows/time.rb CHANGED
@@ -39,8 +39,8 @@ module Windows
39
39
  # Windows XP or later
40
40
  begin
41
41
  API.new('GetSystemTimes', 'PPP', 'B')
42
- API.new('TzSpecificLocalTimeToSystemTime', 'PPP', 'B')
43
- rescue RuntimeError
42
+ API.new('TzSpecificLocalTimeToSystemTime', 'PPP', 'B')
43
+ rescue Windows::API::Error
44
44
  # Do nothing. It's up to you to check your platform.
45
45
  end
46
46
  end
@@ -33,7 +33,7 @@ module Windows
33
33
  # Windows XP or later
34
34
  begin
35
35
  API.new('GetVolumePathNamesForVolumeName', 'PPLL', 'B')
36
- rescue
36
+ rescue Windows::API::Error
37
37
  # Do nothing - not supported on current platform. It's up to you to
38
38
  # check for the existence of the constant in your code.
39
39
  end
@@ -53,7 +53,7 @@ module Windows
53
53
  # Windows XP or later
54
54
  begin
55
55
  API.new('GetLayeredWindowAttributes', 'LPBL', 'B', 'user32')
56
- rescue Exception
56
+ rescue Windows::API::Error
57
57
  # Do nothing - not supported on current platform. It's up to you
58
58
  # to check for the existence of the constant in your code.
59
59
  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.1"
5
+ gem.version = "0.9.2"
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.1
4
+ version: 0.9.2
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-07-29 00:00:00 -06:00
13
+ date: 2008-09-05 00:00:00 -06:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency