security/sandbox/chromium/base/win/startup_information.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
michael@0 2 // Use of this source code is governed by a BSD-style license that can be
michael@0 3 // found in the LICENSE file.
michael@0 4
michael@0 5 #ifndef BASE_WIN_STARTUP_INFORMATION_H_
michael@0 6 #define BASE_WIN_STARTUP_INFORMATION_H_
michael@0 7
michael@0 8 #include <windows.h>
michael@0 9
michael@0 10 #include "base/base_export.h"
michael@0 11 #include "base/basictypes.h"
michael@0 12
michael@0 13 namespace base {
michael@0 14 namespace win {
michael@0 15
michael@0 16 // Manages the lifetime of additional attributes in STARTUPINFOEX.
michael@0 17 class BASE_EXPORT StartupInformation {
michael@0 18 public:
michael@0 19 StartupInformation();
michael@0 20
michael@0 21 ~StartupInformation();
michael@0 22
michael@0 23 // Initialize the attribute list for the specified number of entries.
michael@0 24 bool InitializeProcThreadAttributeList(DWORD attribute_count);
michael@0 25
michael@0 26 // Sets one entry in the initialized attribute list.
michael@0 27 bool UpdateProcThreadAttribute(DWORD_PTR attribute,
michael@0 28 void* value,
michael@0 29 size_t size);
michael@0 30
michael@0 31 LPSTARTUPINFOW startup_info() { return &startup_info_.StartupInfo; }
michael@0 32 const LPSTARTUPINFOW startup_info() const {
michael@0 33 return const_cast<const LPSTARTUPINFOW>(&startup_info_.StartupInfo);
michael@0 34 }
michael@0 35
michael@0 36 bool has_extended_startup_info() const {
michael@0 37 return !!startup_info_.lpAttributeList;
michael@0 38 }
michael@0 39
michael@0 40 private:
michael@0 41 STARTUPINFOEXW startup_info_;
michael@0 42 DISALLOW_COPY_AND_ASSIGN(StartupInformation);
michael@0 43 };
michael@0 44
michael@0 45 } // namespace win
michael@0 46 } // namespace base
michael@0 47
michael@0 48 #endif // BASE_WIN_SCOPED_STARTUP_INFO_EX_H_
michael@0 49

mercurial