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 #include "remoting/host/win/desktop.h" | 5 #include "remoting/host/win/desktop.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 << "Failed to open the desktop '" << desktop_name << "'"; | 76 << "Failed to open the desktop '" << desktop_name << "'"; |
77 return scoped_ptr<Desktop>(); | 77 return scoped_ptr<Desktop>(); |
78 } | 78 } |
79 | 79 |
80 return scoped_ptr<Desktop>(new Desktop(desktop, true)); | 80 return scoped_ptr<Desktop>(new Desktop(desktop, true)); |
81 } | 81 } |
82 | 82 |
83 scoped_ptr<Desktop> Desktop::GetInputDesktop() { | 83 scoped_ptr<Desktop> Desktop::GetInputDesktop() { |
84 HDESK desktop = OpenInputDesktop( | 84 HDESK desktop = OpenInputDesktop( |
85 0, FALSE, GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE); | 85 0, FALSE, GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE); |
86 if (desktop == NULL) { | 86 if (desktop == NULL) |
87 LOG_GETLASTERROR(ERROR) | |
88 << "Failed to open the desktop receiving user input"; | |
89 return scoped_ptr<Desktop>(); | 87 return scoped_ptr<Desktop>(); |
90 } | |
91 | 88 |
92 return scoped_ptr<Desktop>(new Desktop(desktop, true)); | 89 return scoped_ptr<Desktop>(new Desktop(desktop, true)); |
93 } | 90 } |
94 | 91 |
95 scoped_ptr<Desktop> Desktop::GetThreadDesktop() { | 92 scoped_ptr<Desktop> Desktop::GetThreadDesktop() { |
96 HDESK desktop = ::GetThreadDesktop(GetCurrentThreadId()); | 93 HDESK desktop = ::GetThreadDesktop(GetCurrentThreadId()); |
97 if (desktop == NULL) { | 94 if (desktop == NULL) { |
98 LOG_GETLASTERROR(ERROR) | 95 LOG_GETLASTERROR(ERROR) |
99 << "Failed to retrieve the handle of the desktop assigned to " | 96 << "Failed to retrieve the handle of the desktop assigned to " |
100 "the current thread"; | 97 "the current thread"; |
101 return scoped_ptr<Desktop>(); | 98 return scoped_ptr<Desktop>(); |
102 } | 99 } |
103 | 100 |
104 return scoped_ptr<Desktop>(new Desktop(desktop, false)); | 101 return scoped_ptr<Desktop>(new Desktop(desktop, false)); |
105 } | 102 } |
106 | 103 |
107 } // namespace remoting | 104 } // namespace remoting |
OLD | NEW |