Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / remoting / host / win / security_descriptor.h
blobacdef5372d6533f8f52a4e569dead07d2ec03432
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef REMOTING_HOST_WIN_SECURITY_DESCRIPTOR_H_
6 #define REMOTING_HOST_WIN_SECURITY_DESCRIPTOR_H_
8 #include <windows.h>
10 #include <string>
12 #include "remoting/base/typed_buffer.h"
14 namespace remoting {
16 typedef TypedBuffer<ACL> ScopedAcl;
17 typedef TypedBuffer<SECURITY_DESCRIPTOR> ScopedSd;
18 typedef TypedBuffer<SID> ScopedSid;
20 // Converts an SDDL string into a binary self-relative security descriptor.
21 ScopedSd ConvertSddlToSd(const std::string& sddl);
23 // Converts a SID into a text string.
24 std::string ConvertSidToString(SID* sid);
26 // Returns the logon SID of a token. Returns nullptr if the token does not
27 // specify a logon SID or in case of an error.
28 ScopedSid GetLogonSid(HANDLE token);
30 // Converts a security descriptor in self-relative format to a security
31 // descriptor in absolute format.
32 bool MakeScopedAbsoluteSd(const ScopedSd& relative_sd,
33 ScopedSd* absolute_sd,
34 ScopedAcl* dacl,
35 ScopedSid* group,
36 ScopedSid* owner,
37 ScopedAcl* sacl);
39 } // namespace remoting
41 #endif // REMOTING_HOST_WIN_SECURITY_DESCRIPTOR_H_