]> git.proxmox.com Git - ceph.git/blame - 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
CommitLineData
b32b8144
FG
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 */
7c673cae 8
b32b8144
FG
9#ifndef BOOST_WINAPI_SECURITY_HPP_INCLUDED_
10#define BOOST_WINAPI_SECURITY_HPP_INCLUDED_
7c673cae 11
b32b8144 12#include <boost/winapi/basic_types.hpp>
7c673cae
FG
13
14#ifdef BOOST_HAS_PRAGMA_ONCE
15#pragma once
16#endif
17
b32b8144
FG
18#if BOOST_WINAPI_PARTITION_APP_SYSTEM
19
7c673cae
FG
20#if !defined( BOOST_USE_WINDOWS_H )
21extern "C" {
22struct _ACL;
23struct _SECURITY_DESCRIPTOR;
24#if defined( BOOST_WINAPI_IS_MINGW )
25typedef _SECURITY_DESCRIPTOR *PSECURITY_DESCRIPTOR;
26#else
b32b8144 27typedef boost::winapi::PVOID_ PSECURITY_DESCRIPTOR;
7c673cae
FG
28#endif
29
92f5a8d4 30BOOST_SYMBOL_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
7c673cae
FG
31InitializeSecurityDescriptor(
32 PSECURITY_DESCRIPTOR pSecurityDescriptor,
b32b8144 33 boost::winapi::DWORD_ dwRevision);
92f5a8d4 34BOOST_SYMBOL_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
7c673cae
FG
35SetSecurityDescriptorDacl(
36 PSECURITY_DESCRIPTOR pSecurityDescriptor,
b32b8144 37 boost::winapi::BOOL_ bDaclPresent,
7c673cae 38 ::_ACL* pDacl,
b32b8144 39 boost::winapi::BOOL_ bDaclDefaulted);
7c673cae
FG
40}
41#endif
42
43namespace boost {
7c673cae
FG
44namespace winapi {
45
46typedef PVOID_ PSID_;
47typedef WORD_ SECURITY_DESCRIPTOR_CONTROL_, *PSECURITY_DESCRIPTOR_CONTROL_;
48
b32b8144 49typedef struct BOOST_MAY_ALIAS _ACL {
7c673cae
FG
50 BYTE_ AclRevision;
51 BYTE_ Sbz1;
52 WORD_ AclSize;
53 WORD_ AceCount;
54 WORD_ Sbz2;
55} ACL_, *PACL_;
56
b32b8144 57typedef struct BOOST_MAY_ALIAS _SECURITY_DESCRIPTOR {
7c673cae
FG
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
67typedef ::PSECURITY_DESCRIPTOR PSECURITY_DESCRIPTOR_;
68
69using ::InitializeSecurityDescriptor;
70
71BOOST_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
7c673cae
FG
76}
77}
78
b32b8144
FG
79#endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
80#endif // BOOST_WINAPI_SECURITY_HPP_INCLUDED_