3 ms·
At a previous company, we had a legacy software written in PowerBuilder, which crashed on some of the client's computers. We couldn't reproduce the crash on our
by cesarb 10y ago
At a previous company, we had a legacy software written in PowerBuilder, which crashed on some of the client's computers. We couldn't reproduce the crash on our computers, no matter how much we tried.
We finally got access to one of the crashing laptops, and (with the client's permission) installed a debugger on it. After a few false starts, we found that some code deep within PowerBuilder's framework crashed when it received a particular accessibility window message, and that this window message was being sent by some Microsoft touch screen component. All of us techies had avoided buying touch screen laptops (this was when touch screen laptops were Microsoft's latest fad), which is why it had never happened on any of our machines.
The solution was to do a binary edit of the import table of the relevant PowerBuilder DLL to route all Windows calls to a helper DLL, which forwarded them to the real Windows DLL after replacing the window message callback with a small thunk. Said thunk then filtered out the offending window messages, before forwarding the rest back to the real window message callback within the PowerBuilder DLL. Hacky, but worked perfectly.