Sync to Wine-20041201

Filip Navara <xnavara@volny.cz>
- Check the return value from *_GETNUMDEVS message as per KB90562.
- Fix typo in MMDRV_InstallMap.
Eric Pouech <pouech-eric@wanadoo.fr>
- Const correctness fixes.
Robert Shearman <rob@codeweavers.com>
- Fix broken thread start routines.
Eric Pouech <pouech-eric@wanadoo.fr>
Filip Navara <xnavara@volny.cz>
32 bit low level drivers now use a Unicode interface (used to be ANSI):
- Send the *_GETDEVCAPS messages in unicode format from the
  *GetDevCapsW function and call the *GetDevCapsW from their respective
  Ansi versions.
- Modify all low level drivers to correctly process the *_GETDEVCAPS
  messages as unicode.
- *_GETDEVCAPS messages are now mapped from/to unicode for 16 bit code.
- Removed all SoundBlaster naming oldies.
- Better use of some unicode functions (instead of Ansi) in winmm.
Jeremy White <jwhite@codeweavers.com>
- The Sleep(0) in this loop is incorrect, and should be removed.  This
  fixes iTunes and a game reported by che.
Remi Assailly <remi.assailly@free.fr>
- Add some missing error values in WINMM_ErrorToString.

svn path=/trunk/; revision=11976
This commit is contained in:
Gé van Geldorp 2004-12-07 21:41:02 +00:00
parent 7a672d567c
commit c7a5d769f6
10 changed files with 133 additions and 2272 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,46 @@
/*
* MMSYSTEM - Multimedia Wine Extension ... :-)
*
* Copyright (C) the Wine project
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_MMSYSTEM_H
#define __WINE_MMSYSTEM_H
#include_next <mmsystem.h>
#define DRV_SUCCESS 0x0001
#define DRV_FAILURE 0x0000
#define MCI_OPEN_DRIVER 0x0801
#define MCI_CLOSE_DRIVER 0x0802
#define MCI_SOUND 0x0812
#define MCI_SOUND_NAME 0x00000100L
typedef LPCSTR HPCSTR; /* a huge version of LPCSTR */
typedef struct tagMCI_SOUND_PARMS {
DWORD_PTR dwCallback;
LPCSTR lpstrSoundName;
} MCI_SOUND_PARMS, *LPMCI_SOUND_PARMS;
typedef struct midievent_tag *LPMIDIEVENT;
DWORD WINAPI GetDriverFlags(HDRVR hDriver);
#endif /* __WINE_WINNT_H */

View file

@ -85,7 +85,7 @@ void MMDRV_InstallMap(unsigned int drv,
llTypes[drv].Map16To32A = mp1632;
llTypes[drv].UnMap16To32A = um1632;
llTypes[drv].Map32ATo16 = mp3216;
llTypes[drv].UnMap32ATo16 = um1632;
llTypes[drv].UnMap32ATo16 = um3216;
llTypes[drv].Callback = cb;
}
@ -562,6 +562,9 @@ static BOOL MMDRV_InitPerType(LPWINE_MM_DRIVER lpDrv, UINT type, UINT wMsg)
TRACE("Got %u dev for (%s:%s)\n", count, lpDrv->drvname, llTypes[type].typestr);
if (HIWORD(count))
return FALSE;
/* got some drivers */
if (lpDrv->bIsMapper) {
/* it seems native mappers return 0 devices :-( */

View file

@ -248,8 +248,8 @@ static BOOL MCI_IsCommandTableValid(UINT uTbl)
do {
str = lmem;
lmem += strlen(lmem) + 1;
flg = *(LPDWORD)lmem;
eid = *(LPWORD)(lmem + sizeof(DWORD));
flg = *(const DWORD*)lmem;
eid = *(const WORD*)(lmem + sizeof(DWORD));
lmem += sizeof(DWORD) + sizeof(WORD);
idx ++;
/* EPP TRACE("cmd='%s' %08lx %04x\n", str, flg, eid); */
@ -291,8 +291,8 @@ static BOOL MCI_DumpCommandTable(UINT uTbl)
do {
str = lmem;
lmem += strlen(lmem) + 1;
flg = *(LPDWORD)lmem;
eid = *(LPWORD)(lmem + sizeof(DWORD));
flg = *(const DWORD*)lmem;
eid = *(const WORD*)(lmem + sizeof(DWORD));
TRACE("cmd='%s' %08lx %04x\n", str, flg, eid);
lmem += sizeof(DWORD) + sizeof(WORD);
} while (eid != MCI_END_COMMAND && eid != MCI_END_COMMAND_LIST);
@ -379,7 +379,7 @@ UINT MCI_SetCommandTable(void *table, UINT uDevType)
count = 0;
do {
lmem += strlen(lmem) + 1;
eid = *(LPWORD)(lmem + sizeof(DWORD));
eid = *(const WORD*)(lmem + sizeof(DWORD));
lmem += sizeof(DWORD) + sizeof(WORD);
if (eid == MCI_COMMAND_HEAD)
count++;
@ -393,7 +393,7 @@ UINT MCI_SetCommandTable(void *table, UINT uDevType)
do {
str = lmem;
lmem += strlen(lmem) + 1;
eid = *(LPWORD)(lmem + sizeof(DWORD));
eid = *(const WORD*)(lmem + sizeof(DWORD));
lmem += sizeof(DWORD) + sizeof(WORD);
if (eid == MCI_COMMAND_HEAD)
S_MciCmdTable[uTbl].aVerbs[count++] = str;
@ -619,8 +619,8 @@ static LPCSTR MCI_FindCommand(UINT uTbl, LPCSTR verb)
static DWORD MCI_GetReturnType(LPCSTR lpCmd)
{
lpCmd += strlen(lpCmd) + 1 + sizeof(DWORD) + sizeof(WORD);
if (*lpCmd == '\0' && *(LPWORD)(lpCmd + 1 + sizeof(DWORD)) == MCI_RETURN) {
return *(LPDWORD)(lpCmd + 1);
if (*lpCmd == '\0' && *(const WORD*)(lpCmd + 1 + sizeof(DWORD)) == MCI_RETURN) {
return *(const DWORD*)(lpCmd + 1);
}
return 0L;
}
@ -630,7 +630,7 @@ static DWORD MCI_GetReturnType(LPCSTR lpCmd)
*/
static WORD MCI_GetMessage(LPCSTR lpCmd)
{
return (WORD)*(LPDWORD)(lpCmd + strlen(lpCmd) + 1);
return (WORD)*(const DWORD*)(lpCmd + strlen(lpCmd) + 1);
}
/**************************************************************************
@ -712,8 +712,8 @@ static DWORD MCI_ParseOptArgs(LPDWORD data, int _offset, LPCSTR lpCmd,
do { /* loop on options for command table for the requested verb */
str = lmem;
lmem += (len = strlen(lmem)) + 1;
flg = *(LPDWORD)lmem;
eid = *(LPWORD)(lmem + sizeof(DWORD));
flg = *(const DWORD*)lmem;
eid = *(const WORD*)(lmem + sizeof(DWORD));
lmem += sizeof(DWORD) + sizeof(WORD);
/* EPP TRACE("\tcmd='%s' inCst=%c eid=%04x\n", str, inCst ? 'Y' : 'N', eid); */

View file

@ -1893,7 +1893,7 @@ static WINE_MMTHREAD* WINMM_GetmmThread(HANDLE16 h)
return (WINE_MMTHREAD*)MapSL( MAKESEGPTR(h, 0) );
}
void WINAPI WINE_mmThreadEntryPoint(DWORD);
DWORD WINAPI WINE_mmThreadEntryPoint(LPVOID);
/**************************************************************************
* mmThreadCreate [MMSYSTEM.1120]
@ -1951,8 +1951,8 @@ LRESULT WINAPI mmThreadCreate16(FARPROC16 fpThreadAddr, LPHANDLE16 lpHndl, DWORD
/* lpMMThd->hVxD = OpenVxDHandle(lpMMThd->hEvent); */
}
lpMMThd->hThread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)WINE_mmThreadEntryPoint,
(LPVOID)(DWORD)hndl, CREATE_SUSPENDED, &lpMMThd->dwThreadID);
lpMMThd->hThread = CreateThread(0, 0, WINE_mmThreadEntryPoint,
(LPVOID)(DWORD_PTR)hndl, CREATE_SUSPENDED, &lpMMThd->dwThreadID);
if (lpMMThd->hThread == 0) {
WARN("Couldn't create thread\n");
/* clean-up(VxDhandle...); devicedirectio... */
@ -2143,9 +2143,9 @@ HANDLE16 WINAPI mmThreadGetTask16(HANDLE16 hndl)
/**************************************************************************
* __wine_mmThreadEntryPoint (MMSYSTEM.2047)
*/
void WINAPI WINE_mmThreadEntryPoint(DWORD _pmt)
DWORD WINAPI WINE_mmThreadEntryPoint(LPVOID p)
{
HANDLE16 hndl = (HANDLE16)_pmt;
HANDLE16 hndl = (HANDLE16)(DWORD_PTR)p;
WINE_MMTHREAD* lpMMThd = WINMM_GetmmThread(hndl);
TRACE("(%04x %p)\n", hndl, lpMMThd);
@ -2173,6 +2173,8 @@ void WINAPI WINE_mmThreadEntryPoint(DWORD _pmt)
CloseHandle(lpMMThd->hEvent);
GlobalFree16(hndl);
TRACE("done\n");
return 0;
}
typedef BOOL16 (WINAPI *MMCPLCALLBACK)(HWND, LPCSTR, LPCSTR, LPCSTR);

View file

@ -72,7 +72,7 @@ static HMMIO get_mmioFromProfile(UINT uFlags, LPCWSTR lpszName)
static const WCHAR wszNull[] = {0};
TRACE("searching in SystemSound list for %s\n", debugstr_w(lpszName));
GetProfileStringW(wszSounds, (LPWSTR)lpszName, wszNull, str, sizeof(str)/sizeof(str[0]));
GetProfileStringW(wszSounds, lpszName, wszNull, str, sizeof(str)/sizeof(str[0]));
if (lstrlenW(str) == 0)
{
if (uFlags & SND_NODEFAULT) goto next;
@ -420,7 +420,7 @@ errCleanUp:
return bRet;
}
BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODULE hmod, DWORD fdwSound, BOOL bUnicode)
static BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODULE hmod, DWORD fdwSound, BOOL bUnicode)
{
WINE_PLAYSOUND* wps = NULL;

View file

@ -242,18 +242,7 @@ static DWORD CALLBACK TIME_MMSysTimeThread(LPVOID arg)
sleep_time = TIME_MMSysTimeCallback(iData);
if (sleep_time == 0)
{
/* This Sleep is controversial; it was added to make
Wine able to replicate a high speed (e.g. 1 ms)
timer event where the called event routine chews
a lot of CPU. This is required because of the
bias some Linux kernel versions have against threads that
chew a lot of the CPU; this Sleep(0) yields enough
in that spin case doesn't trigger the bias.
Further, it should do no harm, but an fyi. */
Sleep(0);
continue;
}
rc = WaitForSingleObject(TIME_hWakeEvent, sleep_time);
if (rc != WAIT_TIMEOUT && rc != WAIT_OBJECT_0)

View file

@ -1,11 +1,16 @@
? Makefile
? Makefile.ros
? Makefile.ros-template
? winehq2ros.patch
? winmm.spec.def
Index: lolvldrv.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/lolvldrv.c,v
retrieving revision 1.61
diff -u -r1.61 lolvldrv.c
--- lolvldrv.c 22 Sep 2004 04:00:14 -0000 1.61
+++ lolvldrv.c 20 Oct 2004 17:54:30 -0000
@@ -758,11 +758,18 @@
retrieving revision 1.62
diff -u -r1.62 lolvldrv.c
--- lolvldrv.c 1 Dec 2004 15:32:19 -0000 1.62
+++ lolvldrv.c 7 Dec 2004 21:01:01 -0000
@@ -761,11 +761,18 @@
{
TRACE("()\n");
/* first load hardware drivers */
@ -29,10 +34,10 @@ diff -u -r1.61 lolvldrv.c
Index: winmm.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/winmm.c,v
retrieving revision 1.45
diff -u -r1.45 winmm.c
--- winmm.c 19 Oct 2004 23:55:15 -0000 1.45
+++ winmm.c 20 Oct 2004 17:54:32 -0000
retrieving revision 1.46
diff -u -r1.46 winmm.c
--- winmm.c 21 Nov 2004 15:37:04 -0000 1.46
+++ winmm.c 7 Dec 2004 21:01:02 -0000
@@ -94,7 +94,9 @@
return FALSE;
WINMM_IData->hWinMM32Instance = hInstDLL;
@ -56,13 +61,44 @@ diff -u -r1.45 winmm.c
loaded = 1;
}
}
@@ -669,7 +673,7 @@
/**************************************************************************
* mixerMessage [WINMM.@]
*/
-UINT WINAPI mixerMessage(HMIXER hmix, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
+DWORD WINAPI mixerMessage(HMIXER hmix, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
LPWINE_MLD wmld;
@@ -2669,8 +2673,8 @@
* waveOutOpen [WINMM.@]
* All the args/structs have the same layout as the win16 equivalents
*/
-UINT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID,
- const LPWAVEFORMATEX lpFormat, DWORD_PTR dwCallback,
+MMRESULT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID,
+ LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback,
DWORD_PTR dwInstance, DWORD dwFlags)
{
return WAVE_Open((HANDLE*)lphWaveOut, uDeviceID, MMDRV_WAVEOUT, lpFormat,
@@ -3054,8 +3058,8 @@
/**************************************************************************
* waveInOpen [WINMM.@]
*/
-UINT WINAPI waveInOpen(HWAVEIN* lphWaveIn, UINT uDeviceID,
- const LPWAVEFORMATEX lpFormat, DWORD_PTR dwCallback,
+MMRESULT WINAPI waveInOpen(HWAVEIN* lphWaveIn, UINT uDeviceID,
+ LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback,
DWORD_PTR dwInstance, DWORD dwFlags)
{
return WAVE_Open((HANDLE*)lphWaveIn, uDeviceID, MMDRV_WAVEIN, lpFormat,
Index: winmm_res.rc
===================================================================
RCS file: /home/wine/wine/dlls/winmm/winmm_res.rc,v
retrieving revision 1.17
diff -u -r1.17 winmm_res.rc
--- winmm_res.rc 16 Aug 2004 20:02:09 -0000 1.17
+++ winmm_res.rc 20 Oct 2004 17:54:32 -0000
+++ winmm_res.rc 7 Dec 2004 21:01:03 -0000
@@ -34,7 +34,7 @@
#include "winmm_Es.rc"
#include "winmm_Fr.rc"

View file

@ -171,6 +171,15 @@ const char* WINMM_ErrorToString(MMRESULT error)
ERR_TO_STR(MMSYSERR_BADERRNUM);
ERR_TO_STR(MMSYSERR_INVALFLAG);
ERR_TO_STR(MMSYSERR_INVALPARAM);
ERR_TO_STR(MMSYSERR_HANDLEBUSY);
ERR_TO_STR(MMSYSERR_INVALIDALIAS);
ERR_TO_STR(MMSYSERR_BADDB);
ERR_TO_STR(MMSYSERR_KEYNOTFOUND);
ERR_TO_STR(MMSYSERR_READERROR);
ERR_TO_STR(MMSYSERR_WRITEERROR);
ERR_TO_STR(MMSYSERR_DELETEERROR);
ERR_TO_STR(MMSYSERR_VALNOTFOUND);
ERR_TO_STR(MMSYSERR_NODRIVERCB);
ERR_TO_STR(WAVERR_BADFORMAT);
ERR_TO_STR(WAVERR_STILLPLAYING);
ERR_TO_STR(WAVERR_UNPREPARED);
@ -664,7 +673,7 @@ UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdA,
/**************************************************************************
* mixerMessage [WINMM.@]
*/
UINT WINAPI mixerMessage(HMIXER hmix, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
DWORD WINAPI mixerMessage(HMIXER hmix, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
LPWINE_MLD wmld;
@ -2664,8 +2673,8 @@ UINT WINAPI waveOutGetErrorTextW(UINT uError, LPWSTR lpText, UINT uSize)
* waveOutOpen [WINMM.@]
* All the args/structs have the same layout as the win16 equivalents
*/
UINT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID,
const LPWAVEFORMATEX lpFormat, DWORD_PTR dwCallback,
MMRESULT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID,
LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback,
DWORD_PTR dwInstance, DWORD dwFlags)
{
return WAVE_Open((HANDLE*)lphWaveOut, uDeviceID, MMDRV_WAVEOUT, lpFormat,
@ -3049,8 +3058,8 @@ UINT WINAPI waveInGetErrorTextW(UINT uError, LPWSTR lpText, UINT uSize)
/**************************************************************************
* waveInOpen [WINMM.@]
*/
UINT WINAPI waveInOpen(HWAVEIN* lphWaveIn, UINT uDeviceID,
const LPWAVEFORMATEX lpFormat, DWORD_PTR dwCallback,
MMRESULT WINAPI waveInOpen(HWAVEIN* lphWaveIn, UINT uDeviceID,
LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback,
DWORD_PTR dwInstance, DWORD dwFlags)
{
return WAVE_Open((HANDLE*)lphWaveIn, uDeviceID, MMDRV_WAVEIN, lpFormat,

View file

@ -1565,7 +1565,7 @@ MMRESULT WINAPI waveOutGetVolume(HWAVEOUT,PDWORD);
MMRESULT WINAPI waveOutSetVolume(HWAVEOUT,DWORD);
MMRESULT WINAPI waveOutGetErrorTextA(MMRESULT,LPSTR,UINT);
MMRESULT WINAPI waveOutGetErrorTextW(MMRESULT,LPWSTR,UINT);
MMRESULT WINAPI waveOutOpen(LPHWAVEOUT,UINT,LPCWAVEFORMATEX,DWORD,DWORD,DWORD);
MMRESULT WINAPI waveOutOpen(LPHWAVEOUT,UINT,LPCWAVEFORMATEX,DWORD_PTR,DWORD_PTR,DWORD);
MMRESULT WINAPI waveOutClose(HWAVEOUT);
MMRESULT WINAPI waveOutPrepareHeader(HWAVEOUT,LPWAVEHDR,UINT);
MMRESULT WINAPI waveOutUnprepareHeader(HWAVEOUT,LPWAVEHDR,UINT);
@ -1586,7 +1586,7 @@ MMRESULT WINAPI waveInGetDevCapsA(UINT,LPWAVEINCAPSA,UINT);
MMRESULT WINAPI waveInGetDevCapsW(UINT,LPWAVEINCAPSW,UINT);
MMRESULT WINAPI waveInGetErrorTextA(MMRESULT,LPSTR,UINT);
MMRESULT WINAPI waveInGetErrorTextW(MMRESULT,LPWSTR,UINT);
MMRESULT WINAPI waveInOpen(LPHWAVEIN,UINT,LPCWAVEFORMATEX,DWORD,DWORD,DWORD);
MMRESULT WINAPI waveInOpen(LPHWAVEIN,UINT,LPCWAVEFORMATEX,DWORD_PTR,DWORD_PTR,DWORD);
MMRESULT WINAPI waveInClose(HWAVEIN);
MMRESULT WINAPI waveInPrepareHeader(HWAVEIN,LPWAVEHDR,UINT);
MMRESULT WINAPI waveInUnprepareHeader(HWAVEIN,LPWAVEHDR,UINT);
@ -1651,7 +1651,7 @@ MMRESULT WINAPI mixerGetDevCapsA(UINT,LPMIXERCAPSA,UINT);
MMRESULT WINAPI mixerGetDevCapsW(UINT,LPMIXERCAPSW,UINT);
MMRESULT WINAPI mixerOpen(LPHMIXER,UINT,DWORD,DWORD,DWORD);
MMRESULT WINAPI mixerClose(HMIXER);
DWORD WINAPI mixerMessage(HMIXER,UINT,DWORD,DWORD);
DWORD WINAPI mixerMessage(HMIXER,UINT,DWORD_PTR,DWORD_PTR);
MMRESULT WINAPI mixerGetLineInfoA(HMIXEROBJ,LPMIXERLINEA,DWORD);
MMRESULT WINAPI mixerGetLineInfoW(HMIXEROBJ,LPMIXERLINEW,DWORD);
MMRESULT WINAPI mixerGetID(HMIXEROBJ,PUINT,DWORD);