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
d45f041e
Commit
d45f041e
authored
Nov 13, 2001
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 13, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed wave(In|Out)Open when called with WAVE_MAPPED flag; some minor
16/32 API call ordering.
parent
0bf1c246
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
28 deletions
+56
-28
mmsystem.c
dlls/winmm/mmsystem.c
+30
-21
wavemap.c
dlls/winmm/wavemap/wavemap.c
+26
-7
No files found.
dlls/winmm/mmsystem.c
View file @
d45f041e
...
...
@@ -619,18 +619,18 @@ BOOL16 WINAPI sndPlaySound16(LPCSTR lpszSoundName, UINT16 uFlags)
/**************************************************************************
* mmsystemGetVersion [WINMM.@]
* mmsystemGetVersion [MMSYSTEM.5]
* return value borrowed from Win95 winmm.dll ;)
*/
UINT
WINAPI
mmsystemGetVersion
(
void
)
UINT
16
WINAPI
mmsystemGetVersion16
(
void
)
{
return
mmsystemGetVersion
16
();
return
mmsystemGetVersion
();
}
/**************************************************************************
* mmsystemGetVersion [MMSYSTEM.5]
* return value borrowed from Win95 winmm.dll ;)
* mmsystemGetVersion [WINMM.@]
*/
UINT
16
WINAPI
mmsystemGetVersion16
(
void
)
UINT
WINAPI
mmsystemGetVersion
(
void
)
{
TRACE
(
"3.10 (Win95?)
\n
"
);
return
0x030a
;
...
...
@@ -1538,17 +1538,17 @@ BOOL WINAPI mciGetErrorStringW(DWORD wError, LPWSTR lpstrBuffer, UINT uLength)
}
/**************************************************************************
* mciGetErrorString
A [WINMM.@
]
* mciGetErrorString
[MMSYSTEM.706
]
*/
BOOL
WINAPI
mciGetErrorStringA
(
DWORD
wError
,
LPSTR
lpstrBuffer
,
UINT
uLength
)
BOOL
16
WINAPI
mciGetErrorString16
(
DWORD
wError
,
LPSTR
lpstrBuffer
,
UINT16
uLength
)
{
return
mciGetErrorString
16
(
wError
,
lpstrBuffer
,
uLength
);
return
mciGetErrorString
A
(
wError
,
lpstrBuffer
,
uLength
);
}
/**************************************************************************
* mciGetErrorString
[MMSYSTEM.706
]
* mciGetErrorString
A [WINMM.@
]
*/
BOOL
16
WINAPI
mciGetErrorString16
(
DWORD
dwError
,
LPSTR
lpstrBuffer
,
UINT16
uLength
)
BOOL
WINAPI
mciGetErrorStringA
(
DWORD
dwError
,
LPSTR
lpstrBuffer
,
UINT
uLength
)
{
BOOL16
ret
=
FALSE
;
...
...
@@ -3650,6 +3650,8 @@ static UINT WINAPI MMSYSTEM_waveOpen(HANDLE* lphndl, UINT uDeviceID, UINT uType,
if
(
dwFlags
&
WAVE_FORMAT_QUERY
)
TRACE
(
"WAVE_FORMAT_QUERY requested !
\n
"
);
if
(
lpFormat
==
NULL
)
return
WAVERR_BADFORMAT
;
if
((
dwFlags
&
WAVE_MAPPED
)
&&
(
uDeviceID
==
(
UINT
)
-
1
))
return
MMSYSERR_INVALPARAM
;
TRACE
(
"wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u
\n
"
,
lpFormat
->
wFormatTag
,
lpFormat
->
nChannels
,
lpFormat
->
nSamplesPerSec
,
...
...
@@ -3663,19 +3665,22 @@ static UINT WINAPI MMSYSTEM_waveOpen(HANDLE* lphndl, UINT uDeviceID, UINT uType,
wod
.
lpFormat
=
lpFormat
;
/* should the struct be copied iso pointer? */
wod
.
dwCallback
=
dwCallback
;
wod
.
dwInstance
=
dwInstance
;
wod
.
uMappedDeviceID
=
0
;
wod
.
dnDevNode
=
0L
;
/* when called from 16 bit code, mapper will be 0x0000FFFF instead of 0xFFFFFFFF */
/* this should fix it */
wmld
->
uDeviceID
=
(
uDeviceID
==
(
UINT16
)
-
1
&&
!
bFrom32
)
?
(
UINT
)
-
1
:
uDeviceID
;
if
(
dwFlags
&
WAVE_MAPPED
)
{
wod
.
uMappedDeviceID
=
uDeviceID
;
uDeviceID
=
WAVE_MAPPER
;
}
else
{
wod
.
uMappedDeviceID
=
-
1
;
}
wmld
->
uDeviceID
=
uDeviceID
;
dwRet
=
MMDRV_Open
(
wmld
,
(
uType
==
MMDRV_WAVEOUT
)
?
WODM_OPEN
:
WIDM_OPEN
,
(
DWORD
)
&
wod
,
dwFlags
);
dwRet
=
MMDRV_Open
(
wmld
,
(
uType
==
MMDRV_WAVEOUT
)
?
WODM_OPEN
:
WIDM_OPEN
,
(
DWORD
)
&
wod
,
dwFlags
);
if
((
dwFlags
&
WAVE_FORMAT_QUERY
)
||
dwRet
!=
MMSYSERR_NOERROR
)
{
MMDRV_Free
(
handle
,
wmld
);
handle
=
0
;
}
}
if
(
lphndl
!=
NULL
)
*
lphndl
=
handle
;
TRACE
(
"=> %ld hWave=%04x
\n
"
,
dwRet
,
handle
);
...
...
@@ -3848,9 +3853,11 @@ UINT16 WINAPI waveOutOpen16(HWAVEOUT16* lphWaveOut, UINT16 uDeviceID,
/* since layout of WAVEFORMATEX is the same for 16/32 bits, we directly
* call the 32 bit version
* however, we need to promote correctly the wave mapper id
* (0xFFFFFFFF and not 0x0000FFFF)
*/
ret
=
MMSYSTEM_waveOpen
(
&
hWaveOut
,
uDeviceID
,
MMDRV_WAVEOUT
,
lpFormat
,
dwCallback
,
dwInstance
,
dwFlags
,
FALSE
);
ret
=
MMSYSTEM_waveOpen
(
&
hWaveOut
,
(
uDeviceID
==
(
UINT16
)
-
1
)
?
(
UINT
)
-
1
:
uDeviceID
,
MMDRV_WAVEOUT
,
lpFormat
,
dwCallback
,
dwInstance
,
dwFlags
,
FALSE
);
if
(
lphWaveOut
!=
NULL
)
*
lphWaveOut
=
hWaveOut
;
return
ret
;
...
...
@@ -4489,9 +4496,11 @@ UINT16 WINAPI waveInOpen16(HWAVEIN16* lphWaveIn, UINT16 uDeviceID,
/* since layout of WAVEFORMATEX is the same for 16/32 bits, we directly
* call the 32 bit version
* however, we need to promote correctly the wave mapper id
* (0xFFFFFFFF and not 0x0000FFFF)
*/
ret
=
MMSYSTEM_waveOpen
(
&
hWaveIn
,
uDeviceID
,
MMDRV_WAVEIN
,
lpFormat
,
dwCallback
,
dwInstance
,
dwFlags
,
FALSE
);
ret
=
MMSYSTEM_waveOpen
(
&
hWaveIn
,
(
uDeviceID
==
(
UINT16
)
-
1
)
?
(
UINT
)
-
1
:
uDeviceID
,
MMDRV_WAVEIN
,
lpFormat
,
dwCallback
,
dwInstance
,
dwFlags
,
FALSE
);
if
(
lphWaveIn
!=
NULL
)
*
lphWaveIn
=
hWaveIn
;
return
ret
;
...
...
dlls/winmm/wavemap/wavemap.c
View file @
d45f041e
...
...
@@ -111,7 +111,7 @@ static DWORD wodOpenHelper(WAVEMAPDATA* wom, UINT idx,
static
DWORD
wodOpen
(
LPDWORD
lpdwUser
,
LPWAVEOPENDESC
lpDesc
,
DWORD
dwFlags
)
{
UINT
nd
=
waveOutGetNumDevs
()
;
UINT
nd
lo
,
ndhi
;
UINT
i
;
WAVEMAPDATA
*
wom
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WAVEMAPDATA
));
WAVEFORMATEX
wfx
;
...
...
@@ -121,13 +121,22 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
if
(
!
wom
)
return
MMSYSERR_NOMEM
;
ndhi
=
waveOutGetNumDevs
();
if
(
dwFlags
&
WAVE_MAPPED
)
{
if
(
lpDesc
->
uMappedDeviceID
>=
ndhi
)
return
MMSYSERR_INVALPARAM
;
ndlo
=
lpDesc
->
uMappedDeviceID
;
ndhi
=
ndlo
+
1
;
dwFlags
&=
~
WAVE_MAPPED
;
}
else
{
ndlo
=
0
;
}
wom
->
self
=
wom
;
wom
->
dwCallback
=
lpDesc
->
dwCallback
;
wom
->
dwFlags
=
dwFlags
;
wom
->
dwClientInstance
=
lpDesc
->
dwInstance
;
wom
->
hOuterWave
=
lpDesc
->
hWave
;
for
(
i
=
0
;
i
<
nd
;
i
++
)
{
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
/* if no ACM stuff is involved, no need to handle callbacks at this
* level, this will be done transparently
*/
...
...
@@ -145,7 +154,7 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
#define TRY(sps,bps) wfx.nSamplesPerSec = (sps); wfx.wBitsPerSample = (bps); \
if (wodOpenHelper(wom, i, lpDesc, &wfx, dwFlags) == MMSYSERR_NOERROR) goto found;
for
(
i
=
0
;
i
<
nd
;
i
++
)
{
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
/* first try with same stereo/mono option as source */
wfx
.
nChannels
=
lpDesc
->
lpFormat
->
nChannels
;
TRY
(
44100
,
16
);
...
...
@@ -435,7 +444,7 @@ static void CALLBACK widCallback(HWAVE hWave, UINT uMsg, DWORD dwInstance,
TRACE
(
"(0x%x %u %ld %lx %lx);
\n
"
,
hWave
,
uMsg
,
dwInstance
,
dwParam1
,
dwParam2
);
if
(
!
WAVEMAP_IsData
(
wim
))
{
ERR
(
"Bad dat
e
\n
"
);
ERR
(
"Bad dat
a
\n
"
);
return
;
}
...
...
@@ -502,7 +511,7 @@ static DWORD widOpenHelper(WAVEMAPDATA* wim, UINT idx,
static
DWORD
widOpen
(
LPDWORD
lpdwUser
,
LPWAVEOPENDESC
lpDesc
,
DWORD
dwFlags
)
{
UINT
nd
=
waveInGetNumDevs
()
;
UINT
nd
lo
,
ndhi
;
UINT
i
;
WAVEMAPDATA
*
wim
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WAVEMAPDATA
));
WAVEFORMATEX
wfx
;
...
...
@@ -518,7 +527,17 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
wim
->
dwClientInstance
=
lpDesc
->
dwInstance
;
wim
->
hOuterWave
=
lpDesc
->
hWave
;
for
(
i
=
0
;
i
<
nd
;
i
++
)
{
ndhi
=
waveOutGetNumDevs
();
if
(
dwFlags
&
WAVE_MAPPED
)
{
if
(
lpDesc
->
uMappedDeviceID
>=
ndhi
)
return
MMSYSERR_INVALPARAM
;
ndlo
=
lpDesc
->
uMappedDeviceID
;
ndhi
=
ndlo
+
1
;
dwFlags
&=
~
WAVE_MAPPED
;
}
else
{
ndlo
=
0
;
}
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
if
(
waveInOpen
(
&
wim
->
hInnerWave
,
i
,
lpDesc
->
lpFormat
,
(
DWORD
)
widCallback
,
(
DWORD
)
wim
,
(
dwFlags
&
~
CALLBACK_TYPEMASK
)
|
CALLBACK_FUNCTION
)
==
MMSYSERR_NOERROR
)
{
wim
->
hAcmStream
=
0
;
...
...
@@ -532,7 +551,7 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
#define TRY(sps,bps) wfx.nSamplesPerSec = (sps); wfx.wBitsPerSample = (bps); \
if (widOpenHelper(wim, i, lpDesc, &wfx, dwFlags) == MMSYSERR_NOERROR) goto found;
for
(
i
=
0
;
i
<
nd
;
i
++
)
{
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
/* first try with same stereo/mono option as source */
wfx
.
nChannels
=
lpDesc
->
lpFormat
->
nChannels
;
TRY
(
44100
,
8
);
...
...
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