| 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 "chrome_frame/test_utils.h" | 5 #include "chrome_frame/test_utils.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlwin.h> | 8 #include <atlwin.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 | 10 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 int entrypoint_index = 0; | 89 int entrypoint_index = 0; |
| 90 base::LaunchOptions launch_options; | 90 base::LaunchOptions launch_options; |
| 91 base::win::ScopedHandle process_handle; | 91 base::win::ScopedHandle process_handle; |
| 92 int exit_code = -1; | 92 int exit_code = -1; |
| 93 | 93 |
| 94 if (registration_type == PER_USER) | 94 if (registration_type == PER_USER) |
| 95 entrypoint_index += 2; | 95 entrypoint_index += 2; |
| 96 if (registration_operation == UNREGISTER) | 96 if (registration_operation == UNREGISTER) |
| 97 entrypoint_index += 1; | 97 entrypoint_index += 1; |
| 98 base::string16 registration_command(ASCIIToUTF16("\"")); | 98 base::string16 registration_command(base::ASCIIToUTF16("\"")); |
| 99 registration_command += | 99 registration_command += |
| 100 CommandLine::ForCurrentProcess()->GetProgram().value(); | 100 CommandLine::ForCurrentProcess()->GetProgram().value(); |
| 101 registration_command += ASCIIToUTF16("\" "); | 101 registration_command += base::ASCIIToUTF16("\" "); |
| 102 registration_command += kCallRegistrationEntrypointSwitch; | 102 registration_command += kCallRegistrationEntrypointSwitch; |
| 103 registration_command += ASCIIToUTF16(" \""); | 103 registration_command += base::ASCIIToUTF16(" \""); |
| 104 registration_command += path; | 104 registration_command += path; |
| 105 registration_command += ASCIIToUTF16("\" "); | 105 registration_command += base::ASCIIToUTF16("\" "); |
| 106 registration_command += ASCIIToUTF16(kEntrypoints[entrypoint_index]); | 106 registration_command += base::ASCIIToUTF16(kEntrypoints[entrypoint_index]); |
| 107 launch_options.wait = true; | 107 launch_options.wait = true; |
| 108 if (!base::LaunchProcess(registration_command, launch_options, | 108 if (!base::LaunchProcess(registration_command, launch_options, |
| 109 &process_handle)) { | 109 &process_handle)) { |
| 110 PLOG(FATAL) | 110 PLOG(FATAL) |
| 111 << "Failed to register or unregister DLL with command: " | 111 << "Failed to register or unregister DLL with command: " |
| 112 << registration_command; | 112 << registration_command; |
| 113 } else { | 113 } else { |
| 114 if (!base::WaitForExitCodeWithTimeout( | 114 if (!base::WaitForExitCodeWithTimeout( |
| 115 process_handle.Get(), &exit_code, | 115 process_handle.Get(), &exit_code, |
| 116 base::TimeDelta::FromMilliseconds(kDllRegistrationTimeoutMs))) { | 116 base::TimeDelta::FromMilliseconds(kDllRegistrationTimeoutMs))) { |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 UOI_NAME, | 277 UOI_NAME, |
| 278 name, | 278 name, |
| 279 sizeof(name), | 279 sizeof(name), |
| 280 &needed)) { | 280 &needed)) { |
| 281 is_locked = lstrcmpi(name, L"default") != 0; | 281 is_locked = lstrcmpi(name, L"default") != 0; |
| 282 } | 282 } |
| 283 ::CloseDesktop(input_desk); | 283 ::CloseDesktop(input_desk); |
| 284 } | 284 } |
| 285 return is_locked; | 285 return is_locked; |
| 286 } | 286 } |
| OLD | NEW |