It may work for one application, but it doesn't look like a propper fix. I'd suggest there's probably something else going on that's causing stack corruption.
Probably it was declared with the wrong calling convention. Windows deals with this transparently but perhaps more transparently than us :)
So the question is: what calling conventions could cause the observed behaviour?