[PATCH] wininet: Do not call InternetUnlockRequestFile when locking failed.

Zebediah Figura (she/her) zfigura at codeweavers.com
Wed Dec 29 15:56:01 CST 2021


On 12/29/21 14:40, Robert Wilhelm wrote:
> This should fix crashes on W10L vms, when we pass NULL to InternetUnlockRequestFile after prior lock already failed.
> Crashes are here: https://test.winehq.org/data/tests/wininet:http.html
> Behavior after crash is here: https://testbot.winehq.org/JobDetails.pl?Key=104580
> 
> Signed-off-by: Robert Wilhelm <robert.wilhelm at gmx.net>
> ---
>   dlls/wininet/tests/http.c | 15 +++++++++++----
>   1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c
> index cf3f62f868a..ee56c64fbd9 100644
> --- a/dlls/wininet/tests/http.c
> +++ b/dlls/wininet/tests/http.c
> @@ -1718,10 +1718,13 @@ static void InternetLockRequestFile_test(void)
> 
>       ret = InternetLockRequestFile(req.request, &lock2);
>       ok(ret, "InternetLockRequestFile returned: %x(%u)\n", ret, GetLastError());
> +    ok(lock2 != NULL, "lock2 == NULL\n");
>       ok(lock == lock2, "lock != lock2\n");
> 
> -    ret = InternetUnlockRequestFile(lock2);
> -    ok(ret, "InternetUnlockRequestFile failed: %u\n", GetLastError());
> +    if (lock2) {
> +        ret = InternetUnlockRequestFile(lock2);
> +        ok(ret, "InternetUnlockRequestFile failed: %u\n", GetLastError());
> +    }
> 

Shouldn't we fix whatever's causing "lock2" to be NULL instead? Even 
with this patch we're still getting a test failure.



More information about the wine-devel mailing list