wdm/ks hotplug: fixed two bugs in CommitDeviceInfos() Firstly, hostApi->info.deviceCount was being zeroed before it was used to specify how many devices to free, so zero devices/filters would be freed. Secondly, a ptr ptr (**) to temporary scan results localScanResults was being pased to DisposeDeviceInfos() instead of a ptr (*).
This commit is contained in:
parent
89f8f75a27
commit
23b4bdd49a
1 changed files with 5 additions and 5 deletions
|
|
@ -3706,10 +3706,6 @@ static PaError CommitDeviceInfos( struct PaUtilHostApiRepresentation *hostApi, P
|
|||
{
|
||||
PaWinWdmHostApiRepresentation *wdmHostApi = (PaWinWdmHostApiRepresentation*)hostApi;
|
||||
|
||||
hostApi->info.deviceCount = 0;
|
||||
hostApi->info.defaultInputDevice = paNoDevice;
|
||||
hostApi->info.defaultOutputDevice = paNoDevice;
|
||||
|
||||
/* Free any old memory which might be in the device info */
|
||||
if( hostApi->deviceInfos )
|
||||
{
|
||||
|
|
@ -3717,11 +3713,15 @@ static PaError CommitDeviceInfos( struct PaUtilHostApiRepresentation *hostApi, P
|
|||
wdmHostApi->allocations, sizeof(PaWinWDMScanDeviceInfosResults));
|
||||
localScanResults->deviceInfos = hostApi->deviceInfos;
|
||||
|
||||
DisposeDeviceInfos(hostApi, &localScanResults, hostApi->info.deviceCount);
|
||||
DisposeDeviceInfos(hostApi, localScanResults, hostApi->info.deviceCount);
|
||||
|
||||
hostApi->deviceInfos = NULL;
|
||||
}
|
||||
|
||||
hostApi->info.deviceCount = 0;
|
||||
hostApi->info.defaultInputDevice = paNoDevice;
|
||||
hostApi->info.defaultOutputDevice = paNoDevice;
|
||||
|
||||
if( scanResults != NULL )
|
||||
{
|
||||
PaWinWDMScanDeviceInfosResults *scanDeviceInfosResults = ( PaWinWDMScanDeviceInfosResults * ) scanResults;
|
||||
|
|
|
|||
Loading…
Reference in a new issue