The calling convention of window api is stdcall, callee pops its own arguments from the stack, so windows api's return statement usually like this (assembly) ret xxh, xxh == number of arguments * 4 byte.
Number of arguments are vary from api to api, not all windows api uses 20 arguments (and ret 50h) especially some api has no argument, in that situation, before and after api call, esp register can not keep the same value, stack corruption occurs.
Pass the argument according to api's prototype could fix this problem.
The calling convention of window api is stdcall, callee pops its own arguments from the stack, so windows api's return statement usually like this (assembly) ret xxh, xxh == number of arguments * 4 byte. Number of arguments are vary from api to api, not all windows api uses 20 arguments (and ret 50h) especially some api has no argument, in that situation, before and after api call, esp register can not keep the same value, stack corruption occurs. Pass the argument according to api's prototype could fix this problem.