winstd::security_id SID structure wrapper introduced
This commit is contained in:
parent
b09610fd5f
commit
7fac8e286f
@ -42,6 +42,7 @@ namespace winstd
|
|||||||
class WINSTD_API user_impersonator;
|
class WINSTD_API user_impersonator;
|
||||||
class WINSTD_API vmemory;
|
class WINSTD_API vmemory;
|
||||||
class WINSTD_API reg_key;
|
class WINSTD_API reg_key;
|
||||||
|
class WINSTD_API security_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -825,6 +826,31 @@ namespace winstd
|
|||||||
virtual void free_internal();
|
virtual void free_internal();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// SID wrapper class
|
||||||
|
///
|
||||||
|
class WINSTD_API security_id : public handle<PSID>
|
||||||
|
{
|
||||||
|
HANDLE_IMPL(security_id)
|
||||||
|
|
||||||
|
public:
|
||||||
|
///
|
||||||
|
/// Closes a handle to the SID.
|
||||||
|
///
|
||||||
|
/// \sa [FreeSid function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa446631.aspx)
|
||||||
|
///
|
||||||
|
virtual ~security_id();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
///
|
||||||
|
/// Closes a handle to the SID.
|
||||||
|
///
|
||||||
|
/// \sa [FreeSid function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa446631.aspx)
|
||||||
|
///
|
||||||
|
virtual void free_internal();
|
||||||
|
};
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
17
src/Win.cpp
17
src/Win.cpp
@ -309,3 +309,20 @@ void winstd::reg_key::free_internal()
|
|||||||
{
|
{
|
||||||
RegCloseKey(m_h);
|
RegCloseKey(m_h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
// winstd::security_id
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
winstd::security_id::~security_id()
|
||||||
|
{
|
||||||
|
if (m_h)
|
||||||
|
FreeSid(m_h);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void winstd::security_id::free_internal()
|
||||||
|
{
|
||||||
|
FreeSid(m_h);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user