wininet: Fix InternetGetConnectedStateEx[A|W] (try 2, resend)
Bruno Jesus
00cpxxx at gmail.com
Fri May 9 09:36:19 CDT 2014
On Fri, May 9, 2014 at 11:29 AM, Alexandre Julliard <julliard at winehq.org> wrote:
> Bruno Jesus <00cpxxx at gmail.com> writes:
>
>> @@ -1241,8 +1250,9 @@ BOOL WINAPI InternetGetConnectedStateExA(LPDWORD lpdwStatus, LPSTR lpszConnectio
>> dwReserved);
>> if (rc && lpwszConnectionName)
>> {
>> - WideCharToMultiByte(CP_ACP,0,lpwszConnectionName,-1,lpszConnectionName,
>> - dwNameLen, NULL, NULL);
>> + if (WideCharToMultiByte(CP_ACP,0,lpwszConnectionName,-1,lpszConnectionName,
>> + dwNameLen, NULL, NULL) == 0)
>> + *lpszConnectionName = '\0';
>
> That doesn't seem to match what the W function does, and I don't see any
> tests for that case.
Hi, thanks for the review =)
I'm not at home so I can't check it more carefully but judging by the
patch I think this is the test:
+ buffer[0] = 0xDE;
+ res = pInternetGetConnectedStateExA(&flags, buffer, 1, 0);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(flags, "Expected at least one flag set\n");
ok(strlen(buffer) == 0, "Expected 0 bytes, got %u\n", lstrlenA(buffer));
It sets some content inside the buffer and then ensures the string is
zero sized after returning. As far as I remember if you comment the
line "*lpszConnectionName = '\0'" one or more tests will result in
error. I can do a more careful research at the weekend if you wish.
Best wishes,
Bruno
More information about the wine-devel
mailing list