Class: Ragweed::Wrap32::ProcessToken
- Defined in:
- lib/ragweed/wrap32/process_token.rb
Instance Method Summary collapse
- #grant(name) ⇒ Object
-
#initialize(p = nil) ⇒ ProcessToken
constructor
A new instance of ProcessToken.
Constructor Details
#initialize(p = nil) ⇒ ProcessToken
Returns a new instance of ProcessToken.
72 73 74 75 |
# File 'lib/ragweed/wrap32/process_token.rb', line 72 def initialize(p=nil) p ||= Ragweed::Wrap32::open_process(Ragweed::Wrap32::get_current_process_id) @h = Ragweed::Wrap32::open_process_token(p) end |
Instance Method Details
#grant(name) ⇒ Object
77 78 79 80 |
# File 'lib/ragweed/wrap32/process_token.rb', line 77 def grant(name) luid = Ragweed::Wrap32::lookup_privilege_value(name) Ragweed::Wrap32::adjust_token_privileges(@h, 0, [luid, Ragweed::Wrap32::PrivilegeAttribute::ENABLED]) end |