odbccp32: Handle NULL sizeout in SQLGetInstalledDrivers.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48111 Signed-off-by: Gijs Vermeulen <gijsvrm@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
df3c911c63
commit
3915b8d229
|
@ -583,7 +583,8 @@ BOOL WINAPI SQLGetInstalledDrivers(char *buf, WORD size, WORD *sizeout)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
*sizeout = WideCharToMultiByte(CP_ACP, 0, wbuf, written, NULL, 0, NULL, NULL);
|
||||
if (sizeout)
|
||||
*sizeout = WideCharToMultiByte(CP_ACP, 0, wbuf, written, NULL, 0, NULL, NULL);
|
||||
WideCharToMultiByte(CP_ACP, 0, wbuf, written, buf, size, NULL, NULL);
|
||||
|
||||
heap_free(wbuf);
|
||||
|
|
|
@ -643,6 +643,11 @@ static void test_SQLGetInstalledDrivers(void)
|
|||
ok(!ret, "got %d\n", ret);
|
||||
check_error(ODBC_ERROR_INVALID_BUFF_LEN);
|
||||
|
||||
ret = SQLGetInstalledDrivers(buffer, 10, NULL);
|
||||
ok(ret, "got %d\n", ret);
|
||||
ok(strlen(buffer) == 8, "got len %u\n", lstrlenA(buffer));
|
||||
ok(!buffer[9], "buffer not doubly null-terminated\n");
|
||||
|
||||
ret = SQLGetInstalledDrivers(buffer, 10, &written);
|
||||
ok(ret, "got %d\n", ret);
|
||||
ok(strlen(buffer) == 8, "got len %u\n", lstrlenA(buffer));
|
||||
|
|
Loading…
Reference in New Issue