summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Hunt <chrahunt@gmail.com>2014-05-04 16:44:54 -0400
committerChristopher Hunt <chrahunt@gmail.com>2014-05-04 16:44:54 -0400
commitc9c378f5beaeb4734719a4cbab07779e08ebd25a (patch)
tree0e8b0c16a22a3f40838e56729754e91f89e42350
parentabee0e7fd9609d9c9b21eb6fabab27a3813b1eff (diff)
downloadnet-ssh-c9c378f5beaeb4734719a4cbab07779e08ebd25a.tar.gz
Add external methods for security attribute acquiration.
-rw-r--r--lib/net/ssh/authentication/pageant.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/net/ssh/authentication/pageant.rb b/lib/net/ssh/authentication/pageant.rb
index e351cac..7ae0b35 100644
--- a/lib/net/ssh/authentication/pageant.rb
+++ b/lib/net/ssh/authentication/pageant.rb
@@ -32,9 +32,10 @@ module Net; module SSH; module Authentication
dlload 'user32'
dlload 'kernel32'
+ dlload 'advapi32'
else
extend DL::Importer
- dlload 'user32','kernel32'
+ dlload 'user32','kernel32', 'advapi32'
include DL::Win32Types
end
@@ -79,6 +80,25 @@ module Net; module SSH; module Authentication
# args: hWnd, Msg, wParam, lParam, fuFlags, uTimeout, lpdwResult
extern 'LRESULT SendMessageTimeout(HWND, UINT, WPARAM, LPARAM, ' +
'UINT, UINT, PDWORD_PTR)'
+
+ # args: none
+ extern 'HANDLE GetCurrentProcess()'
+
+ # args: hProcessHandle, dwDesiredAccess, (out) phNewTokenHandle
+ extern 'BOOL OpenProcessToken(HANDLE, DWORD, PHANDLE)'
+
+ # args: hTokenHandle, uTokenInformationClass,
+ # (out) lpTokenInformation, dwTokenInformationLength
+ # (out) pdwInfoReturnLength
+ extern 'BOOL GetTokenInformation(HANDLE, UINT, LPVOID, DWORD, ' +
+ 'PDWORD)'
+
+ # args: (out) lpSecurityDescriptor, dwRevisionLevel
+ extern 'BOOL InitializeSecurityDescriptor(LPVOID, DWORD)'
+
+ # args: (out) lpSecurityDescriptor, lpOwnerSid, bOwnerDefaulted
+ extern 'BOOL SetSecurityDescriptorOwner(LPVOID, LPVOID, BOOL)'
+
if RUBY_VERSION < "1.9"
alias_method :FindWindow,:findWindow
module_function :FindWindow