Descriptionwin: Use signed int as the integer representation of HANDLEs
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
Committed: https://chromium.googlesource.com/crashpad/crashpad/+/b666bcbe98c67256a64418313755a40fea2992d6
Patch Set 1 #Patch Set 2 : #
Total comments: 3
Messages
Total messages: 6 (2 generated)
|