| 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 #include <winternl.h> | 10 #include <winternl.h> |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 registration_command += ASCIIToUTF16("\" "); | 106 registration_command += ASCIIToUTF16("\" "); |
| 107 registration_command += ASCIIToUTF16(kEntrypoints[entrypoint_index]); | 107 registration_command += ASCIIToUTF16(kEntrypoints[entrypoint_index]); |
| 108 launch_options.wait = true; | 108 launch_options.wait = true; |
| 109 if (!base::LaunchProcess(registration_command, launch_options, | 109 if (!base::LaunchProcess(registration_command, launch_options, |
| 110 &process_handle)) { | 110 &process_handle)) { |
| 111 PLOG(FATAL) | 111 PLOG(FATAL) |
| 112 << "Failed to register or unregister DLL with command: " | 112 << "Failed to register or unregister DLL with command: " |
| 113 << registration_command; | 113 << registration_command; |
| 114 } else { | 114 } else { |
| 115 base::win::ScopedHandle rundll32(process_handle); | 115 base::win::ScopedHandle rundll32(process_handle); |
| 116 if (!base::WaitForExitCodeWithTimeout(process_handle, &exit_code, | 116 if (!base::WaitForExitCodeWithTimeout( |
| 117 kDllRegistrationTimeoutMs)) { | 117 process_handle, &exit_code, |
| 118 base::TimeDelta::FromMilliseconds(kDllRegistrationTimeoutMs))) { |
| 118 LOG(ERROR) << "Timeout waiting to register or unregister DLL with " | 119 LOG(ERROR) << "Timeout waiting to register or unregister DLL with " |
| 119 "command: " << registration_command; | 120 "command: " << registration_command; |
| 120 base::KillProcess(process_handle, 0, false); | 121 base::KillProcess(process_handle, 0, false); |
| 121 NOTREACHED() << "Aborting test due to registration failure."; | 122 NOTREACHED() << "Aborting test due to registration failure."; |
| 122 } | 123 } |
| 123 } | 124 } |
| 124 if (exit_code != 0) { | 125 if (exit_code != 0) { |
| 125 if (registration_operation == REGISTER) { | 126 if (registration_operation == REGISTER) { |
| 126 LOG(ERROR) | 127 LOG(ERROR) |
| 127 << "DLL registration failed (exit code: 0x" << std::hex << exit_code | 128 << "DLL registration failed (exit code: 0x" << std::hex << exit_code |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 UOI_NAME, | 425 UOI_NAME, |
| 425 name, | 426 name, |
| 426 sizeof(name), | 427 sizeof(name), |
| 427 &needed)) { | 428 &needed)) { |
| 428 is_locked = lstrcmpi(name, L"default") != 0; | 429 is_locked = lstrcmpi(name, L"default") != 0; |
| 429 } | 430 } |
| 430 ::CloseDesktop(input_desk); | 431 ::CloseDesktop(input_desk); |
| 431 } | 432 } |
| 432 return is_locked; | 433 return is_locked; |
| 433 } | 434 } |
| OLD | NEW |