windows-pr 0.6.6 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +7 -0
- data/MANIFEST +1 -0
- data/lib/windows/clipboard.rb +17 -52
- data/lib/windows/com.rb +54 -0
- data/lib/windows/console.rb +62 -281
- data/lib/windows/debug.rb +36 -0
- data/lib/windows/device_io.rb +9 -7
- data/lib/windows/directory.rb +20 -75
- data/lib/windows/error.rb +51 -36
- data/lib/windows/eventlog.rb +20 -101
- data/lib/windows/file.rb +59 -295
- data/lib/windows/file_mapping.rb +14 -32
- data/lib/windows/filesystem.rb +8 -10
- data/lib/windows/handle.rb +15 -11
- data/lib/windows/library.rb +21 -63
- data/lib/windows/memory.rb +28 -106
- data/lib/windows/msvcrt/buffer.rb +20 -15
- data/lib/windows/msvcrt/file.rb +38 -7
- data/lib/windows/msvcrt/io.rb +180 -80
- data/lib/windows/msvcrt/string.rb +20 -15
- data/lib/windows/national.rb +16 -39
- data/lib/windows/network_management.rb +93 -92
- data/lib/windows/nio.rb +26 -0
- data/lib/windows/path.rb +68 -349
- data/lib/windows/pipe.rb +18 -56
- data/lib/windows/process.rb +28 -110
- data/lib/windows/registry.rb +27 -142
- data/lib/windows/security.rb +34 -142
- data/lib/windows/service.rb +34 -80
- data/lib/windows/shell.rb +10 -16
- data/lib/windows/sound.rb +17 -31
- data/lib/windows/synchronize.rb +24 -90
- data/lib/windows/system_info.rb +16 -47
- data/lib/windows/unicode.rb +21 -41
- data/lib/windows/volume.rb +23 -83
- data/lib/windows/window.rb +11 -17
- data/windows-pr.gemspec +3 -2
- metadata +17 -5
data/lib/windows/process.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
-
require '
|
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
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
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
|
-
|
77
|
-
|
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
|
data/lib/windows/registry.rb
CHANGED
@@ -85,154 +85,39 @@ module Windows
|
|
85
85
|
REG_QWORD = 11
|
86
86
|
REG_QWORD_LITTLE_ENDIAN = 11
|
87
87
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
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
|
-
|
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
|
data/lib/windows/security.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
-
require '
|
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
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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
|