DescriptionGet GenericScopedHandle::Set to preserve LastError code
Code like this is elegant and clean and common in Chrome:
event_.Set(CreateEvent(NULL, FALSE, FALSE, wname.c_str()));
if (event_.Get() && GetLastError() != ERROR_ALREADY_EXISTS) {
However it will behave incorrectly if event_.Set() zeroes out the
Windows LastError code, which VC++ 2015 frequently does. This change
avoids that.
R=rvargas@chromium.org
BUG=528394, 529981, 440500
Committed: https://crrev.com/84f30fe06877193d39bb2cb9fe345c2e12e695b3
Cr-Commit-Position: refs/heads/master@{#348324}
Patch Set 1 #
Total comments: 10
Patch Set 2 : Added unit tests #Patch Set 3 : Moved implementation, updated tests. #Patch Set 4 : Comment change. #
Total comments: 6
Patch Set 5 : Remove namespaces #
Total comments: 3
Messages
Total messages: 21 (4 generated)
|