x64 crash fix

This is for people involved in the developement of Snes9x, or SNES emulators in general.
BUG REPORTS BELONG IN TECH SUPPORT/BUG TRACKING!
Post Reply
DaMan
Snes9x White Belt
Posts: 27
Joined: Thu Jan 22, 2015 2:35 pm

x64 crash fix

Post by DaMan » Sat Jan 31, 2015 3:30 pm

Opening input config/customize hotkey would crash 64bit builds made with VS10 and newer (assuming it doesn't affect VS08 since official builds don't crash).
Attachments
Fix-x64.zip
(1.36 KiB) Downloaded 1175 times

User avatar
OV2
Official Win32 Porter/Dev
Posts: 679
Joined: Thu Aug 30, 2007 10:15 pm

Re: x64 crash fix

Post by OV2 » Sun Feb 01, 2015 12:48 am

Thanks, merged to github.

DaMan
Snes9x White Belt
Posts: 27
Joined: Thu Jan 22, 2015 2:35 pm

Re: x64 crash fix

Post by DaMan » Sun Feb 01, 2015 12:45 pm

You're welcome, but you missed a few things.
GetClassLong -> GetClassLongPtr in wsnes.cpp.
GetWindowLong -> GetWindowLongPtr in InputCustom.cpp and on line 841

Code: Select all

SetWindowLongPtr(hwnd, 0, (LONG)icp);
to

Code: Select all

SetWindowLongPtr(hwnd, 0, (LONG_PTR)icp);

User avatar
OV2
Official Win32 Porter/Dev
Posts: 679
Joined: Thu Aug 30, 2007 10:15 pm

Re: x64 crash fix

Post by OV2 » Sun Feb 01, 2015 2:13 pm

Thanks again - that's what happens if you only look at the diff file instead of applying it ;)

However I don't see any GetClassLong calls in the entire project.

DaMan
Snes9x White Belt
Posts: 27
Joined: Thu Jan 22, 2015 2:35 pm

Re: x64 crash fix

Post by DaMan » Sun Feb 01, 2015 4:17 pm

My bad it was also a GetClassLong in inputcustom. Was watching TV when I was writing that out and multitasking isn't my strong point.

Post Reply