windows-pr 1.1.2 → 1.1.3
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 +408 -404
- data/MANIFEST +65 -65
- data/README +149 -149
- data/Rakefile +52 -52
- data/doc/conversion_guide.txt +37 -37
- data/lib/windows/clipboard.rb +59 -59
- data/lib/windows/com.rb +190 -189
- data/lib/windows/com/automation.rb +147 -147
- data/lib/windows/com/variant.rb +22 -22
- data/lib/windows/console.rb +112 -112
- data/lib/windows/debug.rb +33 -33
- data/lib/windows/device_io.rb +246 -246
- data/lib/windows/directory.rb +25 -25
- data/lib/windows/error.rb +482 -482
- data/lib/windows/eventlog.rb +78 -78
- data/lib/windows/file.rb +262 -262
- data/lib/windows/file_mapping.rb +23 -23
- data/lib/windows/filesystem.rb +13 -13
- data/lib/windows/gdi/bitmap.rb +63 -63
- data/lib/windows/gdi/device_context.rb +44 -44
- data/lib/windows/gdi/metafile.rb +38 -38
- data/lib/windows/gdi/painting_drawing.rb +113 -113
- data/lib/windows/handle.rb +21 -21
- data/lib/windows/library.rb +42 -42
- data/lib/windows/limits.rb +31 -31
- data/lib/windows/mailslot.rb +22 -22
- data/lib/windows/memory.rb +126 -126
- data/lib/windows/msvcrt/buffer.rb +73 -73
- data/lib/windows/msvcrt/directory.rb +29 -29
- data/lib/windows/msvcrt/file.rb +45 -45
- data/lib/windows/msvcrt/io.rb +71 -71
- data/lib/windows/msvcrt/time.rb +167 -167
- data/lib/windows/national.rb +578 -578
- data/lib/windows/network/management.rb +523 -523
- data/lib/windows/network/snmp.rb +90 -90
- data/lib/windows/network/winsock.rb +126 -126
- data/lib/windows/nio.rb +48 -47
- data/lib/windows/ntfs/winternl.rb +96 -96
- data/lib/windows/path.rb +141 -141
- data/lib/windows/pipe.rb +40 -40
- data/lib/windows/process.rb +174 -174
- data/lib/windows/registry.rb +126 -126
- data/lib/windows/security.rb +477 -477
- data/lib/windows/security/authentication.rb +30 -30
- data/lib/windows/service.rb +140 -140
- data/lib/windows/shell.rb +169 -169
- data/lib/windows/sound.rb +37 -37
- data/lib/windows/synchronize.rb +131 -131
- data/lib/windows/system_info.rb +227 -222
- data/lib/windows/thread.rb +62 -62
- data/lib/windows/time.rb +46 -46
- data/lib/windows/tool_helper.rb +34 -34
- data/lib/windows/volume.rb +59 -59
- data/lib/windows/window.rb +79 -79
- data/lib/windows/window/classes.rb +57 -57
- data/lib/windows/window/dialog.rb +89 -89
- data/lib/windows/window/menu.rb +100 -100
- data/lib/windows/window/message.rb +295 -295
- data/lib/windows/window/properties.rb +18 -18
- data/lib/windows/window/timer.rb +17 -17
- data/test/tc_clipboard.rb +41 -41
- data/test/tc_com.rb +32 -32
- data/test/tc_com_automation.rb +15 -15
- data/test/tc_console.rb +108 -108
- data/test/tc_debug.rb +48 -48
- data/test/tc_device_io.rb +29 -29
- data/test/tc_directory.rb +25 -25
- data/test/tc_error.rb +49 -49
- data/test/tc_eventlog.rb +58 -58
- data/test/tc_file.rb +67 -67
- data/test/tc_file_mapping.rb +38 -38
- data/test/tc_filesystem.rb +27 -27
- data/test/tc_gdi_bitmap.rb +25 -25
- data/test/tc_gdi_metafile.rb +23 -23
- data/test/tc_handle.rb +36 -36
- data/test/tc_library.rb +37 -37
- data/test/tc_limits.rb +34 -34
- data/test/tc_mailslot.rb +22 -22
- data/test/tc_memory.rb +44 -44
- data/test/tc_msvcrt_buffer.rb +68 -68
- data/test/tc_msvcrt_directory.rb +98 -98
- data/test/tc_msvcrt_file.rb +80 -80
- data/test/tc_msvcrt_io.rb +48 -48
- data/test/tc_msvcrt_string.rb +93 -93
- data/test/tc_msvcrt_time.rb +29 -29
- data/test/tc_national.rb +38 -38
- data/test/tc_network_management.rb +32 -32
- data/test/tc_network_snmp.rb +31 -31
- data/test/tc_network_winsock.rb +34 -34
- data/test/tc_nio.rb +32 -32
- data/test/tc_ntfs_winternl.rb +29 -29
- data/test/tc_path.rb +90 -90
- data/test/tc_pipe.rb +53 -53
- data/test/tc_process.rb +24 -24
- data/test/tc_registry.rb +29 -29
- data/test/tc_security.rb +104 -104
- data/test/tc_security_authentication.rb +34 -34
- data/test/tc_service.rb +57 -57
- data/test/tc_shell.rb +34 -34
- data/test/tc_sound.rb +37 -37
- data/test/tc_synchronize.rb +75 -75
- data/test/tc_system_info.rb +43 -43
- data/test/tc_thread.rb +29 -29
- data/test/tc_time.rb +32 -32
- data/test/tc_tool_helper.rb +29 -29
- data/test/tc_volume.rb +47 -47
- data/test/tc_window.rb +45 -45
- data/test/tc_window_classes.rb +33 -33
- data/test/tc_window_dialog.rb +33 -33
- data/test/tc_window_menu.rb +29 -29
- data/test/tc_window_message.rb +33 -33
- data/test/tc_window_properties.rb +29 -29
- data/test/tc_window_timer.rb +29 -29
- data/windows-pr.gemspec +34 -34
- metadata +4 -4
data/MANIFEST
CHANGED
@@ -1,65 +1,65 @@
|
|
1
|
-
* CHANGES
|
2
|
-
* MANIFEST
|
3
|
-
* README
|
4
|
-
* Rakefile
|
5
|
-
* windows-pr.gemspec
|
6
|
-
|
7
|
-
* doc/conversion_guide.txt
|
8
|
-
|
9
|
-
* lib/windows/clipboard.rb
|
10
|
-
* lib/windows/console.rb
|
11
|
-
* lib/windows/device_io.rb
|
12
|
-
* lib/windows/directory.rb
|
13
|
-
* lib/windows/error.rb
|
14
|
-
* lib/windows/eventlog.rb
|
15
|
-
* lib/windows/file_mapping.rb
|
16
|
-
* lib/windows/file.rb
|
17
|
-
* lib/windows/filesystem.rb
|
18
|
-
* lib/windows/handle.rb
|
19
|
-
* lib/windows/library.rb
|
20
|
-
* lib/windows/limits.rb
|
21
|
-
* lib/windows/mailslot.rb
|
22
|
-
* lib/windows/memory.rb
|
23
|
-
* lib/windows/national.rb
|
24
|
-
* lib/windows/nio.rb
|
25
|
-
* lib/windows/network_management.rb
|
26
|
-
* lib/windows/path.rb
|
27
|
-
* lib/windows/pipe.rb
|
28
|
-
* lib/windows/process.rb
|
29
|
-
* lib/windows/registry.rb
|
30
|
-
* lib/windows/security.rb
|
31
|
-
* lib/windows/service.rb
|
32
|
-
* lib/windows/shell.rb
|
33
|
-
* lib/windows/sound.rb
|
34
|
-
* lib/windows/synchronize.rb
|
35
|
-
* lib/windows/system_info.rb
|
36
|
-
* lib/windows/time.rb
|
37
|
-
* lib/windows/unicode.rb
|
38
|
-
* lib/windows/volume.rb
|
39
|
-
* lib/windows/window.rb
|
40
|
-
|
41
|
-
* lib/windows/com/automation.rb
|
42
|
-
|
43
|
-
* lib/windows/gdi/bitmap.rb
|
44
|
-
* lib/windows/gdi/device_context.rb
|
45
|
-
* lib/windows/gdi/painting_drawing.rb
|
46
|
-
|
47
|
-
* lib/windows/msvcrt/buffer.rb
|
48
|
-
* lib/windows/msvcrt/directory.rb
|
49
|
-
* lib/windows/msvcrt/file.rb
|
50
|
-
* lib/windows/msvcrt/io.rb
|
51
|
-
* lib/windows/msvcrt/string.rb
|
52
|
-
* lib/windows/msvcrt/time.rb
|
53
|
-
|
54
|
-
* lib/windows/network/management.rb
|
55
|
-
* lib/windows/network/snmp.rb
|
56
|
-
* lib/windows/network/winsock.rb
|
57
|
-
|
58
|
-
* lib/windows/ntfs/winternl.rb
|
59
|
-
|
60
|
-
* lib/windows/window/classes.rb
|
61
|
-
* lib/windows/window/dialog.rb
|
62
|
-
* lib/windows/window/menu.rb
|
63
|
-
* lib/windows/window/message.rb
|
64
|
-
* lib/windows/window/properties.rb
|
65
|
-
* lib/windows/window/timer.rb
|
1
|
+
* CHANGES
|
2
|
+
* MANIFEST
|
3
|
+
* README
|
4
|
+
* Rakefile
|
5
|
+
* windows-pr.gemspec
|
6
|
+
|
7
|
+
* doc/conversion_guide.txt
|
8
|
+
|
9
|
+
* lib/windows/clipboard.rb
|
10
|
+
* lib/windows/console.rb
|
11
|
+
* lib/windows/device_io.rb
|
12
|
+
* lib/windows/directory.rb
|
13
|
+
* lib/windows/error.rb
|
14
|
+
* lib/windows/eventlog.rb
|
15
|
+
* lib/windows/file_mapping.rb
|
16
|
+
* lib/windows/file.rb
|
17
|
+
* lib/windows/filesystem.rb
|
18
|
+
* lib/windows/handle.rb
|
19
|
+
* lib/windows/library.rb
|
20
|
+
* lib/windows/limits.rb
|
21
|
+
* lib/windows/mailslot.rb
|
22
|
+
* lib/windows/memory.rb
|
23
|
+
* lib/windows/national.rb
|
24
|
+
* lib/windows/nio.rb
|
25
|
+
* lib/windows/network_management.rb
|
26
|
+
* lib/windows/path.rb
|
27
|
+
* lib/windows/pipe.rb
|
28
|
+
* lib/windows/process.rb
|
29
|
+
* lib/windows/registry.rb
|
30
|
+
* lib/windows/security.rb
|
31
|
+
* lib/windows/service.rb
|
32
|
+
* lib/windows/shell.rb
|
33
|
+
* lib/windows/sound.rb
|
34
|
+
* lib/windows/synchronize.rb
|
35
|
+
* lib/windows/system_info.rb
|
36
|
+
* lib/windows/time.rb
|
37
|
+
* lib/windows/unicode.rb
|
38
|
+
* lib/windows/volume.rb
|
39
|
+
* lib/windows/window.rb
|
40
|
+
|
41
|
+
* lib/windows/com/automation.rb
|
42
|
+
|
43
|
+
* lib/windows/gdi/bitmap.rb
|
44
|
+
* lib/windows/gdi/device_context.rb
|
45
|
+
* lib/windows/gdi/painting_drawing.rb
|
46
|
+
|
47
|
+
* lib/windows/msvcrt/buffer.rb
|
48
|
+
* lib/windows/msvcrt/directory.rb
|
49
|
+
* lib/windows/msvcrt/file.rb
|
50
|
+
* lib/windows/msvcrt/io.rb
|
51
|
+
* lib/windows/msvcrt/string.rb
|
52
|
+
* lib/windows/msvcrt/time.rb
|
53
|
+
|
54
|
+
* lib/windows/network/management.rb
|
55
|
+
* lib/windows/network/snmp.rb
|
56
|
+
* lib/windows/network/winsock.rb
|
57
|
+
|
58
|
+
* lib/windows/ntfs/winternl.rb
|
59
|
+
|
60
|
+
* lib/windows/window/classes.rb
|
61
|
+
* lib/windows/window/dialog.rb
|
62
|
+
* lib/windows/window/menu.rb
|
63
|
+
* lib/windows/window/message.rb
|
64
|
+
* lib/windows/window/properties.rb
|
65
|
+
* lib/windows/window/timer.rb
|
data/README
CHANGED
@@ -1,149 +1,149 @@
|
|
1
|
-
== Description
|
2
|
-
A collection of Windows functions predefined for you via Win32::API.
|
3
|
-
Hence the 'pr', for 'Pure Ruby'.
|
4
|
-
|
5
|
-
== Synopsis
|
6
|
-
require 'windows/path'
|
7
|
-
|
8
|
-
class Foo
|
9
|
-
include Windows::Path
|
10
|
-
|
11
|
-
if PathIsRoot.call("C:\\") > 0
|
12
|
-
...
|
13
|
-
end
|
14
|
-
|
15
|
-
# or
|
16
|
-
|
17
|
-
if PathIsRoot("C:\\")
|
18
|
-
...
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
== Installation
|
23
|
-
gem install windows-pr
|
24
|
-
|
25
|
-
== Methods
|
26
|
-
Each of the various files included as part of this package provide a series
|
27
|
-
of constants corresponding to the equivalent Windows API function and
|
28
|
-
related numeric constants. For example, if you require 'windows/path',
|
29
|
-
you now have PathIsRoot, PathIsUNC, etc, available to you as Win32::API
|
30
|
-
objects in the form of constants.
|
31
|
-
|
32
|
-
A wrapper has been provided for each method in order to avoid the
|
33
|
-
Win32::API#call method. So, instead of PathIsRoot.call(path) you can
|
34
|
-
invoke it as PathIsRoot(path). If the original function is lower case
|
35
|
-
then the wrapper method is lower case as well. For example, instead of
|
36
|
-
doing 'Memcpy.call(dest, src, size)' you can do 'memcpy(dest, src, size)'.
|
37
|
-
|
38
|
-
Remember boys and girls, if you write 'PathIsRoot', you're referring to
|
39
|
-
the constant. If you write 'PathIsRoot()', you're calling the wrapper
|
40
|
-
method.
|
41
|
-
|
42
|
-
Boolean methods automatically perform a check for success or failure. So,
|
43
|
-
instead of having to do something like 'if PathIsRoot(path) > 0' you can
|
44
|
-
just do 'if PathIsRoot(path)'. However, I do not add this nicety for the
|
45
|
-
MSVCRT functions that return int's because some functions have multiple
|
46
|
-
return values which you may want to inspect. So, rather than making you
|
47
|
-
guess, I have simply declared that you must inspect return values manually
|
48
|
-
for any MSVCRT module.
|
49
|
-
|
50
|
-
Source files contain related functions, by topic. For example, the
|
51
|
-
clipboard.rb file contains clipboard related functions, such as
|
52
|
-
CloseClipboard(), as well as constants such as CF_TEXT, CF_BITMAP, etc.
|
53
|
-
|
54
|
-
== Wide character functions
|
55
|
-
I decided that the $KCODE handling was a bad idea, so most of the $KCODE
|
56
|
-
handling has been removed. The only methods that change their behavior
|
57
|
-
based on $KCODE are the multi_to_wide and wide_to_multi helper methods
|
58
|
-
in the Windows::Unicode module. If $KCODE is set to UTF8, then the code
|
59
|
-
point used is CP_UTF8. Otherwise, CP_ACP is used.
|
60
|
-
|
61
|
-
The modules all come with explicit ANSI and Wide (Unicode) functions,
|
62
|
-
when available from MS Windows. By default, a function without an explicit
|
63
|
-
'A' at the end of the function name uses the ANSI version. It is up to you
|
64
|
-
to use the wide ('W') functions explicitly if you wish.
|
65
|
-
|
66
|
-
== Platform specific functions
|
67
|
-
Not all functions are defined on all platforms. For example, the
|
68
|
-
AttachConsole() function is only defined on Windows XP and later. If you
|
69
|
-
eed to conditionally test for its existence, simply use the 'defined?'
|
70
|
-
method:
|
71
|
-
|
72
|
-
if defined? AttachConsole
|
73
|
-
# Do something
|
74
|
-
else
|
75
|
-
# Do something else
|
76
|
-
end
|
77
|
-
|
78
|
-
== Where are the tests, dude?
|
79
|
-
While I've made some effort to test these functions, there are simply too
|
80
|
-
many for me to effectively test them all. We're ultimately talking about
|
81
|
-
hundreds, if not thousands, of functions, and I don't know what all of them
|
82
|
-
actually do. That being said, I will add tests where and when I can.
|
83
|
-
|
84
|
-
If you find that I've declared the function prototype wrong for a given
|
85
|
-
function, please let me know ASAP and I'll fix it. An example program
|
86
|
-
demonstrating the problem would be helpful, too. Or, if you'd just like
|
87
|
-
to contribute some test cases, that's fine as well.
|
88
|
-
|
89
|
-
== What's the point?
|
90
|
-
I became tired of redefining Windows functions over and over whenever I
|
91
|
-
wanted to use the Win32API library. I thought it would be very handy to
|
92
|
-
have them predefined for me in a library with convenient wrapper methods
|
93
|
-
to boot.
|
94
|
-
|
95
|
-
While it's true that Moonwolf has a library on the RAA that includes many
|
96
|
-
of these functions defined already, there are a few issues with it. First,
|
97
|
-
it puts *every* function and constant in one or two files. That's a waste
|
98
|
-
of memory, hard to organize & maintain, and impossible to test. Second,
|
99
|
-
some of his function declarations are wrong. Third, some of the functions
|
100
|
-
I needed for my own projects are missing. Fourth, there's no gem. Lastly,
|
101
|
-
I haven't seen an update in over 6 years, which leads me to believe it is
|
102
|
-
no longer maintained.
|
103
|
-
|
104
|
-
== Hey, I'm missing function X!
|
105
|
-
I have only defined a small subset of the overall Windows API. It would
|
106
|
-
take me years to define them *all*. I defined the ones I needed first,
|
107
|
-
plus some that I thought would be useful to others. I will continue to
|
108
|
-
add functions in my spare time, or (especially) by request.
|
109
|
-
|
110
|
-
== Bugs
|
111
|
-
None that I'm aware of. Please report any bugs on the project page at
|
112
|
-
http://www.rubyforge.org/projects/win32utils.
|
113
|
-
|
114
|
-
The only real bugs you could find are either bad prototype declarations
|
115
|
-
or bad constant values. Sometimes I forget to wrap functions properly
|
116
|
-
that may not be defined on older Windows platforms. But, please report
|
117
|
-
any of these issues on the project page should you stumble into them.
|
118
|
-
|
119
|
-
== Known Issues
|
120
|
-
In some cases the MSDN docs are wrong, and we have to learn it the hard
|
121
|
-
way. If you should happen to find a documentation bug on their site,
|
122
|
-
please contact them and let them know. They're generally good about fixing
|
123
|
-
them.
|
124
|
-
|
125
|
-
In other cases library functions are not exported by the dll. For example,
|
126
|
-
my version of shlwapi.dll does not export the PathIsHTMLFile() function,
|
127
|
-
despite being well past the minimum version for that DLL. There is nothing
|
128
|
-
you or I can do about it short of rebuilding the DLL file from scratch
|
129
|
-
and/or reporting the issue to Microsoft.
|
130
|
-
|
131
|
-
== Supported Platforms
|
132
|
-
I only support the Windows NT family of Windows, and then only Windows
|
133
|
-
2000 and later.
|
134
|
-
|
135
|
-
== License
|
136
|
-
Artistic 2.0
|
137
|
-
|
138
|
-
== Warranty
|
139
|
-
This package is provided "as is" and without any express or
|
140
|
-
implied warranties, including, without limitation, the implied
|
141
|
-
warranties of merchantability and fitness for a particular purpose.
|
142
|
-
|
143
|
-
== Copyright
|
144
|
-
(C) 2006-2010, Daniel J. Berger
|
145
|
-
All Rights Reserved
|
146
|
-
|
147
|
-
== Author(s)
|
148
|
-
Daniel Berger
|
149
|
-
Park Heesob
|
1
|
+
== Description
|
2
|
+
A collection of Windows functions predefined for you via Win32::API.
|
3
|
+
Hence the 'pr', for 'Pure Ruby'.
|
4
|
+
|
5
|
+
== Synopsis
|
6
|
+
require 'windows/path'
|
7
|
+
|
8
|
+
class Foo
|
9
|
+
include Windows::Path
|
10
|
+
|
11
|
+
if PathIsRoot.call("C:\\") > 0
|
12
|
+
...
|
13
|
+
end
|
14
|
+
|
15
|
+
# or
|
16
|
+
|
17
|
+
if PathIsRoot("C:\\")
|
18
|
+
...
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
== Installation
|
23
|
+
gem install windows-pr
|
24
|
+
|
25
|
+
== Methods
|
26
|
+
Each of the various files included as part of this package provide a series
|
27
|
+
of constants corresponding to the equivalent Windows API function and
|
28
|
+
related numeric constants. For example, if you require 'windows/path',
|
29
|
+
you now have PathIsRoot, PathIsUNC, etc, available to you as Win32::API
|
30
|
+
objects in the form of constants.
|
31
|
+
|
32
|
+
A wrapper has been provided for each method in order to avoid the
|
33
|
+
Win32::API#call method. So, instead of PathIsRoot.call(path) you can
|
34
|
+
invoke it as PathIsRoot(path). If the original function is lower case
|
35
|
+
then the wrapper method is lower case as well. For example, instead of
|
36
|
+
doing 'Memcpy.call(dest, src, size)' you can do 'memcpy(dest, src, size)'.
|
37
|
+
|
38
|
+
Remember boys and girls, if you write 'PathIsRoot', you're referring to
|
39
|
+
the constant. If you write 'PathIsRoot()', you're calling the wrapper
|
40
|
+
method.
|
41
|
+
|
42
|
+
Boolean methods automatically perform a check for success or failure. So,
|
43
|
+
instead of having to do something like 'if PathIsRoot(path) > 0' you can
|
44
|
+
just do 'if PathIsRoot(path)'. However, I do not add this nicety for the
|
45
|
+
MSVCRT functions that return int's because some functions have multiple
|
46
|
+
return values which you may want to inspect. So, rather than making you
|
47
|
+
guess, I have simply declared that you must inspect return values manually
|
48
|
+
for any MSVCRT module.
|
49
|
+
|
50
|
+
Source files contain related functions, by topic. For example, the
|
51
|
+
clipboard.rb file contains clipboard related functions, such as
|
52
|
+
CloseClipboard(), as well as constants such as CF_TEXT, CF_BITMAP, etc.
|
53
|
+
|
54
|
+
== Wide character functions
|
55
|
+
I decided that the $KCODE handling was a bad idea, so most of the $KCODE
|
56
|
+
handling has been removed. The only methods that change their behavior
|
57
|
+
based on $KCODE are the multi_to_wide and wide_to_multi helper methods
|
58
|
+
in the Windows::Unicode module. If $KCODE is set to UTF8, then the code
|
59
|
+
point used is CP_UTF8. Otherwise, CP_ACP is used.
|
60
|
+
|
61
|
+
The modules all come with explicit ANSI and Wide (Unicode) functions,
|
62
|
+
when available from MS Windows. By default, a function without an explicit
|
63
|
+
'A' at the end of the function name uses the ANSI version. It is up to you
|
64
|
+
to use the wide ('W') functions explicitly if you wish.
|
65
|
+
|
66
|
+
== Platform specific functions
|
67
|
+
Not all functions are defined on all platforms. For example, the
|
68
|
+
AttachConsole() function is only defined on Windows XP and later. If you
|
69
|
+
eed to conditionally test for its existence, simply use the 'defined?'
|
70
|
+
method:
|
71
|
+
|
72
|
+
if defined? AttachConsole
|
73
|
+
# Do something
|
74
|
+
else
|
75
|
+
# Do something else
|
76
|
+
end
|
77
|
+
|
78
|
+
== Where are the tests, dude?
|
79
|
+
While I've made some effort to test these functions, there are simply too
|
80
|
+
many for me to effectively test them all. We're ultimately talking about
|
81
|
+
hundreds, if not thousands, of functions, and I don't know what all of them
|
82
|
+
actually do. That being said, I will add tests where and when I can.
|
83
|
+
|
84
|
+
If you find that I've declared the function prototype wrong for a given
|
85
|
+
function, please let me know ASAP and I'll fix it. An example program
|
86
|
+
demonstrating the problem would be helpful, too. Or, if you'd just like
|
87
|
+
to contribute some test cases, that's fine as well.
|
88
|
+
|
89
|
+
== What's the point?
|
90
|
+
I became tired of redefining Windows functions over and over whenever I
|
91
|
+
wanted to use the Win32API library. I thought it would be very handy to
|
92
|
+
have them predefined for me in a library with convenient wrapper methods
|
93
|
+
to boot.
|
94
|
+
|
95
|
+
While it's true that Moonwolf has a library on the RAA that includes many
|
96
|
+
of these functions defined already, there are a few issues with it. First,
|
97
|
+
it puts *every* function and constant in one or two files. That's a waste
|
98
|
+
of memory, hard to organize & maintain, and impossible to test. Second,
|
99
|
+
some of his function declarations are wrong. Third, some of the functions
|
100
|
+
I needed for my own projects are missing. Fourth, there's no gem. Lastly,
|
101
|
+
I haven't seen an update in over 6 years, which leads me to believe it is
|
102
|
+
no longer maintained.
|
103
|
+
|
104
|
+
== Hey, I'm missing function X!
|
105
|
+
I have only defined a small subset of the overall Windows API. It would
|
106
|
+
take me years to define them *all*. I defined the ones I needed first,
|
107
|
+
plus some that I thought would be useful to others. I will continue to
|
108
|
+
add functions in my spare time, or (especially) by request.
|
109
|
+
|
110
|
+
== Bugs
|
111
|
+
None that I'm aware of. Please report any bugs on the project page at
|
112
|
+
http://www.rubyforge.org/projects/win32utils.
|
113
|
+
|
114
|
+
The only real bugs you could find are either bad prototype declarations
|
115
|
+
or bad constant values. Sometimes I forget to wrap functions properly
|
116
|
+
that may not be defined on older Windows platforms. But, please report
|
117
|
+
any of these issues on the project page should you stumble into them.
|
118
|
+
|
119
|
+
== Known Issues
|
120
|
+
In some cases the MSDN docs are wrong, and we have to learn it the hard
|
121
|
+
way. If you should happen to find a documentation bug on their site,
|
122
|
+
please contact them and let them know. They're generally good about fixing
|
123
|
+
them.
|
124
|
+
|
125
|
+
In other cases library functions are not exported by the dll. For example,
|
126
|
+
my version of shlwapi.dll does not export the PathIsHTMLFile() function,
|
127
|
+
despite being well past the minimum version for that DLL. There is nothing
|
128
|
+
you or I can do about it short of rebuilding the DLL file from scratch
|
129
|
+
and/or reporting the issue to Microsoft.
|
130
|
+
|
131
|
+
== Supported Platforms
|
132
|
+
I only support the Windows NT family of Windows, and then only Windows
|
133
|
+
2000 and later.
|
134
|
+
|
135
|
+
== License
|
136
|
+
Artistic 2.0
|
137
|
+
|
138
|
+
== Warranty
|
139
|
+
This package is provided "as is" and without any express or
|
140
|
+
implied warranties, including, without limitation, the implied
|
141
|
+
warranties of merchantability and fitness for a particular purpose.
|
142
|
+
|
143
|
+
== Copyright
|
144
|
+
(C) 2006-2010, Daniel J. Berger
|
145
|
+
All Rights Reserved
|
146
|
+
|
147
|
+
== Author(s)
|
148
|
+
Daniel Berger
|
149
|
+
Park Heesob
|
data/Rakefile
CHANGED
@@ -1,52 +1,52 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'rake/clean'
|
3
|
-
require 'rake/testtask'
|
4
|
-
|
5
|
-
CLEAN << FileList['*.gem']
|
6
|
-
|
7
|
-
namespace 'gem' do
|
8
|
-
desc 'Build the windows-pr gem'
|
9
|
-
task :
|
10
|
-
spec = eval(IO.read('windows-pr.gemspec'))
|
11
|
-
Gem::Builder.new(spec).build
|
12
|
-
end
|
13
|
-
|
14
|
-
desc 'Install the windows-pr gem'
|
15
|
-
task :install => [:
|
16
|
-
file = Dir["*.gem"].first
|
17
|
-
sh "gem install #{file}"
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
namespace 'test' do
|
22
|
-
Rake::TestTask.new('all') do |t|
|
23
|
-
t.warning = true
|
24
|
-
t.test_files = FileList['test/tc*']
|
25
|
-
end
|
26
|
-
|
27
|
-
Rake::TestTask.new('clipboard') do |t|
|
28
|
-
t.warning = true
|
29
|
-
t.verbose = true
|
30
|
-
t.test_files = FileList['test/tc_clipboard.rb']
|
31
|
-
end
|
32
|
-
|
33
|
-
Rake::TestTask.new('synchronize') do |t|
|
34
|
-
t.warning = true
|
35
|
-
t.verbose = true
|
36
|
-
t.test_files = FileList['test/tc_synchronize.rb']
|
37
|
-
end
|
38
|
-
|
39
|
-
Rake::TestTask.new('unicode') do |t|
|
40
|
-
t.warning = true
|
41
|
-
t.verbose = true
|
42
|
-
t.test_files = FileList['test/tc_unicode.rb']
|
43
|
-
end
|
44
|
-
|
45
|
-
Rake::TestTask.new('volume') do |t|
|
46
|
-
t.warning = true
|
47
|
-
t.verbose = true
|
48
|
-
t.test_files = FileList['test/tc_volume.rb']
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
task :default => 'test:all'
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/clean'
|
3
|
+
require 'rake/testtask'
|
4
|
+
|
5
|
+
CLEAN << FileList['*.gem']
|
6
|
+
|
7
|
+
namespace 'gem' do
|
8
|
+
desc 'Build the windows-pr gem'
|
9
|
+
task :create do
|
10
|
+
spec = eval(IO.read('windows-pr.gemspec'))
|
11
|
+
Gem::Builder.new(spec).build
|
12
|
+
end
|
13
|
+
|
14
|
+
desc 'Install the windows-pr gem'
|
15
|
+
task :install => [:create] do
|
16
|
+
file = Dir["*.gem"].first
|
17
|
+
sh "gem install #{file}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
namespace 'test' do
|
22
|
+
Rake::TestTask.new('all') do |t|
|
23
|
+
t.warning = true
|
24
|
+
t.test_files = FileList['test/tc*']
|
25
|
+
end
|
26
|
+
|
27
|
+
Rake::TestTask.new('clipboard') do |t|
|
28
|
+
t.warning = true
|
29
|
+
t.verbose = true
|
30
|
+
t.test_files = FileList['test/tc_clipboard.rb']
|
31
|
+
end
|
32
|
+
|
33
|
+
Rake::TestTask.new('synchronize') do |t|
|
34
|
+
t.warning = true
|
35
|
+
t.verbose = true
|
36
|
+
t.test_files = FileList['test/tc_synchronize.rb']
|
37
|
+
end
|
38
|
+
|
39
|
+
Rake::TestTask.new('unicode') do |t|
|
40
|
+
t.warning = true
|
41
|
+
t.verbose = true
|
42
|
+
t.test_files = FileList['test/tc_unicode.rb']
|
43
|
+
end
|
44
|
+
|
45
|
+
Rake::TestTask.new('volume') do |t|
|
46
|
+
t.warning = true
|
47
|
+
t.verbose = true
|
48
|
+
t.test_files = FileList['test/tc_volume.rb']
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
task :default => 'test:all'
|