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

Side by Side Diff: remoting/host/verify_config_window_win.cc

Issue 13642007: Rewrite scoped_array<T> to scoped_ptr<T[]> in remoting/, Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Manually rewrite Win files. Created 7 years, 8 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/plugin/host_script_object.cc ('k') | remoting/host/win/elevated_controller.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/verify_config_window_win.h" 5 #include "remoting/host/verify_config_window_win.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlwin.h> 8 #include <atlwin.h>
9 #include <windows.h> 9 #include <windows.h>
10 10
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 y = std::min(y, area_rect.bottom - width); 120 y = std::min(y, area_rect.bottom - width);
121 121
122 SetWindowPos(NULL, x, y, -1, -1, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); 122 SetWindowPos(NULL, x, y, -1, -1, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
123 } 123 }
124 124
125 bool VerifyConfigWindowWin::VerifyHostSecretHash() { 125 bool VerifyConfigWindowWin::VerifyHostSecretHash() {
126 CWindow pin_edit(GetDlgItem(IDC_PIN)); 126 CWindow pin_edit(GetDlgItem(IDC_PIN));
127 127
128 // Get the PIN length. 128 // Get the PIN length.
129 int pin_length = pin_edit.GetWindowTextLength(); 129 int pin_length = pin_edit.GetWindowTextLength();
130 scoped_array<char16> pin(new char16[pin_length + 1]); 130 scoped_ptr<char16[]> pin(new char16[pin_length + 1]);
131 131
132 // Get the PIN making sure it is NULL terminated even if an error occurs. 132 // Get the PIN making sure it is NULL terminated even if an error occurs.
133 int result = pin_edit.GetWindowText(pin.get(), pin_length + 1); 133 int result = pin_edit.GetWindowText(pin.get(), pin_length + 1);
134 pin[std::min(result, pin_length)] = 0; 134 pin[std::min(result, pin_length)] = 0;
135 135
136 return VerifyHostPinHash(host_secret_hash_, host_id_, UTF16ToUTF8(pin.get())); 136 return VerifyHostPinHash(host_secret_hash_, host_id_, UTF16ToUTF8(pin.get()));
137 } 137 }
138 138
139 } // namespace remoting 139 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/plugin/host_script_object.cc ('k') | remoting/host/win/elevated_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698