It's required that pointers are initialised. If it is working you've either changed that or you have an unpredicable overwrite.
I didn't get as far as looking at the parameters. When it comes to parameters, a good rule is that if the documentation doesn't give a default value, you need to specify the value. Accurately filling in structure lengths, if required, is especially important.