src/os/windows/vm/os_windows.cpp

changeset 1649
0fc941df6fb7
parent 912
24fda36852ce
child 1650
f19bf22685cc
     1.1 --- a/src/os/windows/vm/os_windows.cpp	Wed Jan 13 09:39:46 2010 -0700
     1.2 +++ b/src/os/windows/vm/os_windows.cpp	Tue Feb 02 10:37:32 2010 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 + * Copyright 1997-2010 Sun Microsystems, Inc.  All Rights Reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -142,6 +142,9 @@
    1.11  }
    1.12  
    1.13  #ifndef _WIN64
    1.14 +// previous UnhandledExceptionFilter, if there is one
    1.15 +static LPTOP_LEVEL_EXCEPTION_FILTER prev_uef_handler = NULL;
    1.16 +
    1.17  LONG WINAPI Handle_FLT_Exception(struct _EXCEPTION_POINTERS* exceptionInfo);
    1.18  #endif
    1.19  void os::init_system_properties_values() {
    1.20 @@ -260,7 +263,8 @@
    1.21    }
    1.22  
    1.23  #ifndef _WIN64
    1.24 -  SetUnhandledExceptionFilter(Handle_FLT_Exception);
    1.25 +  // set our UnhandledExceptionFilter and save any previous one
    1.26 +  prev_uef_handler = SetUnhandledExceptionFilter(Handle_FLT_Exception);
    1.27  #endif
    1.28  
    1.29    // Done
    1.30 @@ -1909,7 +1913,7 @@
    1.31  #ifndef  _WIN64
    1.32  //-----------------------------------------------------------------------------
    1.33  LONG WINAPI Handle_FLT_Exception(struct _EXCEPTION_POINTERS* exceptionInfo) {
    1.34 -  // handle exception caused by native mothod modifying control word
    1.35 +  // handle exception caused by native method modifying control word
    1.36    PCONTEXT ctx = exceptionInfo->ContextRecord;
    1.37    DWORD exception_code = exceptionInfo->ExceptionRecord->ExceptionCode;
    1.38  
    1.39 @@ -1930,6 +1934,13 @@
    1.40          return EXCEPTION_CONTINUE_EXECUTION;
    1.41        }
    1.42    }
    1.43 +
    1.44 +  if (prev_uef_handler != NULL) {
    1.45 +    // We didn't handle this exception so pass it to the previous
    1.46 +    // UnhandledExceptionFilter.
    1.47 +    return (prev_uef_handler)(exceptionInfo);
    1.48 +  }
    1.49 +
    1.50    return EXCEPTION_CONTINUE_SEARCH;
    1.51  }
    1.52  #else //_WIN64

mercurial