]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use AddVectoredContinueHandler on Windows XP amd64
authorAlex Brainman <alex.brainman@gmail.com>
Mon, 6 Jul 2015 00:34:01 +0000 (10:34 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Sat, 11 Jul 2015 07:02:57 +0000 (07:02 +0000)
Recent change (CL 10370) unexpectedly broke TestRaiseException on
Windows XP amd64. I still do not know why. But reverting old
CL 8165 fixes the problem.

This effectively makes Windows XP amd64 use AddVectoredContinueHandler
instead of SetUnhandledExceptionFilter for exception handling. That is
what we do for all recent Windows versions too.

Fixes #11481

Change-Id: If2e8037711f05bf97e3c69f5a8d86af67c58f6fc
Reviewed-on: https://go-review.googlesource.com/11888
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/os1_windows.go
src/runtime/signal_windows.go

index bc472d0de99de2a1c4ad4af6a2c53506c649fdce..f608b4ad80c00183f6a5f09bab04f28b18f935f6 100644 (file)
@@ -26,7 +26,6 @@ import (
 //go:cgo_import_dynamic runtime._GetStdHandle GetStdHandle%1 "kernel32.dll"
 //go:cgo_import_dynamic runtime._GetSystemInfo GetSystemInfo%1 "kernel32.dll"
 //go:cgo_import_dynamic runtime._GetThreadContext GetThreadContext%2 "kernel32.dll"
-//go:cgo_import_dynamic runtime._GetVersion GetVersion%0 "kernel32.dll"
 //go:cgo_import_dynamic runtime._LoadLibraryW LoadLibraryW%1 "kernel32.dll"
 //go:cgo_import_dynamic runtime._LoadLibraryA LoadLibraryA%1 "kernel32.dll"
 //go:cgo_import_dynamic runtime._NtWaitForSingleObject NtWaitForSingleObject%3 "ntdll.dll"
@@ -68,7 +67,6 @@ var (
        _GetStdHandle,
        _GetSystemInfo,
        _GetThreadContext,
-       _GetVersion,
        _LoadLibraryW,
        _LoadLibraryA,
        _NtWaitForSingleObject,
@@ -138,12 +136,6 @@ const (
        currentThread  = ^uintptr(1) // -2 = current thread
 )
 
-func getVersion() (major, minor byte) {
-       v := uint32(stdcall0(_GetVersion))
-       low := uint16(v)
-       return byte(low), byte(low >> 8)
-}
-
 // in sys_windows_386.s and sys_windows_amd64.s
 func externalthreadhandler()
 
index b2fce5353482a13f617ef6afefbac68a5c52a77c..5e17f747bd13f6f794b21990f95c5dd93fba89ac 100644 (file)
@@ -26,14 +26,10 @@ func firstcontinuetramp()
 func lastcontinuetramp()
 
 func initExceptionHandler() {
-       major, _ := getVersion()
        stdcall2(_AddVectoredExceptionHandler, 1, funcPC(exceptiontramp))
-       if _AddVectoredContinueHandler == nil || unsafe.Sizeof(&_AddVectoredContinueHandler) == 4 || major < 6 {
+       if _AddVectoredContinueHandler == nil || unsafe.Sizeof(&_AddVectoredContinueHandler) == 4 {
                // use SetUnhandledExceptionFilter for windows-386 or
-               // if VectoredContinueHandler is unavailable or
-               // if running windows-amd64 v5. V5 appears to fail to
-               // call the continue handlers if windows error reporting dialog
-               // is disabled.
+               // if VectoredContinueHandler is unavailable.
                // note: SetUnhandledExceptionFilter handler won't be called, if debugging.
                stdcall1(_SetUnhandledExceptionFilter, funcPC(lastcontinuetramp))
        } else {