]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/winapi/security.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / winapi / security.hpp
1 /*
2 * Copyright 2010 Vicente J. Botet Escriba
3 * Copyright 2015 Andrey Semashev
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * See http://www.boost.org/LICENSE_1_0.txt
7 */
8
9 #ifndef BOOST_WINAPI_SECURITY_HPP_INCLUDED_
10 #define BOOST_WINAPI_SECURITY_HPP_INCLUDED_
11
12 #include <boost/winapi/basic_types.hpp>
13
14 #ifdef BOOST_HAS_PRAGMA_ONCE
15 #pragma once
16 #endif
17
18 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
19
20 #if !defined( BOOST_USE_WINDOWS_H )
21 extern "C" {
22 struct _ACL;
23 struct _SECURITY_DESCRIPTOR;
24 #if defined( BOOST_WINAPI_IS_MINGW )
25 typedef _SECURITY_DESCRIPTOR *PSECURITY_DESCRIPTOR;
26 #else
27 typedef boost::winapi::PVOID_ PSECURITY_DESCRIPTOR;
28 #endif
29
30 BOOST_SYMBOL_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
31 InitializeSecurityDescriptor(
32 PSECURITY_DESCRIPTOR pSecurityDescriptor,
33 boost::winapi::DWORD_ dwRevision);
34 BOOST_SYMBOL_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
35 SetSecurityDescriptorDacl(
36 PSECURITY_DESCRIPTOR pSecurityDescriptor,
37 boost::winapi::BOOL_ bDaclPresent,
38 ::_ACL* pDacl,
39 boost::winapi::BOOL_ bDaclDefaulted);
40 }
41 #endif
42
43 namespace boost {
44 namespace winapi {
45
46 typedef PVOID_ PSID_;
47 typedef WORD_ SECURITY_DESCRIPTOR_CONTROL_, *PSECURITY_DESCRIPTOR_CONTROL_;
48
49 typedef struct BOOST_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_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 #endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
80 #endif // BOOST_WINAPI_SECURITY_HPP_INCLUDED_