1 // Copyright 2017 The Crashpad Authors. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include "util/win/safe_terminate_process.h"
16 
17 #include "base/logging.h"
18 
19 #if defined(ARCH_CPU_X86)
20 
21 namespace crashpad {
22 
SafeTerminateProcess(HANDLE process,UINT exit_code)23 bool SafeTerminateProcess(HANDLE process, UINT exit_code) {
24   // Third-party software that hooks TerminateProcess() incorrectly has been
25   // encountered in the wild. This version of SafeTerminateProcess() lacks
26   // protection against that, so don't use it in production.
27   LOG(WARNING)
28       << "Don't use this! For cross builds only. See https://crbug.com/777924.";
29   return TerminateProcess(process, exit_code) != FALSE;
30 }
31 
32 }  // namespace crashpad
33 
34 #endif  // defined(ARCH_CPU_X86)
35