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
cf390232
Commit
cf390232
authored
Oct 20, 2011
by
Ken Thomases
Committed by
Alexandre Julliard
Oct 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecoreaudio: Avoid an extra copy/conversion of a string.
parent
4bceee9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
mmdevdrv.c
dlls/winecoreaudio.drv/mmdevdrv.c
+5
-12
No files found.
dlls/winecoreaudio.drv/mmdevdrv.c
View file @
cf390232
...
...
@@ -325,7 +325,6 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids,
AudioBufferList
*
buffers
;
CFStringRef
name
;
SIZE_T
len
;
char
nameA
[
256
];
int
j
;
addr
.
mSelector
=
kAudioDevicePropertyStreamConfiguration
;
...
...
@@ -384,18 +383,10 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids,
continue
;
}
if
(
!
CFStringGetCString
(
name
,
nameA
,
sizeof
(
nameA
),
kCFStringEncodingUTF8
)){
WARN
(
"Error converting string to UTF8
\n
"
);
CFRelease
(
name
);
continue
;
}
CFRelease
(
name
);
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
nameA
,
-
1
,
NULL
,
0
);
len
=
CFStringGetLength
(
name
)
+
1
;
(
*
ids
)[
*
num
]
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
(
*
ids
)[
*
num
]){
CFRelease
(
name
);
HeapFree
(
GetProcessHeap
(),
0
,
devices
);
for
(
j
=
0
;
j
<
*
num
;
++
j
){
HeapFree
(
GetProcessHeap
(),
0
,
(
*
ids
)[
j
]);
...
...
@@ -405,7 +396,9 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids,
HeapFree
(
GetProcessHeap
(),
0
,
*
keys
);
return
E_OUTOFMEMORY
;
}
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
nameA
,
-
1
,
(
*
ids
)[
*
num
],
len
);
CFStringGetCharacters
(
name
,
CFRangeMake
(
0
,
len
-
1
),
(
UniChar
*
)(
*
ids
)[
*
num
]);
((
*
ids
)[
*
num
])[
len
-
1
]
=
0
;
CFRelease
(
name
);
(
*
keys
)[
*
num
]
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
AudioDeviceID
));
if
(
!
(
*
keys
)[
*
num
]){
...
...
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