No navigation frame on the left?  Click here.

bumpup.awk

 

The infamous structure padding bug in MIDL is history. Another one is still in ther and occasionally rears it head: if you transfer large amounts of array elements (the more, the merrier), the stubs on the sending side will sometimes underestimate the needed staging buffer size, resulting in nasty heap corruption and ultimately in access violations or memory overwrites.

bumpup.awk prevents this by locating the statements that compute the size of the stub memory allocation and fixing them from N bytes to N * f + c, where f is a slop factor (specified as a percentage) and c is a constant. 10% increase and 2K work well for us here.

bump.awk requires GNU awk 3.0.3 to run, available (among others) from http://www.cygnus.com/.

bumpup.awk, 5 KB