Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
557a6a1b
Commit
557a6a1b
authored
Aug 13, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
Aug 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winepulse: Open/create driver registry key in get_device_guid().
parent
ef1e9aa0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
15 deletions
+9
-15
mmdevdrv.c
dlls/winepulse.drv/mmdevdrv.c
+9
-15
No files found.
dlls/winepulse.drv/mmdevdrv.c
View file @
557a6a1b
...
...
@@ -103,19 +103,22 @@ static void pulse_call(enum unix_funcs code, void *params)
assert
(
!
status
);
}
static
void
get_device_guid
(
HKEY
drv_key
,
EDataFlow
flow
,
const
char
*
pulse_name
,
GUID
*
guid
)
static
void
get_device_guid
(
EDataFlow
flow
,
const
char
*
pulse_name
,
GUID
*
guid
)
{
WCHAR
key_name
[
MAX_PULSE_NAME_LEN
+
2
];
DWORD
type
,
size
=
sizeof
(
*
guid
);
LSTATUS
status
;
HKEY
dev_key
;
HKEY
d
rv_key
,
d
ev_key
;
if
(
!
pulse_name
[
0
])
{
*
guid
=
(
flow
==
eRender
)
?
pulse_render_guid
:
pulse_capture_guid
;
return
;
}
if
(
!
drv_key
)
{
status
=
RegCreateKeyExW
(
HKEY_CURRENT_USER
,
drv_key_devicesW
,
0
,
NULL
,
0
,
KEY_WRITE
|
KEY_WOW64_64KEY
,
NULL
,
&
drv_key
,
NULL
);
if
(
status
!=
ERROR_SUCCESS
)
{
ERR
(
"Failed to open devices registry key: %lu
\n
"
,
status
);
CoCreateGuid
(
guid
);
return
;
}
...
...
@@ -128,6 +131,7 @@ static void get_device_guid(HKEY drv_key, EDataFlow flow, const char *pulse_name
NULL
,
&
dev_key
,
NULL
);
if
(
status
!=
ERROR_SUCCESS
)
{
ERR
(
"Failed to open registry key for device %s: %lu
\n
"
,
pulse_name
,
status
);
RegCloseKey
(
drv_key
);
CoCreateGuid
(
guid
);
return
;
}
...
...
@@ -140,6 +144,7 @@ static void get_device_guid(HKEY drv_key, EDataFlow flow, const char *pulse_name
ERR
(
"Failed to store device GUID for %s to registry: %lu
\n
"
,
pulse_name
,
status
);
}
RegCloseKey
(
dev_key
);
RegCloseKey
(
drv_key
);
}
HRESULT
WINAPI
AUDDRV_GetEndpointIDs
(
EDataFlow
flow
,
WCHAR
***
ids_out
,
GUID
**
keys
,
...
...
@@ -149,8 +154,6 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids_out, GUID **ke
GUID
*
guids
=
NULL
;
WCHAR
**
ids
=
NULL
;
unsigned
int
i
=
0
;
LSTATUS
status
;
HKEY
drv_key
;
TRACE
(
"%d %p %p %p
\n
"
,
flow
,
ids_out
,
num
,
def_index
);
...
...
@@ -173,13 +176,6 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids_out, GUID **ke
goto
end
;
}
status
=
RegCreateKeyExW
(
HKEY_CURRENT_USER
,
drv_key_devicesW
,
0
,
NULL
,
0
,
KEY_WRITE
|
KEY_WOW64_64KEY
,
NULL
,
&
drv_key
,
NULL
);
if
(
status
!=
ERROR_SUCCESS
)
{
ERR
(
"Failed to open devices registry key: %lu
\n
"
,
status
);
drv_key
=
NULL
;
}
for
(
i
=
0
;
i
<
params
.
num
;
i
++
)
{
WCHAR
*
name
=
(
WCHAR
*
)((
char
*
)
params
.
endpoints
+
params
.
endpoints
[
i
].
name
);
char
*
pulse_name
=
(
char
*
)
params
.
endpoints
+
params
.
endpoints
[
i
].
device
;
...
...
@@ -190,10 +186,8 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids_out, GUID **ke
break
;
}
memcpy
(
ids
[
i
],
name
,
size
);
get_device_guid
(
drv_key
,
flow
,
pulse_name
,
&
guids
[
i
]);
get_device_guid
(
flow
,
pulse_name
,
&
guids
[
i
]);
}
if
(
drv_key
)
RegCloseKey
(
drv_key
);
end:
HeapFree
(
GetProcessHeap
(),
0
,
params
.
endpoints
);
...
...
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