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