Generate a pinvoke method is now abstracted away using partial application.