Commit 78b50f23 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

- Moved Wine extension to get DSound interface from a wave device from

include/mmsystem.h to include/mmddk.h. - Removed all dependencies on heap.h. - Fixed a few prototypes (mmioRename[AW], mciSendStringW, *Message).
parent 5cb89119
......@@ -23,10 +23,12 @@
*/
#include <string.h>
#include "heap.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "mmddk.h"
#include "winemm.h"
#include "wine/debug.h"
......@@ -326,9 +328,28 @@ HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lPara
*/
HDRVR WINAPI OpenDriverW(LPCWSTR lpDriverName, LPCWSTR lpSectionName, LPARAM lParam)
{
LPSTR dn = HEAP_strdupWtoA(GetProcessHeap(), 0, lpDriverName);
LPSTR sn = HEAP_strdupWtoA(GetProcessHeap(), 0, lpSectionName);
HDRVR ret = OpenDriverA(dn, sn, lParam);
INT len;
LPSTR dn = NULL;
LPSTR sn = NULL;
HDRVR ret;
if (lpDriverName)
{
len = WideCharToMultiByte( CP_ACP, 0, lpDriverName, -1, NULL, 0, NULL, NULL );
dn = HeapAlloc( GetProcessHeap(), 0, len );
if (!dn) return 0;
WideCharToMultiByte( CP_ACP, 0, lpDriverName, -1, dn, len, NULL, NULL );
}
if (lpSectionName)
{
len = WideCharToMultiByte( CP_ACP, 0, lpSectionName, -1, NULL, 0, NULL, NULL );
sn = HeapAlloc( GetProcessHeap(), 0, len );
if (!sn) return 0;
WideCharToMultiByte( CP_ACP, 0, lpSectionName, -1, sn, len, NULL, NULL );
}
ret = OpenDriverA(dn, sn, lParam);
if (dn) HeapFree(GetProcessHeap(), 0, dn);
if (sn) HeapFree(GetProcessHeap(), 0, sn);
......
......@@ -1050,10 +1050,11 @@ errCleanUp:
/**************************************************************************
* mciSendStringW [WINMM.@]
*/
DWORD WINAPI mciSendStringW(LPCWSTR lpwstrCommand, LPSTR lpstrRet,
DWORD WINAPI mciSendStringW(LPCWSTR lpwstrCommand, LPWSTR lpwstrRet,
UINT uRetLen, HWND hwndCallback)
{
LPSTR lpstrCommand;
LPSTR lpstrRet = NULL;
UINT ret;
INT len;
......@@ -1061,8 +1062,16 @@ DWORD WINAPI mciSendStringW(LPCWSTR lpwstrCommand, LPSTR lpstrRet,
len = WideCharToMultiByte( CP_ACP, 0, lpwstrCommand, -1, NULL, 0, NULL, NULL );
lpstrCommand = HeapAlloc( GetProcessHeap(), 0, len );
WideCharToMultiByte( CP_ACP, 0, lpwstrCommand, -1, lpstrCommand, len, NULL, NULL );
if (lpwstrRet)
{
lpstrRet = HeapAlloc(GetProcessHeap(), 0, uRetLen * sizeof(WCHAR));
if (!lpstrRet) return MMSYSERR_NOMEM;
}
ret = mciSendStringA(lpstrCommand, lpstrRet, uRetLen, hwndCallback);
if (lpwstrRet)
MultiByteToWideChar( CP_ACP, 0, lpstrRet, -1, lpwstrRet, uRetLen );
HeapFree(GetProcessHeap(), 0, lpstrCommand);
if (lpstrRet) HeapFree(GetProcessHeap(), 0, lpstrRet);
return ret;
}
......
......@@ -38,8 +38,8 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "mmsystem.h"
#include "heap.h"
#include "winemm.h"
#include "wine/debug.h"
......@@ -686,7 +686,15 @@ HMMIO WINAPI mmioOpenW(LPWSTR szFileName, MMIOINFO* lpmmioinfo,
DWORD dwOpenFlags)
{
HMMIO ret;
LPSTR szFn = HEAP_strdupWtoA(GetProcessHeap(), 0, szFileName);
LPSTR szFn = NULL;
if (szFileName)
{
INT len = WideCharToMultiByte( CP_ACP, 0, szFileName, -1, NULL, 0, NULL, NULL );
szFn = HeapAlloc( GetProcessHeap(), 0, len );
if (!szFn) return (HMMIO)NULL;
WideCharToMultiByte( CP_ACP, 0, szFileName, -1, szFn, len, NULL, NULL );
}
ret = MMIO_Open(szFn, lpmmioinfo, dwOpenFlags, MMIO_PROC_32W);
......@@ -1063,11 +1071,10 @@ FOURCC WINAPI mmioStringToFOURCCA(LPCSTR sz, UINT uFlags)
*/
FOURCC WINAPI mmioStringToFOURCCW(LPCWSTR sz, UINT uFlags)
{
LPSTR szA = HEAP_strdupWtoA(GetProcessHeap(),0,sz);
FOURCC ret = mmioStringToFOURCCA(szA,uFlags);
char szA[4];
HeapFree(GetProcessHeap(), 0, szA);
return ret;
WideCharToMultiByte( CP_ACP, 0, sz, 4, szA, sizeof(szA), NULL, NULL );
return mmioStringToFOURCCA(szA,uFlags);
}
/**************************************************************************
......@@ -1299,20 +1306,24 @@ MMRESULT WINAPI mmioCreateChunk(HMMIO hmmio, MMCKINFO* lpck, UINT uFlags)
* mmioRenameA [WINMM.@]
*/
MMRESULT WINAPI mmioRenameA(LPCSTR szFileName, LPCSTR szNewFileName,
MMIOINFO* lpmmioinfo, DWORD dwFlags)
const MMIOINFO* lpmmioinfo, DWORD dwFlags)
{
struct IOProcList* ioProc = NULL;
struct IOProcList tmp;
FOURCC fcc;
TRACE("('%s', '%s', %p, %08lX);\n",
debugstr_a(szFileName), debugstr_a(szNewFileName), lpmmioinfo, dwFlags);
/* If both params are NULL, then parse the file name */
if (lpmmioinfo && lpmmioinfo->fccIOProc == 0 && lpmmioinfo->pIOProc == NULL)
lpmmioinfo->fccIOProc = MMIO_ParseExtA(szFileName);
{
fcc = MMIO_ParseExtA(szFileName);
if (fcc) ioProc = MMIO_FindProcNode(fcc);
}
/* Handle any unhandled/error case from above. Assume DOS file */
if (!lpmmioinfo || (lpmmioinfo->fccIOProc == 0 && lpmmioinfo->pIOProc == NULL))
if (!lpmmioinfo || (lpmmioinfo->fccIOProc == 0 && lpmmioinfo->pIOProc == NULL && ioProc == NULL))
ioProc = MMIO_FindProcNode(FOURCC_DOS);
/* if just the four character code is present, look up IO proc */
else if (lpmmioinfo->pIOProc == NULL)
......@@ -1326,7 +1337,10 @@ MMRESULT WINAPI mmioRenameA(LPCSTR szFileName, LPCSTR szNewFileName,
tmp.count = 1;
}
return send_message(ioProc, lpmmioinfo, MMIOM_RENAME,
/* FIXME: should we actually pass lpmmioinfo down the drain ???
* or make a copy of it because it's const ???
*/
return send_message(ioProc, (LPMMIOINFO)lpmmioinfo, MMIOM_RENAME,
(LPARAM)szFileName, (LPARAM)szNewFileName, MMIO_PROC_32A);
}
......@@ -1334,11 +1348,29 @@ MMRESULT WINAPI mmioRenameA(LPCSTR szFileName, LPCSTR szNewFileName,
* mmioRenameW [WINMM.@]
*/
MMRESULT WINAPI mmioRenameW(LPCWSTR szFileName, LPCWSTR szNewFileName,
MMIOINFO* lpmmioinfo, DWORD dwFlags)
const MMIOINFO* lpmmioinfo, DWORD dwFlags)
{
LPSTR szFn = HEAP_strdupWtoA(GetProcessHeap(), 0, szFileName);
LPSTR sznFn = HEAP_strdupWtoA(GetProcessHeap(), 0, szNewFileName);
UINT ret = mmioRenameA(szFn, sznFn, lpmmioinfo, dwFlags);
LPSTR szFn = NULL;
LPSTR sznFn = NULL;
UINT ret;
INT len;
if (szFileName)
{
len = WideCharToMultiByte( CP_ACP, 0, szFileName, -1, NULL, 0, NULL, NULL );
szFn = HeapAlloc( GetProcessHeap(), 0, len );
if (!szFn) return MMSYSERR_NOMEM;
WideCharToMultiByte( CP_ACP, 0, szFileName, -1, szFn, len, NULL, NULL );
}
if (szNewFileName)
{
len = WideCharToMultiByte( CP_ACP, 0, szNewFileName, -1, NULL, 0, NULL, NULL );
sznFn = HeapAlloc( GetProcessHeap(), 0, len );
if (!sznFn) return MMSYSERR_NOMEM;
WideCharToMultiByte( CP_ACP, 0, szNewFileName, -1, sznFn, len, NULL, NULL );
}
ret = mmioRenameA(szFn, sznFn, lpmmioinfo, dwFlags);
HeapFree(GetProcessHeap(),0,szFn);
HeapFree(GetProcessHeap(),0,sznFn);
......
......@@ -38,10 +38,10 @@
#include "ntstatus.h"
#include "winternl.h"
#include "wownt32.h"
#include "winnls.h"
#include "wine/winuser16.h"
#include "winemm.h"
#include "heap.h"
#include "wine/debug.h"
......@@ -2237,20 +2237,32 @@ static WINMM_MapType DRIVER_MapMsg32To16(WORD wMsg, DWORD* lParam1, DWORD* lPara
if (dci16) {
LPSTR str1;
INT len;
dci16->dwDCISize = sizeof(DRVCONFIGINFO16);
if ((str1 = HEAP_strdupWtoA(GetProcessHeap(), 0, dci32->lpszDCISectionName)) != NULL)
{
dci16->lpszDCISectionName = MapLS( str1 );
if (dci32->lpszDCISectionName) {
len = WideCharToMultiByte( CP_ACP, 0, dci32->lpszDCISectionName, -1, NULL, 0, NULL, NULL );
str1 = HeapAlloc( GetProcessHeap(), 0, len );
if (str1) {
WideCharToMultiByte( CP_ACP, 0, dci32->lpszDCISectionName, -1, str1, len, NULL, NULL );
dci16->lpszDCISectionName = MapLS( str1 );
} else {
return WINMM_MAP_NOMEM;
}
} else {
return WINMM_MAP_NOMEM;
dci16->lpszDCISectionName = 0L;
}
if ((str1 = HEAP_strdupWtoA(GetProcessHeap(), 0, dci32->lpszDCIAliasName)) != NULL)
{
dci16->lpszDCIAliasName = MapLS( str1 );
if (dci32->lpszDCIAliasName) {
len = WideCharToMultiByte( CP_ACP, 0, dci32->lpszDCIAliasName, -1, NULL, 0, NULL, NULL );
str1 = HeapAlloc( GetProcessHeap(), 0, len );
if (str1) {
WideCharToMultiByte( CP_ACP, 0, dci32->lpszDCIAliasName, -1, str1, len, NULL, NULL );
dci16->lpszDCIAliasName = MapLS( str1 );
} else {
return WINMM_MAP_NOMEM;
}
} else {
return WINMM_MAP_NOMEM;
dci16->lpszDCISectionName = 0L;
}
} else {
return WINMM_MAP_NOMEM;
......
......@@ -37,8 +37,8 @@
#include "winbase.h"
#include "mmsystem.h"
#include "winuser.h"
#include "winnls.h"
#include "winreg.h"
#include "heap.h"
#include "winternl.h"
#include "winemm.h"
......@@ -680,7 +680,7 @@ UINT WINAPI auxSetVolume(UINT uDeviceID, DWORD dwVolume)
/**************************************************************************
* auxOutMessage [WINMM.@]
*/
DWORD WINAPI auxOutMessage(UINT uDeviceID, UINT uMessage, DWORD dw1, DWORD dw2)
UINT WINAPI auxOutMessage(UINT uDeviceID, UINT uMessage, DWORD dw1, DWORD dw2)
{
LPWINE_MLD wmld;
......@@ -810,10 +810,15 @@ UINT WINAPI mciGetDeviceIDA(LPCSTR lpstrName)
*/
UINT WINAPI mciGetDeviceIDW(LPCWSTR lpwstrName)
{
LPSTR lpstrName;
LPSTR lpstrName = NULL;
UINT ret;
INT len;
lpstrName = HEAP_strdupWtoA(GetProcessHeap(), 0, lpwstrName);
if (lpwstrName) {
len = WideCharToMultiByte( CP_ACP, 0, lpwstrName, -1, NULL, 0, NULL, NULL );
lpstrName = HeapAlloc( GetProcessHeap(), 0, len );
if (lpstrName) WideCharToMultiByte( CP_ACP, 0, lpwstrName, -1, lpstrName, len, NULL, NULL );
}
ret = MCI_GetDriverFromString(lpstrName);
HeapFree(GetProcessHeap(), 0, lpstrName);
return ret;
......@@ -1273,8 +1278,8 @@ UINT WINAPI midiOutGetID(HMIDIOUT hMidiOut, UINT* lpuDeviceID)
/**************************************************************************
* midiOutMessage [WINMM.@]
*/
DWORD WINAPI midiOutMessage(HMIDIOUT hMidiOut, UINT uMessage,
DWORD dwParam1, DWORD dwParam2)
UINT WINAPI midiOutMessage(HMIDIOUT hMidiOut, UINT uMessage,
DWORD dwParam1, DWORD dwParam2)
{
LPWINE_MLD wmld;
......@@ -1545,8 +1550,8 @@ UINT WINAPI midiInGetID(HMIDIIN hMidiIn, UINT* lpuDeviceID)
/**************************************************************************
* midiInMessage [WINMM.@]
*/
DWORD WINAPI midiInMessage(HMIDIIN hMidiIn, UINT uMessage,
DWORD dwParam1, DWORD dwParam2)
UINT WINAPI midiInMessage(HMIDIIN hMidiIn, UINT uMessage,
DWORD dwParam1, DWORD dwParam2)
{
LPWINE_MLD wmld;
......@@ -2590,8 +2595,8 @@ UINT WINAPI waveOutGetID(HWAVEOUT hWaveOut, UINT* lpuDeviceID)
/**************************************************************************
* waveOutMessage [WINMM.@]
*/
DWORD WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage,
DWORD dwParam1, DWORD dwParam2)
UINT WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage,
DWORD dwParam1, DWORD dwParam2)
{
LPWINE_MLD wmld;
......@@ -2844,8 +2849,8 @@ UINT WINAPI waveInGetID(HWAVEIN hWaveIn, UINT* lpuDeviceID)
/**************************************************************************
* waveInMessage [WINMM.@]
*/
DWORD WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage,
DWORD dwParam1, DWORD dwParam2)
UINT WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage,
DWORD dwParam1, DWORD dwParam2)
{
LPWINE_MLD wmld;
......
......@@ -52,7 +52,7 @@
@ stdcall mciSendCommandA(long long long long)
@ stdcall mciSendCommandW(long long long long)
@ stdcall mciSendStringA(str ptr long long)
@ stdcall mciSendStringW(str ptr long long)
@ stdcall mciSendStringW(wstr ptr long long)
@ stdcall mciSetDriverData(long long)
@ stdcall mciSetYieldProc(long ptr long)
@ stub midiConnect
......@@ -125,8 +125,8 @@
@ stdcall mmioOpenA(str ptr long)
@ stdcall mmioOpenW(wstr ptr long)
@ stdcall mmioRead(long ptr long)
@ stdcall mmioRenameA(ptr ptr ptr long)
@ stdcall mmioRenameW(ptr ptr ptr long)
@ stdcall mmioRenameA(str str ptr long)
@ stdcall mmioRenameW(wstr wstr ptr long)
@ stdcall mmioSeek(long long long)
@ stdcall mmioSendMessage(long long long long)
@ stdcall mmioSetBuffer(long ptr long long)
......
......@@ -439,6 +439,10 @@ BOOL WINAPI mciFreeCommandResource(UINT uTable);
BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HDRVR hDev,
UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2);
#ifdef __WINESRC__
#define WAVE_DIRECTSOUND 0x0080
#endif
#include <poppack.h>
#endif /* __MMDDK_H */
......@@ -297,9 +297,6 @@ typedef LPDRVCALLBACK LPWAVECALLBACK;
#define WAVE_MAPPED 0x0004
#define WAVE_FORMAT_DIRECT 0x0008
#define WAVE_FORMAT_DIRECT_QUERY (WAVE_FORMAT_QUERY | WAVE_FORMAT_DIRECT)
#ifdef __WINESRC__
#define WAVE_DIRECTSOUND 0x0080
#endif
typedef struct wavehdr_tag {
LPSTR lpData; /* pointer to locked data buffer */
......@@ -449,7 +446,7 @@ UINT WINAPI waveOutSetPitch(HWAVEOUT,DWORD);
UINT WINAPI waveOutGetPlaybackRate(HWAVEOUT,DWORD*);
UINT WINAPI waveOutSetPlaybackRate(HWAVEOUT,DWORD);
UINT WINAPI waveOutGetID(HWAVEOUT,UINT*);
DWORD WINAPI waveOutMessage(HWAVEOUT,UINT,DWORD,DWORD);
UINT WINAPI waveOutMessage(HWAVEOUT,UINT,DWORD,DWORD);
UINT WINAPI waveInGetNumDevs(void);
UINT WINAPI waveInGetDevCapsA(UINT,LPWAVEINCAPSA,UINT);
UINT WINAPI waveInGetDevCapsW(UINT,LPWAVEINCAPSW,UINT);
......@@ -467,7 +464,7 @@ UINT WINAPI waveInStop(HWAVEIN);
UINT WINAPI waveInReset(HWAVEIN);
UINT WINAPI waveInGetPosition(HWAVEIN,LPMMTIME,UINT);
UINT WINAPI waveInGetID(HWAVEIN,UINT*);
DWORD WINAPI waveInMessage(HWAVEIN,UINT,DWORD,DWORD);
UINT WINAPI waveInMessage(HWAVEIN,UINT,DWORD,DWORD);
#define MIDIERR_UNPREPARED (MIDIERR_BASE + 0) /* header not prepared */
#define MIDIERR_STILLPLAYING (MIDIERR_BASE + 1) /* still something playing */
......@@ -646,7 +643,7 @@ UINT WINAPI midiOutReset(HMIDIOUT);
UINT WINAPI midiOutCachePatches(HMIDIOUT,UINT,WORD*,UINT);
UINT WINAPI midiOutCacheDrumPatches(HMIDIOUT,UINT,WORD*,UINT);
UINT WINAPI midiOutGetID(HMIDIOUT,UINT*);
DWORD WINAPI midiOutMessage(HMIDIOUT,UINT,DWORD,DWORD);
UINT WINAPI midiOutMessage(HMIDIOUT,UINT,DWORD,DWORD);
UINT WINAPI midiInGetNumDevs(void);
UINT WINAPI midiInGetDevCapsA(UINT,LPMIDIINCAPSA,UINT);
......@@ -664,7 +661,7 @@ UINT WINAPI midiInStart(HMIDIIN);
UINT WINAPI midiInStop(HMIDIIN);
UINT WINAPI midiInReset(HMIDIIN);
UINT WINAPI midiInGetID(HMIDIIN,UINT*);
DWORD WINAPI midiInMessage(HMIDIIN,UINT,DWORD,DWORD);
UINT WINAPI midiInMessage(HMIDIIN,UINT,DWORD,DWORD);
MMRESULT WINAPI midiStreamClose(HMIDISTRM hms);
MMRESULT WINAPI midiStreamOpen(HMIDISTRM* phms, LPUINT uDeviceID, DWORD cMidi,
DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen);
......@@ -712,7 +709,7 @@ UINT WINAPI auxGetDevCapsW(UINT,LPAUXCAPSW,UINT);
#define auxGetDevCaps WINELIB_NAME_AW(auxGetDevCaps)
UINT WINAPI auxSetVolume(UINT,DWORD);
UINT WINAPI auxGetVolume(UINT,LPDWORD);
DWORD WINAPI auxOutMessage(UINT,UINT,DWORD,DWORD);
UINT WINAPI auxOutMessage(UINT,UINT,DWORD,DWORD);
#define TIMERR_NOERROR (0) /* no error */
#define TIMERR_NOCANDO (TIMERR_BASE+1) /* request not completed */
......@@ -1389,9 +1386,9 @@ HMMIO WINAPI mmioOpenW(LPWSTR,MMIOINFO*,DWORD);
#define mmioOpen WINELIB_NAME_AW(mmioOpen)
MMRESULT WINAPI mmioRenameA(LPCSTR szFileName, LPCSTR szNewFileName,
MMIOINFO * lpmmioinfo, DWORD dwRenameFlags);
const MMIOINFO * lpmmioinfo, DWORD dwRenameFlags);
MMRESULT WINAPI mmioRenameW(LPCWSTR szFileName, LPCWSTR szNewFileName,
MMIOINFO * lpmmioinfo, DWORD dwRenameFlags);
const MMIOINFO * lpmmioinfo, DWORD dwRenameFlags);
#define mmioRename WINELIB_NAME_AW(mmioRename)
MMRESULT WINAPI mmioClose(HMMIO,UINT);
......@@ -1414,7 +1411,7 @@ DWORD WINAPI mciSendCommandA(UINT,UINT,DWORD,DWORD);
DWORD WINAPI mciSendCommandW(UINT,UINT,DWORD,DWORD);
#define mciSendCommand WINELIB_NAME_AW(mciSendCommand)
DWORD WINAPI mciSendStringA(LPCSTR,LPSTR,UINT,HWND);
DWORD WINAPI mciSendStringW(LPCWSTR,LPSTR,UINT,HWND);
DWORD WINAPI mciSendStringW(LPCWSTR,LPWSTR,UINT,HWND);
#define mciSendString WINELIB_NAME_AW(mciSendString)
UINT WINAPI mciGetDeviceIDA(LPCSTR);
UINT WINAPI mciGetDeviceIDW(LPCWSTR);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment