michael@0: // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #include "sandbox/win/src/sid.h" michael@0: michael@0: #include "base/logging.h" michael@0: michael@0: namespace sandbox { michael@0: michael@0: Sid::Sid(const SID *sid) { michael@0: ::CopySid(SECURITY_MAX_SID_SIZE, sid_, const_cast(sid)); michael@0: }; michael@0: michael@0: Sid::Sid(WELL_KNOWN_SID_TYPE type) { michael@0: DWORD size_sid = SECURITY_MAX_SID_SIZE; michael@0: BOOL result = ::CreateWellKnownSid(type, NULL, sid_, &size_sid); michael@0: DCHECK(result); michael@0: DBG_UNREFERENCED_LOCAL_VARIABLE(result); michael@0: } michael@0: michael@0: const SID *Sid::GetPSID() const { michael@0: return reinterpret_cast(const_cast(sid_)); michael@0: } michael@0: michael@0: } // namespace sandbox