desktop_util: Make ShellExecute() result cast 64-bit-safe

int is not a sufficiently large type for casting a pointer type on
64-bit Windows, so use ptrdiff_t instead.

Tested by vultraz.
This commit is contained in:
Ignacio R. Morelle 2013-10-24 21:50:37 -03:00
parent d7e3b87584
commit 6307e19ddb

View file

@ -85,7 +85,7 @@ bool open_in_file_manager(const std::string& path)
wide_string wpath = utils::string_to_wstring(path);
wpath.push_back(wchar_t(0)); // Make wpath NULL-terminated
const int res = reinterpret_cast<int>(ShellExecute(NULL, L"open", &wpath.front(), NULL, NULL, SW_SHOW));
const ptrdiff_t res = reinterpret_cast<ptrdiff_t>(ShellExecute(NULL, L"open", &wpath.front(), NULL, NULL, SW_SHOW));
if(res <= 32) {
ERR_DE << "open_in_file_manager(): ShellExecute() failed (" << res << ")\n";
return false;