ProcessToken.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace AppSecInc
4 {
5  namespace LSA
6  {
9  {
10  private:
11  HANDLE m_h;
12  public:
13  ProcessToken();
14  virtual ~ProcessToken();
16  void Open(HANDLE hProc, DWORD access = TOKEN_ALL_ACCESS);
18  void Close();
20  bool IsOpen() const { return m_h != NULL; }
22  HANDLE GetHandle() const { return m_h; }
24  void AdjustPrivilege(const std::wstring& privilege, DWORD type = SE_PRIVILEGE_ENABLED);
25  };
26  }
27 }
28 
void Open(HANDLE hProc, DWORD access=TOKEN_ALL_ACCESS)
open a process token handle
Definition: ProcessToken.cpp:12
ProcessToken()
Definition: ProcessToken.cpp:6
void Close()
close a process token handle
Definition: ProcessToken.cpp:31
void AdjustPrivilege(const std::wstring &privilege, DWORD type=SE_PRIVILEGE_ENABLED)
adjust a process token privilege
Definition: ProcessToken.cpp:42
bool IsOpen() const
returns true if process token handle is open
Definition: ProcessToken.h:20
virtual ~ProcessToken()
Definition: ProcessToken.cpp:23
HANDLE GetHandle() const
returns the process handle
Definition: ProcessToken.h:22
A process token.
Definition: ProcessToken.h:8


© Application Security Inc. - All Rights Reserved http://msiext.codeplex.com