From 0e7e2223f00b51516934f6e366239b7f06ee8d43 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?J=C3=B6rg=20H=C3=B6hle?= Date: Sun, 18 Oct 2009 14:21:05 +0200 Subject: [PATCH] mciwave: Update some messages and fix typos. --- dlls/mciwave/mciwave.c | 32 +++++++++++++------------------- 1 files changed, 13 insertions(+), 19 deletions(-) diff --git a/dlls/mciwave/mciwave.c b/dlls/mciwave/mciwave.c index d15603b..a6d18a3 100644 --- a/dlls/mciwave/mciwave.c +++ b/dlls/mciwave/mciwave.c @@ -1,5 +1,5 @@ /* - * Sample Wine Driver for MCI wave forms + * Wine Driver for MCI wave forms * * Copyright 1994 Martin Ayotte * 1999,2000,2005 Eric Pouech @@ -38,7 +38,6 @@ typedef struct { UINT wDevID; HANDLE hWave; int nUseCount; /* Incremented for each shared open */ - BOOL fShareable; /* TRUE if first open was shareable */ HMMIO hFile; /* mmio file handle open as Element */ MCI_WAVE_OPEN_PARMSW openParms; WAVEFORMATEX wfxRef; @@ -46,7 +45,7 @@ typedef struct { BOOL fInput; /* FALSE = Output, TRUE = Input */ volatile WORD dwStatus; /* one from MCI_MODE_xxxx */ DWORD dwMciTimeFormat;/* One of the supported MCI_FORMAT_xxxx */ - DWORD dwPosition; /* position in bytes in chunk */ + volatile DWORD dwPosition; /* position in bytes in chunk */ HANDLE hEvent; /* for synchronization */ LONG dwEventCount; /* for synchronization */ MMCKINFO ckMainRIFF; /* main RIFF chunk */ @@ -87,7 +86,6 @@ static DWORD CALLBACK MCI_SCAStarter(LPVOID arg) sca->wDevID, sca->dwParam1, sca->dwParam2); HeapFree(GetProcessHeap(), 0, sca); ExitThread(ret); - WARN("Should not happen ? what's wrong\n"); /* should not go after this point */ return ret; } @@ -288,14 +286,12 @@ static DWORD WAVE_mciReadFmt(WINE_MCIWAVE* wmw, const MMCKINFO* pckMainRIFF) } TRACE("Chunk Found ckid=%.4s fccType=%.4s cksize=%08X\n", (LPSTR)&wmw->ckWaveData.ckid, (LPSTR)&wmw->ckWaveData.fccType, wmw->ckWaveData.cksize); - TRACE("nChannels=%d nSamplesPerSec=%d\n", - wmw->lpWaveFormat->nChannels, wmw->lpWaveFormat->nSamplesPerSec); return 0; } /************************************************************************** - * WAVE_mciDefaultFmt [internal] + * WAVE_mciDefaultFmt [internal] */ static DWORD WAVE_mciDefaultFmt(WINE_MCIWAVE* wmw) { @@ -476,7 +472,7 @@ static LRESULT WAVE_mciOpen(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_P if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID; if (dwFlags & MCI_OPEN_SHAREABLE) - return MCIERR_HARDWARE; + return MCIERR_UNSUPPORTED_FUNCTION; if (wmw->nUseCount > 0) { /* The driver is already opened on this channel @@ -697,9 +693,7 @@ static void CALLBACK WAVE_mciPlayCallback(HWAVEOUT hwo, UINT uMsg, } /****************************************************************** - * WAVE_mciPlayWaitDone - * - * + * WAVE_mciPlayWaitDone [internal] */ static void WAVE_mciPlayWaitDone(WINE_MCIWAVE* wmw) { @@ -794,7 +788,7 @@ static DWORD WAVE_mciPlay(MCIDEVICEID wDevID, DWORD_PTR dwFlags, DWORD_PTR pmt, TRACE("Playing from byte=%u to byte=%u\n", wmw->dwPosition, end); if (end <= wmw->dwPosition) - return TRUE; + return MMSYSERR_NOERROR; #define WAVE_ALIGN_ON_BLOCK(wmw,v) \ @@ -904,7 +898,7 @@ cleanUp: } /************************************************************************** - * WAVE_mciPlayCallback [internal] + * WAVE_mciRecordCallback [internal] */ static void CALLBACK WAVE_mciRecordCallback(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance, @@ -947,8 +941,7 @@ static void CALLBACK WAVE_mciRecordCallback(HWAVEOUT hwo, UINT uMsg, } /****************************************************************** - * bWAVE_mciRecordWaitDone - * + * WAVE_mciRecordWaitDone [internal] */ static void WAVE_mciRecordWaitDone(WINE_MCIWAVE* wmw) { @@ -991,7 +984,7 @@ static DWORD WAVE_mciRecord(MCIDEVICEID wDevID, DWORD_PTR dwFlags, DWORD_PTR pmt wmw->fInput = TRUE; /** This function will be called again by a thread when async is used. - * We have to set MCI_MODE_PLAY before we do this so that the app can spin + * We have to set MCI_MODE_RECORD before we do this so that the app can spin * on MCI_STATUS, so we have to allow it here if we're not going to start this thread. */ if ((wmw->dwStatus != MCI_MODE_STOP) && ((wmw->dwStatus != MCI_MODE_RECORD) && (dwFlags & MCI_WAIT))) { @@ -1030,7 +1023,7 @@ static DWORD WAVE_mciRecord(MCIDEVICEID wDevID, DWORD_PTR dwFlags, DWORD_PTR pmt if (end <= wmw->dwPosition) { - return TRUE; + return MMSYSERR_NOERROR; } #define WAVE_ALIGN_ON_BLOCK(wmw,v) \ @@ -1331,6 +1324,7 @@ static DWORD WAVE_mciSet(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpPa TRACE("MCI_WAVE_SET_CHANNELS = %d\n", wmw->wfxRef.nChannels); } if (dwFlags & MCI_WAVE_SET_FORMATTAG) { + /* Dangerous because the correct cbSize cannot be set */ wmw->wfxRef.wFormatTag = ((LPMCI_WAVE_SET_PARMS)lpParms)->wFormatTag; TRACE("MCI_WAVE_SET_FORMATTAG = %d\n", wmw->wfxRef.wFormatTag); } @@ -1474,7 +1468,7 @@ static DWORD WAVE_mciStatus(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_STATUS_PARM lpParms->dwReturn = id; } else { lpParms->dwReturn = 0; - ret = MCIERR_WAVE_INPUTUNSPECIFIED; + ret = MCIERR_WAVE_OUTPUTUNSPECIFIED; } } break; @@ -1674,7 +1668,7 @@ LRESULT CALLBACK MCIWAVE_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, case DRV_ENABLE: return 1; case DRV_DISABLE: return 1; case DRV_QUERYCONFIGURE: return 1; - case DRV_CONFIGURE: MessageBoxA(0, "Sample MultiMedia Driver !", "OSS Driver", MB_OK); return 1; + case DRV_CONFIGURE: MessageBoxA(0, "MCI waveaudio Driver !", "Wine Driver", MB_OK); return 1; case DRV_INSTALL: return DRVCNF_RESTART; case DRV_REMOVE: return DRVCNF_RESTART; } -- 1.5.6.3