1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/sandbox/win/src/sid.cc Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,26 @@ 1.4 +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1.5 +// Use of this source code is governed by a BSD-style license that can be 1.6 +// found in the LICENSE file. 1.7 + 1.8 +#include "sandbox/win/src/sid.h" 1.9 + 1.10 +#include "base/logging.h" 1.11 + 1.12 +namespace sandbox { 1.13 + 1.14 +Sid::Sid(const SID *sid) { 1.15 + ::CopySid(SECURITY_MAX_SID_SIZE, sid_, const_cast<SID*>(sid)); 1.16 +}; 1.17 + 1.18 +Sid::Sid(WELL_KNOWN_SID_TYPE type) { 1.19 + DWORD size_sid = SECURITY_MAX_SID_SIZE; 1.20 + BOOL result = ::CreateWellKnownSid(type, NULL, sid_, &size_sid); 1.21 + DCHECK(result); 1.22 + DBG_UNREFERENCED_LOCAL_VARIABLE(result); 1.23 +} 1.24 + 1.25 +const SID *Sid::GetPSID() const { 1.26 + return reinterpret_cast<SID*>(const_cast<BYTE*>(sid_)); 1.27 +} 1.28 + 1.29 +} // namespace sandbox