diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2019-03-08 08:43:49 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-08 08:43:49 -0800 |
| commit | 4aab9cc79e7b0496ec447bad67225dc1c3486bef (patch) | |
| tree | d4e6a664ca7211a1c681bc6906568d7c9102dd55 /tools/gfx/window.cpp | |
| parent | 74a340506bde3c668b05ad5aa1192cfa89763243 (diff) | |
Fix a 64-bit issue in our Windows UI code (#887)
Fixes issue #874
The problem here was that a pointer was being cast to `LONG` so that it could be used with the `SetWindowLongPtr` API, but that API actually expects a `LONG_PTR`. Since `LONG` is a 32-bit type on 64-bit Windows, the pointer we stored was getting truncated, leading to crashes.
I'm kind of surprised this wasn't biting more of our applications (e.g., the render tests).
Diffstat (limited to 'tools/gfx/window.cpp')
| -rw-r--r-- | tools/gfx/window.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/gfx/window.cpp b/tools/gfx/window.cpp index 9e2195141..02a083ef2 100644 --- a/tools/gfx/window.cpp +++ b/tools/gfx/window.cpp @@ -173,7 +173,7 @@ static LRESULT CALLBACK windowProc( window = (Window*) createInfo->lpCreateParams; window->handle = windowHandle; - SetWindowLongPtrW(windowHandle, GWLP_USERDATA, (LONG)size_t(window)); + SetWindowLongPtrW(windowHandle, GWLP_USERDATA, (LONG_PTR) window); } break; |
