win32-security 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +4 -0
- data/lib/win32/security.rb +1 -1
- data/lib/win32/security/windows/functions.rb +31 -27
- data/test/test_security.rb +1 -1
- data/win32-security.gemspec +1 -1
- metadata +2 -2
data/CHANGES
CHANGED
data/lib/win32/security.rb
CHANGED
@@ -13,6 +13,10 @@ module Windows
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
+
typedef :ulong, :dword
|
17
|
+
typedef :uintptr_t, :handle
|
18
|
+
typedef :pointer, :ptr
|
19
|
+
|
16
20
|
ffi_lib :kernel32
|
17
21
|
|
18
22
|
enum :token_info_class, [
|
@@ -59,39 +63,39 @@ module Windows
|
|
59
63
|
:MaxTokenInfoClass
|
60
64
|
]
|
61
65
|
|
62
|
-
attach_pfunc :GetCurrentProcess, [], :
|
63
|
-
attach_pfunc :GetCurrentThread, [], :
|
64
|
-
attach_pfunc :GetVersionExA, [:
|
65
|
-
attach_pfunc :GetLastError, [], :
|
66
|
-
attach_pfunc :CloseHandle, [:
|
66
|
+
attach_pfunc :GetCurrentProcess, [], :handle
|
67
|
+
attach_pfunc :GetCurrentThread, [], :handle
|
68
|
+
attach_pfunc :GetVersionExA, [:ptr], :bool
|
69
|
+
attach_pfunc :GetLastError, [], :dword
|
70
|
+
attach_pfunc :CloseHandle, [:dword], :bool
|
67
71
|
|
68
72
|
ffi_lib :advapi32
|
69
73
|
|
70
|
-
attach_pfunc :AddAccessAllowedAce, [:
|
74
|
+
attach_pfunc :AddAccessAllowedAce, [:ptr, :dword, :dword, :ptr], :bool
|
71
75
|
attach_pfunc :AllocateAndInitializeSid,
|
72
|
-
[:
|
73
|
-
attach_pfunc :CheckTokenMembership, [:
|
74
|
-
attach_pfunc :ConvertSidToStringSid, :ConvertSidToStringSidA, [:
|
75
|
-
attach_pfunc :ConvertStringSidToSid, :ConvertStringSidToSidA, [:string, :
|
76
|
-
attach_pfunc :EqualSid, [:
|
77
|
-
attach_pfunc :FindFirstFreeAce, [:
|
78
|
-
attach_pfunc :GetAclInformation, [:
|
79
|
-
attach_pfunc :GetLengthSid, [:
|
80
|
-
attach_pfunc :GetSidLengthRequired, [:uint], :
|
81
|
-
attach_pfunc :GetSidSubAuthority, [:
|
82
|
-
attach_pfunc :GetTokenInformation, [:
|
83
|
-
attach_pfunc :InitializeAcl, [:
|
84
|
-
attach_pfunc :InitializeSid, [:
|
85
|
-
attach_pfunc :IsValidAcl, [:
|
86
|
-
attach_pfunc :IsValidSid, [:
|
87
|
-
attach_pfunc :IsWellKnownSid, [:
|
76
|
+
[:ptr, :int, :dword, :dword, :dword, :dword, :dword, :dword, :dword, :dword, :ptr], :bool
|
77
|
+
attach_pfunc :CheckTokenMembership, [:handle, :ptr, :ptr], :bool
|
78
|
+
attach_pfunc :ConvertSidToStringSid, :ConvertSidToStringSidA, [:ptr, :ptr], :bool
|
79
|
+
attach_pfunc :ConvertStringSidToSid, :ConvertStringSidToSidA, [:string, :ptr], :bool
|
80
|
+
attach_pfunc :EqualSid, [:ptr, :ptr], :bool
|
81
|
+
attach_pfunc :FindFirstFreeAce, [:ptr, :ptr], :bool
|
82
|
+
attach_pfunc :GetAclInformation, [:ptr, :ptr, :dword, :int], :bool
|
83
|
+
attach_pfunc :GetLengthSid, [:ptr], :dword
|
84
|
+
attach_pfunc :GetSidLengthRequired, [:uint], :dword
|
85
|
+
attach_pfunc :GetSidSubAuthority, [:ptr, :dword], :ptr
|
86
|
+
attach_pfunc :GetTokenInformation, [:handle, :token_info_class, :ptr, :dword, :ptr], :bool
|
87
|
+
attach_pfunc :InitializeAcl, [:ptr, :dword, :dword], :bool
|
88
|
+
attach_pfunc :InitializeSid, [:ptr, :ptr, :uint], :bool
|
89
|
+
attach_pfunc :IsValidAcl, [:ptr], :bool
|
90
|
+
attach_pfunc :IsValidSid, [:ptr], :bool
|
91
|
+
attach_pfunc :IsWellKnownSid, [:ptr, :int], :bool
|
88
92
|
attach_pfunc :LookupAccountName, :LookupAccountNameA,
|
89
|
-
[:string, :string, :
|
93
|
+
[:string, :string, :ptr, :ptr, :ptr, :ptr, :ptr], :bool
|
90
94
|
attach_pfunc :LookupAccountSid, :LookupAccountSidA,
|
91
|
-
[:string, :
|
92
|
-
attach_pfunc :OpenProcessToken, [:
|
93
|
-
attach_pfunc :OpenThreadToken, [:
|
94
|
-
attach_pfunc :SetAclInformation, [:
|
95
|
+
[:string, :ptr, :ptr, :ptr, :ptr, :ptr, :ptr], :bool
|
96
|
+
attach_pfunc :OpenProcessToken, [:handle, :dword, :ptr], :bool
|
97
|
+
attach_pfunc :OpenThreadToken, [:handle, :dword, :bool, :ptr], :bool
|
98
|
+
attach_pfunc :SetAclInformation, [:ptr, :ptr, :dword, :int], :bool
|
95
99
|
end
|
96
100
|
end
|
97
101
|
end
|
data/test/test_security.rb
CHANGED
@@ -9,7 +9,7 @@ require 'win32/security'
|
|
9
9
|
|
10
10
|
class TC_Win32_Security < Test::Unit::TestCase
|
11
11
|
test "version constant is set to expected value" do
|
12
|
-
assert_equal('0.2.
|
12
|
+
assert_equal('0.2.2', Win32::Security::VERSION)
|
13
13
|
end
|
14
14
|
|
15
15
|
test "elevated security basic functionality" do
|
data/win32-security.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: win32-security
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-04-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: ffi
|