src/Common/Lsa/Sid.h

Go to the documentation of this file.
00001 #pragma once
00002 
00003 namespace AppSecInc 
00004 {
00005     namespace LSA
00006     {
00008                 class Sid
00009                 {
00010                 private:
00011                         SID_NAME_USE m_use;
00012                         std::vector<byte> m_data;
00013                 public:
00015                         Sid();
00017                         Sid(const Sid& sid);
00019                         Sid(PSID psid, SID_NAME_USE use = SidTypeInvalid);
00021                         Sid(const std::wstring& sid_string, SID_NAME_USE use = SidTypeInvalid);
00023                         Sid& operator=(const Sid& sid);
00025                         Sid& operator=(PSID psid);
00027                         Sid& operator=(const std::wstring&);
00029                         std::wstring ToString() const;
00031                         std::wstring ToHexString() const;
00033                         DWORD GetLength() const;
00035                         PSID GetPSID() const;
00037                         operator PSID() const { return GetPSID(); }
00039                         SID_NAME_USE GetUse() const { return m_use; }
00041                         void Set(PSID psid, SID_NAME_USE use = SidTypeUnknown);
00043                         void Set(const std::wstring& sid_string, SID_NAME_USE use = SidTypeUnknown);
00045                         bool operator==(const Sid&) const;
00047                         bool operator==(PSID) const;
00049                         bool IsValid() const;
00050                 };
00051     }
00052 }
00053 


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