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

Side by Side Diff: chrome_frame/chrome_launcher.cc

Issue 13619014: Change PolicyLoaderWin to load PReg files if possible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 | « chrome/tools/build/generate_policy_source.py ('k') | chrome_frame/policy_settings.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 "chrome_frame/chrome_launcher.h" 5 #include "chrome_frame/chrome_launcher.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 #include <shlwapi.h> 9 #include <shlwapi.h>
10 10
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 // Used for basic checks since CreateProcess doesn't support command lines 158 // Used for basic checks since CreateProcess doesn't support command lines
159 // longer than 0x8000 characters. If we surpass that length, we do not add the 159 // longer than 0x8000 characters. If we surpass that length, we do not add the
160 // additional parameters. Because we need to add a space before the 160 // additional parameters. Because we need to add a space before the
161 // extra parameters, we use 0x7fff and not 0x8000. 161 // extra parameters, we use 0x7fff and not 0x8000.
162 const size_t kMaxChars = 0x7FFF - command_line->size(); 162 const size_t kMaxChars = 0x7FFF - command_line->size();
163 HKEY key; 163 HKEY key;
164 LONG result; 164 LONG result;
165 bool found = false; 165 bool found = false;
166 for (int i = 0; !found && i < arraysize(kRootKeys); ++i) { 166 for (int i = 0; !found && i < arraysize(kRootKeys); ++i) {
167 result = ::RegOpenKeyExW(kRootKeys[i], policy::kRegistryMandatorySubKey, 0, 167 result = ::RegOpenKeyExW(kRootKeys[i], policy::kRegistryChromePolicyKey, 0,
168 KEY_QUERY_VALUE, &key); 168 KEY_QUERY_VALUE, &key);
169 if (result == ERROR_SUCCESS) { 169 if (result == ERROR_SUCCESS) {
170 DWORD size = 0; 170 DWORD size = 0;
171 DWORD type = 0; 171 DWORD type = 0;
172 result = RegQueryValueExW(key, launch_params_value_name.c_str(), 172 result = RegQueryValueExW(key, launch_params_value_name.c_str(),
173 0, &type, NULL, &size); 173 0, &type, NULL, &size);
174 if (result == ERROR_SUCCESS && type == REG_SZ && size > 0 && 174 if (result == ERROR_SUCCESS && type == REG_SZ && size > 0 &&
175 (size / sizeof(wchar_t)) < kMaxChars) { 175 (size / sizeof(wchar_t)) < kMaxChars) {
176 // This size includes any terminating null character or characters 176 // This size includes any terminating null character or characters
177 // unless the data was stored without them, so for safety we allocate 177 // unless the data was stored without them, so for safety we allocate
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 if (PathFileExists(cur_path)) { 259 if (PathFileExists(cur_path)) {
260 *chrome_path = cur_path; 260 *chrome_path = cur_path;
261 success = true; 261 success = true;
262 } 262 }
263 } 263 }
264 264
265 return success; 265 return success;
266 } 266 }
267 267
268 } // namespace chrome_launcher 268 } // namespace chrome_launcher
OLDNEW
« no previous file with comments | « chrome/tools/build/generate_policy_source.py ('k') | chrome_frame/policy_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698