Commit 23c26982 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

mmdevapi: Disable sound if the user explicitly selects no driver.

This also tweaks the no-driver behavior to report 0 active devices instead of returning an error code.
parent 7d469430
...@@ -445,6 +445,9 @@ static HRESULT load_driver_devices(EDataFlow flow) ...@@ -445,6 +445,9 @@ static HRESULT load_driver_devices(EDataFlow flow)
UINT num, def, i; UINT num, def, i;
HRESULT hr; HRESULT hr;
if(!drvs.pGetEndpointIDs)
return S_OK;
hr = drvs.pGetEndpointIDs(flow, &ids, &keys, &num, &def); hr = drvs.pGetEndpointIDs(flow, &ids, &keys, &num, &def);
if(FAILED(hr)) if(FAILED(hr))
return hr; return hr;
...@@ -824,9 +827,6 @@ HRESULT MMDevEnum_Create(REFIID riid, void **ppv) ...@@ -824,9 +827,6 @@ HRESULT MMDevEnum_Create(REFIID riid, void **ppv)
{ {
MMDevEnumImpl *This = MMDevEnumerator; MMDevEnumImpl *This = MMDevEnumerator;
if(!drvs.pGetAudioEndpoint)
return AUDCLNT_E_SERVICE_NOT_RUNNING;
if (!This) if (!This)
{ {
This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
......
...@@ -104,9 +104,12 @@ static BOOL init_driver(void) ...@@ -104,9 +104,12 @@ static BOOL init_driver(void)
DWORD size = sizeof(driver_name); DWORD size = sizeof(driver_name);
if(RegQueryValueExW(key, drv_value, 0, NULL, (BYTE*)driver_name, if(RegQueryValueExW(key, drv_value, 0, NULL, (BYTE*)driver_name,
&size) == ERROR_SUCCESS && driver_name[0] != '\0'){ &size) == ERROR_SUCCESS){
RegCloseKey(key); RegCloseKey(key);
if(driver_name[0] == '\0')
return TRUE;
for(next = p = driver_name; next; p = next + 1){ for(next = p = driver_name; next; p = next + 1){
next = strchrW(p, ','); next = strchrW(p, ',');
if(next) if(next)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment