• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "base/win/wrapped_window_proc.h"
6 
7 #include "base/atomicops.h"
8 
9 namespace {
10 
11 base::win::WinProcExceptionFilter s_exception_filter = NULL;
12 
13 }  // namespace.
14 
15 namespace base {
16 namespace win {
17 
SetWinProcExceptionFilter(WinProcExceptionFilter filter)18 WinProcExceptionFilter SetWinProcExceptionFilter(
19     WinProcExceptionFilter filter) {
20   subtle::AtomicWord rv = subtle::NoBarrier_AtomicExchange(
21       reinterpret_cast<subtle::AtomicWord*>(&s_exception_filter),
22       reinterpret_cast<subtle::AtomicWord>(filter));
23   return reinterpret_cast<WinProcExceptionFilter>(rv);
24 }
25 
CallExceptionFilter(EXCEPTION_POINTERS * info)26 int CallExceptionFilter(EXCEPTION_POINTERS* info) {
27   return s_exception_filter ? s_exception_filter(info) :
28                               EXCEPTION_CONTINUE_SEARCH;
29 }
30 
31 }  // namespace win
32 }  // namespace base
33