Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: remoting/host/win/wts_terminal_monitor.cc

Issue 121123002: Update uses of UTF conversions in ppapi/, printing/, remoting/, rlz/, sandbox/, skia/, sql/, sync/,… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/win/wts_session_process_delegate.cc ('k') | rlz/ios/lib/machine_id_ios.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/wts_terminal_monitor.h" 5 #include "remoting/host/win/wts_terminal_monitor.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <wtsapi32.h> 8 #include <wtsapi32.h>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 24 matching lines...) Expand all
35 DWORD bytes; 35 DWORD bytes;
36 wchar_t* working_directory; 36 wchar_t* working_directory;
37 if (!WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE, 37 if (!WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE,
38 session_id, 38 session_id,
39 WTSWorkingDirectory, 39 WTSWorkingDirectory,
40 &working_directory, 40 &working_directory,
41 &bytes)) { 41 &bytes)) {
42 return false; 42 return false;
43 } 43 }
44 44
45 bool result = WideToUTF8(working_directory, (bytes / sizeof(wchar_t)) - 1, 45 bool result = base::WideToUTF8(working_directory,
46 terminal_id); 46 (bytes / sizeof(wchar_t)) - 1,
47 terminal_id);
47 WTSFreeMemory(working_directory); 48 WTSFreeMemory(working_directory);
48 return result; 49 return result;
49 } 50 }
50 51
51 // static 52 // static
52 uint32 WtsTerminalMonitor::LookupSessionId(const std::string& terminal_id) { 53 uint32 WtsTerminalMonitor::LookupSessionId(const std::string& terminal_id) {
53 // Use the fast path if the caller wants to get id of the session attached to 54 // Use the fast path if the caller wants to get id of the session attached to
54 // the physical console. 55 // the physical console.
55 if (terminal_id == kConsole) 56 if (terminal_id == kConsole)
56 return WTSGetActiveConsoleSessionId(); 57 return WTSGetActiveConsoleSessionId();
(...skipping 18 matching lines...) Expand all
75 76
76 // |terminal_id| is not associated with any session. 77 // |terminal_id| is not associated with any session.
77 WTSFreeMemory(session_info); 78 WTSFreeMemory(session_info);
78 return kInvalidSessionId; 79 return kInvalidSessionId;
79 } 80 }
80 81
81 WtsTerminalMonitor::WtsTerminalMonitor() { 82 WtsTerminalMonitor::WtsTerminalMonitor() {
82 } 83 }
83 84
84 } // namespace remoting 85 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/win/wts_session_process_delegate.cc ('k') | rlz/ios/lib/machine_id_ios.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698