michael@0: // Copyright (c) 2009 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: #ifndef SANDBOX_SRC_WINDOW_H_ michael@0: #define SANDBOX_SRC_WINDOW_H_ michael@0: michael@0: #include michael@0: #include michael@0: michael@0: #include "sandbox/win/src/sandbox_types.h" michael@0: michael@0: namespace sandbox { michael@0: michael@0: // Creates a window station. The name is generated by the OS. The security michael@0: // descriptor is based on the security descriptor of the current window michael@0: // station. michael@0: ResultCode CreateAltWindowStation(HWINSTA* winsta); michael@0: michael@0: // Creates a desktop. The name is a static string followed by the pid of the michael@0: // current process. The security descriptor on the new desktop is based on the michael@0: // security descriptor of the desktop associated with the current thread. michael@0: // If a winsta is specified, the function will switch to it before creating michael@0: // the desktop. If the functions fails the switch back to the current winsta, michael@0: // the function will return SBOX_ERROR_FAILED_TO_SWITCH_BACK_WINSTATION. michael@0: ResultCode CreateAltDesktop(HWINSTA winsta, HDESK* desktop); michael@0: michael@0: // Returns the name of a desktop or a window station. michael@0: std::wstring GetWindowObjectName(HANDLE handle); michael@0: michael@0: // Returns the name of the desktop referenced by |desktop|. If a window michael@0: // station is specified, the name is prepended with the window station name, michael@0: // followed by a backslash. This name can be used as the lpDesktop parameter michael@0: // to CreateProcess. michael@0: std::wstring GetFullDesktopName(HWINSTA winsta, HDESK desktop); michael@0: michael@0: } // namespace sandbox michael@0: michael@0: #endif // SANDBOX_SRC_WINDOW_H_