winecfg/audio: properly terminate an empty list of drivers (resend)
Kirill K. Smirnov
lich at math.spbu.ru
Thu Dec 4 02:51:12 CST 2008
If no driver is found, the drivers list should be terminated with an empty
driver, not just zeroes (bug 15699 causa).
The previous diff was just badly formatted. Now it is OK.
-------------- next part --------------
diff --git a/programs/winecfg/audio.c b/programs/winecfg/audio.c
index 78f9f57..8e966a5 100644
--- a/programs/winecfg/audio.c
+++ b/programs/winecfg/audio.c
@@ -533,8 +533,10 @@ static void findAudioDrivers(void)
if (numFound) {
loadedAudioDrv = HeapReAlloc(GetProcessHeap(), 0, loadedAudioDrv, (numFound + 1) * sizeof(AUDIO_DRIVER));
CopyMemory(&loadedAudioDrv[numFound], pAudioDrv, sizeof(AUDIO_DRIVER));
- } else
- loadedAudioDrv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(AUDIO_DRIVER));
+ } else {
+ loadedAudioDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(AUDIO_DRIVER));
+ CopyMemory(&loadedAudioDrv[0], pAudioDrv, sizeof(AUDIO_DRIVER));
+ }
}
/* check local copy of registry string for unloadable drivers */
More information about the wine-patches
mailing list