I have an 32-bit app that needs to set a 64-bit window long value to a window that belongs to a 64-bit process. When I try to call SetWindowLong from a 32-bit process, only low dword of the 64-bit value is set (I saw it while debugging 64-bit process), and obviously only low dword of the 64-bit value is returned to the caller (because function returns LONG, which is 32-bit value). The function SetWindowLongPtr is not exported in 32-bit version of user32.dll. I tried to disassemble SetWindowLongPtr source code to see if it is just some layer above syscall, but the function is actually huge and calls several other undocumented functions. How can I set a 64-bit window long value from a 32-bit process? Rebuilding 32-bit app to x64 target is not an option.
2
votes
1 Answers
2
votes
There are some things that you just cannot do from the 32 bit emulator. This is one of them. Call SetWindowLongPtr from a 64 bit process to achieve your goal. You don't necessarily have to convert your entire application to be 32 bit, but you need a 64 bit process on hand to do this particular task.