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
773acf41
Commit
773acf41
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_EnumerateW.
parent
2e95764e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
100 deletions
+43
-100
propset.c
dlls/dsound/propset.c
+43
-100
No files found.
dlls/dsound/propset.c
View file @
773acf41
...
...
@@ -900,117 +900,60 @@ static HRESULT DSPROPERTY_EnumerateW(
PULONG
pcbReturned
)
{
PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
ppd
=
pPropData
;
HRESULT
err
;
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
data
;
BOOL
ret
;
int
widn
,
wodn
,
i
;
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_W_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
)
{
WCHAR
*
wDescription
=
HeapAlloc
(
GetProcessHeap
(),
0
,
0x200
);
WCHAR
*
wModule
=
HeapAlloc
(
GetProcessHeap
(),
0
,
0x200
);
if
(
wDescription
&&
wModule
)
{
DWORD
size
;
err
=
mmErr
(
waveOutMessage
(
UlongToHandle
(
wod
),
DRV_QUERYDEVICEINTERFACESIZE
,
(
DWORD_PTR
)
&
size
,
0
));
if
(
err
==
DS_OK
)
{
WCHAR
*
wInterface
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
wInterface
)
{
err
=
mmErr
(
waveOutMessage
(
UlongToHandle
(
wod
),
DRV_QUERYDEVICEINTERFACE
,
(
DWORD_PTR
)
wInterface
,
size
));
if
(
err
==
DS_OK
)
{
PIDSCDRIVER
drv
;
ZeroMemory
(
&
data
,
sizeof
(
data
));
data
.
DataFlow
=
DIRECTSOUNDDEVICE_DATAFLOW_RENDER
;
data
.
WaveDeviceId
=
wod
;
data
.
DeviceId
=
DSOUND_renderer_guids
[
wod
];
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
.
szDesc
,
-
1
,
wDescription
,
0x100
);
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
.
szDrvname
,
-
1
,
wModule
,
0x100
);
data
.
Description
=
wDescription
;
data
.
Module
=
wModule
;
data
.
Interface
=
wInterface
;
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
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
wInterface
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
wDescription
);
HeapFree
(
GetProcessHeap
(),
0
,
wModule
);
}
}
devs
=
waveInGetNumDevs
();
for
(
wid
=
0
;
wid
<
devs
;
++
wid
)
{
err
=
mmErr
(
waveInMessage
(
UlongToHandle
(
wid
),
DRV_QUERYDSOUNDDESC
,(
DWORD_PTR
)
&
desc
,
0
));
if
(
err
==
DS_OK
)
{
WCHAR
*
wDescription
=
HeapAlloc
(
GetProcessHeap
(),
0
,
0x200
);
WCHAR
*
wModule
=
HeapAlloc
(
GetProcessHeap
(),
0
,
0x200
);
if
(
wDescription
&&
wModule
)
{
DWORD
size
;
err
=
mmErr
(
waveInMessage
(
UlongToHandle
(
wid
),
DRV_QUERYDEVICEINTERFACESIZE
,
(
DWORD_PTR
)
&
size
,
0
));
if
(
err
==
DS_OK
)
{
WCHAR
*
wInterface
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
wInterface
)
{
err
=
mmErr
(
waveInMessage
(
UlongToHandle
(
wid
),
DRV_QUERYDEVICEINTERFACE
,
(
DWORD_PTR
)
wInterface
,
size
));
if
(
err
==
DS_OK
)
{
PIDSCDRIVER
drv
;
ZeroMemory
(
&
data
,
sizeof
(
data
));
data
.
DataFlow
=
DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
;
data
.
WaveDeviceId
=
wid
;
data
.
DeviceId
=
DSOUND_capture_guids
[
wid
];
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
.
szDesc
,
-
1
,
wDescription
,
0x100
);
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
.
szDrvname
,
-
1
,
wModule
,
0x100
);
if
(
pcbReturned
)
*
pcbReturned
=
0
;
data
.
Description
=
wDescription
;
data
.
Module
=
wModule
;
data
.
Interface
=
wInterface
;
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
"
);
if
(
!
ppd
||
!
ppd
->
Callback
)
{
WARN
(
"Invalid ppd %p
\n
"
,
ppd
);
return
E_PROP_ID_UNSUPPORTED
;
}
TRACE
(
"calling Callback(%p,%p)
\n
"
,
&
data
,
ppd
->
Context
);
(
ppd
->
Callback
)(
&
data
,
ppd
->
Context
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
wInterface
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
wDescription
);
HeapFree
(
GetProcessHeap
(),
0
,
wModule
);
}
}
wodn
=
waveOutGetNumDevs
();
widn
=
waveInGetNumDevs
();
data
.
DeviceId
=
DSOUND_renderer_guids
[
0
];
for
(
i
=
0
;
i
<
wodn
;
++
i
)
{
HRESULT
hr
;
data
.
DeviceId
.
Data4
[
7
]
=
i
;
hr
=
DSPROPERTY_DescriptionW
(
&
data
,
sizeof
(
data
),
NULL
);
if
(
FAILED
(
hr
))
{
ERR
(
"DescriptionW failed!
\n
"
);
return
S_OK
;
}
ret
=
ppd
->
Callback
(
&
data
,
ppd
->
Context
);
HeapFree
(
GetProcessHeap
(),
0
,
data
.
Module
);
HeapFree
(
GetProcessHeap
(),
0
,
data
.
Description
);
if
(
!
ret
)
return
S_OK
;
}
if
(
pcbReturned
)
{
*
pcbReturned
=
0
;
FIXME
(
"*pcbReturned=%d
\n
"
,
*
pcbReturned
);
data
.
DeviceId
=
DSOUND_capture_guids
[
0
];
for
(
i
=
0
;
i
<
widn
;
++
i
)
{
HRESULT
hr
;
data
.
DeviceId
.
Data4
[
7
]
=
i
;
hr
=
DSPROPERTY_DescriptionW
(
&
data
,
sizeof
(
data
),
NULL
);
if
(
FAILED
(
hr
))
{
ERR
(
"DescriptionW failed!
\n
"
);
return
S_OK
;
}
ret
=
ppd
->
Callback
(
&
data
,
ppd
->
Context
);
HeapFree
(
GetProcessHeap
(),
0
,
data
.
Module
);
HeapFree
(
GetProcessHeap
(),
0
,
data
.
Description
);
if
(
!
ret
)
return
S_OK
;
}
return
E_PROP_ID_UNSUPPORTED
;
return
S_OK
;
}
static
HRESULT
WINAPI
IKsPrivatePropertySetImpl_Get
(
...
...
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