windows-pr 0.6.6 → 0.7.0

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.
@@ -1,80 +1,180 @@
1
- require 'Win32API'
2
-
3
- module Windows
4
- class IO
5
- S_IFMT = 0170000 # file type mask
6
- S_IFDIR = 0040000 # directory
7
- S_IFCHR = 0020000 # character special
8
- S_IFIFO = 0010000 # pipe
9
- S_IFREG = 0100000 # regular
10
- S_IREAD = 0000400 # read permission, owner
11
- S_IWRITE = 0000200 # write permission, owner
12
- S_IEXEC = 0000100 # execute/search permission, owner
13
-
14
- Clearerr = Win32API.new('msvcrt', 'clearerr', 'I', 'V')
15
- Close = Win32API.new('msvcrt', '_close', 'I', 'V')
16
- Fclose = Win32API.new('msvcrt', 'fclose', 'I', 'I')
17
- Fcloseall = Win32API.new('msvcrt', '_fcloseall', 'V', 'I')
18
- Fdopen = Win32API.new('msvcrt', '_fdopen', 'IP', 'I')
19
- Feof = Win32API.new('msvcrt', 'feof', 'I', 'I')
20
- Fflush = Win32API.new('msvcrt', 'fflush', 'I', 'I')
21
- Fileno = Win32API.new('msvcrt', '_fileno', 'I', 'I')
22
- Fopen = Win32API.new('msvcrt', 'fopen', 'PP', 'I')
23
- Open = Win32API.new('msvcrt', '_open', 'PPI', 'I')
24
- Wopen = Win32API.new('msvcrt', '_wopen', 'PPI', 'I')
25
- Wfdopen = Win32API.new('msvcrt', '_wfdopen', 'IP', 'I')
26
- Wfopen = Win32API.new('msvcrt', '_wfopen', 'PPI', 'I')
27
-
28
- def clearerr(stream)
29
- Clearerr.call(stream)
30
- end
31
-
32
- def close
33
- Close.call(fd)
34
- end
35
-
36
- def fclose(stream)
37
- Fclose.call(stream)
38
- end
39
-
40
- def fcloseall
41
- Fcloseall.call
42
- end
43
-
44
- def fdopen(fd, mode)
45
- Fdopen.call(fd, mode)
46
- end
47
-
48
- def feof(stream)
49
- Feof.call(stream)
50
- end
51
-
52
- def fflush(stream)
53
- Fflush.call(stream)
54
- end
55
-
56
- def fileno(stream)
57
- Fileno.call(stream)
58
- end
59
-
60
- def fopen(file, mode)
61
- Fopen.call(file, mode)
62
- end
63
-
64
- def open(file, flag, mode)
65
- Open.call(file, flag, mode)
66
- end
67
-
68
- def wopen(file, flag, mode)
69
- Wopen.call(file, flag, mode)
70
- end
71
-
72
- def wfdopen(fd, mode)
73
- Wfdopen.call(fd, mode)
74
- end
75
-
76
- def wfopen(file, mode)
77
- Wfopen.call(file, mode)
78
- end
79
- end
80
- end
1
+ require 'windows/api'
2
+ include Windows
3
+
4
+ # This module includes stream I/O, low level I/O, etc.
5
+ module Windows
6
+ module MSVCRT
7
+ module IO
8
+ API.auto_constant = false
9
+ API.auto_method = false
10
+ API.auto_unicode = false
11
+
12
+ S_IFMT = 0170000 # file type mask
13
+ S_IFDIR = 0040000 # directory
14
+ S_IFCHR = 0020000 # character special
15
+ S_IFIFO = 0010000 # pipe
16
+ S_IFREG = 0100000 # regular
17
+ S_IREAD = 0000400 # read permission, owner
18
+ S_IWRITE = 0000200 # write permission, owner
19
+ S_IEXEC = 0000100 # execute/search permission, owner
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
+ Tempnam = API.new('_tempnam', 'PP', 'P', 'msvcrt')
44
+ Tmpfile = API.new('tmpfile', 'V', 'L', 'msvcrt')
45
+ Tmpnam = API.new('tmpnam', 'P', 'P', 'msvcrt')
46
+ Wopen = API.new('_wopen', 'PPI', 'I', 'msvcrt')
47
+ Wfdopen = API.new('_wfdopen', 'IP', 'I', 'msvcrt')
48
+ Wfopen = API.new('_wfopen', 'PPI', 'I', 'msvcrt')
49
+ Wtempnam = API.new('_wtempnam', 'PP', 'P', 'msvcrt')
50
+ Wtmpnam = API.new('_wtmpnam', 'P', 'P', 'msvcrt')
51
+
52
+ # VC++ 8.0 or later
53
+ begin
54
+ Tmpfile_s = API.new('_tmpfile_s', 'P', 'L', 'msvcrt')
55
+ rescue RuntimeError
56
+ # Ignore - you must check for it via 'defined?'
57
+ end
58
+
59
+ def clearerr(stream)
60
+ Clearerr.call(stream)
61
+ end
62
+
63
+ def close(fd)
64
+ Close.call(fd)
65
+ end
66
+
67
+ def fclose(stream)
68
+ Fclose.call(stream)
69
+ end
70
+
71
+ def fcloseall
72
+ Fcloseall.call
73
+ end
74
+
75
+ def fdopen(fd, mode)
76
+ Fdopen.call(fd, mode)
77
+ end
78
+
79
+ def feof(stream)
80
+ Feof.call(stream)
81
+ end
82
+
83
+ def ferror(stream)
84
+ Ferror.call(stream)
85
+ end
86
+
87
+ def fflush(stream)
88
+ Fflush.call(stream)
89
+ end
90
+
91
+ def fgetc(stream)
92
+ Fgetc.call(stream)
93
+ end
94
+
95
+ def fgetpos(stream, pos)
96
+ Fgetpos.call(stream, pos)
97
+ end
98
+
99
+ def fgets(str, n, stream)
100
+ Fgets.call(str, n, stream)
101
+ end
102
+
103
+ def fgetws(str, n, stream)
104
+ Fgetws.call(str, n, stream)
105
+ end
106
+
107
+ def fgetwc(stream)
108
+ Fgetwc.call(stream)
109
+ end
110
+
111
+ def fileno(stream)
112
+ Fileno.call(stream)
113
+ end
114
+
115
+ def flushall
116
+ Flushall.call()
117
+ end
118
+
119
+ def fopen(file, mode)
120
+ Fopen.call(file, mode)
121
+ end
122
+
123
+ def fputs(str, stream)
124
+ Fputs.call(str, stream)
125
+ end
126
+
127
+ def fputws(str, stream)
128
+ Fputws.call(str, stream)
129
+ end
130
+
131
+ def getc(stream)
132
+ Getc.call(stream)
133
+ end
134
+
135
+ def getwc(stream)
136
+ Getwc.call(stream)
137
+ end
138
+
139
+ def open(file, flag, mode)
140
+ Open.call(file, flag, mode)
141
+ end
142
+
143
+ def tmpfile()
144
+ Tmpfile.call
145
+ end
146
+
147
+ def tmpfile_s(file_ptr)
148
+ Tmpfile_s.call(file_ptr)
149
+ end
150
+
151
+ def tempnam(dir, prefix)
152
+ Tempnam.call(dir, prefix)
153
+ end
154
+
155
+ def tmpnam(template)
156
+ Tmpnam.call(template)
157
+ end
158
+
159
+ def wopen(file, flag, mode)
160
+ Wopen.call(file, flag, mode)
161
+ end
162
+
163
+ def wfdopen(fd, mode)
164
+ Wfdopen.call(fd, mode)
165
+ end
166
+
167
+ def wfopen(file, mode)
168
+ Wfopen.call(file, mode)
169
+ end
170
+
171
+ def wtempnam(dir, prefix)
172
+ Wtempnam.call(dir, prefix)
173
+ end
174
+
175
+ def wtmpnam(template)
176
+ Wtmpnam.call(template)
177
+ end
178
+ end
179
+ end
180
+ end
@@ -1,22 +1,27 @@
1
- require 'Win32API'
1
+ require 'windows/api'
2
+ include Windows
2
3
 
3
4
  module Windows
4
5
  module MSVCRT
5
6
  module String
6
- Strcmp = Win32API.new('msvcrt', 'strcmp', 'PP', 'I')
7
- Strcpy = Win32API.new('msvcrt', 'strcpy', 'PL', 'L')
8
- Strlen = Win32API.new('msvcrt', 'strlen', 'P', 'L')
9
- Strrev = Win32API.new('msvcrt', '_strrev', 'P', 'P')
10
-
11
- Mbscmp = Win32API.new('msvcrt', '_mbscmp', 'PP', 'I')
12
- Mbscpy = Win32API.new('msvcrt', '_mbscpy', 'PL', 'L')
13
- Mbslen = Win32API.new('msvcrt', '_mbslen', 'P', 'L')
14
- Mbsrev = Win32API.new('msvcrt', '_mbsrev', 'P', 'P')
7
+ API.auto_constant = false
8
+ API.auto_method = false
9
+ API.auto_unicode = false
10
+
11
+ Strcmp = API.new('strcmp', 'PP', 'I', 'msvcrt')
12
+ Strcpy = API.new('strcpy', 'PL', 'L', 'msvcrt')
13
+ Strlen = API.new('strlen', 'P', 'L', 'msvcrt')
14
+ Strrev = API.new('_strrev', 'P', 'P', 'msvcrt')
15
+
16
+ Mbscmp = API.new('_mbscmp', 'PP', 'I', 'msvcrt')
17
+ Mbscpy = API.new('_mbscpy', 'PL', 'L', 'msvcrt')
18
+ Mbslen = API.new('_mbslen', 'P', 'L', 'msvcrt')
19
+ Mbsrev = API.new('_mbsrev', 'P', 'P', 'msvcrt')
15
20
 
16
- Wcscmp = Win32API.new('msvcrt', 'wcscmp', 'PP', 'I')
17
- Wcscpy = Win32API.new('msvcrt', 'wcscpy', 'PL', 'L')
18
- Wcslen = Win32API.new('msvcrt', 'wcslen', 'P', 'L')
19
- Wcsrev = Win32API.new('msvcrt', '_wcsrev', 'P', 'P')
21
+ Wcscmp = API.new('wcscmp', 'PP', 'I', 'msvcrt')
22
+ Wcscpy = API.new('wcscpy', 'PL', 'L', 'msvcrt')
23
+ Wcslen = API.new('wcslen', 'P', 'L', 'msvcrt')
24
+ Wcsrev = API.new('_wcsrev', 'P', 'P', 'msvcrt')
20
25
 
21
26
  def strcmp(str1, str2)
22
27
  if str1 == 0 || str2 == 0
@@ -85,4 +90,4 @@ module Windows
85
90
  end
86
91
  end
87
92
  end
88
- end
93
+ end
@@ -1,7 +1,13 @@
1
- require 'Win32API'
1
+ require 'windows/api'
2
+ include Windows
2
3
 
3
4
  module Windows
4
5
  module National
6
+ API.auto_namespace = 'Windows::National'
7
+ API.auto_constant = true
8
+ API.auto_method = true
9
+ API.auto_unicode = true
10
+
5
11
  # Code page identifiers. Used for get_acp_string method.
6
12
  CODE_PAGE = {
7
13
  037 => 'IBM EBCDIC = U.S./Canada',
@@ -525,43 +531,14 @@ module Windows
525
531
  LOCALE_USER_DEFAULT = 1024
526
532
  LOCALE_INVARIANT = 8323072
527
533
 
528
- GetACP = Win32API.new('kernel32', 'GetACP', 'V', 'I')
529
- GetDateFormat = Win32API.new('kernel32', 'GetDateFormat', 'LLPPPI', 'I')
530
- GetLocaleInfo = Win32API.new('kernel32', 'GetLocaleInfo', 'LLPL', 'I')
531
-
532
- GetSystemDefaultLangID = Win32API.new('kernel32', 'GetSystemDefaultLangID', 'V', 'L')
533
- GetSystemDefaultLCID = Win32API.new('kernel32', 'GetSystemDefaultLCID', 'V', 'L')
534
- GetUserDefaultLangID = Win32API.new('kernel32', 'GetUserDefaultLangID', 'V', 'L')
535
- GetUserDefaultLCID = Win32API.new('kernel32', 'GetUserDefaultLCID', 'V', 'L')
536
-
537
- def GetACP()
538
- GetACP.call
539
- end
540
-
541
- def GetDateFormat(locale, flags, date, format, datestr, size)
542
- GetDateFormat.call(locale, flags, date, format, datestr, size)
543
- end
544
-
545
- def GetLocaleInfo(locale, lctype, lcdata, size)
546
- GetLocaleInfo.call(locale, lctype, lcdata, size)
547
- end
548
-
549
- def GetSystemDefaultLangID()
550
- GetSystemDefaultLangID.call
551
- end
552
-
553
- def GetSystemDefaultLCID()
554
- GetSystemDefaultLCID.call
555
- end
534
+ API.new('GetACP', 'V', 'I')
535
+ API.new('GetDateFormat', 'LLPPPI', 'I')
536
+ API.new('GetLocaleInfo', 'LLPL', 'I')
537
+ API.new('GetSystemDefaultLangID', 'V', 'L')
538
+ API.new('GetSystemDefaultLCID', 'V', 'L')
539
+ API.new('GetUserDefaultLangID', 'V', 'L')
540
+ API.new('GetUserDefaultLCID', 'V', 'L')
556
541
 
557
- def GetUserDefaultLangID()
558
- GetUserDefaultLangID.call
559
- end
560
-
561
- def GetUserDefaultLCID()
562
- GetUserDefaultLCID.call
563
- end
564
-
565
542
  # Convenience method for converting the results of the GetACP()
566
543
  # function to a human readable string.
567
544
  #
@@ -577,8 +554,8 @@ module Windows
577
554
 
578
555
  # Equivalent of the MAKELANGID macro in WinNT.h
579
556
  #
580
- def MAKELANGID(p, s)
581
- s << 10 | p
557
+ def MAKELANGID(x, s)
558
+ s << 10 | x
582
559
  end
583
560
  end
584
561
  end
@@ -1,7 +1,16 @@
1
- require 'Win32API'
1
+ require 'windows/api'
2
+ include Windows
2
3
 
4
+ # I don't use the Boolean flag for the return types of these methods because
5
+ # they succeed, not fail, if the return value is 0.
6
+ #
3
7
  module Windows
4
8
  module NetworkManagement
9
+ API.auto_namespace = 'Windows::NetworkManagement'
10
+ API.auto_constant = true
11
+ API.auto_method = false
12
+ API.auto_unicode = false
13
+
5
14
  NERR_Success = 0
6
15
  MAX_PREFERRED_LENGTH = -1
7
16
 
@@ -40,99 +49,91 @@ module Windows
40
49
  SV_TYPE_DOMAIN_ENUM = 0x80000000
41
50
  SV_TYPE_ALL = 0xFFFFFFFF
42
51
 
43
- NetAlertRaise = Win32API.new('netapi32', 'NetAlertRaise', 'PPL', 'L')
44
- NetAlertRaiseEx = Win32API.new('netapi32', 'NetAlertRaiseEx', 'PPLP', 'L')
45
- NetApiBufferAllocate = Win32API.new('netapi32', 'NetApiBufferAllocate', 'LP', 'L')
46
- NetApiBufferFree = Win32API.new('netapi32', 'NetApiBufferFree', 'P', 'L')
47
- NetApiBufferReallocate = Win32API.new('netapi32', 'NetApiBufferReallocate', 'PLP', 'L')
48
- NetApiBufferSize = Win32API.new('netapi32', 'NetApiBufferSize', 'PP', 'L')
49
- NetGetAnyDCName = Win32API.new('netapi32', 'NetGetAnyDCName', 'PPP', 'L')
50
- NetGetDCName = Win32API.new('netapi32', 'NetGetDCName', 'PPP', 'L')
51
-
52
- NetGetDisplayInformationIndex = Win32API.new('netapi32', 'NetGetDisplayInformationIndex', 'PLPP', 'L')
53
- NetGetJoinableOUs = Win32API.new('netapi32', 'NetGetJoinableOUs', 'PPPPPP', 'L')
54
- NetGetJoinInformation = Win32API.new('netapi32', 'NetGetJoinInformation', 'PPP', 'L')
55
-
56
- NetGroupAdd = Win32API.new('netapi32', 'NetGroupAdd', 'PLPP', 'L')
57
- NetGroupAddUser = Win32API.new('netapi32', 'NetGroupAddUser', 'PPP', 'L')
58
- NetGroupDel = Win32API.new('netapi32', 'NetGroupDel', 'PP', 'L')
59
- NetGroupDelUser = Win32API.new('netapi32', 'NetGroupDelUser', 'PPP', 'L')
60
- NetGroupEnum = Win32API.new('netapi32', 'NetGroupEnum', 'PLPLPPP', 'L')
61
- NetGroupGetInfo = Win32API.new('netapi32', 'NetGroupGetInfo', 'PPLP', 'L')
62
- NetGroupGetUsers = Win32API.new('netapi32', 'NetGroupGetUsers', 'PPLPLPPP', 'L')
63
- NetGroupSetInfo = Win32API.new('netapi32', 'NetGroupSetInfo', 'PPLPP', 'L')
64
- NetGroupSetUsers = Win32API.new('netapi32', 'NetGroupSetUsers', 'PPLPL', 'L')
65
- NetJoinDomain = Win32API.new('netapi32', 'NetJoinDomain', 'PPPPPL', 'L')
66
-
67
- NetLocalGroupAdd = Win32API.new('netapi32', 'NetLocalGroupAdd', 'PLPP', 'L')
68
- NetLocalGroupAddMembers = Win32API.new('netapi32', 'NetLocalGroupAddMembers', 'PPLPL', 'L')
69
- NetLocalGroupDel = Win32API.new('netapi32', 'NetLocalGroupDel', 'PP', 'L')
70
- NetLocalGroupDelMembers = Win32API.new('netapi32', 'NetLocalGroupDelMembers', 'PPLPL', 'L')
71
- NetLocalGroupEnum = Win32API.new('netapi32', 'NetLocalGroupEnum', 'PLPLPPP', 'L')
72
- NetLocalGroupGetInfo = Win32API.new('netapi32', 'NetLocalGroupGetInfo', 'PPLP', 'L')
73
- NetLocalGroupGetMembers = Win32API.new('netapi32', 'NetLocalGroupGetMembers', 'PPLPLPPP', 'L')
74
- NetLocalGroupSetInfo = Win32API.new('netapi32', 'NetLocalGroupSetInfo', 'PPLPP', 'L')
75
- NetLocalGroupSetMembers = Win32API.new('netapi32', 'NetLocalGroupSetMembers', 'PPLPP', 'L')
76
- NetMessageBufferSend = Win32API.new('netapi32', 'NetMessageBufferSend', 'PPPPL', 'L')
77
- NetMessageNameAdd = Win32API.new('netapi32', 'NetMessageNameAdd', 'PP', 'L')
78
- NetMessageNameDel = Win32API.new('netapi32', 'NetMessageNameDel', 'PP', 'L')
79
- NetMessageNameEnum = Win32API.new('netapi32', 'NetMessageNameEnum', 'PLPLPPP', 'L')
80
- NetMessageNameGetInfo = Win32API.new('netapi32', 'NetMessageNameGetInfo', 'PPLP', 'L')
81
-
82
- NetQueryDisplayInformation = Win32API.new('netapi32', 'NetQueryDisplayInformation', 'PLLLLPP', 'L')
83
- NetRemoteComputerSupports = Win32API.new('netapi32', 'NetRemoteComputerSupports', 'PLP', 'L')
84
- NetRemoteTOD = Win32API.new('netapi32', 'NetRemoteTOD', 'PP', 'L')
85
- NetRenameMachineInDomain = Win32API.new('netapi32', 'NetRenameMachineInDomain', 'PPPPL', 'L')
86
- NetScheduleJobAdd = Win32API.new('netapi32', 'NetScheduleJobAdd', 'PPP', 'L')
87
- NetScheduleJobDel = Win32API.new('netapi32', 'NetScheduleJobDel', 'PLL', 'L')
88
- NetScheduleJobEnum = Win32API.new('netapi32', 'NetScheduleJobEnum', 'PPLPPP', 'L')
89
- NetScheduleJobGetInfo = Win32API.new('netapi32', 'NetScheduleJobGetInfo', 'PLP', 'L')
90
-
91
- NetServerComputerNameAdd = Win32API.new('netapi32', 'NetServerComputerNameAdd', 'PPP', 'L')
92
- NetServerComputerNameDel = Win32API.new('netapi32', 'NetServerComputerNameDel', 'PP', 'L')
93
- NetServerDiskEnum = Win32API.new('netapi32', 'NetServerDiskEnum', 'PLPLPPP', 'L')
94
- NetServerEnum = Win32API.new('netapi32', 'NetServerEnum', 'PLPLPPLPP', 'L')
95
- NetServerGetInfo = Win32API.new('netapi32', 'NetServerGetInfo', 'PLP', 'L')
96
- NetServerSetInfo = Win32API.new('netapi32', 'NetServerSetInfo', 'PLPP', 'L')
97
- NetServerTransportAdd = Win32API.new('netapi32', 'NetServerTransportAdd', 'PLP', 'L')
98
- NetServerTransportAddEx = Win32API.new('netapi32', 'NetServerTransportAddEx', 'PLP', 'L')
99
- NetServerTransportDel = Win32API.new('netapi32', 'NetServerTransportDel', 'PLP', 'L')
100
- NetServerTransportEnum = Win32API.new('netapi32', 'NetServerTransportEnum', 'PLPLPPP', 'L')
101
- NetUnjoinDomain = Win32API.new('netapi32', 'NetUnjoinDomain', 'PPPL', 'L')
102
-
103
- NetUseAdd = Win32API.new('netapi32', 'NetUseAdd', 'PLPP', 'L')
104
- NetUseDel = Win32API.new('netapi32', 'NetUseDel', 'PPL', 'L')
105
- NetUseEnum = Win32API.new('netapi32', 'NetUseEnum', 'PLPLPPP', 'L')
106
- NetUseGetInfo = Win32API.new('netapi32', 'NetUseGetInfo', 'PPLP', 'L')
107
-
108
- NetUserAdd = Win32API.new('netapi32', 'NetUserAdd', 'PLPP', 'L')
109
- NetUserChangePassword = Win32API.new('netapi32', 'NetUserChangePassword', 'PPPP', 'L')
110
- NetUserDel = Win32API.new('netapi32', 'NetUserDel', 'PP', 'L')
111
- NetUserEnum = Win32API.new('netapi32', 'NetUserEnum', 'PLLPLPPP', 'L')
112
- NetUserGetGroups = Win32API.new('netapi32', 'NetUserGetGroups', 'PPLPLPP', 'L')
113
- NetUserGetInfo = Win32API.new('netapi32', 'NetUserGetInfo', 'PPLP', 'L')
114
- NetUserGetLocalGroups = Win32API.new('netapi32', 'NetUserGetLocalGroups', 'PPLLPLPP', 'L')
115
-
116
- NetUserModalsGet = Win32API.new('netapi32', 'NetUserModalsGet', 'PLP', 'L')
117
- NetUserModalsSet = Win32API.new('netapi32', 'NetUserModalsSet', 'PLPP', 'L')
118
- NetUserSetGroups = Win32API.new('netapi32', 'NetUserSetGroups', 'PPLPL', 'L')
119
- NetUserSetInfo = Win32API.new('netapi32', 'NetUserSetInfo', 'PPLPP', 'L')
120
- NetValidateName = Win32API.new('netapi32', 'NetValidateName', 'PPPPP', 'L')
121
-
122
- NetWkstaGetInfo = Win32API.new('netapi32', 'NetWkstaGetInfo', 'PLP', 'L')
123
- NetWkstaSetInfo = Win32API.new('netapi32', 'NetWkstaSetInfo', 'PLPP', 'L')
124
- NetWkstaTransportAdd = Win32API.new('netapi32', 'NetWkstaTransportAdd', 'PLPP', 'L')
125
- NetWkstaTransportDel = Win32API.new('netapi32', 'NetWkstaTransportDel', 'PPL', 'L')
126
- NetWkstaTransportEnum = Win32API.new('netapi32', 'NetWkstaTransportEnum', 'PLPLPPP', 'L')
127
- NetWkstaUserEnum = Win32API.new('netapi32', 'NetWkstaUserEnum', 'PLPLPPP', 'L')
128
- NetWkstaUserGetInfo = Win32API.new('netapi32', 'NetWkstaUserGetInfo', 'PLP', 'L')
129
- NetWkstaUserSetInfo = Win32API.new('netapi32', 'NetWkstaUserSetInfo', 'PPLP', 'L')
130
-
52
+ API.new('NetAlertRaise', 'PPL', 'L', 'netapi32')
53
+ API.new('NetAlertRaiseEx', 'PPLP', 'L', 'netapi32')
54
+ API.new('NetApiBufferAllocate', 'LP', 'L', 'netapi32')
55
+ API.new('NetApiBufferFree', 'P', 'L', 'netapi32')
56
+ API.new('NetApiBufferReallocate', 'PLP', 'L', 'netapi32')
57
+ API.new('NetApiBufferSize', 'PP', 'L', 'netapi32')
58
+ API.new('NetGetAnyDCName', 'PPP', 'L', 'netapi32')
59
+ API.new('NetGetDCName', 'PPP', 'L', 'netapi32')
60
+ API.new('NetGetDisplayInformationIndex', 'PLPP', 'L', 'netapi32')
61
+ API.new('NetGetJoinableOUs', 'PPPPPP', 'L', 'netapi32')
62
+ API.new('NetGetJoinInformation', 'PPP', 'L', 'netapi32')
63
+ API.new('NetGroupAdd', 'PLPP', 'L', 'netapi32')
64
+ API.new('NetGroupAddUser', 'PPP', 'L', 'netapi32')
65
+ API.new('NetGroupDel', 'PP', 'L', 'netapi32')
66
+ API.new('NetGroupDelUser', 'PPP', 'L', 'netapi32')
67
+ API.new('NetGroupEnum', 'PLPLPPP', 'L', 'netapi32')
68
+ API.new('NetGroupGetInfo', 'PPLP', 'L', 'netapi32')
69
+ API.new('NetGroupGetUsers', 'PPLPLPPP', 'L', 'netapi32')
70
+ API.new('NetGroupSetInfo', 'PPLPP', 'L', 'netapi32')
71
+ API.new('NetGroupSetUsers', 'PPLPL', 'L', 'netapi32')
72
+ API.new('NetJoinDomain', 'PPPPPL', 'L', 'netapi32')
73
+ API.new('NetLocalGroupAdd', 'PLPP', 'L', 'netapi32')
74
+ API.new('NetLocalGroupAddMembers', 'PPLPL', 'L', 'netapi32')
75
+ API.new('NetLocalGroupDel', 'PP', 'L', 'netapi32')
76
+ API.new('NetLocalGroupDelMembers', 'PPLPL', 'L', 'netapi32')
77
+ API.new('NetLocalGroupEnum', 'PLPLPPP', 'L', 'netapi32')
78
+ API.new('NetLocalGroupGetInfo', 'PPLP', 'L', 'netapi32')
79
+ API.new('NetLocalGroupGetMembers', 'PPLPLPPP', 'L', 'netapi32')
80
+ API.new('NetLocalGroupSetInfo', 'PPLPP', 'L', 'netapi32')
81
+ API.new('NetLocalGroupSetMembers', 'PPLPP', 'L', 'netapi32')
82
+ API.new('NetMessageBufferSend', 'PPPPL', 'L', 'netapi32')
83
+ API.new('NetMessageNameAdd', 'PP', 'L', 'netapi32')
84
+ API.new('NetMessageNameDel', 'PP', 'L', 'netapi32')
85
+ API.new('NetMessageNameEnum', 'PLPLPPP', 'L', 'netapi32')
86
+ API.new('NetMessageNameGetInfo', 'PPLP', 'L', 'netapi32')
87
+ API.new('NetQueryDisplayInformation', 'PLLLLPP', 'L', 'netapi32')
88
+ API.new('NetRemoteComputerSupports', 'PLP', 'L', 'netapi32')
89
+ API.new('NetRemoteTOD', 'PP', 'L', 'netapi32')
90
+ API.new('NetRenameMachineInDomain', 'PPPPL', 'L', 'netapi32')
91
+ API.new('NetScheduleJobAdd', 'PPP', 'L', 'netapi32')
92
+ API.new('NetScheduleJobDel', 'PLL', 'L', 'netapi32')
93
+ API.new('NetScheduleJobEnum', 'PPLPPP', 'L', 'netapi32')
94
+ API.new('NetScheduleJobGetInfo', 'PLP', 'L', 'netapi32')
95
+ API.new('NetServerComputerNameAdd', 'PPP', 'L', 'netapi32')
96
+ API.new('NetServerComputerNameDel', 'PP', 'L', 'netapi32')
97
+ API.new('NetServerDiskEnum', 'PLPLPPP', 'L', 'netapi32')
98
+ API.new('NetServerEnum', 'PLPLPPLPP', 'L', 'netapi32')
99
+ API.new('NetServerGetInfo', 'PLP', 'L', 'netapi32')
100
+ API.new('NetServerSetInfo', 'PLPP', 'L', 'netapi32')
101
+ API.new('NetServerTransportAdd', 'PLP', 'L', 'netapi32')
102
+ API.new('NetServerTransportAddEx', 'PLP', 'L', 'netapi32')
103
+ API.new('NetServerTransportDel', 'PLP', 'L', 'netapi32')
104
+ API.new('NetServerTransportEnum', 'PLPLPPP', 'L', 'netapi32')
105
+ API.new('NetUnjoinDomain', 'PPPL', 'L', 'netapi32')
106
+ API.new('NetUseAdd', 'PLPP', 'L', 'netapi32')
107
+ API.new('NetUseDel', 'PPL', 'L', 'netapi32')
108
+ API.new('NetUseEnum', 'PLPLPPP', 'L', 'netapi32')
109
+ API.new('NetUseGetInfo', 'PPLP', 'L', 'netapi32')
110
+ API.new('NetUserAdd', 'PLPP', 'L', 'netapi32')
111
+ API.new('NetUserChangePassword', 'PPPP', 'L', 'netapi32')
112
+ API.new('NetUserDel', 'PP', 'L', 'netapi32')
113
+ API.new('NetUserEnum', 'PLLPLPPP', 'L', 'netapi32')
114
+ API.new('NetUserGetGroups', 'PPLPLPP', 'L', 'netapi32')
115
+ API.new('NetUserGetInfo', 'PPLP', 'L', 'netapi32')
116
+ API.new('NetUserGetLocalGroups', 'PPLLPLPP', 'L', 'netapi32')
117
+ API.new('NetUserModalsGet', 'PLP', 'L', 'netapi32')
118
+ API.new('NetUserModalsSet', 'PLPP', 'L', 'netapi32')
119
+ API.new('NetUserSetGroups', 'PPLPL', 'L', 'netapi32')
120
+ API.new('NetUserSetInfo', 'PPLPP', 'L', 'netapi32')
121
+ API.new('NetValidateName', 'PPPPP', 'L', 'netapi32')
122
+ API.new('NetWkstaGetInfo', 'PLP', 'L', 'netapi32')
123
+ API.new('NetWkstaSetInfo', 'PLPP', 'L', 'netapi32')
124
+ API.new('NetWkstaTransportAdd', 'PLPP', 'L', 'netapi32')
125
+ API.new('NetWkstaTransportDel', 'PPL', 'L', 'netapi32')
126
+ API.new('NetWkstaTransportEnum', 'PLPLPPP', 'L', 'netapi32')
127
+ API.new('NetWkstaUserEnum', 'PLPLPPP', 'L', 'netapi32')
128
+ API.new('NetWkstaUserGetInfo', 'PLP', 'L', 'netapi32')
129
+ API.new('NetWkstaUserSetInfo', 'PPLP', 'L', 'netapi32')
130
+
131
+ # Windows XP or later.
131
132
  begin
132
- GetNetScheduleAccountInformation = Win32API.new('mstask', 'GetNetScheduleAccountInformation', 'PLP', 'L')
133
- SetNetScheduleAccountInformation = Win32API.new('netapi32', 'SetNetScheduleAccountInformation', 'PPP', 'L')
133
+ API.new('GetNetScheduleAccountInformation', 'PLP', 'L', 'mstask')
134
+ API.new('SetNetScheduleAccountInformation', 'PPP', 'L', 'netapi32')
134
135
  rescue Exception
135
- # Do nothing. Not supported on current platform
136
+ # Do nothing. Not supported on current platform.
136
137
  end
137
138
 
138
139
  def NetAlertRaise(name, buf, bufsize)