[PATCH] advapi32: test and fix ChangeServiceConfig2 when given a zero length or a null description (try 2) (was: succeed for null pointer in ChangeServiceConfig2)

Bernhard Übelacker bernhardu at vr-web.de
Mon Jun 8 16:01:57 CDT 2015

sorry for the delay. The first version of this patch
was sent and discussed in March.

[1] https://www.winehq.org/pipermail/wine-patches/2015-March/137996.html
[2] https://www.winehq.org/pipermail/wine-devel/2015-March/thread.html#106999

This iteration compared to "try 1" has following changes:
- move check of descr->lpDescription to server side
- add some more tests and check the results.

Kind regards,

PS.: During discussion there was another issue identified when calling
ChangeServiceConfig2W with an invalid server handle.
This patch does not try to test or solve this issue.

Am 19.03.2015 um 13:06 schrieb Bernhard Übelacker:
> Hello,
> attached patch avoids an issue when trying to run Flatout 2 with copy
> protection.
> When starting Flatout2.exe for the first time it wants to install some
> services, but shows in wine some error messages.
> The only visible sign in terminal output, that something went wrong, is
> this:
>      err:rpc:I_RpcReceive we got fault packet with status 0x3e6
> And of course later some dialog showing error 998 (=0x3e6) and a
> unhandled exception.
> This is because the SC_RPC_CONFIG_INFOW parameter has in its
> descr->lpDescription a null pointer instead of a valid LPWSTR.
> Right now this null pointer would be accessed in
> svcctl_ChangeServiceConfig2W and causes an exception there , but is
> hidden by the RPC layer.
> (And of course this makes the SF4 protection still not working.)
> Kind regards,
> Bernhard

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-advapi32-test-and-fix-ChangeServiceConfig2-when-give.patch
Type: text/x-patch
Size: 6931 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20150608/d9203c0e/attachment.bin>

More information about the wine-patches mailing list