aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/os_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/os_windows.go')
-rw-r--r--src/runtime/os_windows.go23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/runtime/os_windows.go b/src/runtime/os_windows.go
index 2cf81f61a9..bb631b66a9 100644
--- a/src/runtime/os_windows.go
+++ b/src/runtime/os_windows.go
@@ -263,9 +263,7 @@ func loadOptionalSyscalls() {
func monitorSuspendResume() {
const (
- _DEVICE_NOTIFY_CALLBACK = 2
- _ERROR_FILE_NOT_FOUND = 2
- _ERROR_INVALID_PARAMETERS = 87
+ _DEVICE_NOTIFY_CALLBACK = 2
)
type _DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS struct {
callback uintptr
@@ -292,25 +290,8 @@ func monitorSuspendResume() {
callback: compileCallback(*efaceOf(&fn), true),
}
handle := uintptr(0)
- ret := stdcall3(powerRegisterSuspendResumeNotification, _DEVICE_NOTIFY_CALLBACK,
+ stdcall3(powerRegisterSuspendResumeNotification, _DEVICE_NOTIFY_CALLBACK,
uintptr(unsafe.Pointer(&params)), uintptr(unsafe.Pointer(&handle)))
- // This function doesn't use GetLastError(), so we use the return value directly.
- switch ret {
- case 0:
- return // Successful, nothing more to do.
- case _ERROR_FILE_NOT_FOUND:
- // Systems without access to the suspend/resume notifier
- // also have their clock on "program time", and therefore
- // don't want or need this anyway.
- return
- case _ERROR_INVALID_PARAMETERS:
- // This is seen when running in Windows Docker.
- // See issue 36557.
- return
- default:
- println("runtime: PowerRegisterSuspendResumeNotification failed with errno=", ret)
- throw("runtime: PowerRegisterSuspendResumeNotification failure")
- }
}
//go:nosplit