Get 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

Review URL: https://codereview.chromium.org/1320673016

Cr-Commit-Position: refs/heads/master@{#348324}


CrOS-Libchrome-Original-Commit: 84f30fe06877193d39bb2cb9fe345c2e12e695b3
1 file changed
tree: 35402f5a04401a7351a2defe59aceb9a312dfbc7
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/