mirror of
https://github.com/chromium/crashpad.git
synced 2025-01-02 03:08:09 +08:00
b666bcbe98
HandleToInt() and IntToHandle() use int, a signed type, for the 32-bit integer representation of HANDLE values. For opaque values, an unsigned type would normally be used, but in this case, signed was chosen for sign extension to work correctly. INVALID_HANDLE_VALUE is defined as ((HANDLE)(LONG_PTR)-1), and this needs to round-trip through the chosen integer representation back to the same HANDLE value. Sign extension is also recommended by https://msdn.microsoft.com/en-us/library/windows/desktop/aa384203. As suggested in https://codereview.chromium.org/1422503015/diff/1/util/win/handle.cc#newcode24 R=scottmg@chromium.org Review URL: https://codereview.chromium.org/1422023010 .