windows-pr 1.2.0 → 1.2.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 +6 -0
- data/lib/windows/msvcrt/string.rb +27 -6
- data/test/tc_ntfs_winternl.rb +1 -1
- data/windows-pr.gemspec +1 -1
- metadata +5 -7
data/CHANGES
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
= 1.2.1 - 25-Aug-2011
|
2
|
+
* The strcpy, mbscpy and wsccpy functions in the Windows::MSVCRT::String
|
3
|
+
module have been made friendlier. They will now accept either a string
|
4
|
+
or an address for the second argument.
|
5
|
+
* Minor modification to one GetFinalPathNameByHandle test.
|
6
|
+
|
1
7
|
= 1.2.0 - 24-Mar-2011
|
2
8
|
* All methods and constants are now private. These methods were never meant
|
3
9
|
to be used by individual objects, but are only meant to be used internally.
|
@@ -21,17 +21,26 @@ module Windows
|
|
21
21
|
Strspn = API.new('strspn', 'PP', 'L', MSVCRT_DLL)
|
22
22
|
Strstr = API.new('strstr', 'PP', 'P', MSVCRT_DLL)
|
23
23
|
Strtok = API.new('strtok', 'PP', 'P', MSVCRT_DLL)
|
24
|
+
|
25
|
+
StrcpyPL = API.new('strcpy', 'PL', 'L', MSVCRT_DLL)
|
26
|
+
StrcpyPP = API.new('strcpy', 'PP', 'L', MSVCRT_DLL)
|
24
27
|
|
25
28
|
Mbscmp = API.new('_mbscmp', 'PP', 'I', 'msvcrt')
|
26
29
|
Mbscpy = API.new('_mbscpy', 'PL', 'L', 'msvcrt')
|
27
30
|
Mbslen = API.new('_mbslen', 'P', 'L', 'msvcrt')
|
28
31
|
Mbsrev = API.new('_mbsrev', 'P', 'P', 'msvcrt')
|
32
|
+
|
33
|
+
MbscpyPL = API.new('_mbscpy', 'PL', 'L', 'msvcrt')
|
34
|
+
MbscpyPP = API.new('_mbscpy', 'PP', 'L', 'msvcrt')
|
29
35
|
|
30
36
|
Wcscmp = API.new('wcscmp', 'PP', 'I', MSVCRT_DLL)
|
31
37
|
Wcscpy = API.new('wcscpy', 'PL', 'L', MSVCRT_DLL)
|
32
38
|
Wcslen = API.new('wcslen', 'P', 'L', MSVCRT_DLL)
|
33
39
|
Wcsncpy = API.new('wcsncpy', 'PPL', 'P', MSVCRT_DLL)
|
34
40
|
Wcsrev = API.new('_wcsrev', 'P', 'P', MSVCRT_DLL)
|
41
|
+
|
42
|
+
WcscpyPL = API.new('wcscpy', 'PL', 'L', MSVCRT_DLL)
|
43
|
+
WcscpyPP = API.new('wcscpy', 'PP', 'L', MSVCRT_DLL)
|
35
44
|
|
36
45
|
begin
|
37
46
|
Strtok_s = API.new('strtok_s', 'PPI', 'P', MSVCRT_DLL)
|
@@ -52,8 +61,12 @@ module Windows
|
|
52
61
|
end
|
53
62
|
|
54
63
|
def strcpy(dest, src)
|
55
|
-
|
56
|
-
|
64
|
+
if src.is_a?(Numeric)
|
65
|
+
return nil if src == 0
|
66
|
+
StrcpyPL.call(dest, src)
|
67
|
+
else
|
68
|
+
StrcpyPP.call(dest, src)
|
69
|
+
end
|
57
70
|
end
|
58
71
|
|
59
72
|
def strlen(string)
|
@@ -116,8 +129,12 @@ module Windows
|
|
116
129
|
end
|
117
130
|
|
118
131
|
def mbscpy(dest, src)
|
119
|
-
|
120
|
-
|
132
|
+
if src.is_a?(Numeric)
|
133
|
+
return nil if src == 0
|
134
|
+
MbscpyPL.call(dest, src)
|
135
|
+
else
|
136
|
+
MbscpyPP.call(dest, src)
|
137
|
+
end
|
121
138
|
end
|
122
139
|
|
123
140
|
def mbslen(string)
|
@@ -138,8 +155,12 @@ module Windows
|
|
138
155
|
end
|
139
156
|
|
140
157
|
def wcscpy(dest, src)
|
141
|
-
|
142
|
-
|
158
|
+
if src.is_a?(Numeric)
|
159
|
+
return nil if src == 0
|
160
|
+
WcscpyPL.call(dest, src)
|
161
|
+
else
|
162
|
+
WcscpyPP.call(dest, src)
|
163
|
+
end
|
143
164
|
end
|
144
165
|
|
145
166
|
def wcslen(string)
|
data/test/tc_ntfs_winternl.rb
CHANGED
@@ -33,7 +33,7 @@ class TC_Windows_NTFS_Winternl < Test::Unit::TestCase
|
|
33
33
|
res = GetFinalPathNameByHandle(@handle, buf, buf.size, 2)
|
34
34
|
}
|
35
35
|
assert_kind_of(Fixnum, res)
|
36
|
-
assert_equal(
|
36
|
+
assert_equal(@name, File.basename(buf))
|
37
37
|
end
|
38
38
|
|
39
39
|
def teardown
|
data/windows-pr.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: windows-pr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 1
|
10
|
+
version: 1.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Daniel J. Berger
|
@@ -16,8 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
20
|
-
default_executable:
|
19
|
+
date: 2011-08-25 00:00:00 Z
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|
23
22
|
name: windows-api
|
@@ -185,7 +184,6 @@ files:
|
|
185
184
|
- test/tc_window_timer.rb
|
186
185
|
- test/tc_wsa.rb
|
187
186
|
- windows-pr.gemspec
|
188
|
-
has_rdoc: true
|
189
187
|
homepage: http://www.rubyforge.org/projects/win32utils
|
190
188
|
licenses:
|
191
189
|
- Artistic 2.0
|
@@ -215,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
213
|
requirements: []
|
216
214
|
|
217
215
|
rubyforge_project: win32utils
|
218
|
-
rubygems_version: 1.
|
216
|
+
rubygems_version: 1.8.8
|
219
217
|
signing_key:
|
220
218
|
specification_version: 3
|
221
219
|
summary: Windows functions and constants bundled via Win32::API
|