| OLD | NEW |
| 1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with 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 | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 | 310 |
| 311 case ClientToServerMessage::kRegister: | 311 case ClientToServerMessage::kRegister: |
| 312 // Handled below. | 312 // Handled below. |
| 313 break; | 313 break; |
| 314 | 314 |
| 315 default: | 315 default: |
| 316 LOG(ERROR) << "unhandled message type: " << message.type; | 316 LOG(ERROR) << "unhandled message type: " << message.type; |
| 317 return false; | 317 return false; |
| 318 } | 318 } |
| 319 | 319 |
| 320 if (message.registration.version != RegistrationRequest::kMessageVersion) { |
| 321 LOG(ERROR) << "unexpected version. got: " << message.registration.version |
| 322 << " expecting: " << RegistrationRequest::kMessageVersion; |
| 323 return false; |
| 324 } |
| 325 |
| 320 decltype(GetNamedPipeClientProcessId)* get_named_pipe_client_process_id = | 326 decltype(GetNamedPipeClientProcessId)* get_named_pipe_client_process_id = |
| 321 GetNamedPipeClientProcessIdFunction(); | 327 GetNamedPipeClientProcessIdFunction(); |
| 322 if (get_named_pipe_client_process_id) { | 328 if (get_named_pipe_client_process_id) { |
| 323 // GetNamedPipeClientProcessId is only available on Vista+. | 329 // GetNamedPipeClientProcessId is only available on Vista+. |
| 324 DWORD real_pid = 0; | 330 DWORD real_pid = 0; |
| 325 if (get_named_pipe_client_process_id(service_context.pipe(), &real_pid) && | 331 if (get_named_pipe_client_process_id(service_context.pipe(), &real_pid) && |
| 326 message.registration.client_process_id != real_pid) { | 332 message.registration.client_process_id != real_pid) { |
| 327 LOG(ERROR) << "forged client pid, real pid: " << real_pid | 333 LOG(ERROR) << "forged client pid, real pid: " << real_pid |
| 328 << ", got: " << message.registration.client_process_id; | 334 << ", got: " << message.registration.client_process_id; |
| 329 return false; | 335 return false; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 void __stdcall ExceptionHandlerServer::OnProcessEnd(void* ctx, BOOLEAN) { | 419 void __stdcall ExceptionHandlerServer::OnProcessEnd(void* ctx, BOOLEAN) { |
| 414 // This function is executed on the thread pool. | 420 // This function is executed on the thread pool. |
| 415 internal::ClientData* client = reinterpret_cast<internal::ClientData*>(ctx); | 421 internal::ClientData* client = reinterpret_cast<internal::ClientData*>(ctx); |
| 416 base::AutoLock lock(*client->lock()); | 422 base::AutoLock lock(*client->lock()); |
| 417 | 423 |
| 418 // Post back to the main thread to have it delete this client record. | 424 // Post back to the main thread to have it delete this client record. |
| 419 PostQueuedCompletionStatus(client->port(), 0, ULONG_PTR(client), nullptr); | 425 PostQueuedCompletionStatus(client->port(), 0, ULONG_PTR(client), nullptr); |
| 420 } | 426 } |
| 421 | 427 |
| 422 } // namespace crashpad | 428 } // namespace crashpad |
| OLD | NEW |