]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/winapi/include/boost/detail/winapi/security.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / winapi / include / boost / detail / winapi / security.hpp
1 // security.hpp --------------------------------------------------------------//
2
3 // Copyright 2010 Vicente J. Botet Escriba
4 // Copyright 2015 Andrey Semashev
5
6 // Distributed under the Boost Software License, Version 1.0.
7 // See http://www.boost.org/LICENSE_1_0.txt
8
9
10 #ifndef BOOST_DETAIL_WINAPI_SECURITY_HPP
11 #define BOOST_DETAIL_WINAPI_SECURITY_HPP
12
13 #include <boost/detail/winapi/basic_types.hpp>
14
15 #ifdef BOOST_HAS_PRAGMA_ONCE
16 #pragma once
17 #endif
18
19 #if !defined( BOOST_USE_WINDOWS_H )
20 extern "C" {
21 struct _ACL;
22 struct _SECURITY_DESCRIPTOR;
23 #if defined( BOOST_WINAPI_IS_MINGW )
24 typedef _SECURITY_DESCRIPTOR *PSECURITY_DESCRIPTOR;
25 #else
26 typedef boost::detail::winapi::PVOID_ PSECURITY_DESCRIPTOR;
27 #endif
28
29 BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
30 InitializeSecurityDescriptor(
31 PSECURITY_DESCRIPTOR pSecurityDescriptor,
32 boost::detail::winapi::DWORD_ dwRevision);
33 BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
34 SetSecurityDescriptorDacl(
35 PSECURITY_DESCRIPTOR pSecurityDescriptor,
36 boost::detail::winapi::BOOL_ bDaclPresent,
37 ::_ACL* pDacl,
38 boost::detail::winapi::BOOL_ bDaclDefaulted);
39 }
40 #endif
41
42 namespace boost {
43 namespace detail {
44 namespace winapi {
45
46 typedef PVOID_ PSID_;
47 typedef WORD_ SECURITY_DESCRIPTOR_CONTROL_, *PSECURITY_DESCRIPTOR_CONTROL_;
48
49 typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _ACL {
50 BYTE_ AclRevision;
51 BYTE_ Sbz1;
52 WORD_ AclSize;
53 WORD_ AceCount;
54 WORD_ Sbz2;
55 } ACL_, *PACL_;
56
57 typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SECURITY_DESCRIPTOR {
58 BYTE_ Revision;
59 BYTE_ Sbz1;
60 SECURITY_DESCRIPTOR_CONTROL_ Control;
61 PSID_ Owner;
62 PSID_ Group;
63 PACL_ Sacl;
64 PACL_ Dacl;
65 } SECURITY_DESCRIPTOR_, *PISECURITY_DESCRIPTOR_;
66
67 typedef ::PSECURITY_DESCRIPTOR PSECURITY_DESCRIPTOR_;
68
69 using ::InitializeSecurityDescriptor;
70
71 BOOST_FORCEINLINE BOOL_ SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR_ pSecurityDescriptor, BOOL_ bDaclPresent, PACL_ pDacl, BOOL_ bDaclDefaulted)
72 {
73 return ::SetSecurityDescriptorDacl(pSecurityDescriptor, bDaclPresent, reinterpret_cast< ::_ACL* >(pDacl), bDaclDefaulted);
74 }
75
76 }
77 }
78 }
79
80 #endif // BOOST_DETAIL_WINAPI_SECURITY_HPP