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
317d95a9
Commit
317d95a9
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_Description1.
parent
a5bf8b6b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
180 deletions
+25
-180
propset.c
dlls/dsound/propset.c
+25
-180
No files found.
dlls/dsound/propset.c
View file @
317d95a9
...
...
@@ -186,186 +186,6 @@ static HRESULT DSPROPERTY_WaveDeviceMappingA(
return
hr
;
}
static
HRESULT
DSPROPERTY_Description1
(
LPVOID
pPropData
,
ULONG
cbPropData
,
PULONG
pcbReturned
)
{
HRESULT
err
;
GUID
dev_guid
;
PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
ppd
;
TRACE
(
"(pPropData=%p,cbPropData=%d,pcbReturned=%p)
\n
"
,
pPropData
,
cbPropData
,
pcbReturned
);
ppd
=
(
PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
)
pPropData
;
if
(
!
ppd
)
{
WARN
(
"invalid parameter: pPropData
\n
"
);
return
DSERR_INVALIDPARAM
;
}
TRACE
(
"DeviceId=%s
\n
"
,
debugstr_guid
(
&
ppd
->
DeviceId
));
if
(
IsEqualGUID
(
&
ppd
->
DeviceId
,
&
GUID_NULL
)
)
{
/* default device of type specified by ppd->DataFlow */
if
(
ppd
->
DataFlow
==
DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
)
{
TRACE
(
"DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
\n
"
);
}
else
if
(
ppd
->
DataFlow
==
DIRECTSOUNDDEVICE_DATAFLOW_RENDER
)
{
TRACE
(
"DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER
\n
"
);
}
else
{
TRACE
(
"DataFlow=Unknown(%d)
\n
"
,
ppd
->
DataFlow
);
}
FIXME
(
"(pPropData=%p,cbPropData=%d,pcbReturned=%p) GUID_NULL not implemented!
\n
"
,
pPropData
,
cbPropData
,
pcbReturned
);
return
E_PROP_ID_UNSUPPORTED
;
}
ppd
->
Type
=
DIRECTSOUNDDEVICE_TYPE_EMULATED
;
GetDeviceID
(
&
ppd
->
DeviceId
,
&
dev_guid
);
if
(
IsEqualGUID
(
&
ppd
->
DeviceId
,
&
DSDEVID_DefaultPlayback
)
||
IsEqualGUID
(
&
ppd
->
DeviceId
,
&
DSDEVID_DefaultVoicePlayback
)
)
{
ULONG
wod
;
unsigned
int
wodn
;
TRACE
(
"DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER
\n
"
);
ppd
->
DataFlow
=
DIRECTSOUNDDEVICE_DATAFLOW_RENDER
;
wodn
=
waveOutGetNumDevs
();
for
(
wod
=
0
;
wod
<
wodn
;
wod
++
)
{
if
(
IsEqualGUID
(
&
dev_guid
,
&
DSOUND_renderer_guids
[
wod
]
)
)
{
DSDRIVERDESC
desc
;
ppd
->
WaveDeviceId
=
wod
;
ppd
->
Devnode
=
wod
;
err
=
mmErr
(
waveOutMessage
(
UlongToHandle
(
wod
),
DRV_QUERYDSOUNDDESC
,(
DWORD_PTR
)
&
desc
,
0
));
if
(
err
==
DS_OK
)
{
PIDSDRIVER
drv
=
NULL
;
lstrcpynA
(
ppd
->
DescriptionA
,
desc
.
szDesc
,
sizeof
(
ppd
->
DescriptionA
));
lstrcpynA
(
ppd
->
ModuleA
,
desc
.
szDrvname
,
sizeof
(
ppd
->
ModuleA
));
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
.
szDesc
,
-
1
,
ppd
->
DescriptionW
,
sizeof
(
ppd
->
DescriptionW
)
/
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
.
szDrvname
,
-
1
,
ppd
->
ModuleW
,
sizeof
(
ppd
->
ModuleW
)
/
sizeof
(
WCHAR
)
);
err
=
mmErr
(
waveOutMessage
(
UlongToHandle
(
wod
),
DRV_QUERYDSOUNDIFACE
,
(
DWORD_PTR
)
&
drv
,
0
));
if
(
err
==
DS_OK
&&
drv
)
ppd
->
Type
=
DIRECTSOUNDDEVICE_TYPE_VXD
;
else
WARN
(
"waveOutMessage(DRV_QUERYDSOUNDIFACE) failed
\n
"
);
break
;
}
else
{
WARN
(
"waveOutMessage(DRV_QUERYDSOUNDDESC) failed
\n
"
);
return
E_PROP_ID_UNSUPPORTED
;
}
}
}
}
else
if
(
IsEqualGUID
(
&
ppd
->
DeviceId
,
&
DSDEVID_DefaultCapture
)
||
IsEqualGUID
(
&
ppd
->
DeviceId
,
&
DSDEVID_DefaultVoiceCapture
)
)
{
ULONG
wid
;
unsigned
int
widn
;
TRACE
(
"DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
\n
"
);
ppd
->
DataFlow
=
DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
;
widn
=
waveInGetNumDevs
();
for
(
wid
=
0
;
wid
<
widn
;
wid
++
)
{
if
(
IsEqualGUID
(
&
dev_guid
,
&
DSOUND_capture_guids
[
wid
]
)
)
{
DSDRIVERDESC
desc
;
ppd
->
WaveDeviceId
=
wid
;
ppd
->
Devnode
=
wid
;
err
=
mmErr
(
waveInMessage
(
UlongToHandle
(
wid
),
DRV_QUERYDSOUNDDESC
,(
DWORD_PTR
)
&
desc
,
0
));
if
(
err
==
DS_OK
)
{
PIDSCDRIVER
drv
;
lstrcpynA
(
ppd
->
DescriptionA
,
desc
.
szDesc
,
sizeof
(
ppd
->
DescriptionA
));
lstrcpynA
(
ppd
->
ModuleA
,
desc
.
szDrvname
,
sizeof
(
ppd
->
ModuleA
));
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
.
szDesc
,
-
1
,
ppd
->
DescriptionW
,
sizeof
(
ppd
->
DescriptionW
)
/
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
.
szDrvname
,
-
1
,
ppd
->
ModuleW
,
sizeof
(
ppd
->
ModuleW
)
/
sizeof
(
WCHAR
)
);
err
=
mmErr
(
waveInMessage
(
UlongToHandle
(
wid
),
DRV_QUERYDSOUNDIFACE
,(
DWORD_PTR
)
&
drv
,
0
));
if
(
err
==
DS_OK
&&
drv
)
ppd
->
Type
=
DIRECTSOUNDDEVICE_TYPE_VXD
;
else
WARN
(
"waveInMessage(DRV_QUERYDSOUNDIFACE) failed
\n
"
);
break
;
}
else
{
WARN
(
"waveInMessage(DRV_QUERYDSOUNDDESC) failed
\n
"
);
return
E_PROP_ID_UNSUPPORTED
;
}
}
}
}
else
{
BOOL
found
=
FALSE
;
ULONG
wod
;
unsigned
int
wodn
;
/* given specific device so try the render devices first */
wodn
=
waveOutGetNumDevs
();
for
(
wod
=
0
;
wod
<
wodn
;
wod
++
)
{
if
(
IsEqualGUID
(
&
ppd
->
DeviceId
,
&
DSOUND_renderer_guids
[
wod
]
)
)
{
DSDRIVERDESC
desc
;
TRACE
(
"DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER
\n
"
);
ppd
->
DataFlow
=
DIRECTSOUNDDEVICE_DATAFLOW_RENDER
;
ppd
->
WaveDeviceId
=
wod
;
ppd
->
Devnode
=
wod
;
err
=
mmErr
(
waveOutMessage
(
UlongToHandle
(
wod
),
DRV_QUERYDSOUNDDESC
,(
DWORD_PTR
)
&
desc
,
0
));
if
(
err
==
DS_OK
)
{
PIDSDRIVER
drv
=
NULL
;
lstrcpynA
(
ppd
->
DescriptionA
,
desc
.
szDesc
,
sizeof
(
ppd
->
DescriptionA
));
lstrcpynA
(
ppd
->
ModuleA
,
desc
.
szDrvname
,
sizeof
(
ppd
->
ModuleA
));
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
.
szDesc
,
-
1
,
ppd
->
DescriptionW
,
sizeof
(
ppd
->
DescriptionW
)
/
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
.
szDrvname
,
-
1
,
ppd
->
ModuleW
,
sizeof
(
ppd
->
ModuleW
)
/
sizeof
(
WCHAR
)
);
err
=
mmErr
(
waveOutMessage
(
UlongToHandle
(
wod
),
DRV_QUERYDSOUNDIFACE
,
(
DWORD_PTR
)
&
drv
,
0
));
if
(
err
==
DS_OK
&&
drv
)
ppd
->
Type
=
DIRECTSOUNDDEVICE_TYPE_VXD
;
else
WARN
(
"waveOutMessage(DRV_QUERYDSOUNDIFACE) failed
\n
"
);
found
=
TRUE
;
break
;
}
else
{
WARN
(
"waveOutMessage(DRV_QUERYDSOUNDDESC) failed
\n
"
);
return
E_PROP_ID_UNSUPPORTED
;
}
}
}
if
(
found
==
FALSE
)
{
ULONG
wid
;
unsigned
int
widn
;
/* given specific device so try the capture devices next */
widn
=
waveInGetNumDevs
();
for
(
wid
=
0
;
wid
<
widn
;
wid
++
)
{
if
(
IsEqualGUID
(
&
ppd
->
DeviceId
,
&
DSOUND_capture_guids
[
wid
]
)
)
{
DSDRIVERDESC
desc
;
TRACE
(
"DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
\n
"
);
ppd
->
DataFlow
=
DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
;
ppd
->
WaveDeviceId
=
wid
;
ppd
->
Devnode
=
wid
;
err
=
mmErr
(
waveInMessage
(
UlongToHandle
(
wid
),
DRV_QUERYDSOUNDDESC
,(
DWORD_PTR
)
&
desc
,
0
));
if
(
err
==
DS_OK
)
{
PIDSDRIVER
drv
=
NULL
;
lstrcpynA
(
ppd
->
DescriptionA
,
desc
.
szDesc
,
sizeof
(
ppd
->
DescriptionA
));
lstrcpynA
(
ppd
->
ModuleA
,
desc
.
szDrvname
,
sizeof
(
ppd
->
ModuleA
));
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
.
szDesc
,
-
1
,
ppd
->
DescriptionW
,
sizeof
(
ppd
->
DescriptionW
)
/
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
.
szDrvname
,
-
1
,
ppd
->
ModuleW
,
sizeof
(
ppd
->
ModuleW
)
/
sizeof
(
WCHAR
)
);
err
=
mmErr
(
waveInMessage
(
UlongToHandle
(
wid
),
DRV_QUERYDSOUNDIFACE
,
(
DWORD_PTR
)
&
drv
,
0
));
if
(
err
==
DS_OK
&&
drv
)
ppd
->
Type
=
DIRECTSOUNDDEVICE_TYPE_VXD
;
else
WARN
(
"waveInMessage(DRV_QUERYDSOUNDIFACE) failed
\n
"
);
found
=
TRUE
;
break
;
}
else
{
WARN
(
"waveInMessage(DRV_QUERYDSOUNDDESC) failed
\n
"
);
return
E_PROP_ID_UNSUPPORTED
;
}
}
}
if
(
found
==
FALSE
)
{
WARN
(
"device not found
\n
"
);
return
E_PROP_ID_UNSUPPORTED
;
}
}
}
if
(
pcbReturned
)
{
*
pcbReturned
=
cbPropData
;
TRACE
(
"*pcbReturned=%d
\n
"
,
*
pcbReturned
);
}
return
S_OK
;
}
static
HRESULT
DSPROPERTY_DescriptionW
(
LPVOID
pPropData
,
ULONG
cbPropData
,
...
...
@@ -659,6 +479,31 @@ static HRESULT DSPROPERTY_DescriptionA(
return
hr
;
}
static
HRESULT
DSPROPERTY_Description1
(
LPVOID
pPropData
,
ULONG
cbPropData
,
PULONG
pcbReturned
)
{
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
data
;
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
*
ppd
=
pPropData
;
HRESULT
hr
;
if
(
pcbReturned
)
*
pcbReturned
=
sizeof
(
*
ppd
);
if
(
!
pPropData
)
return
S_OK
;
data
.
DeviceId
=
ppd
->
DeviceId
;
data
.
DataFlow
=
ppd
->
DataFlow
;
hr
=
DSPROPERTY_DescriptionW
(
&
data
,
sizeof
(
data
),
NULL
);
if
(
FAILED
(
hr
))
return
hr
;
DSPROPERTY_descWto1
(
&
data
,
ppd
);
HeapFree
(
GetProcessHeap
(),
0
,
data
.
Module
);
HeapFree
(
GetProcessHeap
(),
0
,
data
.
Interface
);
return
hr
;
}
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