Chromium Code Reviews| Index: chrome/app/close_handle_hook_win.cc |
| diff --git a/chrome/app/close_handle_hook_win.cc b/chrome/app/close_handle_hook_win.cc |
| index 02dfce513d13f9c0ba084cdc6bf0ec77ed2f6fd4..25d6f7f3922a38709d8be3221e69328d49194a3a 100644 |
| --- a/chrome/app/close_handle_hook_win.cc |
| +++ b/chrome/app/close_handle_hook_win.cc |
| @@ -37,7 +37,13 @@ DuplicateHandleType g_duplicate_function = NULL; |
| // function. |
| BOOL WINAPI CloseHandleHook(HANDLE handle) { |
| base::win::OnHandleBeingClosed(handle); |
| - return g_close_function(handle); |
| + BOOL result = g_close_function(handle); |
| + // Check for CloseHandle failures. |
| + // urlmon closes a handle that is NULL so we can't fail on that. |
| + // Also CloseHandle() under a debugger only throws an exception on handles |
| + // that are neither NULL nor INVALID_HANDLE_VALUE. |
| + DCHECK(result || handle == NULL || handle == INVALID_HANDLE_VALUE); |
|
grt (UTC plus 2)
2015/09/15 14:08:07
nit: DPCHECK so that the last error code is nicely
brucedawson
2015/09/15 16:49:27
Done.
|
| + return result; |
| } |
| BOOL WINAPI DuplicateHandleHook(HANDLE source_process, |