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
0d34e5c6
Commit
0d34e5c6
authored
Dec 09, 2009
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Dec 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Implement DSPROPERTY_WaveDeviceMappingA on top of *W.
parent
7705fe64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
60 deletions
+32
-60
propset.c
dlls/dsound/propset.c
+32
-60
No files found.
dlls/dsound/propset.c
View file @
0d34e5c6
...
...
@@ -88,13 +88,13 @@ static ULONG WINAPI IKsPrivatePropertySetImpl_Release(LPKSPROPERTYSET iface)
return
ref
;
}
static
HRESULT
DSPROPERTY_WaveDeviceMapping
A
(
static
HRESULT
DSPROPERTY_WaveDeviceMapping
W
(
LPVOID
pPropData
,
ULONG
cbPropData
,
PULONG
pcbReturned
)
{
HRESULT
hr
=
DSERR_INVALIDPARAM
;
PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_
A
_DATA
ppd
;
PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_
W
_DATA
ppd
;
TRACE
(
"(pPropData=%p,cbPropData=%d,pcbReturned=%p)
\n
"
,
pPropData
,
cbPropData
,
pcbReturned
);
...
...
@@ -111,15 +111,15 @@ static HRESULT DSPROPERTY_WaveDeviceMappingA(
TRACE
(
"DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER
\n
"
);
wodn
=
waveOutGetNumDevs
();
for
(
wod
=
0
;
wod
<
wodn
;
wod
++
)
{
WAVEOUTCAPS
A
capsA
;
WAVEOUTCAPS
W
capsW
;
MMRESULT
res
;
res
=
waveOutGetDevCaps
A
(
wod
,
&
capsA
,
sizeof
(
capsA
));
res
=
waveOutGetDevCaps
W
(
wod
,
&
capsW
,
sizeof
(
capsW
));
if
(
res
==
MMSYSERR_NOERROR
)
{
if
(
lstrcmp
A
(
capsA
.
szPname
,
ppd
->
DeviceName
)
==
0
)
{
if
(
lstrcmp
W
(
capsW
.
szPname
,
ppd
->
DeviceName
)
==
0
)
{
ppd
->
DeviceId
=
DSOUND_renderer_guids
[
wod
];
hr
=
DS_OK
;
TRACE
(
"found %s for %s
\n
"
,
debugstr_guid
(
&
ppd
->
DeviceId
),
ppd
->
DeviceName
);
debugstr_w
(
ppd
->
DeviceName
)
);
break
;
}
}
...
...
@@ -130,15 +130,15 @@ static HRESULT DSPROPERTY_WaveDeviceMappingA(
TRACE
(
"DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
\n
"
);
widn
=
waveInGetNumDevs
();
for
(
wid
=
0
;
wid
<
widn
;
wid
++
)
{
WAVEINCAPS
A
capsA
;
WAVEINCAPS
W
capsW
;
MMRESULT
res
;
res
=
waveInGetDevCaps
A
(
wid
,
&
capsA
,
sizeof
(
capsA
));
res
=
waveInGetDevCaps
W
(
wid
,
&
capsW
,
sizeof
(
capsW
));
if
(
res
==
MMSYSERR_NOERROR
)
{
if
(
lstrcmp
A
(
capsA
.
szPname
,
ppd
->
DeviceName
)
==
0
)
{
if
(
lstrcmp
W
(
capsW
.
szPname
,
ppd
->
DeviceName
)
==
0
)
{
ppd
->
DeviceId
=
DSOUND_capture_guids
[
wid
];
TRACE
(
"found %s for %s
\n
"
,
debugstr_guid
(
&
ppd
->
DeviceId
),
ppd
->
DeviceName
);
hr
=
DS_OK
;
TRACE
(
"found %s for %s
\n
"
,
debugstr_guid
(
&
ppd
->
DeviceId
),
debugstr_w
(
ppd
->
DeviceName
));
break
;
}
}
...
...
@@ -146,67 +146,39 @@ static HRESULT DSPROPERTY_WaveDeviceMappingA(
}
if
(
pcbReturned
)
*
pcbReturned
=
cbPropData
;
*
pcbReturned
=
cbPropData
;
return
hr
;
}
static
HRESULT
DSPROPERTY_WaveDeviceMapping
W
(
static
HRESULT
DSPROPERTY_WaveDeviceMapping
A
(
LPVOID
pPropData
,
ULONG
cbPropData
,
PULONG
pcbReturned
)
{
HRESULT
hr
=
DSERR_INVALIDPARAM
;
PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
ppd
;
TRACE
(
"(pPropData=%p,cbPropData=%d,pcbReturned=%p)
\n
"
,
pPropData
,
cbPropData
,
pcbReturned
)
;
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
*
ppd
=
pPropData
;
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
data
;
DWORD
len
;
HRESULT
hr
;
ppd
=
pPropData
;
TRACE
(
"(pPropData=%p,cbPropData=%d,pcbReturned=%p)
\n
"
,
pPropData
,
cbPropData
,
pcbReturned
);
if
(
!
ppd
)
{
WARN
(
"invalid parameter: pPropData
\n
"
);
return
DSERR_INVALIDPARAM
;
if
(
!
ppd
||
!
ppd
->
DeviceName
)
{
WARN
(
"invalid parameter: ppd=%p
\n
"
,
ppd
);
return
DSERR_INVALIDPARAM
;
}
if
(
ppd
->
DataFlow
==
DIRECTSOUNDDEVICE_DATAFLOW_RENDER
)
{
ULONG
wod
;
unsigned
int
wodn
;
TRACE
(
"DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER
\n
"
);
wodn
=
waveOutGetNumDevs
();
for
(
wod
=
0
;
wod
<
wodn
;
wod
++
)
{
WAVEOUTCAPSW
capsW
;
MMRESULT
res
;
res
=
waveOutGetDevCapsW
(
wod
,
&
capsW
,
sizeof
(
capsW
));
if
(
res
==
MMSYSERR_NOERROR
)
{
if
(
lstrcmpW
(
capsW
.
szPname
,
ppd
->
DeviceName
)
==
0
)
{
ppd
->
DeviceId
=
DSOUND_renderer_guids
[
wod
];
hr
=
DS_OK
;
TRACE
(
"found %s for %s
\n
"
,
debugstr_guid
(
&
ppd
->
DeviceId
),
debugstr_w
(
ppd
->
DeviceName
));
break
;
}
}
}
}
else
if
(
ppd
->
DataFlow
==
DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
)
{
ULONG
wid
;
unsigned
int
widn
;
TRACE
(
"DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
\n
"
);
widn
=
waveInGetNumDevs
();
for
(
wid
=
0
;
wid
<
widn
;
wid
++
)
{
WAVEINCAPSW
capsW
;
MMRESULT
res
;
res
=
waveInGetDevCapsW
(
wid
,
&
capsW
,
sizeof
(
capsW
));
if
(
res
==
MMSYSERR_NOERROR
)
{
if
(
lstrcmpW
(
capsW
.
szPname
,
ppd
->
DeviceName
)
==
0
)
{
ppd
->
DeviceId
=
DSOUND_capture_guids
[
wid
];
hr
=
DS_OK
;
TRACE
(
"found %s for %s
\n
"
,
debugstr_guid
(
&
ppd
->
DeviceId
),
debugstr_w
(
ppd
->
DeviceName
));
break
;
}
}
}
}
data
.
DataFlow
=
ppd
->
DataFlow
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
ppd
->
DeviceName
,
-
1
,
NULL
,
0
);
data
.
DeviceName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
data
.
DeviceName
)
return
E_OUTOFMEMORY
;
MultiByteToWideChar
(
CP_ACP
,
0
,
ppd
->
DeviceName
,
-
1
,
data
.
DeviceName
,
len
);
hr
=
DSPROPERTY_WaveDeviceMappingW
(
&
data
,
cbPropData
,
pcbReturned
);
HeapFree
(
GetProcessHeap
(),
0
,
data
.
DeviceName
);
ppd
->
DeviceId
=
data
.
DeviceId
;
if
(
pcbReturned
)
*
pcbReturned
=
cbPropData
;
...
...
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