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,7 +1,13 @@
1
- require 'Win32API'
1
+ require 'windows/api'
2
+ include Windows
2
3
 
3
4
  module Windows
4
5
  module Process
6
+ API.auto_namespace = 'Windows::Process'
7
+ API.auto_constant = true
8
+ API.auto_method = true
9
+ API.auto_unicode = true
10
+
5
11
  PROCESS_ALL_ACCESS = 0x1F0FFF
6
12
  PROCESS_CREATE_PROCESS = 0x0080
7
13
  PROCESS_CREATE_THREAD = 0x0002
@@ -51,121 +57,33 @@ module Windows
51
57
  STARTF_USESTDHANDLES = 0x00000100
52
58
  STARTF_USEHOTKEY = 0x00000200
53
59
 
54
- CreateProcess = Win32API.new('kernel32', 'CreateProcess', 'LPLLLLLPPP', 'I')
55
- CreateRemoteThread = Win32API.new('kernel32', 'CreateRemoteThread', 'LPLLPLP', 'L')
56
- CreateThread = Win32API.new('kernel32', 'CreateThread', 'PLPPLP', 'L')
57
- ExitProcess = Win32API.new('kernel32', 'ExitProcess', 'L', 'V')
58
- GetCommandLine = Win32API.new('kernel32', 'GetCommandLine', 'V', 'P')
59
- GetCurrentProcess = Win32API.new('kernel32', 'GetCurrentProcess', 'V', 'L')
60
- GetCurrentProcessId = Win32API.new('kernel32', 'GetCurrentProcessId', 'V', 'L')
61
- GetEnvironmentStrings = Win32API.new('kernel32', 'GetEnvironmentStrings', 'V', 'L')
62
- GetEnvironmentVariable = Win32API.new('kernel32', 'GetEnvironmentVariable', 'PPL', 'L')
63
- GetExitCodeProcess = Win32API.new('kernel32', 'GetExitCodeProcess', 'LP', 'I')
64
- GetPriorityClass = Win32API.new('kernel32', 'GetPriorityClass', 'L', 'L')
65
- GetProcessTimes = Win32API.new('kernel32', 'GetProcessTimes', 'LPPPP', 'I')
66
- GetStartupInfo = Win32API.new('kernel32', 'GetStartupInfo', 'P', 'V')
67
- OpenProcess = Win32API.new('kernel32', 'OpenProcess', 'LIL', 'L')
68
- SetEnvironmentVariable = Win32API.new('kernel32', 'SetEnvironmentVariable', 'PP', 'I')
69
- Sleep = Win32API.new('kernel32', 'Sleep', 'L', 'V')
70
- SleepEx = Win32API.new('kernel32', 'SleepEx', 'LI', 'L')
71
- TerminateProcess = Win32API.new('kernel32', 'TerminateProcess', 'LL', 'I')
72
- WaitForInputIdle = Win32API.new('user32', 'WaitForInputIdle', 'LL', 'L')
60
+ API.new('CreateProcess', 'LPLLLLLPPP', 'B')
61
+ API.new('CreateRemoteThread', 'LPLLPLP', 'L')
62
+ API.new('CreateThread', 'PLPPLP', 'L')
63
+ API.new('ExitProcess', 'L', 'V')
64
+ API.new('GetCommandLine', 'V', 'P')
65
+ API.new('GetCurrentProcess', 'V', 'L')
66
+ API.new('GetCurrentProcessId', 'V', 'L')
67
+ API.new('GetEnvironmentStrings', 'V', 'L')
68
+ API.new('GetEnvironmentVariable', 'PPL', 'L')
69
+ API.new('GetExitCodeProcess', 'LP', 'B')
70
+ API.new('GetPriorityClass', 'L', 'L')
71
+ API.new('GetProcessTimes', 'LPPPP', 'B')
72
+ API.new('GetStartupInfo', 'P', 'V')
73
+ API.new('OpenProcess', 'LIL', 'L')
74
+ API.new('SetEnvironmentVariable', 'PP', 'I')
75
+ API.new('Sleep', 'L', 'V')
76
+ API.new('SleepEx', 'LI', 'L')
77
+ API.new('TerminateProcess', 'LL', 'B')
78
+ API.new('WaitForInputIdle', 'LL', 'L', 'user32')
73
79
 
74
80
  # Windows XP or later
75
81
  begin
76
- GetProcessId = Win32API.new('kernel32', 'GetProcessId', 'L', 'L')
77
- GetProcessHandleCount = Win32API.new('kernel32', 'GetProcessHandleCount', 'LP', 'I')
82
+ API.new('GetProcessId', 'L', 'L')
83
+ API.new('GetProcessHandleCount', 'LP', 'B')
78
84
  rescue Exception
79
85
  # Do nothing - not supported on current platform. It's up to you to
80
86
  # check for the existence of the constant in your code.
81
87
  end
82
-
83
- def CreateProcess(app, cmd, pattr, tattr, handles, flags, env, dir, sinfo, pinfo)
84
- CreateProcess.call(app, cmd, pattr, tattr, handles, flags, env, dir, sinfo, pinfo) != 0
85
- end
86
-
87
- def CreateRemoteThread(handle, tattr, size, start, param, flags, tid)
88
- CreateRemoteThread.call(handle, tattr, size, start, param, flags, tid)
89
- end
90
-
91
- def CreateThread(attr, size, addr, param, flags, id)
92
- CreateThread.call(attr, size, addr, param, flags, id)
93
- end
94
-
95
- def ExitProcess(exit_code)
96
- ExitProcess.call(exit_code)
97
- end
98
-
99
- def GetCommandLine
100
- GetCommandLine.call
101
- end
102
-
103
- def GetCurrentProcess()
104
- GetCurrentProcess.call
105
- end
106
-
107
- def GetCurrentProcessId()
108
- GetCurrentProcessId.call
109
- end
110
-
111
- def GetEnvironmentStrings()
112
- GetEnvironmentStrings.call
113
- end
114
-
115
- def GetEnvironmentVariable(name, buffer, size)
116
- GetEnvironmentVariable.call(name, buffer, size)
117
- end
118
-
119
- def GetExitCodeProcess(handle, exit_code)
120
- GetExitCodeProcess.call(handle, exit_code) != 0
121
- end
122
-
123
- def GetPriorityClass(handle)
124
- GetPriorityClass.call(handle)
125
- end
126
-
127
- def GetProcessTimes(handle, t_creation, t_exit, t_kernel, t_user)
128
- GetProcessTimes.call(handle, t_creation, t_exit, t_kernel, t_user) != 0
129
- end
130
-
131
- def GetStartupInfo(info_struct)
132
- GetStartupInfo.call(info_struct)
133
- end
134
-
135
- def OpenProcess(access, handle, pid)
136
- OpenProcess.call(access, handle, pid)
137
- end
138
-
139
- def SetEnvironmentVariable(name, value)
140
- SetEnvironmentVariable.call(name, value)
141
- end
142
-
143
- def Sleep(milliseconds)
144
- Sleep.call(milliseconds)
145
- end
146
-
147
- def SleepEx(milliseconds, alertable)
148
- SleepEx.call(milliseconds, alertable)
149
- end
150
-
151
- def TerminateProcess(handle, exit_code)
152
- TerminateProcess.call(handle, exit_code) != 0
153
- end
154
-
155
- def WaitForInputIdle(handle, milliseconds)
156
- WaitForInputIdle.call(handle, milliseconds)
157
- end
158
-
159
- begin
160
- def GetProcessId(handle)
161
- GetProcessId.call(handle)
162
- end
163
-
164
- def GetProcessHandleCount(handle, count)
165
- GetProcessHandleCount.call(handle, count) != 0
166
- end
167
- rescue Exception
168
- # Windows XP or later
169
- end
170
88
  end
171
89
  end
@@ -85,154 +85,39 @@ module Windows
85
85
  REG_QWORD = 11
86
86
  REG_QWORD_LITTLE_ENDIAN = 11
87
87
 
88
- RegCloseKey = Win32API.new('advapi32', 'RegCloseKey', 'L', 'L')
89
- RegConnectRegistry = Win32API.new('advapi32', 'RegConnectRegistry', 'PLP', 'L')
90
- RegCreateKey = Win32API.new('advapi32', 'RegCreateKey', 'LPP', 'L')
91
- RegCreateKeyEx = Win32API.new('advapi32', 'RegCreateKeyEx', 'LPLPLLPPP', 'L')
92
- RegDeleteKey = Win32API.new('advapi32', 'RegDeleteKey', 'LP', 'L')
93
- RegDeleteValue = Win32API.new('advapi32', 'RegDeleteValue', 'LP', 'L')
94
- RegDisablePredefinedCache = Win32API.new('advapi32', 'RegDisablePredefinedCache', 'V', 'L')
95
- RegEnumKey = Win32API.new('advapi32', 'RegEnumKey', 'LLPL', 'L')
96
- RegEnumKeyEx = Win32API.new('advapi32', 'RegEnumKeyEx', 'LLPPPPP', 'L')
97
- RegEnumValue = Win32API.new('advapi32', 'RegEnumValue', 'LLPPPPPP', 'L')
98
- RegFlushKey = Win32API.new('advapi32', 'RegFlushKey', 'L', 'L')
99
- RegLoadKey = Win32API.new('advapi32', 'RegLoadKey', 'LPP', 'L')
100
- RegNotifyChangeKeyValue = Win32API.new('advapi32', 'RegNotifyChangeKeyValue', 'LILLI', 'L')
101
- RegOpenCurrentUser = Win32API.new('advapi32', 'RegOpenCurrentUser', 'LP', 'L')
102
- RegOpenKey = Win32API.new('advapi32', 'RegOpenKey', 'LPP', 'L')
103
- RegOpenKeyEx = Win32API.new('advapi32', 'RegOpenKeyEx', 'LPLLP', 'L')
104
- RegOpenUserClassesRoot = Win32API.new('advapi32', 'RegOpenUserClassesRoot', 'LLLP', 'L')
105
- RegOverridePredefKey = Win32API.new('advapi32', 'RegOverridePredefKey', 'LL', 'L')
106
- RegQueryInfoKey = Win32API.new('advapi32', 'RegQueryInfoKey', 'LPPPPPPPPPPP', 'L')
107
- RegQueryMultipleValues = Win32API.new('advapi32', 'RegQueryMultipleValues', 'LPLPP', 'L')
108
- RegQueryValueEx = Win32API.new('advapi32', 'RegQueryValueEx', 'LPPPPP', 'L')
109
- RegReplaceKey = Win32API.new('advapi32', 'RegReplaceKey', 'LPPP', 'L')
110
- RegRestoreKey = Win32API.new('advapi32', 'RegRestoreKey', 'LPL', 'L')
111
- RegSaveKey = Win32API.new('advapi32', 'RegSaveKey', 'LPP', 'L')
112
- RegSetValueEx = Win32API.new('advapi32', 'RegSetValueEx', 'LPLLPL', 'L')
113
- RegUnLoadKey = Win32API.new('advapi32', 'RegUnLoadKey', 'LP', 'L')
88
+ API.new('RegCloseKey', 'L', 'L', 'advapi32')
89
+ API.new('RegConnectRegistry', 'PLP', 'L', 'advapi32')
90
+ API.new('RegCreateKey', 'LPP', 'L', 'advapi32')
91
+ API.new('RegCreateKeyEx', 'LPLPLLPPP', 'L', 'advapi32')
92
+ API.new('RegDeleteKey', 'LP', 'L', 'advapi32')
93
+ API.new('RegDeleteValue', 'LP', 'L', 'advapi32')
94
+ API.new('RegDisablePredefinedCache', 'V', 'L', 'advapi32')
95
+ API.new('RegEnumKey', 'LLPL', 'L', 'advapi32')
96
+ API.new('RegEnumKeyEx', 'LLPPPPP', 'L', 'advapi32')
97
+ API.new('RegEnumValue', 'LLPPPPPP', 'L', 'advapi32')
98
+ API.new('RegFlushKey', 'L', 'L', 'advapi32')
99
+ API.new('RegLoadKey', 'LPP', 'L', 'advapi32')
100
+ API.new('RegNotifyChangeKeyValue', 'LILLI', 'L', 'advapi32')
101
+ API.new('RegOpenCurrentUser', 'LP', 'L', 'advapi32')
102
+ API.new('RegOpenKey', 'LPP', 'L', 'advapi32')
103
+ API.new('RegOpenKeyEx', 'LPLLP', 'L', 'advapi32')
104
+ API.new('RegOpenUserClassesRoot', 'LLLP', 'L', 'advapi32')
105
+ API.new('RegOverridePredefKey', 'LL', 'L', 'advapi32')
106
+ API.new('RegQueryInfoKey', 'LPPPPPPPPPPP', 'L', 'advapi32')
107
+ API.new('RegQueryMultipleValues', 'LPLPP', 'L', 'advapi32')
108
+ API.new('RegQueryValueEx', 'LPPPPP', 'L', 'advapi32')
109
+ API.new('RegReplaceKey', 'LPPP', 'L', 'advapi32')
110
+ API.new('RegRestoreKey', 'LPL', 'L', 'advapi32')
111
+ API.new('RegSaveKey', 'LPP', 'L', 'advapi32')
112
+ API.new('RegSetValueEx', 'LPLLPL', 'L', 'advapi32')
113
+ API.new('RegUnLoadKey', 'LP', 'L', 'advapi32')
114
114
 
115
115
  # Windows XP or later
116
116
  begin
117
- RegSaveKeyEx = Win32API.new('advapi32', 'RegSaveKeyEx', 'LPPL', 'L')
117
+ API.new('RegSaveKeyEx', 'LPPL', 'L', 'advapi32')
118
118
  rescue Exception
119
119
  # Do nothing - not supported on current platform. It's up to you to
120
120
  # check for the existence of the constant in your code.
121
121
  end
122
-
123
- def RegCloseKey(key)
124
- RegCloseKey.call(key)
125
- end
126
-
127
- def RegConnectRegistry(machine, key, result)
128
- RegConnectRegistry.call(machine, key, result)
129
- end
130
-
131
- def RegCreateKey(key, subkey, result)
132
- RegCreateKey.call(key, subkey, result)
133
- end
134
-
135
- def RegCreateKeyEx(key, subkey, res, klass, opt, sam, sec, result, disp)
136
- RegCreateKeyEx.call(key, subkey, res, klass, opt, sam, sec, result, disp)
137
- end
138
-
139
- def RegDeleteKey(key, subkey)
140
- RegDeleteKey.call(key, subkey)
141
- end
142
-
143
- def RegDeleteValue(key, value)
144
- RegDeleteValue.call(key, value)
145
- end
146
-
147
- def RegDisablePredefinedCache()
148
- RegDisablePredefinedCache.call()
149
- end
150
-
151
- def RegEnumKey(key, index, name, size)
152
- RegEnumKey.call(key, index, name, size)
153
- end
154
-
155
- def RegEnumKeyEx(key, index, name, size, res, klass, ksize, time)
156
- RegEnumKeyEx.call(key, index, name, size, res, klass, ksize, time)
157
- end
158
-
159
- def RegEnumValue(key, index, value, size, res, type, data, dsize)
160
- RegEnumValue.call(key, index, value, size, res, type, data, dsize)
161
- end
162
-
163
- def RegOpenKeyEx(key, subkey, options, sam, result)
164
- RegOpenKeyEx.call(key, subkey, options, sam, result)
165
- end
166
-
167
- def RegFlushKey(key)
168
- RegFlushKey.call(key)
169
- end
170
-
171
- def RegLoadKey(key, subkey, file)
172
- RegLoadKey.call(key, subkey, file)
173
- end
174
-
175
- def RegNotifyChangeKeyValue(key, subtree, filter, event, async)
176
- RegNotifyChangeKeyValue.call(key, subtree, filter, event, async)
177
- end
178
-
179
- def RegOpenCurrentUser(sam, result)
180
- RegOpenCurrentUser.call(sam, result)
181
- end
182
-
183
- def RegOpenKeyEx(key, subkey, options, sam, result)
184
- RegOpenKeyEx.call(key, subkey, options, sam, result)
185
- end
186
-
187
- def RegOpenUserClassesRoot(token, options, sam, result)
188
- RegOpenUserClassesRoot.call(token, options, sam, result)
189
- end
190
-
191
- def RegOverridePredefKey(key, new_key)
192
- RegOverridePredefKey.call(key, new_key)
193
- end
194
-
195
- def RegQueryInfoKey(key, klass, ksize, res, subkeys, maxkey, maxklass,
196
- values, maxname, maxvalue, sec, time)
197
- RegQueryInfoKey.call(key, klass, ksize, res, subkeys, maxkey, maxklass,
198
- values, maxname, maxvalue, sec, time)
199
- end
200
-
201
- def RegQueryMultipleValues(key, val_list, num_vals, buf, size)
202
- RegQueryMultipleValues.call(key, val_list, num_vals, buf, size)
203
- end
204
-
205
- def RegQueryValueEx(key, value, res, type, data, cbdata)
206
- RegQueryValueEx.call(key, value, res, type, data, cbdata)
207
- end
208
-
209
- def RegReplaceKey(key, subkey, newfile, oldfile)
210
- RegReplaceKey.call(key, subkey, newfile, oldfile)
211
- end
212
-
213
- def RegRestoreKey(key, file, flags)
214
- RegRestoreKey.call(key, file, flags)
215
- end
216
-
217
- def RegSaveKey(key, file, sec)
218
- RegSaveKey.call(key, file, sec)
219
- end
220
-
221
- def RegSetValueEx(key, value, res, type, data, size)
222
- RegSetValueEx.call(key, value, res, type, data, size)
223
- end
224
-
225
- def RegUnLoadKey(key, subkey)
226
- RegUnLoadKey.call(key, subkey)
227
- end
228
-
229
- # Windows XP or later
230
- begin
231
- def RegSaveKeyEx(key, file, sec, flags)
232
- RegSaveKeyEx.call(key, file, sec, flags)
233
- end
234
- rescue Exception
235
- # Do nothing - not supported on current platform
236
- end
237
122
  end
238
123
  end
@@ -1,7 +1,13 @@
1
- require 'Win32API'
1
+ require 'windows/api'
2
+ include Windows
2
3
 
3
4
  module Windows
4
5
  module Security
6
+ API.auto_namespace = 'Windows::Security'
7
+ API.auto_constant = true
8
+ API.auto_method = true
9
+ API.auto_unicode = false
10
+
5
11
  ACL_REVISION = 2
6
12
  ACL_REVISION2 = 2
7
13
  ACL_REVISION3 = 3
@@ -16,146 +22,32 @@ module Windows
16
22
  GENERIC_RIGHTS_CHK = 4026531840
17
23
  REST_RIGHTS_MASK = 2097151
18
24
 
19
- AddAce = Win32API.new('advapi32', 'AddAce', 'PLLLL', 'I')
20
- CopySid = Win32API.new('advapi32', 'CopySid', 'LLP', 'I')
21
-
22
- ConvertSidToStringSid = Win32API.new('advapi32', 'ConvertSidToStringSid', 'PL', 'I')
23
- ConvertSecurityDescriptorToStringSecurityDescriptor = Win32API.new('advapi32', 'ConvertSecurityDescriptorToStringSecurityDescriptor', 'PLLPP', 'I')
24
- ConvertStringSecurityDescriptorToSecurityDescriptor = Win32API.new('advapi32', 'ConvertStringSecurityDescriptorToSecurityDescriptor', 'PLPP', 'I')
25
- ConvertStringSidToSid = Win32API.new('advapi32', 'ConvertStringSidToSid', 'PL', 'I')
26
-
27
- GetAce = Win32API.new('advapi32', 'GetAce', 'LLP', 'I')
28
- GetFileSecurity = Win32API.new('advapi32', 'GetFileSecurity', 'PLPLP', 'I')
29
- GetLengthSid = Win32API.new('advapi32', 'GetLengthSid', 'P', 'L')
30
-
31
- GetSecurityDescriptorControl = Win32API.new('advapi32', 'GetSecurityDescriptorControl', 'PPP', 'I')
32
- GetSecurityDescriptorDacl = Win32API.new('advapi32', 'GetSecurityDescriptorDacl', 'PPPP', 'I')
33
- GetSecurityDescriptorGroup = Win32API.new('advapi32', 'GetSecurityDescriptorGroup', 'PPI', 'I')
34
- GetSecurityDescriptorLength = Win32API.new('advapi32', 'GetSecurityDescriptorLength', 'P', 'L')
35
- GetSecurityDescriptorOwner = Win32API.new('advapi32', 'GetSecurityDescriptorOwner', 'PPI', 'I')
36
- GetSecurityDescriptorRMControl = Win32API.new('advapi32', 'GetSecurityDescriptorRMControl', 'PP', 'L')
37
- GetSecurityDescriptorSacl = Win32API.new('advapi32', 'GetSecurityDescriptorSacl', 'PIPI', 'I')
38
-
39
- InitializeAcl = Win32API.new('advapi32', 'InitializeAcl', 'PLL', 'I')
40
- InitializeSecurityDescriptor = Win32API.new('advapi32', 'InitializeSecurityDescriptor', 'PL', 'I')
41
- IsValidSecurityDescriptor = Win32API.new('advapi32', 'IsValidSecurityDescriptor', 'P', 'I')
42
-
43
- LookupAccountName = Win32API.new('advapi32', 'LookupAccountName', 'PPPPPPP', 'I')
44
- LookupAccountSid = Win32API.new('advapi32', 'LookupAccountSid', 'PLPPPPP', 'I')
45
-
46
- SetFileSecurity = Win32API.new('advapi32', 'SetFileSecurity', 'PPP', 'I')
47
- SetSecurityDescriptorDacl = Win32API.new('advapi32', 'SetSecurityDescriptorDacl', 'PIPI', 'I')
48
- SetSecurityDescriptorGroup = Win32API.new('advapi32', 'SetSecurityDescriptorGroup', 'PPI', 'I')
49
- SetSecurityDescriptorOwner = Win32API.new('advapi32', 'SetSecurityDescriptorOwner', 'PPI', 'I')
50
- SetSecurityDescriptorRMControl = Win32API.new('advapi32', 'SetSecurityDescriptorRMControl', 'PP', 'L')
51
- SetSecurityDescriptorSacl = Win32API.new('advapi32', 'SetSecurityDescriptorSacl', 'PIPI', 'I')
52
-
53
- def AddAce(acl, rev, index, list, length)
54
- AddAce.call(acl, rev, index, list, length) != 0
55
- end
56
-
57
- def CopySid(sid_length, sid_buf, sid_source)
58
- CopySid.call(sid_length, sid_buf, sid_source) != 0
59
- end
60
-
61
- def ConvertSidToStringSid(sid, buf)
62
- ConvertSidToStringSid.call(sid, buf) != 0
63
- end
64
-
65
- def ConvertSecurityDescriptorToStringSecurityDescriptor(sid, revision, info, desc, desc_length)
66
- ConvertSecurityDescriptorToStringSecurityDescriptor.call(sid, revision, info, desc, desc_length).call != 0
67
- end
68
-
69
- def ConvertStringSecurityDescriptorToSecurityDescriptor(sid, revision, desc, desc_length)
70
- ConvertStringSecurityDescriptorToSecurityDescriptor.call(sid, revision, desc, desc_length) != 0
71
- end
72
-
73
- def ConvertStringSidToSid(string, sid)
74
- ConvertStringSidToSid.call(string, sid) != 0
75
- end
76
-
77
- def GetAce(acl, index, ace)
78
- GetAce.call(acl, index, ace) != 0
79
- end
80
-
81
- def GetFileSecurity(file, info, descriptor, length, nlength)
82
- GetFileSecurity.call(file, info, descriptor, length, nlength) != 0
83
- end
84
-
85
- def GetLengthSid(sid)
86
- GetLengthSid.call(sid)
87
- end
88
-
89
- def GetSecurityDescriptorControl(descriptor, control, revision)
90
- GetSecurityDescriptorControl.call(descriptor, control, revision) != 0
91
- end
92
-
93
- def GetSecurityDescriptorDacl(descriptor, dacl_present, dacl, default)
94
- GetSecurityDescriptorDacl.call(descriptor, dacl_present, dacl, default) != 0
95
- end
96
-
97
- def GetSecurityDescriptorGroup(descriptor, group, default)
98
- GetSecurityDescriptorGroup.call(descriptor, group, default) != 0
99
- end
100
-
101
- def GetSecurityDescriptorLength(descriptor)
102
- GetSecurityDescriptorLength.call(descriptor)
103
- end
104
-
105
- def GetSecurityDescriptorOwner(descriptor, owner, default)
106
- GetSecurityDescriptorOwner.call(descriptor, owner, default) != 0
107
- end
108
-
109
- def GetSecurityDescriptorRMControl(descriptor, control)
110
- GetSecurityDescriptorRMControl.call(descriptor, control)
111
- end
112
-
113
- def GetSecurityDescriptorSacl(descriptor, present, sacl, default)
114
- GetSecurityDescriptorSacl.call(descriptor, present, sacl, default) != 0
115
- end
116
-
117
- def InitializeAcl(acl, length, revision = ACL_REVISION)
118
- InitializeAcl.call(acl, length, revision) != 0
119
- end
120
-
121
- def InitializeSecurityDescriptor(descriptor, revision = SECURITY_DESCRIPTOR_REVISION)
122
- InitializeSecurityDescriptor.call(descriptor, revision) != 0
123
- end
124
-
125
- def IsValidSecurityDescriptor(descriptor)
126
- IsValidSecurityDescriptor.call(descriptor) != 0
127
- end
128
-
129
- def LookupAccountName(sys, name, sid, sid_size, domain, domain_size, use)
130
- LookupAccountName.call(sys, name, sid, sid_size, domain, domain_size, use) != 0
131
- end
132
-
133
- def LookupAccountSid(sys, sid, name, name_size, domain, domain_size, use)
134
- LookupAccountSid.call(sys, sid, name, name_size, domain, domain_size, use) != 0
135
- end
136
-
137
- def SetFileSecurity(file, info, descriptor)
138
- SetFileSecurity.call(file, info, descriptor) != 0
139
- end
140
-
141
- def SetSecurityDescriptorDacl(descriptor, present, dacl, default)
142
- SetSecurityDescriptorDacl.call(descriptor, present, dacl, default) != 0
143
- end
144
-
145
- def SetSecurityDescriptorGroup(descriptor, group, default)
146
- SetSecurityDescriptorGroup.call(descriptor, group, default) != 0
147
- end
148
-
149
- def SetSecurityDescriptorOwner(descriptor, owner, default)
150
- SetSecurityDescriptorOwner.call(descriptor, owner, default) != 0
151
- end
152
-
153
- def SetSecurityDescriptorRMControl(descriptor, control)
154
- SetSecurityDescriptorRMControl.call(descriptor, control)
155
- end
156
-
157
- def SetSecurityDescriptorSacl(descriptor, present, sacl, default)
158
- SetSecurityDescriptorSacl.call(descriptor, present, sacl, default) != 0
159
- end
25
+ API.new('AddAce', 'PLLLL', 'B', 'advapi32')
26
+ API.new('CopySid', 'LLP', 'B', 'advapi32')
27
+ API.new('ConvertSidToStringSid', 'PL', 'B', 'advapi32')
28
+ API.new('ConvertSecurityDescriptorToStringSecurityDescriptor', 'PLLPP', 'B', 'advapi32')
29
+ API.new('ConvertStringSecurityDescriptorToSecurityDescriptor', 'PLPP', 'B', 'advapi32')
30
+ API.new('ConvertStringSidToSid', 'PL', 'B', 'advapi32')
31
+ API.new('GetAce', 'LLP', 'B', 'advapi32')
32
+ API.new('GetFileSecurity', 'PLPLP', 'B', 'advapi32')
33
+ API.new('GetLengthSid', 'P', 'L', 'advapi32')
34
+ API.new('GetSecurityDescriptorControl', 'PPP', 'B', 'advapi32')
35
+ API.new('GetSecurityDescriptorDacl', 'PPPP', 'B', 'advapi32')
36
+ API.new('GetSecurityDescriptorGroup', 'PPI', 'B', 'advapi32')
37
+ API.new('GetSecurityDescriptorLength', 'P', 'L', 'advapi32')
38
+ API.new('GetSecurityDescriptorOwner', 'PPI', 'B', 'advapi32')
39
+ API.new('GetSecurityDescriptorRMControl', 'PP', 'L', 'advapi32')
40
+ API.new('GetSecurityDescriptorSacl', 'PIPI', 'B', 'advapi32')
41
+ API.new('InitializeAcl', 'PLL', 'B', 'advapi32')
42
+ API.new('InitializeSecurityDescriptor', 'PL', 'B', 'advapi32')
43
+ API.new('IsValidSecurityDescriptor', 'P', 'B', 'advapi32')
44
+ API.new('LookupAccountName', 'PPPPPPP', 'B', 'advapi32')
45
+ API.new('LookupAccountSid', 'PLPPPPP', 'B', 'advapi32')
46
+ API.new('SetFileSecurity', 'PPP', 'B', 'advapi32')
47
+ API.new('SetSecurityDescriptorDacl', 'PIPI', 'B', 'advapi32')
48
+ API.new('SetSecurityDescriptorGroup', 'PPI', 'B', 'advapi32')
49
+ API.new('SetSecurityDescriptorOwner', 'PPI', 'B', 'advapi32')
50
+ API.new('SetSecurityDescriptorRMControl', 'PP', 'L', 'advapi32')
51
+ API.new('SetSecurityDescriptorSacl', 'PIPI', 'B', 'advapi32')
160
52
  end
161
53
  end