Imported Upstream version 1.57.0
[platform/upstream/boost.git] / boost / detail / winapi / security.hpp
1 //  security.hpp  --------------------------------------------------------------//
2
3 //  Copyright 2010 Vicente J. Botet Escriba
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_DETAIL_WINAPI_SECURITY_HPP
10 #define BOOST_DETAIL_WINAPI_SECURITY_HPP
11
12 #include <boost/detail/winapi/basic_types.hpp>
13
14 #ifdef BOOST_HAS_PRAGMA_ONCE
15 #pragma once
16 #endif
17
18 namespace boost
19 {
20 namespace detail
21 {
22 namespace winapi
23 {
24 #if defined( BOOST_USE_WINDOWS_H )
25 typedef ::SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES_;
26 typedef ::PSECURITY_ATTRIBUTES PSECURITY_ATTRIBUTES_;
27 typedef ::LPSECURITY_ATTRIBUTES LPSECURITY_ATTRIBUTES_;
28     
29 #else
30 extern "C" { 
31     struct SECURITY_DESCRIPTOR_;
32     typedef SECURITY_DESCRIPTOR_* PSECURITY_DESCRIPTOR_;
33     typedef struct _ACL {
34       BYTE_ AclRevision;
35       BYTE_ Sbz1;
36       WORD_ AclSize;
37       WORD_ AceCount;
38       WORD_ Sbz2;
39     } ACL_, *PACL_;
40
41     typedef struct _SECURITY_ATTRIBUTES {
42       DWORD_  nLength;
43       LPVOID_ lpSecurityDescriptor;
44       BOOL_   bInheritHandle;
45     } SECURITY_ATTRIBUTES_, *PSECURITY_ATTRIBUTES_, *LPSECURITY_ATTRIBUTES_;
46
47     __declspec(dllimport) BOOL_ __stdcall 
48         InitializeSecurityDescriptor(
49             PSECURITY_DESCRIPTOR_ pSecurityDescriptor,
50             DWORD_ dwRevision
51     );
52     __declspec(dllimport) BOOL_ __stdcall 
53         SetSecurityDescriptorDacl(
54             PSECURITY_DESCRIPTOR_ pSecurityDescriptor,
55             BOOL_ bDaclPresent,
56             PACL_ pDacl,
57             BOOL_ bDaclDefaulted
58     );
59 }
60 #endif
61 }
62 }
63 }
64
65 #endif // BOOST_DETAIL_WINAPI_SECURITY_HPP