diff options
author | Mikkel Krautz <mikkel@krautz.dk> | 2016-08-21 16:06:20 +0300 |
---|---|---|
committer | Mikkel Krautz <mikkel@krautz.dk> | 2016-08-21 19:43:25 +0300 |
commit | 4cc34410ddc1fafbbba91977e64e1d653037ce7e (patch) | |
tree | 33d02f301fa48043304f3ec2c170fbf305dd4750 | |
parent | b711ea987c66ff1de7c08dc0be1e239f260f6b8d (diff) |
overlay/overlay_exe: use unsigned long long for our passed-in handle to silence MSVC2015 warning.
Before:
warning C4312: 'reinterpret_cast': conversion from 'unsigned long' to 'HANDLE' of greater size
Also, please note the comment in src/mumble/Overlay_win.cpp regarding the
32-bit masking:
https://msdn.microsoft.com/en-us/library/aa384203.aspx says:
> When sharing a handle between 32-bit and 64-bit applications, only
> the lower 32 bits are significant [...]
-rw-r--r-- | overlay/overlay_exe/overlay_exe.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/overlay/overlay_exe/overlay_exe.cpp b/overlay/overlay_exe/overlay_exe.cpp index e3e1131a3..4d57801ed 100644 --- a/overlay/overlay_exe/overlay_exe.cpp +++ b/overlay/overlay_exe/overlay_exe.cpp @@ -150,8 +150,8 @@ int main(int argc, char **argv) { } try { - unsigned long passedInHandle = std::stoul(handleStr); - parent = reinterpret_cast<HANDLE>(passedInHandle & 0xFFFFFFFFUL); + unsigned long long passedInHandle = std::stoull(handleStr); + parent = reinterpret_cast<HANDLE>(passedInHandle & 0xFFFFFFFFULL); } catch(std::exception &) { return OVERLAY_HELPER_ERROR_EXE_INVALID_HANDLE_ARGUMENT; } |