windows-pr 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES +444 -438
  3. data/MANIFEST +68 -65
  4. data/README +154 -153
  5. data/Rakefile +42 -37
  6. data/doc/conversion_guide.txt +37 -37
  7. data/lib/windows/clipboard.rb +61 -61
  8. data/lib/windows/com.rb +192 -192
  9. data/lib/windows/com/accessibility.rb +16 -16
  10. data/lib/windows/com/automation.rb +149 -149
  11. data/lib/windows/com/variant.rb +24 -24
  12. data/lib/windows/console.rb +114 -114
  13. data/lib/windows/debug.rb +35 -35
  14. data/lib/windows/device_io.rb +248 -248
  15. data/lib/windows/directory.rb +27 -27
  16. data/lib/windows/error.rb +504 -498
  17. data/lib/windows/eventlog.rb +80 -80
  18. data/lib/windows/file.rb +264 -264
  19. data/lib/windows/file_mapping.rb +25 -25
  20. data/lib/windows/filesystem.rb +15 -15
  21. data/lib/windows/gdi/bitmap.rb +65 -65
  22. data/lib/windows/gdi/device_context.rb +46 -46
  23. data/lib/windows/gdi/metafile.rb +40 -40
  24. data/lib/windows/gdi/painting_drawing.rb +115 -115
  25. data/lib/windows/handle.rb +23 -23
  26. data/lib/windows/library.rb +44 -44
  27. data/lib/windows/limits.rb +34 -34
  28. data/lib/windows/mailslot.rb +24 -24
  29. data/lib/windows/memory.rb +128 -128
  30. data/lib/windows/msvcrt/buffer.rb +75 -75
  31. data/lib/windows/msvcrt/directory.rb +31 -31
  32. data/lib/windows/msvcrt/file.rb +47 -47
  33. data/lib/windows/msvcrt/io.rb +73 -73
  34. data/lib/windows/msvcrt/string.rb +182 -182
  35. data/lib/windows/msvcrt/time.rb +169 -169
  36. data/lib/windows/national.rb +580 -580
  37. data/lib/windows/network/management.rb +525 -525
  38. data/lib/windows/network/snmp.rb +92 -92
  39. data/lib/windows/network/winsock.rb +128 -128
  40. data/lib/windows/nio.rb +50 -50
  41. data/lib/windows/ntfs/winternl.rb +117 -117
  42. data/lib/windows/path.rb +143 -143
  43. data/lib/windows/pipe.rb +42 -42
  44. data/lib/windows/process.rb +176 -176
  45. data/lib/windows/registry.rb +171 -171
  46. data/lib/windows/security.rb +479 -479
  47. data/lib/windows/security/authentication.rb +32 -32
  48. data/lib/windows/security/sspi.rb +153 -0
  49. data/lib/windows/service.rb +142 -142
  50. data/lib/windows/shell.rb +171 -171
  51. data/lib/windows/socket.rb +86 -86
  52. data/lib/windows/sound.rb +39 -39
  53. data/lib/windows/synchronize.rb +133 -133
  54. data/lib/windows/system_info.rb +229 -229
  55. data/lib/windows/thread.rb +64 -64
  56. data/lib/windows/time.rb +48 -48
  57. data/lib/windows/tool_helper.rb +36 -36
  58. data/lib/windows/unicode.rb +155 -155
  59. data/lib/windows/volume.rb +61 -61
  60. data/lib/windows/window.rb +81 -81
  61. data/lib/windows/window/classes.rb +59 -59
  62. data/lib/windows/window/dialog.rb +91 -91
  63. data/lib/windows/window/menu.rb +102 -102
  64. data/lib/windows/window/message.rb +297 -297
  65. data/lib/windows/window/properties.rb +20 -20
  66. data/lib/windows/window/timer.rb +19 -19
  67. data/lib/windows/wsa.rb +102 -102
  68. data/test/tc_clipboard.rb +41 -41
  69. data/test/tc_com.rb +32 -32
  70. data/test/tc_com_automation.rb +15 -15
  71. data/test/tc_console.rb +108 -108
  72. data/test/tc_debug.rb +48 -48
  73. data/test/tc_device_io.rb +29 -29
  74. data/test/tc_directory.rb +25 -25
  75. data/test/tc_error.rb +38 -38
  76. data/test/tc_eventlog.rb +58 -58
  77. data/test/tc_file.rb +67 -67
  78. data/test/tc_file_mapping.rb +38 -38
  79. data/test/tc_filesystem.rb +27 -27
  80. data/test/tc_gdi_bitmap.rb +25 -25
  81. data/test/tc_gdi_metafile.rb +23 -23
  82. data/test/tc_handle.rb +36 -36
  83. data/test/tc_library.rb +37 -37
  84. data/test/tc_limits.rb +34 -34
  85. data/test/tc_mailslot.rb +22 -22
  86. data/test/tc_memory.rb +44 -44
  87. data/test/tc_msvcrt_buffer.rb +63 -63
  88. data/test/tc_msvcrt_directory.rb +96 -96
  89. data/test/tc_msvcrt_file.rb +80 -80
  90. data/test/tc_msvcrt_io.rb +48 -48
  91. data/test/tc_msvcrt_string.rb +94 -94
  92. data/test/tc_msvcrt_time.rb +19 -19
  93. data/test/tc_national.rb +38 -38
  94. data/test/tc_network_management.rb +32 -32
  95. data/test/tc_network_snmp.rb +31 -31
  96. data/test/tc_network_winsock.rb +34 -34
  97. data/test/tc_nio.rb +32 -32
  98. data/test/tc_ntfs_winternl.rb +48 -48
  99. data/test/tc_path.rb +90 -90
  100. data/test/tc_pipe.rb +53 -53
  101. data/test/tc_process.rb +24 -24
  102. data/test/tc_registry.rb +29 -29
  103. data/test/tc_security.rb +104 -104
  104. data/test/tc_security_authentication.rb +34 -34
  105. data/test/tc_security_sspi.rb +23 -0
  106. data/test/tc_service.rb +57 -57
  107. data/test/tc_shell.rb +34 -34
  108. data/test/tc_socket.rb +20 -20
  109. data/test/tc_sound.rb +37 -37
  110. data/test/tc_synchronize.rb +75 -75
  111. data/test/tc_system_info.rb +33 -33
  112. data/test/tc_thread.rb +29 -29
  113. data/test/tc_time.rb +32 -32
  114. data/test/tc_tool_helper.rb +29 -29
  115. data/test/tc_unicode.rb +83 -83
  116. data/test/tc_volume.rb +47 -47
  117. data/test/tc_window.rb +45 -45
  118. data/test/tc_window_classes.rb +33 -33
  119. data/test/tc_window_dialog.rb +33 -33
  120. data/test/tc_window_menu.rb +29 -29
  121. data/test/tc_window_message.rb +33 -33
  122. data/test/tc_window_properties.rb +29 -29
  123. data/test/tc_window_timer.rb +29 -29
  124. data/test/tc_wsa.rb +19 -19
  125. data/windows-pr.gemspec +33 -34
  126. metadata +31 -32
@@ -1,19 +1,19 @@
1
- #####################################################################
2
- # tc_msvcrt_time.rb
3
- #
4
- # Test case for the Windows::MSVCRT::Time module.
5
- #####################################################################
6
- require 'windows/msvcrt/time'
7
- require 'test/unit'
8
-
9
- class TC_Windows_MSVCRT_Time < Test::Unit::TestCase
10
- include Windows::MSVCRT::Time
11
-
12
- def test_method_constants
13
- assert_not_nil(Asctime)
14
- end
15
-
16
- def test_asctime
17
- assert(self.respond_to?(:asctime, true))
18
- end
19
- end
1
+ #####################################################################
2
+ # tc_msvcrt_time.rb
3
+ #
4
+ # Test case for the Windows::MSVCRT::Time module.
5
+ #####################################################################
6
+ require 'windows/msvcrt/time'
7
+ require 'test/unit'
8
+
9
+ class TC_Windows_MSVCRT_Time < Test::Unit::TestCase
10
+ include Windows::MSVCRT::Time
11
+
12
+ def test_method_constants
13
+ assert_not_nil(Asctime)
14
+ end
15
+
16
+ def test_asctime
17
+ assert(self.respond_to?(:asctime, true))
18
+ end
19
+ end
@@ -1,38 +1,38 @@
1
- #####################################################################
2
- # tc_national.rb
3
- #
4
- # Test case for the Windows::National module.
5
- #####################################################################
6
- require 'windows/national'
7
- require 'test/unit'
8
-
9
- class NationalFoo
10
- include Windows::National
11
- end
12
-
13
- class TC_Windows_National < Test::Unit::TestCase
14
- def setup
15
- @foo = NationalFoo.new
16
- end
17
-
18
- def test_numeric_constants
19
- assert_equal(2048, NationalFoo::LANG_SYSTEM_DEFAULT)
20
- assert_equal(1024, NationalFoo::LANG_USER_DEFAULT)
21
- assert_equal(2048, NationalFoo::LOCALE_SYSTEM_DEFAULT)
22
- assert_equal(1024, NationalFoo::LOCALE_USER_DEFAULT)
23
- assert_equal(8323072, NationalFoo::LOCALE_INVARIANT)
24
- end
25
-
26
- def test_method_constants
27
- assert_not_nil(NationalFoo::GetACP)
28
- assert_not_nil(NationalFoo::GetDateFormat)
29
- assert_not_nil(NationalFoo::GetLocaleInfo)
30
- assert_not_nil(NationalFoo::GetSystemDefaultLangID)
31
- assert_not_nil(NationalFoo::GetUserDefaultLangID)
32
- assert_not_nil(NationalFoo::GetUserDefaultLCID)
33
- end
34
-
35
- def teardown
36
- @foo = nil
37
- end
38
- end
1
+ #####################################################################
2
+ # tc_national.rb
3
+ #
4
+ # Test case for the Windows::National module.
5
+ #####################################################################
6
+ require 'windows/national'
7
+ require 'test/unit'
8
+
9
+ class NationalFoo
10
+ include Windows::National
11
+ end
12
+
13
+ class TC_Windows_National < Test::Unit::TestCase
14
+ def setup
15
+ @foo = NationalFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(2048, NationalFoo::LANG_SYSTEM_DEFAULT)
20
+ assert_equal(1024, NationalFoo::LANG_USER_DEFAULT)
21
+ assert_equal(2048, NationalFoo::LOCALE_SYSTEM_DEFAULT)
22
+ assert_equal(1024, NationalFoo::LOCALE_USER_DEFAULT)
23
+ assert_equal(8323072, NationalFoo::LOCALE_INVARIANT)
24
+ end
25
+
26
+ def test_method_constants
27
+ assert_not_nil(NationalFoo::GetACP)
28
+ assert_not_nil(NationalFoo::GetDateFormat)
29
+ assert_not_nil(NationalFoo::GetLocaleInfo)
30
+ assert_not_nil(NationalFoo::GetSystemDefaultLangID)
31
+ assert_not_nil(NationalFoo::GetUserDefaultLangID)
32
+ assert_not_nil(NationalFoo::GetUserDefaultLCID)
33
+ end
34
+
35
+ def teardown
36
+ @foo = nil
37
+ end
38
+ end
@@ -1,32 +1,32 @@
1
- #####################################################################
2
- # tc_network_management.rb
3
- #
4
- # Test case for the Windows::NetworkManagement module.
5
- #####################################################################
6
- require 'windows/network/management'
7
- require 'test/unit'
8
-
9
- class NetworkManagementFoo
10
- include Windows::Network::Management
11
- end
12
-
13
- class TC_Windows_Network_Management < Test::Unit::TestCase
14
- def setup
15
- @foo = NetworkManagementFoo.new
16
- end
17
-
18
- def test_numeric_constants
19
- assert_equal(0, NetworkManagementFoo::NERR_Success)
20
- assert_equal(0xFFFFFFFF, NetworkManagementFoo::MAX_PREFERRED_LENGTH)
21
- assert_equal(0x00000001, NetworkManagementFoo::SV_TYPE_WORKSTATION)
22
- end
23
-
24
- def test_method_constants
25
- assert_not_nil(NetworkManagementFoo::NetAlertRaise)
26
- assert_not_nil(NetworkManagementFoo::NetAlertRaiseEx)
27
- end
28
-
29
- def teardown
30
- @foo = nil
31
- end
32
- end
1
+ #####################################################################
2
+ # tc_network_management.rb
3
+ #
4
+ # Test case for the Windows::NetworkManagement module.
5
+ #####################################################################
6
+ require 'windows/network/management'
7
+ require 'test/unit'
8
+
9
+ class NetworkManagementFoo
10
+ include Windows::Network::Management
11
+ end
12
+
13
+ class TC_Windows_Network_Management < Test::Unit::TestCase
14
+ def setup
15
+ @foo = NetworkManagementFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(0, NetworkManagementFoo::NERR_Success)
20
+ assert_equal(0xFFFFFFFF, NetworkManagementFoo::MAX_PREFERRED_LENGTH)
21
+ assert_equal(0x00000001, NetworkManagementFoo::SV_TYPE_WORKSTATION)
22
+ end
23
+
24
+ def test_method_constants
25
+ assert_not_nil(NetworkManagementFoo::NetAlertRaise)
26
+ assert_not_nil(NetworkManagementFoo::NetAlertRaiseEx)
27
+ end
28
+
29
+ def teardown
30
+ @foo = nil
31
+ end
32
+ end
@@ -1,31 +1,31 @@
1
- #####################################################################
2
- # tc_network_snmp.rb
3
- #
4
- # Test case for the Windows::NetworkSNMP module.
5
- #####################################################################
6
- require 'windows/network/snmp'
7
- require 'test/unit'
8
-
9
- class NetworkSNMPFoo
10
- include Windows::Network::SNMP
11
- end
12
-
13
- class TC_Windows_Network_SNMP < Test::Unit::TestCase
14
- def setup
15
- @foo = NetworkSNMPFoo.new
16
- end
17
-
18
- def test_numeric_constants
19
- assert_equal(0, NetworkSNMPFoo::SNMPAPI_FAILURE)
20
- assert_equal(1, NetworkSNMPFoo::SNMPAPI_SUCCESS)
21
- end
22
-
23
- def test_method_constants
24
- assert_not_nil(NetworkSNMPFoo::SnmpCleanup)
25
- assert_not_nil(NetworkSNMPFoo::SnmpClose)
26
- end
27
-
28
- def teardown
29
- @foo = nil
30
- end
31
- end
1
+ #####################################################################
2
+ # tc_network_snmp.rb
3
+ #
4
+ # Test case for the Windows::NetworkSNMP module.
5
+ #####################################################################
6
+ require 'windows/network/snmp'
7
+ require 'test/unit'
8
+
9
+ class NetworkSNMPFoo
10
+ include Windows::Network::SNMP
11
+ end
12
+
13
+ class TC_Windows_Network_SNMP < Test::Unit::TestCase
14
+ def setup
15
+ @foo = NetworkSNMPFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(0, NetworkSNMPFoo::SNMPAPI_FAILURE)
20
+ assert_equal(1, NetworkSNMPFoo::SNMPAPI_SUCCESS)
21
+ end
22
+
23
+ def test_method_constants
24
+ assert_not_nil(NetworkSNMPFoo::SnmpCleanup)
25
+ assert_not_nil(NetworkSNMPFoo::SnmpClose)
26
+ end
27
+
28
+ def teardown
29
+ @foo = nil
30
+ end
31
+ end
@@ -1,34 +1,34 @@
1
- #####################################################################
2
- # tc_network_winsock.rb
3
- #
4
- # Test case for the Windows::Winsock module.
5
- #####################################################################
6
- require 'windows/network/winsock'
7
- require 'test/unit'
8
-
9
- class WinsockFoo
10
- include Windows::Network::Winsock
11
- end
12
-
13
- class TC_Windows_Network_Winsock < Test::Unit::TestCase
14
- def setup
15
- @foo = WinsockFoo.new
16
- end
17
-
18
- def test_numeric_constants
19
- assert_equal(0, WinsockFoo::NS_DEFAULT)
20
- end
21
-
22
- def test_method_constants
23
- assert_not_nil(WinsockFoo::GetTypeByName)
24
- end
25
-
26
- def test_method_mixins
27
- assert_respond_to(@foo, :gethostbyname)
28
- assert_respond_to(@foo, :GetTypeByName)
29
- end
30
-
31
- def teardown
32
- @foo = nil
33
- end
34
- end
1
+ #####################################################################
2
+ # tc_network_winsock.rb
3
+ #
4
+ # Test case for the Windows::Winsock module.
5
+ #####################################################################
6
+ require 'windows/network/winsock'
7
+ require 'test/unit'
8
+
9
+ class WinsockFoo
10
+ include Windows::Network::Winsock
11
+ end
12
+
13
+ class TC_Windows_Network_Winsock < Test::Unit::TestCase
14
+ def setup
15
+ @foo = WinsockFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(0, WinsockFoo::NS_DEFAULT)
20
+ end
21
+
22
+ def test_method_constants
23
+ assert_not_nil(WinsockFoo::GetTypeByName)
24
+ end
25
+
26
+ def test_method_mixins
27
+ assert_respond_to(@foo, :gethostbyname)
28
+ assert_respond_to(@foo, :GetTypeByName)
29
+ end
30
+
31
+ def teardown
32
+ @foo = nil
33
+ end
34
+ end
@@ -1,32 +1,32 @@
1
- #####################################################################
2
- # tc_nio.rb
3
- #
4
- # Test case for the Windows::NIO module.
5
- #####################################################################
6
- require 'windows/nio'
7
- require 'test/unit'
8
-
9
- class NIOFoo
10
- include Windows::NIO
11
- end
12
-
13
- class TC_Windows_NIO < Test::Unit::TestCase
14
- def setup
15
- @foo = NIOFoo.new
16
- end
17
-
18
- def test_numeric_constants
19
- assert_equal(0, NIOFoo::OF_READ)
20
- assert_equal(1, NIOFoo::OF_WRITE)
21
- assert_equal(2, NIOFoo::OF_READWRITE)
22
- end
23
-
24
- def test_method_constants
25
- assert_not_nil(NIOFoo::CancelIo)
26
- assert_not_nil(NIOFoo::ReadFileScatter)
27
- end
28
-
29
- def teardown
30
- @foo = nil
31
- end
32
- end
1
+ #####################################################################
2
+ # tc_nio.rb
3
+ #
4
+ # Test case for the Windows::NIO module.
5
+ #####################################################################
6
+ require 'windows/nio'
7
+ require 'test/unit'
8
+
9
+ class NIOFoo
10
+ include Windows::NIO
11
+ end
12
+
13
+ class TC_Windows_NIO < Test::Unit::TestCase
14
+ def setup
15
+ @foo = NIOFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(0, NIOFoo::OF_READ)
20
+ assert_equal(1, NIOFoo::OF_WRITE)
21
+ assert_equal(2, NIOFoo::OF_READWRITE)
22
+ end
23
+
24
+ def test_method_constants
25
+ assert_not_nil(NIOFoo::CancelIo)
26
+ assert_not_nil(NIOFoo::ReadFileScatter)
27
+ end
28
+
29
+ def teardown
30
+ @foo = nil
31
+ end
32
+ end
@@ -1,48 +1,48 @@
1
- #####################################################################
2
- # test_ntfs_winternl.rb
3
- #
4
- # Test case for the Windows::NTFS::Winternl module.
5
- #####################################################################
6
- require 'windows/handle'
7
- require 'windows/ntfs/winternl'
8
- require 'windows/error'
9
- require 'test/unit'
10
-
11
- class TC_Windows_NTFS_Winternl < Test::Unit::TestCase
12
- include Windows::Handle
13
- include Windows::NTFS::Winternl
14
- include Windows::Error
15
-
16
- def setup
17
- @name = "winternl_test.txt"
18
- @handle = File.open(@name, 'w')
19
- end
20
-
21
- def test_numeric_constants
22
- assert_equal(8, FileAccessInformation)
23
- end
24
-
25
- def test_methods_defined
26
- assert(self.respond_to?(:NtQueryInformationFile, true))
27
- end
28
-
29
- def test_get_final_path_name_by_handle
30
- assert(self.respond_to?(:GetFinalPathNameByHandle, true))
31
- end
32
-
33
- def test_get_final_path_name_by_handle_returns_expected_result
34
- buf = 0.chr * 260
35
- res = nil
36
- hdl = get_osfhandle(@handle.fileno)
37
-
38
- assert_nothing_raised{ res = GetFinalPathNameByHandle(hdl, buf, buf.size, 2) }
39
- assert_kind_of(Fixnum, res)
40
- assert_equal(@name, File.basename(buf.strip))
41
- end
42
-
43
- def teardown
44
- @handle.close if @handle
45
- File.delete(@name) if File.exists?(@name)
46
- @name = nil
47
- end
48
- end
1
+ #####################################################################
2
+ # test_ntfs_winternl.rb
3
+ #
4
+ # Test case for the Windows::NTFS::Winternl module.
5
+ #####################################################################
6
+ require 'windows/handle'
7
+ require 'windows/ntfs/winternl'
8
+ require 'windows/error'
9
+ require 'test/unit'
10
+
11
+ class TC_Windows_NTFS_Winternl < Test::Unit::TestCase
12
+ include Windows::Handle
13
+ include Windows::NTFS::Winternl
14
+ include Windows::Error
15
+
16
+ def setup
17
+ @name = "winternl_test.txt"
18
+ @handle = File.open(@name, 'w')
19
+ end
20
+
21
+ def test_numeric_constants
22
+ assert_equal(8, FileAccessInformation)
23
+ end
24
+
25
+ def test_methods_defined
26
+ assert(self.respond_to?(:NtQueryInformationFile, true))
27
+ end
28
+
29
+ def test_get_final_path_name_by_handle
30
+ assert(self.respond_to?(:GetFinalPathNameByHandle, true))
31
+ end
32
+
33
+ def test_get_final_path_name_by_handle_returns_expected_result
34
+ buf = 0.chr * 260
35
+ res = nil
36
+ hdl = get_osfhandle(@handle.fileno)
37
+
38
+ assert_nothing_raised{ res = GetFinalPathNameByHandle(hdl, buf, buf.size, 2) }
39
+ assert_kind_of(Fixnum, res)
40
+ assert_equal(@name, File.basename(buf.strip))
41
+ end
42
+
43
+ def teardown
44
+ @handle.close if @handle
45
+ File.delete(@name) if File.exists?(@name)
46
+ @name = nil
47
+ end
48
+ end