From def5c50960eea4c112647f88361a3ae7155901a8 Mon Sep 17 00:00:00 2001 From: egor-tensin Date: Tue, 4 Jul 2023 00:48:00 +0000 Subject: =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20egor-tensin/wina?= =?UTF-8?q?pi-common@0c196cbe8b4927c78c02b2c7312fc69a507db845=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sid_8hpp_source.html | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sid_8hpp_source.html (limited to 'sid_8hpp_source.html') diff --git a/sid_8hpp_source.html b/sid_8hpp_source.html new file mode 100644 index 0000000..c37466e --- /dev/null +++ b/sid_8hpp_source.html @@ -0,0 +1,121 @@ + + + + + + + +winapi_common: include/winapi/sid.hpp Source File + + + + + + + + + +
+
+ + + + + + +
+
winapi_common +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
sid.hpp
+
+
+
1 // Copyright (c) 2020 Egor Tensin <Egor.Tensin@gmail.com>
+
2 // This file is part of the "winapi-common" project.
+
3 // For details, see https://github.com/egor-tensin/winapi-common.
+
4 // Distributed under the MIT License.
+
5 
+
6 #pragma once
+
7 
+
8 #include "buffer.hpp"
+
9 
+
10 #include <windows.h>
+
11 
+
12 #include <cstddef>
+
13 #include <string>
+
14 
+
15 namespace winapi {
+
16 
+
17 class Sid {
+
18 public:
+
19  static constexpr std::size_t MAX_SID_SIZE = SECURITY_MAX_SID_SIZE;
+
20 
+
21  typedef SID Impl;
+
22 
+
23  static Sid well_known(WELL_KNOWN_SID_TYPE type);
+
24 
+
25  static Sid builtin_administrators();
+
26 
+
27  explicit Sid(const Buffer& buffer) : m_buffer(buffer) {}
+
28 
+
29  explicit operator SID&() { return get_impl(); }
+
30  explicit operator const SID&() const { return get_impl(); }
+
31 
+
32  std::string to_string() const;
+
33 
+
34 private:
+
35  Impl& get_impl() { return *reinterpret_cast<SID*>(m_buffer.data()); }
+
36  const Impl& get_impl() const { return *reinterpret_cast<const SID*>(m_buffer.data()); }
+
37 
+
38  Buffer m_buffer;
+
39 };
+
40 
+
41 } // namespace winapi
+
Binary data container.
Definition: buffer.hpp:24
+ +
+ + + + -- cgit v1.2.3