Fixes the "Run as different user" window freezing#27779
Merged
ibeckermayer merged 7 commits intomasterfrom Jun 14, 2023
Merged
Conversation
The problem was that we were occasionally getting SCARD_IOCTL_GETSTATUSCHANGEW calls with infinite timeouts, which we would never return from because our status never changes. This is the correct behavior in the short run, but we were ignoring the meaning of SCARD_IOCTL_CANCEL, which tells such long-hanging calls to return with an SCARD_E_CANCELLED return value. This was causing the "Run as different user" window to freeze, because something internally was waiting around for an SCARD_E_CANCELLED that would never come. To fix this, now whenever we get an SCARD_IOCTL_GETSTATUSCHANGEW with an infinite timeout, we add to the corresponding context a DeviceControlResponse that wraps the necessary SCARD_E_CANCELLED return value. Later, when an SCARD_IOCTL_CANCEL is received for that context, we grab the DeviceControlResponse and return it.
zmb3
reviewed
Jun 13, 2023
Collaborator
zmb3
left a comment
There was a problem hiding this comment.
Will have a closer look soon.
zmb3
approved these changes
Jun 14, 2023
espadolini
reviewed
Jun 14, 2023
espadolini
approved these changes
Jun 14, 2023
|
@ibeckermayer See the table below for backport results.
|
This was referenced Jun 14, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem was that we were occasionally getting
SCARD_IOCTL_GETSTATUSCHANGEWcalls with infinite timeouts, which we would never return from because our status never changes. This is the correct behavior in the short run, but we were ignoring the meaning ofSCARD_IOCTL_CANCEL, which tells such long-hanging calls to return with anSCARD_E_CANCELLEDreturn value.This was causing the "Run as different user" window to freeze, because something internally was waiting around for an
SCARD_E_CANCELLEDthat would never come.To fix this, now whenever we get an
SCARD_IOCTL_GETSTATUSCHANGEWwith an infinite timeout, we add to the corresponding context aDeviceControlResponsethat wraps the necessarySCARD_E_CANCELLEDreturn value. Later, when anSCARD_IOCTL_CANCELis received for that context, we grab theDeviceControlResponseand return it.