windows-pr 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. data/CHANGES +408 -404
  2. data/MANIFEST +65 -65
  3. data/README +149 -149
  4. data/Rakefile +52 -52
  5. data/doc/conversion_guide.txt +37 -37
  6. data/lib/windows/clipboard.rb +59 -59
  7. data/lib/windows/com.rb +190 -189
  8. data/lib/windows/com/automation.rb +147 -147
  9. data/lib/windows/com/variant.rb +22 -22
  10. data/lib/windows/console.rb +112 -112
  11. data/lib/windows/debug.rb +33 -33
  12. data/lib/windows/device_io.rb +246 -246
  13. data/lib/windows/directory.rb +25 -25
  14. data/lib/windows/error.rb +482 -482
  15. data/lib/windows/eventlog.rb +78 -78
  16. data/lib/windows/file.rb +262 -262
  17. data/lib/windows/file_mapping.rb +23 -23
  18. data/lib/windows/filesystem.rb +13 -13
  19. data/lib/windows/gdi/bitmap.rb +63 -63
  20. data/lib/windows/gdi/device_context.rb +44 -44
  21. data/lib/windows/gdi/metafile.rb +38 -38
  22. data/lib/windows/gdi/painting_drawing.rb +113 -113
  23. data/lib/windows/handle.rb +21 -21
  24. data/lib/windows/library.rb +42 -42
  25. data/lib/windows/limits.rb +31 -31
  26. data/lib/windows/mailslot.rb +22 -22
  27. data/lib/windows/memory.rb +126 -126
  28. data/lib/windows/msvcrt/buffer.rb +73 -73
  29. data/lib/windows/msvcrt/directory.rb +29 -29
  30. data/lib/windows/msvcrt/file.rb +45 -45
  31. data/lib/windows/msvcrt/io.rb +71 -71
  32. data/lib/windows/msvcrt/time.rb +167 -167
  33. data/lib/windows/national.rb +578 -578
  34. data/lib/windows/network/management.rb +523 -523
  35. data/lib/windows/network/snmp.rb +90 -90
  36. data/lib/windows/network/winsock.rb +126 -126
  37. data/lib/windows/nio.rb +48 -47
  38. data/lib/windows/ntfs/winternl.rb +96 -96
  39. data/lib/windows/path.rb +141 -141
  40. data/lib/windows/pipe.rb +40 -40
  41. data/lib/windows/process.rb +174 -174
  42. data/lib/windows/registry.rb +126 -126
  43. data/lib/windows/security.rb +477 -477
  44. data/lib/windows/security/authentication.rb +30 -30
  45. data/lib/windows/service.rb +140 -140
  46. data/lib/windows/shell.rb +169 -169
  47. data/lib/windows/sound.rb +37 -37
  48. data/lib/windows/synchronize.rb +131 -131
  49. data/lib/windows/system_info.rb +227 -222
  50. data/lib/windows/thread.rb +62 -62
  51. data/lib/windows/time.rb +46 -46
  52. data/lib/windows/tool_helper.rb +34 -34
  53. data/lib/windows/volume.rb +59 -59
  54. data/lib/windows/window.rb +79 -79
  55. data/lib/windows/window/classes.rb +57 -57
  56. data/lib/windows/window/dialog.rb +89 -89
  57. data/lib/windows/window/menu.rb +100 -100
  58. data/lib/windows/window/message.rb +295 -295
  59. data/lib/windows/window/properties.rb +18 -18
  60. data/lib/windows/window/timer.rb +17 -17
  61. data/test/tc_clipboard.rb +41 -41
  62. data/test/tc_com.rb +32 -32
  63. data/test/tc_com_automation.rb +15 -15
  64. data/test/tc_console.rb +108 -108
  65. data/test/tc_debug.rb +48 -48
  66. data/test/tc_device_io.rb +29 -29
  67. data/test/tc_directory.rb +25 -25
  68. data/test/tc_error.rb +49 -49
  69. data/test/tc_eventlog.rb +58 -58
  70. data/test/tc_file.rb +67 -67
  71. data/test/tc_file_mapping.rb +38 -38
  72. data/test/tc_filesystem.rb +27 -27
  73. data/test/tc_gdi_bitmap.rb +25 -25
  74. data/test/tc_gdi_metafile.rb +23 -23
  75. data/test/tc_handle.rb +36 -36
  76. data/test/tc_library.rb +37 -37
  77. data/test/tc_limits.rb +34 -34
  78. data/test/tc_mailslot.rb +22 -22
  79. data/test/tc_memory.rb +44 -44
  80. data/test/tc_msvcrt_buffer.rb +68 -68
  81. data/test/tc_msvcrt_directory.rb +98 -98
  82. data/test/tc_msvcrt_file.rb +80 -80
  83. data/test/tc_msvcrt_io.rb +48 -48
  84. data/test/tc_msvcrt_string.rb +93 -93
  85. data/test/tc_msvcrt_time.rb +29 -29
  86. data/test/tc_national.rb +38 -38
  87. data/test/tc_network_management.rb +32 -32
  88. data/test/tc_network_snmp.rb +31 -31
  89. data/test/tc_network_winsock.rb +34 -34
  90. data/test/tc_nio.rb +32 -32
  91. data/test/tc_ntfs_winternl.rb +29 -29
  92. data/test/tc_path.rb +90 -90
  93. data/test/tc_pipe.rb +53 -53
  94. data/test/tc_process.rb +24 -24
  95. data/test/tc_registry.rb +29 -29
  96. data/test/tc_security.rb +104 -104
  97. data/test/tc_security_authentication.rb +34 -34
  98. data/test/tc_service.rb +57 -57
  99. data/test/tc_shell.rb +34 -34
  100. data/test/tc_sound.rb +37 -37
  101. data/test/tc_synchronize.rb +75 -75
  102. data/test/tc_system_info.rb +43 -43
  103. data/test/tc_thread.rb +29 -29
  104. data/test/tc_time.rb +32 -32
  105. data/test/tc_tool_helper.rb +29 -29
  106. data/test/tc_volume.rb +47 -47
  107. data/test/tc_window.rb +45 -45
  108. data/test/tc_window_classes.rb +33 -33
  109. data/test/tc_window_dialog.rb +33 -33
  110. data/test/tc_window_menu.rb +29 -29
  111. data/test/tc_window_message.rb +33 -33
  112. data/test/tc_window_properties.rb +29 -29
  113. data/test/tc_window_timer.rb +29 -29
  114. data/windows-pr.gemspec +34 -34
  115. metadata +4 -4
data/test/tc_thread.rb CHANGED
@@ -1,29 +1,29 @@
1
- #####################################################################
2
- # tc_thread.rb
3
- #
4
- # Test case for the Windows::Thread module.
5
- #####################################################################
6
- require 'windows/thread'
7
- require 'test/unit'
8
-
9
- class ThreadFoo
10
- include Windows::Thread
11
- end
12
-
13
- class TC_Windows_Thread < Test::Unit::TestCase
14
- def setup
15
- @foo = ThreadFoo.new
16
- end
17
-
18
- def test_numeric_constants
19
- assert_equal(0x00100000, ThreadFoo::SYNCHRONIZE)
20
- end
21
-
22
- def test_method_constants
23
- assert_not_nil(ThreadFoo::CreateThread)
24
- end
25
-
26
- def teardown
27
- @foo = nil
28
- end
29
- end
1
+ #####################################################################
2
+ # tc_thread.rb
3
+ #
4
+ # Test case for the Windows::Thread module.
5
+ #####################################################################
6
+ require 'windows/thread'
7
+ require 'test/unit'
8
+
9
+ class ThreadFoo
10
+ include Windows::Thread
11
+ end
12
+
13
+ class TC_Windows_Thread < Test::Unit::TestCase
14
+ def setup
15
+ @foo = ThreadFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(0x00100000, ThreadFoo::SYNCHRONIZE)
20
+ end
21
+
22
+ def test_method_constants
23
+ assert_not_nil(ThreadFoo::CreateThread)
24
+ end
25
+
26
+ def teardown
27
+ @foo = nil
28
+ end
29
+ end
data/test/tc_time.rb CHANGED
@@ -1,32 +1,32 @@
1
- #####################################################################
2
- # tc_time.rb
3
- #
4
- # Test case for the Windows::Time module.
5
- #####################################################################
6
- require 'windows/time'
7
- require 'test/unit'
8
-
9
- class TimeFoo
10
- include Windows::Time
11
- end
12
-
13
- class TC_Windows_Time < Test::Unit::TestCase
14
- def setup
15
- @foo = TimeFoo.new
16
- end
17
-
18
- def test_numeric_constants
19
- assert_equal(0, TimeFoo::TIME_ZONE_ID_UNKNOWN)
20
- assert_equal(1, TimeFoo::TIME_ZONE_ID_STANDARD)
21
- assert_equal(2, TimeFoo::TIME_ZONE_ID_DAYLIGHT)
22
- end
23
-
24
- def test_method_constants
25
- assert_not_nil(TimeFoo::CompareFileTime)
26
- assert_not_nil(TimeFoo::GetLocalTime)
27
- end
28
-
29
- def teardown
30
- @foo = nil
31
- end
32
- end
1
+ #####################################################################
2
+ # tc_time.rb
3
+ #
4
+ # Test case for the Windows::Time module.
5
+ #####################################################################
6
+ require 'windows/time'
7
+ require 'test/unit'
8
+
9
+ class TimeFoo
10
+ include Windows::Time
11
+ end
12
+
13
+ class TC_Windows_Time < Test::Unit::TestCase
14
+ def setup
15
+ @foo = TimeFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(0, TimeFoo::TIME_ZONE_ID_UNKNOWN)
20
+ assert_equal(1, TimeFoo::TIME_ZONE_ID_STANDARD)
21
+ assert_equal(2, TimeFoo::TIME_ZONE_ID_DAYLIGHT)
22
+ end
23
+
24
+ def test_method_constants
25
+ assert_not_nil(TimeFoo::CompareFileTime)
26
+ assert_not_nil(TimeFoo::GetLocalTime)
27
+ end
28
+
29
+ def teardown
30
+ @foo = nil
31
+ end
32
+ end
@@ -1,29 +1,29 @@
1
- #####################################################################
2
- # tc_tool_helper.rb
3
- #
4
- # Test case for the Windows::ToolHelper module.
5
- #####################################################################
6
- require 'windows/tool_helper'
7
- require 'test/unit'
8
-
9
- class ToolHelperFoo
10
- include Windows::ToolHelper
11
- end
12
-
13
- class TC_Windows_ToolHelper < Test::Unit::TestCase
14
- def setup
15
- @foo = ToolHelperFoo.new
16
- end
17
-
18
- def test_numeric_constants
19
- assert_equal(0x00000001, ToolHelperFoo::TH32CS_SNAPHEAPLIST)
20
- end
21
-
22
- def test_method_constants
23
- assert_not_nil(ToolHelperFoo::Process32First)
24
- end
25
-
26
- def teardown
27
- @foo = nil
28
- end
29
- end
1
+ #####################################################################
2
+ # tc_tool_helper.rb
3
+ #
4
+ # Test case for the Windows::ToolHelper module.
5
+ #####################################################################
6
+ require 'windows/tool_helper'
7
+ require 'test/unit'
8
+
9
+ class ToolHelperFoo
10
+ include Windows::ToolHelper
11
+ end
12
+
13
+ class TC_Windows_ToolHelper < Test::Unit::TestCase
14
+ def setup
15
+ @foo = ToolHelperFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(0x00000001, ToolHelperFoo::TH32CS_SNAPHEAPLIST)
20
+ end
21
+
22
+ def test_method_constants
23
+ assert_not_nil(ToolHelperFoo::Process32First)
24
+ end
25
+
26
+ def teardown
27
+ @foo = nil
28
+ end
29
+ end
data/test/tc_volume.rb CHANGED
@@ -1,47 +1,47 @@
1
- #####################################################################
2
- # tc_volume.rb
3
- #
4
- # Test case for the Windows::Volume module.
5
- #####################################################################
6
- require 'windows/volume'
7
- require 'test/unit'
8
-
9
- class TC_Windows_Volume < Test::Unit::TestCase
10
- include Windows::Volume
11
-
12
- def test_constants
13
- assert_equal(0, DRIVE_UNKNOWN)
14
- assert_equal(1, DRIVE_NO_ROOT_DIR)
15
- assert_equal(2, DRIVE_REMOVABLE)
16
- assert_equal(3, DRIVE_FIXED)
17
- assert_equal(4, DRIVE_REMOTE)
18
- assert_equal(5, DRIVE_CDROM)
19
- assert_equal(6, DRIVE_RAMDISK)
20
- end
21
-
22
- def test_method_constants
23
- assert_not_nil(DefineDosDevice)
24
- assert_not_nil(DeleteVolumeMountPoint)
25
- assert_not_nil(FindFirstVolume)
26
- assert_not_nil(FindFirstVolumeMountPoint)
27
- assert_not_nil(FindNextVolume)
28
- assert_not_nil(FindNextVolumeMountPoint)
29
- assert_not_nil(FindVolumeClose)
30
- assert_not_nil(FindVolumeMountPointClose)
31
- assert_not_nil(GetDriveType)
32
- assert_not_nil(GetLogicalDrives)
33
- assert_not_nil(GetLogicalDriveStrings)
34
- assert_not_nil(GetVolumeInformation)
35
- assert_not_nil(GetVolumeNameForVolumeMountPoint)
36
- assert_not_nil(GetVolumePathName)
37
- assert_not_nil(QueryDosDevice)
38
- assert_not_nil(SetVolumeLabel)
39
- assert_not_nil(SetVolumeMountPoint)
40
- end
41
-
42
- def test_get_volume_type
43
- assert_respond_to(self, :get_volume_type)
44
- assert_nothing_raised{ get_volume_type }
45
- assert_kind_of(String, get_volume_type)
46
- end
47
- end
1
+ #####################################################################
2
+ # tc_volume.rb
3
+ #
4
+ # Test case for the Windows::Volume module.
5
+ #####################################################################
6
+ require 'windows/volume'
7
+ require 'test/unit'
8
+
9
+ class TC_Windows_Volume < Test::Unit::TestCase
10
+ include Windows::Volume
11
+
12
+ def test_constants
13
+ assert_equal(0, DRIVE_UNKNOWN)
14
+ assert_equal(1, DRIVE_NO_ROOT_DIR)
15
+ assert_equal(2, DRIVE_REMOVABLE)
16
+ assert_equal(3, DRIVE_FIXED)
17
+ assert_equal(4, DRIVE_REMOTE)
18
+ assert_equal(5, DRIVE_CDROM)
19
+ assert_equal(6, DRIVE_RAMDISK)
20
+ end
21
+
22
+ def test_method_constants
23
+ assert_not_nil(DefineDosDevice)
24
+ assert_not_nil(DeleteVolumeMountPoint)
25
+ assert_not_nil(FindFirstVolume)
26
+ assert_not_nil(FindFirstVolumeMountPoint)
27
+ assert_not_nil(FindNextVolume)
28
+ assert_not_nil(FindNextVolumeMountPoint)
29
+ assert_not_nil(FindVolumeClose)
30
+ assert_not_nil(FindVolumeMountPointClose)
31
+ assert_not_nil(GetDriveType)
32
+ assert_not_nil(GetLogicalDrives)
33
+ assert_not_nil(GetLogicalDriveStrings)
34
+ assert_not_nil(GetVolumeInformation)
35
+ assert_not_nil(GetVolumeNameForVolumeMountPoint)
36
+ assert_not_nil(GetVolumePathName)
37
+ assert_not_nil(QueryDosDevice)
38
+ assert_not_nil(SetVolumeLabel)
39
+ assert_not_nil(SetVolumeMountPoint)
40
+ end
41
+
42
+ def test_get_volume_type
43
+ assert_respond_to(self, :get_volume_type)
44
+ assert_nothing_raised{ get_volume_type }
45
+ assert_kind_of(String, get_volume_type)
46
+ end
47
+ end
data/test/tc_window.rb CHANGED
@@ -1,45 +1,45 @@
1
- #####################################################################
2
- # tc_window.rb
3
- #
4
- # Test case for the Windows::Window module.
5
- #####################################################################
6
- require 'windows/window'
7
- require 'test/unit'
8
-
9
- class WindowFoo
10
- include Windows::Window
11
- end
12
-
13
- class TC_Windows_Window < Test::Unit::TestCase
14
- def setup
15
- @foo = WindowFoo.new
16
- end
17
-
18
- def test_numeric_constants
19
- assert_equal(0, WindowFoo::SW_HIDE)
20
- assert_equal(1, WindowFoo::SW_SHOWNORMAL)
21
- assert_equal(1, WindowFoo::SW_NORMAL)
22
- assert_equal(2, WindowFoo::SW_SHOWMINIMIZED)
23
- assert_equal(3, WindowFoo::SW_SHOWMAXIMIZED)
24
- assert_equal(3, WindowFoo::SW_MAXIMIZE)
25
- assert_equal(4, WindowFoo::SW_SHOWNOACTIVATE)
26
- assert_equal(5, WindowFoo::SW_SHOW)
27
- assert_equal(6, WindowFoo::SW_MINIMIZE)
28
- assert_equal(7, WindowFoo::SW_SHOWMINNOACTIVE)
29
- assert_equal(8, WindowFoo::SW_SHOWNA)
30
- assert_equal(9, WindowFoo::SW_RESTORE)
31
- assert_equal(10, WindowFoo::SW_SHOWDEFAULT)
32
- assert_equal(11, WindowFoo::SW_FORCEMINIMIZE)
33
- assert_equal(11, WindowFoo::SW_MAX)
34
- end
35
-
36
- def test_method_constants
37
- assert_not_nil(WindowFoo::GetClientRect)
38
- assert_not_nil(WindowFoo::GetForegroundWindow)
39
- assert_not_nil(WindowFoo::GetWindowRect)
40
- end
41
-
42
- def teardown
43
- @foo = nil
44
- end
45
- end
1
+ #####################################################################
2
+ # tc_window.rb
3
+ #
4
+ # Test case for the Windows::Window module.
5
+ #####################################################################
6
+ require 'windows/window'
7
+ require 'test/unit'
8
+
9
+ class WindowFoo
10
+ include Windows::Window
11
+ end
12
+
13
+ class TC_Windows_Window < Test::Unit::TestCase
14
+ def setup
15
+ @foo = WindowFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(0, WindowFoo::SW_HIDE)
20
+ assert_equal(1, WindowFoo::SW_SHOWNORMAL)
21
+ assert_equal(1, WindowFoo::SW_NORMAL)
22
+ assert_equal(2, WindowFoo::SW_SHOWMINIMIZED)
23
+ assert_equal(3, WindowFoo::SW_SHOWMAXIMIZED)
24
+ assert_equal(3, WindowFoo::SW_MAXIMIZE)
25
+ assert_equal(4, WindowFoo::SW_SHOWNOACTIVATE)
26
+ assert_equal(5, WindowFoo::SW_SHOW)
27
+ assert_equal(6, WindowFoo::SW_MINIMIZE)
28
+ assert_equal(7, WindowFoo::SW_SHOWMINNOACTIVE)
29
+ assert_equal(8, WindowFoo::SW_SHOWNA)
30
+ assert_equal(9, WindowFoo::SW_RESTORE)
31
+ assert_equal(10, WindowFoo::SW_SHOWDEFAULT)
32
+ assert_equal(11, WindowFoo::SW_FORCEMINIMIZE)
33
+ assert_equal(11, WindowFoo::SW_MAX)
34
+ end
35
+
36
+ def test_method_constants
37
+ assert_not_nil(WindowFoo::GetClientRect)
38
+ assert_not_nil(WindowFoo::GetForegroundWindow)
39
+ assert_not_nil(WindowFoo::GetWindowRect)
40
+ end
41
+
42
+ def teardown
43
+ @foo = nil
44
+ end
45
+ end
@@ -1,33 +1,33 @@
1
- #####################################################################
2
- # tc_window_classes.rb
3
- #
4
- # Test case for the Windows::Window::Classes module.
5
- #####################################################################
6
- require 'windows/window/classes'
7
- require 'test/unit'
8
-
9
- class WindowClassesFoo
10
- include Windows::Window::Classes
11
- end
12
-
13
- class TC_Windows_Window_Classes < Test::Unit::TestCase
14
- def setup
15
- @foo = WindowClassesFoo.new
16
- end
17
-
18
- def test_numeric_constants
19
- assert_equal(-8, WindowClassesFoo::GCL_MENUNAME)
20
- end
21
-
22
- def test_method_constants
23
- assert_not_nil(WindowClassesFoo::GetClassInfo)
24
- end
25
-
26
- def test_method_mixin
27
- assert_respond_to(@foo, :GetClassInfo)
28
- end
29
-
30
- def teardown
31
- @foo = nil
32
- end
33
- end
1
+ #####################################################################
2
+ # tc_window_classes.rb
3
+ #
4
+ # Test case for the Windows::Window::Classes module.
5
+ #####################################################################
6
+ require 'windows/window/classes'
7
+ require 'test/unit'
8
+
9
+ class WindowClassesFoo
10
+ include Windows::Window::Classes
11
+ end
12
+
13
+ class TC_Windows_Window_Classes < Test::Unit::TestCase
14
+ def setup
15
+ @foo = WindowClassesFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(-8, WindowClassesFoo::GCL_MENUNAME)
20
+ end
21
+
22
+ def test_method_constants
23
+ assert_not_nil(WindowClassesFoo::GetClassInfo)
24
+ end
25
+
26
+ def test_method_mixin
27
+ assert_respond_to(@foo, :GetClassInfo)
28
+ end
29
+
30
+ def teardown
31
+ @foo = nil
32
+ end
33
+ end
@@ -1,33 +1,33 @@
1
- #####################################################################
2
- # tc_window_dialog.rb
3
- #
4
- # Test case for the Windows::Window::Dialog module.
5
- #####################################################################
6
- require 'windows/window/dialog'
7
- require 'test/unit'
8
-
9
- class WindowDialogFoo
10
- include Windows::Window::Dialog
11
- end
12
-
13
- class TC_Windows_Window_Dialog < Test::Unit::TestCase
14
- def setup
15
- @foo = WindowDialogFoo.new
16
- end
17
-
18
- def test_numeric_constants
19
- assert_equal(0, WindowDialogFoo::MB_OK)
20
- end
21
-
22
- def test_method_constants
23
- assert_not_nil(WindowDialogFoo::MessageBox)
24
- end
25
-
26
- def test_method_mixin
27
- assert_respond_to(@foo, :MessageBox)
28
- end
29
-
30
- def teardown
31
- @foo = nil
32
- end
33
- end
1
+ #####################################################################
2
+ # tc_window_dialog.rb
3
+ #
4
+ # Test case for the Windows::Window::Dialog module.
5
+ #####################################################################
6
+ require 'windows/window/dialog'
7
+ require 'test/unit'
8
+
9
+ class WindowDialogFoo
10
+ include Windows::Window::Dialog
11
+ end
12
+
13
+ class TC_Windows_Window_Dialog < Test::Unit::TestCase
14
+ def setup
15
+ @foo = WindowDialogFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(0, WindowDialogFoo::MB_OK)
20
+ end
21
+
22
+ def test_method_constants
23
+ assert_not_nil(WindowDialogFoo::MessageBox)
24
+ end
25
+
26
+ def test_method_mixin
27
+ assert_respond_to(@foo, :MessageBox)
28
+ end
29
+
30
+ def teardown
31
+ @foo = nil
32
+ end
33
+ end