OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 SANDBOX_SRC_WINDOW_H_ | 5 #ifndef SANDBOX_SRC_WINDOW_H_ |
6 #define SANDBOX_SRC_WINDOW_H_ | 6 #define SANDBOX_SRC_WINDOW_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
| 11 #include "base/strings/string16.h" |
11 #include "sandbox/win/src/sandbox_types.h" | 12 #include "sandbox/win/src/sandbox_types.h" |
12 | 13 |
13 namespace sandbox { | 14 namespace sandbox { |
14 | 15 |
15 // Creates a window station. The name is generated by the OS. The security | 16 // Creates a window station. The name is generated by the OS. The security |
16 // descriptor is based on the security descriptor of the current window | 17 // descriptor is based on the security descriptor of the current window |
17 // station. | 18 // station. |
18 ResultCode CreateAltWindowStation(HWINSTA* winsta); | 19 ResultCode CreateAltWindowStation(HWINSTA* winsta); |
19 | 20 |
20 // Creates a desktop. The name is a static string followed by the pid of the | 21 // Creates a desktop. The name is a static string followed by the pid of the |
21 // current process. The security descriptor on the new desktop is based on the | 22 // current process. The security descriptor on the new desktop is based on the |
22 // security descriptor of the desktop associated with the current thread. | 23 // security descriptor of the desktop associated with the current thread. |
23 // If a winsta is specified, the function will switch to it before creating | 24 // If a winsta is specified, the function will switch to it before creating |
24 // the desktop. If the functions fails the switch back to the current winsta, | 25 // the desktop. If the functions fails the switch back to the current winsta, |
25 // the function will return SBOX_ERROR_FAILED_TO_SWITCH_BACK_WINSTATION. | 26 // the function will return SBOX_ERROR_FAILED_TO_SWITCH_BACK_WINSTATION. |
26 ResultCode CreateAltDesktop(HWINSTA winsta, HDESK* desktop); | 27 ResultCode CreateAltDesktop(HWINSTA winsta, HDESK* desktop); |
27 | 28 |
28 // Returns the name of a desktop or a window station. | 29 // Returns the name of a desktop or a window station. |
29 std::wstring GetWindowObjectName(HANDLE handle); | 30 base::string16 GetWindowObjectName(HANDLE handle); |
30 | 31 |
31 // Returns the name of the desktop referenced by |desktop|. If a window | 32 // Returns the name of the desktop referenced by |desktop|. If a window |
32 // station is specified, the name is prepended with the window station name, | 33 // station is specified, the name is prepended with the window station name, |
33 // followed by a backslash. This name can be used as the lpDesktop parameter | 34 // followed by a backslash. This name can be used as the lpDesktop parameter |
34 // to CreateProcess. | 35 // to CreateProcess. |
35 std::wstring GetFullDesktopName(HWINSTA winsta, HDESK desktop); | 36 base::string16 GetFullDesktopName(HWINSTA winsta, HDESK desktop); |
36 | 37 |
37 } // namespace sandbox | 38 } // namespace sandbox |
38 | 39 |
39 #endif // SANDBOX_SRC_WINDOW_H_ | 40 #endif // SANDBOX_SRC_WINDOW_H_ |
OLD | NEW |