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 CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.2.2 - 8-Apr-2013
2
+ * Fixed HANDLE prototypes in the underlying FFI code. This affected
3
+ 64 bit versions of Ruby.
4
+
1
5
  == 0.2.1 - 19-Feb-2013
2
6
  * Removed a trailing comma that was causing problems.
3
7
 
@@ -20,7 +20,7 @@ module Win32
20
20
  extend Windows::Security::Functions
21
21
 
22
22
  # The version of the win32-security library
23
- VERSION = '0.2.1'
23
+ VERSION = '0.2.2'
24
24
 
25
25
  # Used by OpenProcessToken
26
26
  TOKEN_QUERY = 8
@@ -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, [], :ulong
63
- attach_pfunc :GetCurrentThread, [], :ulong
64
- attach_pfunc :GetVersionExA, [:pointer], :bool
65
- attach_pfunc :GetLastError, [], :ulong
66
- attach_pfunc :CloseHandle, [:ulong], :bool
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, [:pointer, :ulong, :ulong, :pointer], :bool
74
+ attach_pfunc :AddAccessAllowedAce, [:ptr, :dword, :dword, :ptr], :bool
71
75
  attach_pfunc :AllocateAndInitializeSid,
72
- [:pointer, :int, :ulong, :ulong, :ulong, :ulong, :ulong, :ulong, :ulong, :ulong, :pointer], :bool
73
- attach_pfunc :CheckTokenMembership, [:ulong, :pointer, :pointer], :bool
74
- attach_pfunc :ConvertSidToStringSid, :ConvertSidToStringSidA, [:pointer, :pointer], :bool
75
- attach_pfunc :ConvertStringSidToSid, :ConvertStringSidToSidA, [:string, :pointer], :bool
76
- attach_pfunc :EqualSid, [:pointer, :pointer], :bool
77
- attach_pfunc :FindFirstFreeAce, [:pointer, :pointer], :bool
78
- attach_pfunc :GetAclInformation, [:pointer, :pointer, :ulong, :int], :bool
79
- attach_pfunc :GetLengthSid, [:pointer], :ulong
80
- attach_pfunc :GetSidLengthRequired, [:uint], :ulong
81
- attach_pfunc :GetSidSubAuthority, [:pointer, :ulong], :pointer
82
- attach_pfunc :GetTokenInformation, [:ulong, :token_info_class, :pointer, :ulong, :pointer], :bool
83
- attach_pfunc :InitializeAcl, [:pointer, :ulong, :ulong], :bool
84
- attach_pfunc :InitializeSid, [:pointer, :pointer, :uint], :bool
85
- attach_pfunc :IsValidAcl, [:pointer], :bool
86
- attach_pfunc :IsValidSid, [:pointer], :bool
87
- attach_pfunc :IsWellKnownSid, [:pointer, :int], :bool
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, :pointer, :pointer, :pointer, :pointer, :pointer], :bool
93
+ [:string, :string, :ptr, :ptr, :ptr, :ptr, :ptr], :bool
90
94
  attach_pfunc :LookupAccountSid, :LookupAccountSidA,
91
- [:string, :pointer, :pointer, :pointer, :pointer, :pointer, :pointer], :bool
92
- attach_pfunc :OpenProcessToken, [:ulong, :ulong, :pointer], :bool
93
- attach_pfunc :OpenThreadToken, [:ulong, :ulong, :bool, :pointer], :bool
94
- attach_pfunc :SetAclInformation, [:pointer, :pointer, :ulong, :int], :bool
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
@@ -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.1', Win32::Security::VERSION)
12
+ assert_equal('0.2.2', Win32::Security::VERSION)
13
13
  end
14
14
 
15
15
  test "elevated security basic functionality" do
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'win32-security'
5
- spec.version = '0.2.1'
5
+ spec.version = '0.2.2'
6
6
  spec.authors = ['Daniel J. Berger', 'Park Heesob']
7
7
  spec.license = 'Artistic 2.0'
8
8
  spec.email = 'djberg96@gmail.com'
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.1
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-02-20 00:00:00.000000000 Z
13
+ date: 2013-04-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ffi