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
d0b43b86
Commit
d0b43b86
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: Clean up DSPROPERTY_Enumerate1.
parent
4ecc5e66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
82 deletions
+46
-82
propset.c
dlls/dsound/propset.c
+46
-82
No files found.
dlls/dsound/propset.c
View file @
d0b43b86
...
...
@@ -702,88 +702,6 @@ static HRESULT DSPROPERTY_DescriptionW(
return
S_OK
;
}
static
HRESULT
DSPROPERTY_Enumerate1
(
LPVOID
pPropData
,
ULONG
cbPropData
,
PULONG
pcbReturned
)
{
PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
ppd
=
(
PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
)
pPropData
;
HRESULT
err
;
TRACE
(
"(pPropData=%p,cbPropData=%d,pcbReturned=%p)
\n
"
,
pPropData
,
cbPropData
,
pcbReturned
);
if
(
ppd
)
{
if
(
ppd
->
Callback
)
{
unsigned
devs
,
wod
,
wid
;
DSDRIVERDESC
desc
;
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
data
;
devs
=
waveOutGetNumDevs
();
for
(
wod
=
0
;
wod
<
devs
;
++
wod
)
{
err
=
mmErr
(
waveOutMessage
(
UlongToHandle
(
wod
),
DRV_QUERYDSOUNDDESC
,(
DWORD_PTR
)
&
desc
,
0
));
if
(
err
==
DS_OK
)
{
PIDSCDRIVER
drv
;
ZeroMemory
(
&
data
,
sizeof
(
data
));
data
.
DataFlow
=
DIRECTSOUNDDEVICE_DATAFLOW_RENDER
;
data
.
WaveDeviceId
=
wod
;
data
.
DeviceId
=
DSOUND_renderer_guids
[
wod
];
lstrcpynA
(
data
.
DescriptionA
,
desc
.
szDesc
,
sizeof
(
data
.
DescriptionA
));
lstrcpynA
(
data
.
ModuleA
,
desc
.
szDrvname
,
sizeof
(
data
.
ModuleA
));
MultiByteToWideChar
(
CP_ACP
,
0
,
data
.
DescriptionA
,
-
1
,
data
.
DescriptionW
,
sizeof
(
data
.
DescriptionW
)
/
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
data
.
ModuleA
,
-
1
,
data
.
ModuleW
,
sizeof
(
data
.
ModuleW
)
/
sizeof
(
WCHAR
)
);
data
.
Type
=
DIRECTSOUNDDEVICE_TYPE_EMULATED
;
err
=
mmErr
(
waveOutMessage
(
UlongToHandle
(
wod
),
DRV_QUERYDSOUNDIFACE
,
(
DWORD_PTR
)
&
drv
,
0
));
if
(
err
==
DS_OK
&&
drv
)
data
.
Type
=
DIRECTSOUNDDEVICE_TYPE_VXD
;
else
WARN
(
"waveOutMessage(DRV_QUERYDSOUNDIFACE) failed
\n
"
);
TRACE
(
"calling Callback(%p,%p)
\n
"
,
&
data
,
ppd
->
Context
);
(
ppd
->
Callback
)(
&
data
,
ppd
->
Context
);
}
}
devs
=
waveInGetNumDevs
();
for
(
wid
=
0
;
wid
<
devs
;
++
wid
)
{
err
=
mmErr
(
waveInMessage
(
UlongToHandle
(
wid
),
DRV_QUERYDSOUNDDESC
,(
DWORD_PTR
)
&
desc
,
0
));
if
(
err
==
DS_OK
)
{
PIDSCDRIVER
drv
;
ZeroMemory
(
&
data
,
sizeof
(
data
));
data
.
DataFlow
=
DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
;
data
.
WaveDeviceId
=
wid
;
data
.
DeviceId
=
DSOUND_capture_guids
[
wid
];
lstrcpynA
(
data
.
DescriptionA
,
desc
.
szDesc
,
sizeof
(
data
.
DescriptionA
));
lstrcpynA
(
data
.
ModuleA
,
desc
.
szDrvname
,
sizeof
(
data
.
ModuleA
));
MultiByteToWideChar
(
CP_ACP
,
0
,
data
.
DescriptionA
,
-
1
,
data
.
DescriptionW
,
sizeof
(
data
.
DescriptionW
)
/
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
data
.
ModuleA
,
-
1
,
data
.
ModuleW
,
sizeof
(
data
.
ModuleW
)
/
sizeof
(
WCHAR
)
);
data
.
Type
=
DIRECTSOUNDDEVICE_TYPE_EMULATED
;
err
=
mmErr
(
waveInMessage
(
UlongToHandle
(
wid
),
DRV_QUERYDSOUNDIFACE
,
(
DWORD_PTR
)
&
drv
,
0
));
if
(
err
==
DS_OK
&&
drv
)
data
.
Type
=
DIRECTSOUNDDEVICE_TYPE_VXD
;
else
WARN
(
"waveInMessage(DRV_QUERYDSOUNDIFACE) failed
\n
"
);
TRACE
(
"calling Callback(%p,%p)
\n
"
,
&
data
,
ppd
->
Context
);
(
ppd
->
Callback
)(
&
data
,
ppd
->
Context
);
}
}
return
S_OK
;
}
}
if
(
pcbReturned
)
{
*
pcbReturned
=
0
;
FIXME
(
"*pcbReturned=%d
\n
"
,
*
pcbReturned
);
}
return
E_PROP_ID_UNSUPPORTED
;
}
static
HRESULT
DSPROPERTY_EnumerateW
(
LPVOID
pPropData
,
ULONG
cbPropData
,
...
...
@@ -874,6 +792,21 @@ static BOOL DSPROPERTY_descWtoA(DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
return
TRUE
;
}
static
void
DSPROPERTY_descWto1
(
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
*
dataW
,
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
*
data1
)
{
data1
->
DeviceId
=
dataW
->
DeviceId
;
lstrcpynW
(
data1
->
ModuleW
,
dataW
->
Module
,
sizeof
(
data1
->
ModuleW
)
/
sizeof
(
*
data1
->
ModuleW
));
lstrcpynW
(
data1
->
DescriptionW
,
dataW
->
Description
,
sizeof
(
data1
->
DescriptionW
)
/
sizeof
(
*
data1
->
DescriptionW
));
WideCharToMultiByte
(
CP_ACP
,
0
,
data1
->
DescriptionW
,
-
1
,
data1
->
DescriptionA
,
sizeof
(
data1
->
DescriptionA
)
-
1
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
data1
->
ModuleW
,
-
1
,
data1
->
ModuleA
,
sizeof
(
data1
->
ModuleA
)
-
1
,
NULL
,
NULL
);
data1
->
DescriptionA
[
sizeof
(
data1
->
DescriptionA
)
-
1
]
=
0
;
data1
->
ModuleA
[
sizeof
(
data1
->
ModuleA
)
-
1
]
=
0
;
data1
->
Type
=
dataW
->
Type
;
data1
->
DataFlow
=
dataW
->
DataFlow
;
data1
->
WaveDeviceId
=
data1
->
Devnode
=
dataW
->
WaveDeviceId
;
}
static
BOOL
CALLBACK
DSPROPERTY_enumWtoA
(
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
*
descW
,
void
*
data
)
{
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
descA
;
...
...
@@ -909,6 +842,37 @@ static HRESULT DSPROPERTY_EnumerateA(
return
DSPROPERTY_EnumerateW
(
&
data
,
cbPropData
,
pcbReturned
);
}
static
BOOL
CALLBACK
DSPROPERTY_enumWto1
(
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
*
descW
,
void
*
data
)
{
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
desc1
;
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
*
ppd
=
data
;
BOOL
ret
;
DSPROPERTY_descWto1
(
descW
,
&
desc1
);
ret
=
ppd
->
Callback
(
&
desc1
,
ppd
->
Context
);
return
ret
;
}
static
HRESULT
DSPROPERTY_Enumerate1
(
LPVOID
pPropData
,
ULONG
cbPropData
,
PULONG
pcbReturned
)
{
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
*
ppd
=
pPropData
;
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
data
;
if
(
!
ppd
||
!
ppd
->
Callback
)
{
WARN
(
"Invalid ppd %p
\n
"
,
ppd
);
return
E_PROP_ID_UNSUPPORTED
;
}
data
.
Callback
=
DSPROPERTY_enumWto1
;
data
.
Context
=
ppd
;
return
DSPROPERTY_EnumerateW
(
&
data
,
cbPropData
,
pcbReturned
);
}
static
HRESULT
WINAPI
IKsPrivatePropertySetImpl_Get
(
LPKSPROPERTYSET
iface
,
REFGUID
guidPropSet
,
...
...
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