2 * Copyright 2010 Vicente J. Botet Escriba
3 * Copyright 2015 Andrey Semashev
5 * Distributed under the Boost Software License, Version 1.0.
6 * See http://www.boost.org/LICENSE_1_0.txt
9 #ifndef BOOST_WINAPI_SECURITY_HPP_INCLUDED_
10 #define BOOST_WINAPI_SECURITY_HPP_INCLUDED_
12 #include <boost/winapi/basic_types.hpp>
14 #ifdef BOOST_HAS_PRAGMA_ONCE
18 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
20 #if !defined( BOOST_USE_WINDOWS_H )
23 struct _SECURITY_DESCRIPTOR;
24 #if defined( BOOST_WINAPI_IS_MINGW )
25 typedef _SECURITY_DESCRIPTOR *PSECURITY_DESCRIPTOR;
27 typedef boost::winapi::PVOID_ PSECURITY_DESCRIPTOR;
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,
39 boost::winapi::BOOL_ bDaclDefaulted);
47 typedef WORD_ SECURITY_DESCRIPTOR_CONTROL_, *PSECURITY_DESCRIPTOR_CONTROL_;
49 typedef struct BOOST_MAY_ALIAS _ACL {
57 typedef struct BOOST_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);
79 #endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
80 #endif // BOOST_WINAPI_SECURITY_HPP_INCLUDED_