Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Issue 1422023010: win: Use signed int as the integer representation of HANDLEs (Closed)

Created:
5 years, 1 month ago by Mark Mentovai
Modified:
5 years, 1 month ago
Reviewers:
scottmg
CC:
crashpad-dev_chromium.org
Base URL:
https://chromium.googlesource.com/crashpad/crashpad@master
Target Ref:
refs/heads/master
Project:
crashpad
Visibility:
Public.

Description

win: 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -28 lines) Patch
M test/win/win_child_process.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M util/win/handle.h View 2 chunks +12 lines, -12 lines 2 comments Download
M util/win/process_info.h View 1 chunk +1 line, -1 line 0 comments Download
M util/win/process_info_test.cc View 4 chunks +4 lines, -5 lines 0 comments Download
M util/win/registration_protocol_win.h View 1 chunk +10 lines, -10 lines 1 comment Download

Messages

Total messages: 6 (2 generated)
Mark Mentovai
5 years, 1 month ago (2015-11-06 16:06:33 UTC) #3
scottmg
lgtm https://codereview.chromium.org/1422023010/diff/20001/util/win/handle.h File util/win/handle.h (right): https://codereview.chromium.org/1422023010/diff/20001/util/win/handle.h#newcode25 util/win/handle.h:25: //! pointers to anything. Only 32 bits of ...
5 years, 1 month ago (2015-11-06 18:33:22 UTC) #4
Mark Mentovai
https://codereview.chromium.org/1422023010/diff/20001/util/win/handle.h File util/win/handle.h (right): https://codereview.chromium.org/1422023010/diff/20001/util/win/handle.h#newcode25 util/win/handle.h:25: //! pointers to anything. Only 32 bits of kernel ...
5 years, 1 month ago (2015-11-06 18:36:27 UTC) #5
Mark Mentovai
5 years, 1 month ago (2015-11-06 20:03:21 UTC) #6
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
b666bcbe98c67256a64418313755a40fea2992d6 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698