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
e3e0bfca
Commit
e3e0bfca
authored
Jan 12, 2012
by
Jörg Höhle
Committed by
Alexandre Julliard
Nov 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: Avoid generic MMSYSERR_ERROR during initialisation.
parent
6086c7be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
15 deletions
+45
-15
waveform.c
dlls/winmm/waveform.c
+45
-15
No files found.
dlls/winmm/waveform.c
View file @
e3e0bfca
...
...
@@ -379,6 +379,29 @@ static inline void WINMM_NotifyClient(WINMM_CBInfo *info, WORD msg, DWORD_PTR pa
msg
,
info
->
user
,
param1
,
param2
);
}
static
MMRESULT
hr2mmr
(
HRESULT
hr
)
{
switch
(
hr
){
case
S_OK
:
case
AUDCLNT_E_NOT_STOPPED
:
return
MMSYSERR_NOERROR
;
case
AUDCLNT_E_UNSUPPORTED_FORMAT
:
return
WAVERR_BADFORMAT
;
case
AUDCLNT_E_DEVICE_IN_USE
:
return
MMSYSERR_ALLOCATED
;
case
AUDCLNT_E_ENDPOINT_CREATE_FAILED
:
return
MMSYSERR_NOTENABLED
;
case
E_OUTOFMEMORY
:
return
MMSYSERR_NOMEM
;
case
E_POINTER
:
case
E_INVALIDARG
:
return
MMSYSERR_INVALPARAM
;
case
AUDCLNT_E_DEVICE_INVALIDATED
:
/* DSERR_BUFFERLOST */
default:
return
FAILED
(
hr
)
?
MMSYSERR_ERROR
:
MMSYSERR_NOERROR
;
}
}
static
HRESULT
WINMM_GetFriendlyName
(
IMMDevice
*
device
,
WCHAR
*
out
,
UINT
outlen
)
{
...
...
@@ -898,7 +921,7 @@ static LRESULT WINMM_OpenDevice(WINMM_Device *device, WINMM_MMDevice *mmdevice,
WINMM_OpenInfo
*
info
)
{
WAVEFORMATEX
*
closer_fmt
=
NULL
,
fmt
,
*
passed_fmt
;
LRESULT
ret
=
MMSYSERR_
ERROR
;
LRESULT
ret
=
MMSYSERR_
NOMEM
;
HRESULT
hr
;
hr
=
IMMDeviceEnumerator_GetDevice
(
g_devenum
,
mmdevice
->
dev_id
,
...
...
@@ -907,13 +930,18 @@ static LRESULT WINMM_OpenDevice(WINMM_Device *device, WINMM_MMDevice *mmdevice,
WARN
(
"Device %s (%s) unavailable: %08x
\n
"
,
wine_dbgstr_w
(
mmdevice
->
dev_id
),
wine_dbgstr_w
(
mmdevice
->
out_caps
.
szPname
),
hr
);
ret
=
MMSYSERR_NODRIVER
;
goto
error
;
}
/* this is where winexyz.drv opens the audio device */
hr
=
IMMDevice_Activate
(
device
->
device
,
&
IID_IAudioClient
,
CLSCTX_INPROC_SERVER
,
NULL
,
(
void
**
)
&
device
->
client
);
if
(
FAILED
(
hr
)){
WARN
(
"Activate failed: %08x
\n
"
,
hr
);
ret
=
hr2mmr
(
hr
);
if
(
ret
==
MMSYSERR_ERROR
)
ret
=
MMSYSERR_NOTENABLED
;
goto
error
;
}
...
...
@@ -945,6 +973,7 @@ static LRESULT WINMM_OpenDevice(WINMM_Device *device, WINMM_MMDevice *mmdevice,
CoTaskMemFree
(
closer_fmt
);
if
(
FAILED
(
hr
)
&&
hr
!=
AUDCLNT_E_UNSUPPORTED_FORMAT
){
WARN
(
"IsFormatSupported failed: %08x
\n
"
,
hr
);
ret
=
hr2mmr
(
hr
);
goto
error
;
}
if
(
hr
==
S_FALSE
||
hr
==
AUDCLNT_E_UNSUPPORTED_FORMAT
){
...
...
@@ -962,6 +991,7 @@ static LRESULT WINMM_OpenDevice(WINMM_Device *device, WINMM_MMDevice *mmdevice,
10
*
100000
,
50000
,
passed_fmt
,
&
device
->
parent
->
session
);
if
(
FAILED
(
hr
)){
WARN
(
"Initialize failed: %08x
\n
"
,
hr
);
ret
=
hr2mmr
(
hr
);
goto
error
;
}
...
...
@@ -1038,7 +1068,7 @@ static LRESULT WOD_Open(WINMM_OpenInfo *info)
{
WINMM_MMDevice
*
mmdevice
;
WINMM_Device
*
device
=
NULL
;
LRESULT
ret
=
MMSYSERR_ERROR
;
LRESULT
ret
;
HRESULT
hr
;
TRACE
(
"(%u, %p, %08x)
\n
"
,
info
->
req_device
,
info
,
info
->
flags
);
...
...
@@ -1111,7 +1141,7 @@ static LRESULT WID_Open(WINMM_OpenInfo *info)
{
WINMM_MMDevice
*
mmdevice
;
WINMM_Device
*
device
=
NULL
;
LRESULT
ret
=
MMSYSERR_ERROR
;
LRESULT
ret
;
HRESULT
hr
;
TRACE
(
"(%u, %p, %08x)
\n
"
,
info
->
req_device
,
info
,
info
->
flags
);
...
...
@@ -2378,7 +2408,7 @@ UINT WINAPI waveOutGetDevCapsW(UINT_PTR uDeviceID, LPWAVEOUTCAPSW lpCaps,
hr
=
WINMM_InitMMDevices
();
if
(
FAILED
(
hr
))
return
MMSYSERR_
ERRO
R
;
return
MMSYSERR_
NODRIVE
R
;
if
(
lpCaps
==
NULL
)
return
MMSYSERR_INVALPARAM
;
...
...
@@ -2474,7 +2504,7 @@ MMRESULT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID,
dwCallback
,
dwInstance
,
dwFlags
);
if
(
!
WINMM_StartDevicesThread
())
return
MMSYSERR_
ERRO
R
;
return
MMSYSERR_
NODRIVE
R
;
if
(
!
lphWaveOut
&&
!
(
dwFlags
&
WAVE_FORMAT_QUERY
))
return
MMSYSERR_INVALPARAM
;
...
...
@@ -2939,7 +2969,7 @@ static UINT get_device_interface(UINT msg, BOOL is_out, UINT index, WCHAR *out,
WINMM_QueryInterfaceInfo
info
;
if
(
!
WINMM_StartDevicesThread
())
return
MMSYSERR_
ERRO
R
;
return
MMSYSERR_
NODRIVE
R
;
info
.
is_out
=
is_out
;
info
.
index
=
index
;
...
...
@@ -3021,7 +3051,7 @@ UINT WINAPI waveInGetDevCapsW(UINT_PTR uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSi
hr
=
WINMM_InitMMDevices
();
if
(
FAILED
(
hr
))
return
MMSYSERR_
ERRO
R
;
return
MMSYSERR_
NODRIVE
R
;
if
(
!
lpCaps
)
return
MMSYSERR_INVALPARAM
;
...
...
@@ -3096,7 +3126,7 @@ MMRESULT WINAPI waveInOpen(HWAVEIN* lphWaveIn, UINT uDeviceID,
dwCallback
,
dwInstance
,
dwFlags
);
if
(
!
WINMM_StartDevicesThread
())
return
MMSYSERR_
ERRO
R
;
return
MMSYSERR_
NODRIVE
R
;
if
(
!
lphWaveIn
&&
!
(
dwFlags
&
WAVE_FORMAT_QUERY
))
return
MMSYSERR_INVALPARAM
;
...
...
@@ -3445,7 +3475,7 @@ UINT WINAPI mixerGetDevCapsW(UINT_PTR uDeviceID, LPMIXERCAPSW lpCaps, UINT uSize
hr
=
WINMM_InitMMDevices
();
if
(
FAILED
(
hr
))
return
MMSYSERR_
ERRO
R
;
return
MMSYSERR_
NODRIVE
R
;
if
(
!
lpCaps
)
return
MMSYSERR_INVALPARAM
;
...
...
@@ -3490,7 +3520,7 @@ UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback,
hr
=
WINMM_InitMMDevices
();
if
(
FAILED
(
hr
))
return
MMSYSERR_
ERRO
R
;
return
MMSYSERR_
NODRIVE
R
;
if
(
!
lphMix
)
return
MMSYSERR_INVALPARAM
;
...
...
@@ -3539,7 +3569,7 @@ UINT WINAPI mixerGetID(HMIXEROBJ hmix, LPUINT lpid, DWORD fdwID)
hr
=
WINMM_InitMMDevices
();
if
(
FAILED
(
hr
))
return
MMSYSERR_
ERRO
R
;
return
MMSYSERR_
NODRIVE
R
;
if
(
!
lpid
)
return
MMSYSERR_INVALPARAM
;
...
...
@@ -3567,7 +3597,7 @@ UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdW
hr
=
WINMM_InitMMDevices
();
if
(
FAILED
(
hr
))
return
MMSYSERR_
ERRO
R
;
return
MMSYSERR_
NODRIVE
R
;
if
(
!
lpmcdW
)
return
MMSYSERR_INVALPARAM
;
...
...
@@ -3754,7 +3784,7 @@ UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW,
hr
=
WINMM_InitMMDevices
();
if
(
FAILED
(
hr
))
return
MMSYSERR_
ERRO
R
;
return
MMSYSERR_
NODRIVE
R
;
if
(
fdwControls
&
~
(
MIXER_GETLINECONTROLSF_ALL
|
MIXER_GETLINECONTROLSF_ONEBYID
|
...
...
@@ -3972,7 +4002,7 @@ UINT WINAPI mixerGetLineInfoW(HMIXEROBJ hmix, LPMIXERLINEW lpmliW, DWORD fdwInfo
hr
=
WINMM_InitMMDevices
();
if
(
FAILED
(
hr
))
return
MMSYSERR_
ERRO
R
;
return
MMSYSERR_
NODRIVE
R
;
if
(
!
lpmliW
||
lpmliW
->
cbStruct
<
sizeof
(
MIXERLINEW
))
return
MMSYSERR_INVALPARAM
;
...
...
@@ -4098,7 +4128,7 @@ UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd,
TRACE
(
"(%p, %p, %x)
\n
"
,
hmix
,
lpmcd
,
fdwDetails
);
if
(
!
WINMM_StartDevicesThread
())
return
MMSYSERR_
ERRO
R
;
return
MMSYSERR_
NODRIVE
R
;
if
((
fdwDetails
&
MIXER_SETCONTROLDETAILSF_QUERYMASK
)
==
MIXER_SETCONTROLDETAILSF_CUSTOM
)
...
...
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