Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f7d37b38
Commit
f7d37b38
authored
Feb 14, 2012
by
Andrew Eikum
Committed by
Alexandre Julliard
Feb 15, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Only return ACTIVE devices from GetDefaultAudioEndpoint.
This prevents invalid devices from being created if the user adds a device, sets it as default, and then removes it.
parent
4f5271a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
devenum.c
dlls/mmdevapi/devenum.c
+11
-5
No files found.
dlls/mmdevapi/devenum.c
View file @
f7d37b38
...
...
@@ -942,7 +942,7 @@ static HRESULT WINAPI MMDevEnum_GetDefaultAudioEndpoint(IMMDeviceEnumerator *ifa
if
(
RegOpenKeyW
(
HKEY_CURRENT_USER
,
reg_key
,
&
key
)
==
ERROR_SUCCESS
){
const
WCHAR
*
reg_x_name
,
*
reg_vx_name
;
WCHAR
def_id
[
256
];
DWORD
size
=
sizeof
(
def_id
);
DWORD
size
=
sizeof
(
def_id
)
,
state
;
if
(
flow
==
eRender
){
reg_x_name
=
reg_out_nameW
;
...
...
@@ -957,8 +957,11 @@ static HRESULT WINAPI MMDevEnum_GetDefaultAudioEndpoint(IMMDeviceEnumerator *ifa
(
BYTE
*
)
def_id
,
&
size
)
==
ERROR_SUCCESS
){
hr
=
IMMDeviceEnumerator_GetDevice
(
iface
,
def_id
,
device
);
if
(
SUCCEEDED
(
hr
)){
RegCloseKey
(
key
);
return
S_OK
;
if
(
SUCCEEDED
(
IMMDevice_GetState
(
*
device
,
&
state
))
&&
state
==
DEVICE_STATE_ACTIVE
){
RegCloseKey
(
key
);
return
S_OK
;
}
}
TRACE
(
"Unable to find voice device %s
\n
"
,
wine_dbgstr_w
(
def_id
));
...
...
@@ -968,8 +971,11 @@ static HRESULT WINAPI MMDevEnum_GetDefaultAudioEndpoint(IMMDeviceEnumerator *ifa
(
BYTE
*
)
def_id
,
&
size
)
==
ERROR_SUCCESS
){
hr
=
IMMDeviceEnumerator_GetDevice
(
iface
,
def_id
,
device
);
if
(
SUCCEEDED
(
hr
)){
RegCloseKey
(
key
);
return
S_OK
;
if
(
SUCCEEDED
(
IMMDevice_GetState
(
*
device
,
&
state
))
&&
state
==
DEVICE_STATE_ACTIVE
){
RegCloseKey
(
key
);
return
S_OK
;
}
}
TRACE
(
"Unable to find device %s
\n
"
,
wine_dbgstr_w
(
def_id
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment