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
ef1e9aa0
Commit
ef1e9aa0
authored
Aug 13, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
Aug 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineoss: Update device cache in get_device_guid().
parent
8fb70648
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
mmdevdrv.c
dlls/wineoss.drv/mmdevdrv.c
+22
-22
No files found.
dlls/wineoss.drv/mmdevdrv.c
View file @
ef1e9aa0
...
...
@@ -95,6 +95,18 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved)
return
TRUE
;
}
static
void
device_add
(
OSSDevice
*
oss_dev
)
{
OSSDevice
*
dev_item
;
LIST_FOR_EACH_ENTRY
(
dev_item
,
&
g_devices
,
OSSDevice
,
entry
)
if
(
IsEqualGUID
(
&
oss_dev
->
guid
,
&
dev_item
->
guid
)){
/* already in list */
HeapFree
(
GetProcessHeap
(),
0
,
oss_dev
);
return
;
}
list_add_tail
(
&
g_devices
,
&
oss_dev
->
entry
);
}
static
void
set_device_guid
(
EDataFlow
flow
,
HKEY
drv_key
,
const
WCHAR
*
key_name
,
GUID
*
guid
)
{
...
...
@@ -135,6 +147,15 @@ static void get_device_guid(EDataFlow flow, const char *device, GUID *guid)
HKEY
key
=
NULL
,
dev_key
;
DWORD
type
,
size
=
sizeof
(
*
guid
);
WCHAR
key_name
[
256
];
const
unsigned
int
dev_size
=
strlen
(
device
)
+
1
;
OSSDevice
*
oss_dev
=
HeapAlloc
(
GetProcessHeap
(),
0
,
offsetof
(
OSSDevice
,
devnode
[
dev_size
]));
if
(
oss_dev
){
oss_dev
->
flow
=
flow
;
oss_dev
->
guid
=
*
guid
;
memcpy
(
oss_dev
->
devnode
,
device
,
dev_size
);
device_add
(
oss_dev
);
}
if
(
flow
==
eCapture
)
key_name
[
0
]
=
'1'
;
...
...
@@ -185,18 +206,6 @@ BOOL WINAPI get_device_name_from_guid(GUID *guid, char **name, EDataFlow *flow)
return
FALSE
;
}
static
void
device_add
(
OSSDevice
*
oss_dev
)
{
OSSDevice
*
dev_item
;
LIST_FOR_EACH_ENTRY
(
dev_item
,
&
g_devices
,
OSSDevice
,
entry
)
if
(
IsEqualGUID
(
&
oss_dev
->
guid
,
&
dev_item
->
guid
)){
/* already in list */
HeapFree
(
GetProcessHeap
(),
0
,
oss_dev
);
return
;
}
list_add_tail
(
&
g_devices
,
&
oss_dev
->
entry
);
}
HRESULT
WINAPI
AUDDRV_GetEndpointIDs
(
EDataFlow
flow
,
WCHAR
***
ids_out
,
GUID
**
guids_out
,
UINT
*
num
,
UINT
*
def_index
)
{
...
...
@@ -229,23 +238,14 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids_out, GUID **gu
WCHAR
*
name
=
(
WCHAR
*
)((
char
*
)
params
.
endpoints
+
params
.
endpoints
[
i
].
name
);
char
*
device
=
(
char
*
)
params
.
endpoints
+
params
.
endpoints
[
i
].
device
;
unsigned
int
name_size
=
(
wcslen
(
name
)
+
1
)
*
sizeof
(
WCHAR
);
unsigned
int
dev_size
=
strlen
(
device
)
+
1
;
OSSDevice
*
oss_dev
;
ids
[
i
]
=
HeapAlloc
(
GetProcessHeap
(),
0
,
name_size
);
oss_dev
=
HeapAlloc
(
GetProcessHeap
(),
0
,
offsetof
(
OSSDevice
,
devnode
[
dev_size
]));
if
(
!
ids
[
i
]
||
!
oss_dev
){
HeapFree
(
GetProcessHeap
(),
0
,
oss_dev
);
if
(
!
ids
[
i
]){
params
.
result
=
E_OUTOFMEMORY
;
goto
end
;
}
memcpy
(
ids
[
i
],
name
,
name_size
);
get_device_guid
(
flow
,
device
,
guids
+
i
);
oss_dev
->
flow
=
flow
;
oss_dev
->
guid
=
guids
[
i
];
memcpy
(
oss_dev
->
devnode
,
device
,
dev_size
);
device_add
(
oss_dev
);
}
*
def_index
=
params
.
default_idx
;
...
...
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