windows-pr 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,4 +1,12 @@
1
- = 0.8.1 - ???
1
+ = 0.8.2 - 17-Apr-2008
2
+ * Most of the MSVCRT modules now use the MSVCRT_DLL from the Windows::API
3
+ library. This helps resolve an obscure bug where state information from a
4
+ statically linked runtime DLL is local to that runtime and not shared with
5
+ the Ruby process.
6
+ * Now requires windows-api 0.2.2 or later.
7
+ * Added more MSVCRT tests.
8
+
9
+ = 0.8.1 - 27-Mar-2008
2
10
  * Added waitable timer functions to the Windows::Synchronize module.
3
11
  * Fixed params 3 and 4 in the CreateProcess function.
4
12
 
data/MANIFEST CHANGED
@@ -37,6 +37,8 @@ lib/windows/unicode.rb
37
37
  lib/windows/volume.rb
38
38
  lib/windows/window.rb
39
39
 
40
+ lib/windows/com/automation.rb
41
+
40
42
  lib/windows/gdi/bitmap.rb
41
43
  lib/windows/gdi/device_context.rb
42
44
  lib/windows/gdi/painting_drawing.rb
@@ -46,4 +48,7 @@ lib/windows/msvcrt/directory.rb
46
48
  lib/windows/msvcrt/file.rb
47
49
  lib/windows/msvcrt/io.rb
48
50
  lib/windows/msvcrt/string.rb
49
- lib/windows/msvcrt/time.rb
51
+ lib/windows/msvcrt/time.rb
52
+
53
+ lib/windows/network/management.rb
54
+ lib/windows/network/snmp.rb
@@ -16,8 +16,8 @@ module Windows
16
16
  DuplicateHandle = API.new('DuplicateHandle', 'LLLLLIL', 'I')
17
17
  GetHandleInformation = API.new('GetHandleInformation', 'LL', 'I')
18
18
  SetHandleInformation = API.new('SetHandleInformation', 'LLL', 'I')
19
- GetOSFHandle = API.new('_get_osfhandle', 'I', 'L', 'msvcrt')
20
- OpenOSFHandle = API.new('_open_osfhandle', 'LI', 'I', 'msvcrt')
19
+ GetOSFHandle = API.new('_get_osfhandle', 'I', 'L', MSVCRT_DLL)
20
+ OpenOSFHandle = API.new('_open_osfhandle', 'LI', 'I', MSVCRT_DLL)
21
21
 
22
22
  def CloseHandle(handle)
23
23
  CloseHandle.call(handle) != 0
@@ -8,19 +8,19 @@ module Windows
8
8
  API.auto_method = false
9
9
  API.auto_unicode = false
10
10
 
11
- Memcpy = API.new('memcpy', 'PLL', 'P', 'msvcrt')
12
- Memccpy = API.new('_memccpy', 'PPIL', 'P', 'msvcrt')
13
- Memchr = API.new('memchr', 'PIL', 'P', 'msvcrt')
14
- Memcmp = API.new('memcmp', 'PPL', 'I', 'msvcrt')
15
- Memicmp = API.new('_memicmp', 'PPL', 'I', 'msvcrt')
16
- Memmove = API.new('memmove', 'PPL', 'P', 'msvcrt')
17
- Memset = API.new('memset', 'PLL', 'L', 'msvcrt')
18
- Swab = API.new('_swab', 'PPI', 'V', 'msvcrt')
11
+ Memcpy = API.new('memcpy', 'PLL', 'P', MSVCRT_DLL)
12
+ Memccpy = API.new('_memccpy', 'PPIL', 'P', MSVCRT_DLL)
13
+ Memchr = API.new('memchr', 'PIL', 'P', MSVCRT_DLL)
14
+ Memcmp = API.new('memcmp', 'PPL', 'I', MSVCRT_DLL)
15
+ Memicmp = API.new('_memicmp', 'PPL', 'I', MSVCRT_DLL)
16
+ Memmove = API.new('memmove', 'PPL', 'P', MSVCRT_DLL)
17
+ Memset = API.new('memset', 'PLL', 'L', MSVCRT_DLL)
18
+ Swab = API.new('_swab', 'PPI', 'V', MSVCRT_DLL)
19
19
 
20
- MemcpyPLL = API.new('memcpy', 'PLL', 'P', 'msvcrt')
21
- MemcpyLPL = API.new('memcpy', 'LPL', 'P', 'msvcrt')
22
- MemcpyLLL = API.new('memcpy', 'LLL', 'P', 'msvcrt')
23
- MemcpyPPL = API.new('memcpy', 'PPL', 'P', 'msvcrt')
20
+ MemcpyPLL = API.new('memcpy', 'PLL', 'P', MSVCRT_DLL)
21
+ MemcpyLPL = API.new('memcpy', 'LPL', 'P', MSVCRT_DLL)
22
+ MemcpyLLL = API.new('memcpy', 'LLL', 'P', MSVCRT_DLL)
23
+ MemcpyPPL = API.new('memcpy', 'PPL', 'P', MSVCRT_DLL)
24
24
 
25
25
  # Wrapper for the memcpy() function. Both the +dest+ and +src+ can
26
26
  # be either a string or a memory address. If +size+ is omitted, it
@@ -6,24 +6,24 @@ module Windows
6
6
  module Directory
7
7
  API.auto_method = false
8
8
  API.auto_constant = false
9
- API.auto_unicode = false
10
-
11
- Chdir = API.new('_chdir', 'P', 'I', 'msvcrt')
12
- Wchdir = API.new('_wchdir', 'P', 'I', 'msvcrt')
13
- Chdrive = API.new('_chdrive', 'I', 'I', 'msvcrt')
14
- Getcwd = API.new('_getcwd', 'PI', 'P', 'msvcrt')
15
- Wgetcwd = API.new('_wgetcwd', 'PI', 'P', 'msvcrt')
16
- Getdcwd = API.new('_getdcwd', 'IPI', 'P', 'msvcrt')
17
- Wgetdcwd = API.new('_wgetdcwd', 'IPI', 'P', 'msvcrt')
18
- Getdiskfree = API.new('_getdiskfree', 'IP', 'I', 'msvcrt')
19
- Getdrive = API.new('_getdrive', 'V', 'I', 'msvcrt')
20
- Getdrives = API.new('_getdrives', 'V', 'L', 'msvcrt')
21
- Mkdir = API.new('_mkdir', 'P', 'I', 'msvcrt')
22
- Wmkdir = API.new('_wmkdir', 'P', 'I', 'msvcrt')
23
- Rmdir = API.new('_rmdir', 'P', 'I', 'msvcrt')
24
- Wrmdir = API.new('_wrmdir', 'P', 'I', 'msvcrt')
25
- Searchenv = API.new('_searchenv', 'PPP', 'V', 'msvcrt')
26
- Wsearchenv = API.new('_wsearchenv', 'PPP', 'V', 'msvcrt')
9
+ API.auto_unicode = false
10
+
11
+ Chdir = API.new('_chdir', 'P', 'I', MSVCRT_DLL)
12
+ Wchdir = API.new('_wchdir', 'P', 'I', MSVCRT_DLL)
13
+ Chdrive = API.new('_chdrive', 'I', 'I', MSVCRT_DLL)
14
+ Getcwd = API.new('_getcwd', 'PI', 'P', MSVCRT_DLL)
15
+ Wgetcwd = API.new('_wgetcwd', 'PI', 'P', MSVCRT_DLL)
16
+ Getdcwd = API.new('_getdcwd', 'IPI', 'P', MSVCRT_DLL)
17
+ Wgetdcwd = API.new('_wgetdcwd', 'IPI', 'P', MSVCRT_DLL)
18
+ Getdiskfree = API.new('_getdiskfree', 'IP', 'I', MSVCRT_DLL)
19
+ Getdrive = API.new('_getdrive', 'V', 'I', MSVCRT_DLL)
20
+ Getdrives = API.new('_getdrives', 'V', 'L', MSVCRT_DLL)
21
+ Mkdir = API.new('_mkdir', 'P', 'I', MSVCRT_DLL)
22
+ Wmkdir = API.new('_wmkdir', 'P', 'I', MSVCRT_DLL)
23
+ Rmdir = API.new('_rmdir', 'P', 'I', MSVCRT_DLL)
24
+ Wrmdir = API.new('_wrmdir', 'P', 'I', MSVCRT_DLL)
25
+ Searchenv = API.new('_searchenv', 'PPP', 'V', MSVCRT_DLL)
26
+ Wsearchenv = API.new('_wsearchenv', 'PPP', 'V', MSVCRT_DLL)
27
27
 
28
28
  def chdir(dirname)
29
29
  Chdir.call(dirname)
@@ -6,7 +6,7 @@ module Windows
6
6
  module File
7
7
  API.auto_method = false
8
8
  API.auto_constant = false
9
- API.auto_unicode = false
9
+ API.auto_unicode = false
10
10
 
11
11
  S_IFMT = 0170000 # file type mask
12
12
  S_IFDIR = 0040000 # directory
@@ -17,21 +17,21 @@ module Windows
17
17
  S_IWRITE = 0000200 # write permission, owner
18
18
  S_IEXEC = 0000100 # execute/search permission, owner
19
19
 
20
- Chmod = API.new('_chmod', 'PI', 'I', 'msvcrt')
21
- Chsize = API.new('_chsize', 'IL', 'I', 'msvcrt')
22
- Mktemp = API.new('_mktemp', 'P', 'P', 'msvcrt')
20
+ Chmod = API.new('_chmod', 'PI', 'I', MSVCRT_DLL)
21
+ Chsize = API.new('_chsize', 'IL', 'I', MSVCRT_DLL)
22
+ Mktemp = API.new('_mktemp', 'P', 'P', MSVCRT_DLL)
23
23
  Stat = API.new('_stat', 'PP', 'I', 'msvcrt')
24
- Stat64 = API.new('_stat64', 'PP', 'I', 'msvcrt')
25
- Wchmod = API.new('_wchmod', 'PI', 'I', 'msvcrt')
26
- Wmktemp = API.new('_wmktemp', 'P', 'P', 'msvcrt')
24
+ Stat64 = API.new('_stat64', 'PP', 'I', MSVCRT_DLL)
25
+ Wchmod = API.new('_wchmod', 'PI', 'I', MSVCRT_DLL)
26
+ Wmktemp = API.new('_wmktemp', 'P', 'P', MSVCRT_DLL)
27
27
  Wstat = API.new('_wstat', 'PP', 'I', 'msvcrt')
28
- Wstat64 = API.new('_wstat64', 'PP', 'I', 'msvcrt')
28
+ Wstat64 = API.new('_wstat64', 'PP', 'I', MSVCRT_DLL)
29
29
 
30
30
  # VC++ 8.0 or later
31
31
  begin
32
- Chsize_s = API.new('_chsize_s', 'IL', 'I', 'msvcrt')
33
- Mktemp_s = API.new('_mktemp_s', 'PL', 'L', 'msvcrt')
34
- Wmktemp_s = API.new('_wmktemp_s', 'PL', 'L', 'msvcrt')
32
+ Chsize_s = API.new('_chsize_s', 'IL', 'I', MSVCRT_DLL)
33
+ Mktemp_s = API.new('_mktemp_s', 'PL', 'L', MSVCRT_DLL)
34
+ Wmktemp_s = API.new('_wmktemp_s', 'PL', 'L', MSVCRT_DLL)
35
35
  rescue RuntimeError
36
36
  # Ignore - you must check for it via 'defined?'
37
37
  end
@@ -18,41 +18,41 @@ module Windows
18
18
  S_IWRITE = 0000200 # write permission, owner
19
19
  S_IEXEC = 0000100 # execute/search permission, owner
20
20
 
21
- Clearerr = API.new('clearerr', 'I', 'V', 'msvcrt')
22
- Close = API.new('_close', 'I', 'V', 'msvcrt')
23
- Fclose = API.new('fclose', 'I', 'I', 'msvcrt')
24
- Fcloseall = API.new('_fcloseall', 'V', 'I', 'msvcrt')
25
- Fdopen = API.new('_fdopen', 'IP', 'I', 'msvcrt')
26
- Feof = API.new('feof', 'I', 'I', 'msvcrt')
27
- Ferror = API.new('ferror', 'L', 'I', 'msvcrt')
28
- Fflush = API.new('fflush', 'I', 'I', 'msvcrt')
29
- Fgetc = API.new('fgetc', 'L', 'I', 'msvcrt')
30
- Fgetpos = API.new('fgetpos', 'LP', 'I', 'msvcrt')
31
- Fgetwc = API.new('fgetwc', 'L', 'I', 'msvcrt')
32
- Fgets = API.new('fgets', 'PIL', 'P', 'msvcrt')
33
- Fgetws = API.new('fgetws', 'PIL', 'P', 'msvcrt')
34
- Fileno = API.new('_fileno', 'I', 'I', 'msvcrt')
35
- Flushall = API.new('_flushall', 'V', 'I', 'msvcrt')
36
- Fopen = API.new('fopen', 'PP', 'I', 'msvcrt')
37
- Fputs = API.new('fputs', 'PL', 'I', 'msvcrt')
38
- Fputws = API.new('fputws', 'PL', 'I', 'msvcrt')
39
- Getc = API.new('getc', 'L', 'I', 'msvcrt')
40
- Getwc = API.new('getwc', 'L', 'L', 'msvcrt')
41
- Open = API.new('_open', 'PPI', 'I', 'msvcrt')
42
- Rmtmp = API.new('_rmtmp', 'V', 'I', 'msvcrt')
43
- Setmode = API.new('_setmode', 'II', 'I', 'msvcrt')
44
- Tempnam = API.new('_tempnam', 'PP', 'P', 'msvcrt')
45
- Tmpfile = API.new('tmpfile', 'V', 'L', 'msvcrt')
46
- Tmpnam = API.new('tmpnam', 'P', 'P', 'msvcrt')
47
- Wopen = API.new('_wopen', 'PPI', 'I', 'msvcrt')
48
- Wfdopen = API.new('_wfdopen', 'IP', 'I', 'msvcrt')
49
- Wfopen = API.new('_wfopen', 'PPI', 'I', 'msvcrt')
50
- Wtempnam = API.new('_wtempnam', 'PP', 'P', 'msvcrt')
51
- Wtmpnam = API.new('_wtmpnam', 'P', 'P', 'msvcrt')
21
+ Clearerr = API.new('clearerr', 'I', 'V', MSVCRT_DLL)
22
+ Close = API.new('_close', 'I', 'V', MSVCRT_DLL)
23
+ Fclose = API.new('fclose', 'I', 'I', MSVCRT_DLL)
24
+ Fcloseall = API.new('_fcloseall', 'V', 'I', MSVCRT_DLL)
25
+ Fdopen = API.new('_fdopen', 'IP', 'I', MSVCRT_DLL)
26
+ Feof = API.new('feof', 'I', 'I', MSVCRT_DLL)
27
+ Ferror = API.new('ferror', 'L', 'I', MSVCRT_DLL)
28
+ Fflush = API.new('fflush', 'I', 'I', MSVCRT_DLL)
29
+ Fgetc = API.new('fgetc', 'L', 'I', MSVCRT_DLL)
30
+ Fgetpos = API.new('fgetpos', 'LP', 'I', MSVCRT_DLL)
31
+ Fgetwc = API.new('fgetwc', 'L', 'I', MSVCRT_DLL)
32
+ Fgets = API.new('fgets', 'PIL', 'P', MSVCRT_DLL)
33
+ Fgetws = API.new('fgetws', 'PIL', 'P', MSVCRT_DLL)
34
+ Fileno = API.new('_fileno', 'I', 'I', MSVCRT_DLL)
35
+ Flushall = API.new('_flushall', 'V', 'I', MSVCRT_DLL)
36
+ Fopen = API.new('fopen', 'PP', 'I', MSVCRT_DLL)
37
+ Fputs = API.new('fputs', 'PL', 'I', MSVCRT_DLL)
38
+ Fputws = API.new('fputws', 'PL', 'I', MSVCRT_DLL)
39
+ Getc = API.new('getc', 'L', 'I', MSVCRT_DLL)
40
+ Getwc = API.new('getwc', 'L', 'L', MSVCRT_DLL)
41
+ Open = API.new('_open', 'PPI', 'I', MSVCRT_DLL)
42
+ Rmtmp = API.new('_rmtmp', 'V', 'I', MSVCRT_DLL)
43
+ Setmode = API.new('_setmode', 'II', 'I', MSVCRT_DLL)
44
+ Tempnam = API.new('_tempnam', 'PP', 'P', MSVCRT_DLL)
45
+ Tmpfile = API.new('tmpfile', 'V', 'L', MSVCRT_DLL)
46
+ Tmpnam = API.new('tmpnam', 'P', 'P', MSVCRT_DLL)
47
+ Wopen = API.new('_wopen', 'PPI', 'I', MSVCRT_DLL)
48
+ Wfdopen = API.new('_wfdopen', 'IP', 'I', MSVCRT_DLL)
49
+ Wfopen = API.new('_wfopen', 'PPI', 'I', MSVCRT_DLL)
50
+ Wtempnam = API.new('_wtempnam', 'PP', 'P', MSVCRT_DLL)
51
+ Wtmpnam = API.new('_wtmpnam', 'P', 'P', MSVCRT_DLL)
52
52
 
53
53
  # VC++ 8.0 or later
54
54
  begin
55
- Tmpfile_s = API.new('_tmpfile_s', 'P', 'L', 'msvcrt')
55
+ Tmpfile_s = API.new('_tmpfile_s', 'P', 'L', MSVCRT_DLL)
56
56
  rescue RuntimeError
57
57
  # Ignore - you must check for it via 'defined?'
58
58
  end
@@ -8,28 +8,28 @@ module Windows
8
8
  API.auto_method = false
9
9
  API.auto_unicode = false
10
10
 
11
- Strcmp = API.new('strcmp', 'PP', 'I', 'msvcrt')
12
- Strcpy = API.new('strcpy', 'PL', 'L', 'msvcrt')
13
- Strcspn = API.new('strcspn', 'PP', 'L', 'msvcrt')
14
- Strlen = API.new('strlen', 'P', 'L', 'msvcrt')
15
- Strncpy = API.new('strncpy', 'PPL', 'P', 'msvcrt')
16
- Strrchr = API.new('strrchr', 'PI', 'P', 'msvcrt')
17
- Strrev = API.new('_strrev', 'P', 'P', 'msvcrt')
18
- Strtok = API.new('strtok', 'PP', 'P', 'msvcrt')
11
+ Strcmp = API.new('strcmp', 'PP', 'I', MSVCRT_DLL)
12
+ Strcpy = API.new('strcpy', 'PL', 'L', MSVCRT_DLL)
13
+ Strcspn = API.new('strcspn', 'PP', 'L', MSVCRT_DLL)
14
+ Strlen = API.new('strlen', 'P', 'L', MSVCRT_DLL)
15
+ Strncpy = API.new('strncpy', 'PPL', 'P', MSVCRT_DLL)
16
+ Strrchr = API.new('strrchr', 'PI', 'P', MSVCRT_DLL)
17
+ Strrev = API.new('_strrev', 'P', 'P', MSVCRT_DLL)
18
+ Strtok = API.new('strtok', 'PP', 'P', MSVCRT_DLL)
19
19
 
20
20
  Mbscmp = API.new('_mbscmp', 'PP', 'I', 'msvcrt')
21
21
  Mbscpy = API.new('_mbscpy', 'PL', 'L', 'msvcrt')
22
22
  Mbslen = API.new('_mbslen', 'P', 'L', 'msvcrt')
23
23
  Mbsrev = API.new('_mbsrev', 'P', 'P', 'msvcrt')
24
24
 
25
- Wcscmp = API.new('wcscmp', 'PP', 'I', 'msvcrt')
26
- Wcscpy = API.new('wcscpy', 'PL', 'L', 'msvcrt')
27
- Wcslen = API.new('wcslen', 'P', 'L', 'msvcrt')
28
- Wcsncpy = API.new('wcsncpy', 'PPL', 'P', 'msvcrt')
29
- Wcsrev = API.new('_wcsrev', 'P', 'P', 'msvcrt')
25
+ Wcscmp = API.new('wcscmp', 'PP', 'I', MSVCRT_DLL)
26
+ Wcscpy = API.new('wcscpy', 'PL', 'L', MSVCRT_DLL)
27
+ Wcslen = API.new('wcslen', 'P', 'L', MSVCRT_DLL)
28
+ Wcsncpy = API.new('wcsncpy', 'PPL', 'P', MSVCRT_DLL)
29
+ Wcsrev = API.new('_wcsrev', 'P', 'P', MSVCRT_DLL)
30
30
 
31
31
  begin
32
- Strtok_s = API.new('strtok_s', 'PPI', 'P', 'msvcrt')
32
+ Strtok_s = API.new('strtok_s', 'PPI', 'P', MSVCRT_DLL)
33
33
  rescue RuntimeError
34
34
  # Do nothing. Not supported on your system.
35
35
  end
@@ -8,37 +8,37 @@ module Windows
8
8
  API.auto_method = false
9
9
  API.auto_unicode = false
10
10
 
11
- Asctime = API.new('asctime', 'P', 'P', 'msvcrt')
12
- Clock = API.new('clock', 'V', 'L', 'msvcrt')
11
+ Asctime = API.new('asctime', 'P', 'P', MSVCRT_DLL)
12
+ Clock = API.new('clock', 'V', 'L', MSVCRT_DLL)
13
13
  Ctime = API.new('ctime', 'P', 'P', 'msvcrt')
14
- Ctime64 = API.new('_ctime64', 'P', 'P', 'msvcrt')
14
+ Ctime64 = API.new('_ctime64', 'P', 'P', MSVCRT_DLL)
15
15
  Difftime = API.new('difftime', 'LL', 'L', 'msvcrt')
16
16
  Ftime = API.new('_ftime', 'P', 'L', 'msvcrt')
17
- Ftime64 = API.new('_ftime64', 'P', 'L', 'msvcrt')
17
+ Ftime64 = API.new('_ftime64', 'P', 'L', MSVCRT_DLL)
18
18
  Futime = API.new('_futime', 'IP', 'I', 'msvcrt')
19
- Futime64 = API.new('_futime64', 'IP', 'I', 'msvcrt')
19
+ Futime64 = API.new('_futime64', 'IP', 'I', MSVCRT_DLL)
20
20
  Gmtime = API.new('gmtime', 'P', 'P', 'msvcrt')
21
- Gmtime64 = API.new('_gmtime64', 'P', 'P', 'msvcrt')
21
+ Gmtime64 = API.new('_gmtime64', 'P', 'P', MSVCRT_DLL)
22
22
  Localtime = API.new('localtime', 'P', 'P', 'msvcrt')
23
- Localtime64 = API.new('_localtime64', 'P', 'P', 'msvcrt')
23
+ Localtime64 = API.new('_localtime64', 'P', 'P', MSVCRT_DLL)
24
24
  Mktime = API.new('mktime', 'P', 'L', 'msvcrt')
25
- Mktime64 = API.new('_mktime64', 'P', 'L', 'msvcrt')
26
- Strdate = API.new('_strdate', 'P', 'P', 'msvcrt')
27
- Strftime = API.new('strftime', 'PLPP', 'L', 'msvcrt')
28
- Strtime = API.new('_strtime', 'P', 'P', 'msvcrt')
25
+ Mktime64 = API.new('_mktime64', 'P', 'L', MSVCRT_DLL)
26
+ Strdate = API.new('_strdate', 'P', 'P', MSVCRT_DLL)
27
+ Strftime = API.new('strftime', 'PLPP', 'L', MSVCRT_DLL)
28
+ Strtime = API.new('_strtime', 'P', 'P', MSVCRT_DLL)
29
29
  WinTime = API.new('time', 'P', 'L', 'msvcrt') # Avoid conflict
30
- WinTime64 = API.new('_time64', 'P', 'L', 'msvcrt') # Avoid conflict
31
- Tzset = API.new('_tzset', 'V', 'V', 'msvcrt')
30
+ WinTime64 = API.new('_time64', 'P', 'L', MSVCRT_DLL) # Avoid conflict
31
+ Tzset = API.new('_tzset', 'V', 'V', MSVCRT_DLL)
32
32
  Utime = API.new('_utime', 'PP', 'I', 'msvcrt')
33
- Utime64 = API.new('_utime64', 'PP', 'I', 'msvcrt')
34
- Wasctime = API.new('_wasctime', 'P', 'P', 'msvcrt')
33
+ Utime64 = API.new('_utime64', 'PP', 'I', MSVCRT_DLL)
34
+ Wasctime = API.new('_wasctime', 'P', 'P', MSVCRT_DLL)
35
35
  Wctime = API.new('_wctime', 'P', 'P', 'msvcrt')
36
- Wctime64 = API.new('_wctime64', 'P', 'P', 'msvcrt')
37
- Wstrdate = API.new('_wstrdate', 'P', 'L', 'msvcrt')
38
- Wcsftime = API.new('wcsftime', 'PLPP', 'L', 'msvcrt')
39
- Wstrtime = API.new('_wstrtime', 'P', 'P', 'msvcrt')
36
+ Wctime64 = API.new('_wctime64', 'P', 'P', MSVCRT_DLL)
37
+ Wstrdate = API.new('_wstrdate', 'P', 'L', MSVCRT_DLL)
38
+ Wcsftime = API.new('wcsftime', 'PLPP', 'L', MSVCRT_DLL)
39
+ Wstrtime = API.new('_wstrtime', 'P', 'P', MSVCRT_DLL)
40
40
  Wutime = API.new('_wutime', 'PP', 'I', 'msvcrt')
41
- Wutime64 = API.new('_wutime64', 'PP', 'I', 'msvcrt')
41
+ Wutime64 = API.new('_wutime64', 'PP', 'I', MSVCRT_DLL)
42
42
 
43
43
  def asctime(timeptr)
44
44
  Asctime.call(timeptr)
@@ -0,0 +1,67 @@
1
+ #####################################################################
2
+ # tc_msvcrt_directory.rb
3
+ #
4
+ # Test case for the Windows::MSVCRT::File module.
5
+ #####################################################################
6
+ require 'windows/msvcrt/directory'
7
+ require 'test/unit'
8
+
9
+ class MDirectoryFoo
10
+ include Windows::MSVCRT::Directory
11
+ end
12
+
13
+ class TC_Windows_MSVCRT_Directory < Test::Unit::TestCase
14
+ def setup
15
+ @foo = MDirectoryFoo.new
16
+ end
17
+
18
+ def test_method_constants
19
+ assert_not_nil(MDirectoryFoo::Chdir)
20
+ assert_not_nil(MDirectoryFoo::Wchdir)
21
+ assert_not_nil(MDirectoryFoo::Chdrive)
22
+ assert_not_nil(MDirectoryFoo::Getcwd)
23
+ assert_not_nil(MDirectoryFoo::Wgetcwd)
24
+ assert_not_nil(MDirectoryFoo::Getdcwd)
25
+ assert_not_nil(MDirectoryFoo::Getdiskfree)
26
+ assert_not_nil(MDirectoryFoo::Getdrive)
27
+ assert_not_nil(MDirectoryFoo::Getdrives)
28
+ assert_not_nil(MDirectoryFoo::Mkdir)
29
+ assert_not_nil(MDirectoryFoo::Wmkdir)
30
+ assert_not_nil(MDirectoryFoo::Rmdir)
31
+ assert_not_nil(MDirectoryFoo::Wrmdir)
32
+ assert_not_nil(MDirectoryFoo::Searchenv)
33
+ assert_not_nil(MDirectoryFoo::Wsearchenv)
34
+ end
35
+
36
+ def test_chdir
37
+ assert_respond_to(@foo, :chdir)
38
+ end
39
+
40
+ def test_wchdir
41
+ assert_respond_to(@foo, :wchdir)
42
+ end
43
+
44
+ def test_chdrive
45
+ assert_respond_to(@foo, :chdrive)
46
+ end
47
+
48
+ def test_getcwd
49
+ assert_respond_to(@foo, :getcwd)
50
+ end
51
+
52
+ def test_wgetcwd
53
+ assert_respond_to(@foo, :wgetcwd)
54
+ end
55
+
56
+ def test_getdcwd
57
+ assert_respond_to(@foo, :getdcwd)
58
+ end
59
+
60
+ def test_wgetdcwd
61
+ assert_respond_to(@foo, :wgetdcwd)
62
+ end
63
+
64
+ def teardown
65
+ @foo = nil
66
+ end
67
+ end
@@ -0,0 +1,80 @@
1
+ #####################################################################
2
+ # tc_msvcrt_file.rb
3
+ #
4
+ # Test case for the Windows::MSVCRT::File module.
5
+ #####################################################################
6
+ require 'windows/msvcrt/file'
7
+ require 'test/unit'
8
+
9
+ class MFileFoo
10
+ include Windows::MSVCRT::File
11
+ end
12
+
13
+ class TC_Windows_MSVCRT_File < Test::Unit::TestCase
14
+ def setup
15
+ @foo = MFileFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_not_nil(MFileFoo::S_IFMT)
20
+ assert_not_nil(MFileFoo::S_IFDIR)
21
+ assert_not_nil(MFileFoo::S_IFCHR)
22
+ assert_not_nil(MFileFoo::S_IFIFO)
23
+ assert_not_nil(MFileFoo::S_IFREG)
24
+ assert_not_nil(MFileFoo::S_IREAD)
25
+ assert_not_nil(MFileFoo::S_IWRITE)
26
+ assert_not_nil(MFileFoo::S_IEXEC)
27
+ end
28
+
29
+ def test_method_constants
30
+ assert_not_nil(MFileFoo::Chmod)
31
+ assert_not_nil(MFileFoo::Chsize)
32
+ assert_not_nil(MFileFoo::Mktemp)
33
+ assert_not_nil(MFileFoo::Stat)
34
+ assert_not_nil(MFileFoo::Stat64)
35
+ assert_not_nil(MFileFoo::Wchmod)
36
+ assert_not_nil(MFileFoo::Wmktemp)
37
+ assert_not_nil(MFileFoo::Wstat)
38
+ assert_not_nil(MFileFoo::Wstat64)
39
+ end
40
+
41
+ def test_chmod
42
+ assert_respond_to(@foo, :chmod)
43
+ end
44
+
45
+ def test_chsize
46
+ assert_respond_to(@foo, :chsize)
47
+ end
48
+
49
+ def test_mktemp
50
+ assert_respond_to(@foo, :mktemp)
51
+ end
52
+
53
+ def test_stat
54
+ assert_respond_to(@foo, :stat)
55
+ end
56
+
57
+ def test_stat64
58
+ assert_respond_to(@foo, :stat64)
59
+ end
60
+
61
+ def test_wchmod
62
+ assert_respond_to(@foo, :wchmod)
63
+ end
64
+
65
+ def test_wmktemp
66
+ assert_respond_to(@foo, :wmktemp)
67
+ end
68
+
69
+ def test_wstat
70
+ assert_respond_to(@foo, :wstat)
71
+ end
72
+
73
+ def test_wstat64
74
+ assert_respond_to(@foo, :wstat64)
75
+ end
76
+
77
+ def teardown
78
+ @foo = nil
79
+ end
80
+ end
@@ -0,0 +1,48 @@
1
+ #####################################################################
2
+ # tc_msvcrt_io.rb
3
+ #
4
+ # Test case for the Windows::MSVCRT::IO module.
5
+ #####################################################################
6
+ require 'windows/msvcrt/io'
7
+ require 'test/unit'
8
+
9
+ class MIOFoo
10
+ include Windows::MSVCRT::IO
11
+ end
12
+
13
+ class TC_Windows_MSVCRT_IO < Test::Unit::TestCase
14
+ def setup
15
+ @foo = MIOFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_not_nil(MIOFoo::S_IFMT)
20
+ end
21
+
22
+ def test_method_constants
23
+ assert_not_nil(MIOFoo::Clearerr)
24
+ assert_not_nil(MIOFoo::Close)
25
+ assert_not_nil(MIOFoo::Fclose)
26
+ assert_not_nil(MIOFoo::Fileno)
27
+ end
28
+
29
+ def test_clearerr
30
+ assert_respond_to(@foo, :clearerr)
31
+ end
32
+
33
+ def test_close
34
+ assert_respond_to(@foo, :close)
35
+ end
36
+
37
+ def test_fclose
38
+ assert_respond_to(@foo, :fclose)
39
+ end
40
+
41
+ def test_fileno
42
+ assert_respond_to(@foo, :fileno)
43
+ end
44
+
45
+ def teardown
46
+ @foo = nil
47
+ end
48
+ end
@@ -0,0 +1,36 @@
1
+ #####################################################################
2
+ # tc_msvcrt_string.rb
3
+ #
4
+ # Test case for the Windows::MSVCRT::String module.
5
+ #####################################################################
6
+ require 'windows/msvcrt/string'
7
+ require 'test/unit'
8
+
9
+ class MStringFoo
10
+ include Windows::MSVCRT::String
11
+ end
12
+
13
+ class TC_Windows_MSVCRT_String < Test::Unit::TestCase
14
+ def setup
15
+ @foo = MStringFoo.new
16
+ end
17
+
18
+ def test_method_constants
19
+ assert_not_nil(MStringFoo::Strcmp)
20
+ assert_not_nil(MStringFoo::Strcpy)
21
+ assert_not_nil(MStringFoo::Strcspn)
22
+ assert_not_nil(MStringFoo::Strlen)
23
+ assert_not_nil(MStringFoo::Strncpy)
24
+ assert_not_nil(MStringFoo::Strrchr)
25
+ assert_not_nil(MStringFoo::Strrev)
26
+ assert_not_nil(MStringFoo::Strtok)
27
+ end
28
+
29
+ def test_strcmp
30
+ assert_respond_to(@foo, :strcmp)
31
+ end
32
+
33
+ def teardown
34
+ @foo = nil
35
+ end
36
+ end
@@ -0,0 +1,29 @@
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 MTimeFoo
10
+ include Windows::MSVCRT::Time
11
+ end
12
+
13
+ class TC_Windows_MSVCRT_Time < Test::Unit::TestCase
14
+ def setup
15
+ @foo = MTimeFoo.new
16
+ end
17
+
18
+ def test_method_constants
19
+ assert_not_nil(MTimeFoo::Asctime)
20
+ end
21
+
22
+ def test_asctime
23
+ assert_respond_to(@foo, :asctime)
24
+ end
25
+
26
+ def teardown
27
+ @foo = nil
28
+ end
29
+ end
data/windows-pr.gemspec CHANGED
@@ -2,10 +2,11 @@ require "rubygems"
2
2
 
3
3
  spec = Gem::Specification.new do |gem|
4
4
  gem.name = "windows-pr"
5
- gem.version = "0.8.1"
5
+ gem.version = "0.8.2"
6
6
  gem.author = "Daniel J. Berger"
7
7
  gem.email = "djberg96@gmail.com"
8
8
  gem.homepage = "http://www.rubyforge.org/projects/win32utils"
9
+ gem.rubyforge_project = "win32utils"
9
10
  gem.platform = Gem::Platform::RUBY
10
11
  gem.summary = "Windows functions and constants bundled via Win32::API"
11
12
  gem.description = "Windows functions and constants bundled via Win32::API"
@@ -18,7 +19,7 @@ spec = Gem::Specification.new do |gem|
18
19
  gem.files.reject! { |fn| fn.include? "CVS" }
19
20
  gem.require_path = "lib"
20
21
  gem.extra_rdoc_files = ["MANIFEST", "README", "CHANGES"]
21
- gem.add_dependency("windows-api", ">= 0.2.0")
22
+ gem.add_dependency("windows-api", ">= 0.2.2")
22
23
  end
23
24
 
24
25
  if $0 == __FILE__
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.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-03-27 00:00:00 -06:00
12
+ date: 2008-04-18 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -19,7 +19,7 @@ dependencies:
19
19
  requirements:
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.2.0
22
+ version: 0.2.2
23
23
  version:
24
24
  description: Windows functions and constants bundled via Win32::API
25
25
  email: djberg96@gmail.com
@@ -81,6 +81,11 @@ files:
81
81
  - test/tc_limits.rb
82
82
  - test/tc_memory.rb
83
83
  - test/tc_msvcrt_buffer.rb
84
+ - test/tc_msvcrt_directory.rb
85
+ - test/tc_msvcrt_file.rb
86
+ - test/tc_msvcrt_io.rb
87
+ - test/tc_msvcrt_string.rb
88
+ - test/tc_msvcrt_time.rb
84
89
  - test/tc_national.rb
85
90
  - test/tc_network_management.rb
86
91
  - test/tc_network_snmp.rb
@@ -140,8 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
145
  version:
141
146
  requirements: []
142
147
 
143
- rubyforge_project:
144
- rubygems_version: 1.0.1
148
+ rubyforge_project: win32utils
149
+ rubygems_version: 1.1.1
145
150
  signing_key:
146
151
  specification_version: 2
147
152
  summary: Windows functions and constants bundled via Win32::API
@@ -162,6 +167,11 @@ test_files:
162
167
  - test/tc_limits.rb
163
168
  - test/tc_memory.rb
164
169
  - test/tc_msvcrt_buffer.rb
170
+ - test/tc_msvcrt_directory.rb
171
+ - test/tc_msvcrt_file.rb
172
+ - test/tc_msvcrt_io.rb
173
+ - test/tc_msvcrt_string.rb
174
+ - test/tc_msvcrt_time.rb
165
175
  - test/tc_national.rb
166
176
  - test/tc_network_management.rb
167
177
  - test/tc_network_snmp.rb