1 // security.hpp --------------------------------------------------------------//
3 // Copyright 2010 Vicente J. Botet Escriba
4 // Copyright 2015 Andrey Semashev
6 // Distributed under the Boost Software License, Version 1.0.
7 // See http://www.boost.org/LICENSE_1_0.txt
10 #ifndef BOOST_DETAIL_WINAPI_SECURITY_HPP
11 #define BOOST_DETAIL_WINAPI_SECURITY_HPP
13 #include <boost/detail/winapi/basic_types.hpp>
15 #ifdef BOOST_HAS_PRAGMA_ONCE
19 #if !defined( BOOST_USE_WINDOWS_H )
22 struct _SECURITY_DESCRIPTOR;
23 #if defined( BOOST_WINAPI_IS_MINGW )
24 typedef _SECURITY_DESCRIPTOR *PSECURITY_DESCRIPTOR;
26 typedef boost::detail::winapi::PVOID_ PSECURITY_DESCRIPTOR;
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,
38 boost::detail::winapi::BOOL_ bDaclDefaulted);
47 typedef WORD_ SECURITY_DESCRIPTOR_CONTROL_, *PSECURITY_DESCRIPTOR_CONTROL_;
49 typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _ACL {
57 typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SECURITY_DESCRIPTOR {
60 SECURITY_DESCRIPTOR_CONTROL_ Control;
65 } SECURITY_DESCRIPTOR_, *PISECURITY_DESCRIPTOR_;
67 typedef ::PSECURITY_DESCRIPTOR PSECURITY_DESCRIPTOR_;
69 using ::InitializeSecurityDescriptor;
71 BOOST_FORCEINLINE BOOL_ SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR_ pSecurityDescriptor, BOOL_ bDaclPresent, PACL_ pDacl, BOOL_ bDaclDefaulted)
73 return ::SetSecurityDescriptorDacl(pSecurityDescriptor, bDaclPresent, reinterpret_cast< ::_ACL* >(pDacl), bDaclDefaulted);
80 #endif // BOOST_DETAIL_WINAPI_SECURITY_HPP