Removed wrong glue code for structs
Pass IntPtr.Zero for optional IntPtr parameters instead of null