window.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  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
  3. // found in the LICENSE file.
  4. #ifndef SANDBOX_WIN_SRC_WINDOW_H_
  5. #define SANDBOX_WIN_SRC_WINDOW_H_
  6. #include <string>
  7. #include "base/win/windows_types.h"
  8. #include "sandbox/win/src/sandbox_types.h"
  9. namespace sandbox {
  10. // Creates a window station. The name is generated by the OS. The security
  11. // descriptor is based on the security descriptor of the current window
  12. // station.
  13. ResultCode CreateAltWindowStation(HWINSTA* winsta);
  14. // Creates a desktop. The name is a static string followed by the pid of the
  15. // current process. The security descriptor on the new desktop is based on the
  16. // security descriptor of the desktop associated with the current thread.
  17. // If a winsta is specified, the function will switch to it before creating
  18. // the desktop. If the functions fails the switch back to the current winsta,
  19. // the function will return SBOX_ERROR_FAILED_TO_SWITCH_BACK_WINSTATION.
  20. ResultCode CreateAltDesktop(HWINSTA winsta, HDESK* desktop);
  21. // Returns the name of the desktop referenced by |desktop|. If a window
  22. // station is specified, the name is prepended with the window station name,
  23. // followed by a backslash. This name can be used as the lpDesktop parameter
  24. // to CreateProcess.
  25. std::wstring GetFullDesktopName(HWINSTA winsta, HDESK desktop);
  26. } // namespace sandbox
  27. #endif // SANDBOX_WIN_SRC_WINDOW_H_