changes in v2: - return on size being NULL ERROR_INVALID_PARAMETER instead of ERROR_INSUFFICIENT_BUFFER.
[Testbot run with first patch](https://testbot.winehq.org/JobDetails.pl?Key=158998)
[Testbot run with both patches](https://testbot.winehq.org/JobDetails.pl?Key=159000)