mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall: return error if GetQueuedCompletionStatus truncates key
This function has the wrong signature, so return an error when that actually might lead to unexpected results. Users should switch to x/sys/windows for the real version of this function. Updates #44538. Change-Id: I4d1f3d1e380815733ecfea683f939b1d25dcc32a Reviewed-on: https://go-review.googlesource.com/c/go/+/296154 Trust: Jason A. Donenfeld <Jason@zx2c4.com> Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
76c0003cd5
commit
37ca84a9cd
1 changed files with 3 additions and 0 deletions
|
|
@ -1229,6 +1229,9 @@ func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overla
|
|||
err := getQueuedCompletionStatus(cphandle, qty, pukey, overlapped, timeout)
|
||||
if key != nil {
|
||||
*key = uint32(ukey)
|
||||
if uintptr(*key) != ukey && err == nil {
|
||||
err = errorspkg.New("GetQueuedCompletionStatus returned key overflow")
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue