Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/odbccp32/odbccp32.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/odbccp32/odbccp32.c b/dlls/odbccp32/odbccp32.c index 8788330..515d44c 100644 --- a/dlls/odbccp32/odbccp32.c +++ b/dlls/odbccp32/odbccp32.c @@ -510,8 +510,8 @@ BOOL WINAPI SQLGetInstalledDriversW(WCHAR *buf, WORD size, WORD *sizeout) return FALSE; }
- RegQueryInfoKeyW(drivers, 0, 0, 0, 0, 0, 0, 0, &valuelen, 0, 0, 0); - value = heap_alloc(++valuelen * sizeof(WCHAR)); + valuelen = 256; + value = heap_alloc(valuelen * sizeof(WCHAR));
size--;
@@ -519,6 +519,11 @@ BOOL WINAPI SQLGetInstalledDriversW(WCHAR *buf, WORD size, WORD *sizeout) { len = valuelen; res = RegEnumValueW(drivers, index++, value, &len, NULL, NULL, NULL, NULL); + if (res == ERROR_MORE_DATA) + { + value = heap_realloc(value, ++len * sizeof(WCHAR)); + res = RegEnumValueW(drivers, index++, value, &len, NULL, NULL, NULL, NULL); + } if (res == ERROR_SUCCESS) { lstrcpynW(buf + written, value, size - written);