Commit 1eed552b authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

- rewrite MCI interfaces as Unicode interface (as it should be)

- made some winmm APIs rely on the Unicode version for the core implementation (instead of Ansi flavor)
parent e40af1cc
...@@ -5,6 +5,7 @@ SRCDIR = @srcdir@ ...@@ -5,6 +5,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = winmm.dll MODULE = winmm.dll
IMPORTS = user32 advapi32 kernel32 ntdll IMPORTS = user32 advapi32 kernel32 ntdll
EXTRALIBS = $(LIBUNICODE)
C_SRCS = \ C_SRCS = \
driver.c \ driver.c \
......
/* -*- tab-width: 8; c-basic-offset: 4 -*- */
/* /*
* WINE Drivers functions * WINE Drivers functions
* *
...@@ -33,15 +31,16 @@ ...@@ -33,15 +31,16 @@
#include "mmddk.h" #include "mmddk.h"
#include "winemm.h" #include "winemm.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(driver); WINE_DEFAULT_DEBUG_CHANNEL(driver);
#define HKLM_BASE "Software\\Microsoft\\Windows NT\\CurrentVersion"
static LPWINE_DRIVER lpDrvItemList /* = NULL */; static LPWINE_DRIVER lpDrvItemList /* = NULL */;
static const WCHAR HKLM_BASE[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s',' ','N','T','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n',0};
WINE_MMTHREAD* (*pFnGetMMThread16)(UINT16 h) /* = NULL */; WINE_MMTHREAD* (*pFnGetMMThread16)(UINT16 h) /* = NULL */;
LPWINE_DRIVER (*pFnOpenDriver16)(LPCSTR,LPCSTR,LPARAM) /* = NULL */; LPWINE_DRIVER (*pFnOpenDriver16)(LPCWSTR,LPCWSTR,LPARAM) /* = NULL */;
LRESULT (*pFnCloseDriver16)(UINT16,LPARAM,LPARAM) /* = NULL */; LRESULT (*pFnCloseDriver16)(UINT16,LPARAM,LPARAM) /* = NULL */;
LRESULT (*pFnSendMessage16)(UINT16,UINT,LPARAM,LPARAM) /* = NULL */; LRESULT (*pFnSendMessage16)(UINT16,UINT,LPARAM,LPARAM) /* = NULL */;
...@@ -207,16 +206,19 @@ static BOOL DRIVER_AddToList(LPWINE_DRIVER lpNewDrv, LPARAM lParam1, LPARAM lPar ...@@ -207,16 +206,19 @@ static BOOL DRIVER_AddToList(LPWINE_DRIVER lpNewDrv, LPARAM lParam1, LPARAM lPar
* DRIVER_GetLibName [internal] * DRIVER_GetLibName [internal]
* *
*/ */
BOOL DRIVER_GetLibName(LPCSTR keyName, LPCSTR sectName, LPSTR buf, int sz) BOOL DRIVER_GetLibName(LPCWSTR keyName, LPCWSTR sectName, LPWSTR buf, int sz)
{ {
HKEY hKey, hSecKey; HKEY hKey, hSecKey;
DWORD bufLen, lRet; DWORD bufLen, lRet;
static const WCHAR wszSystemIni[] = {'S','Y','S','T','E','M','.','I','N','I',0};
WCHAR wsznull = '\0';
lRet = RegOpenKeyExA(HKEY_LOCAL_MACHINE, HKLM_BASE, 0, KEY_QUERY_VALUE, &hKey); lRet = RegOpenKeyExW(HKEY_LOCAL_MACHINE, HKLM_BASE, 0, KEY_QUERY_VALUE, &hKey);
if (lRet == ERROR_SUCCESS) { if (lRet == ERROR_SUCCESS) {
lRet = RegOpenKeyExA(hKey, sectName, 0, KEY_QUERY_VALUE, &hSecKey); lRet = RegOpenKeyExW(hKey, sectName, 0, KEY_QUERY_VALUE, &hSecKey);
if (lRet == ERROR_SUCCESS) { if (lRet == ERROR_SUCCESS) {
lRet = RegQueryValueExA(hSecKey, keyName, 0, 0, buf, &bufLen); bufLen = sz;
lRet = RegQueryValueExW(hSecKey, keyName, 0, 0, (void*)buf, &bufLen);
RegCloseKey( hSecKey ); RegCloseKey( hSecKey );
} }
RegCloseKey( hKey ); RegCloseKey( hKey );
...@@ -224,7 +226,7 @@ BOOL DRIVER_GetLibName(LPCSTR keyName, LPCSTR sectName, LPSTR buf, int sz) ...@@ -224,7 +226,7 @@ BOOL DRIVER_GetLibName(LPCSTR keyName, LPCSTR sectName, LPSTR buf, int sz)
if (lRet == ERROR_SUCCESS) return TRUE; if (lRet == ERROR_SUCCESS) return TRUE;
/* default to system.ini if we can't find it in the registry, /* default to system.ini if we can't find it in the registry,
* to support native installations where system.ini is still used */ * to support native installations where system.ini is still used */
return GetPrivateProfileStringA(sectName, keyName, "", buf, sz, "SYSTEM.INI"); return GetPrivateProfileStringW(sectName, keyName, &wsznull, buf, sz, wszSystemIni);
} }
/************************************************************************** /**************************************************************************
...@@ -232,16 +234,16 @@ BOOL DRIVER_GetLibName(LPCSTR keyName, LPCSTR sectName, LPSTR buf, int sz) ...@@ -232,16 +234,16 @@ BOOL DRIVER_GetLibName(LPCSTR keyName, LPCSTR sectName, LPSTR buf, int sz)
* *
* Tries to load a 32 bit driver whose DLL's (module) name is fn * Tries to load a 32 bit driver whose DLL's (module) name is fn
*/ */
LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2) LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCWSTR fn, LPARAM lParam2)
{ {
LPWINE_DRIVER lpDrv = NULL; LPWINE_DRIVER lpDrv = NULL;
HMODULE hModule = 0; HMODULE hModule = 0;
LPSTR ptr; LPWSTR ptr;
LPCSTR cause = 0; LPCSTR cause = 0;
TRACE("(%s, %08lX);\n", debugstr_a(fn), lParam2); TRACE("(%s, %08lX);\n", debugstr_w(fn), lParam2);
if ((ptr = strchr(fn, ' ')) != NULL) { if ((ptr = strchrW(fn, ' ')) != NULL) {
*ptr++ = '\0'; *ptr++ = '\0';
while (*ptr == ' ') ptr++; while (*ptr == ' ') ptr++;
if (*ptr == '\0') ptr = NULL; if (*ptr == '\0') ptr = NULL;
...@@ -250,7 +252,7 @@ LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2) ...@@ -250,7 +252,7 @@ LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2)
lpDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_DRIVER)); lpDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_DRIVER));
if (lpDrv == NULL) {cause = "OOM"; goto exit;} if (lpDrv == NULL) {cause = "OOM"; goto exit;}
if ((hModule = LoadLibraryA(fn)) == 0) {cause = "Not a 32 bit lib"; goto exit;} if ((hModule = LoadLibraryW(fn)) == 0) {cause = "Not a 32 bit lib"; goto exit;}
lpDrv->d.d32.lpDrvProc = (DRIVERPROC)GetProcAddress(hModule, "DriverProc"); lpDrv->d.d32.lpDrvProc = (DRIVERPROC)GetProcAddress(hModule, "DriverProc");
if (lpDrv->d.d32.lpDrvProc == NULL) {cause = "no DriverProc"; goto exit;} if (lpDrv->d.d32.lpDrvProc == NULL) {cause = "no DriverProc"; goto exit;}
...@@ -290,7 +292,7 @@ LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2) ...@@ -290,7 +292,7 @@ LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2)
exit: exit:
FreeLibrary(hModule); FreeLibrary(hModule);
HeapFree(GetProcessHeap(), 0, lpDrv); HeapFree(GetProcessHeap(), 0, lpDrv);
TRACE("Unable to load 32 bit module %s: %s\n", debugstr_a(fn), cause); TRACE("Unable to load 32 bit module %s: %s\n", debugstr_w(fn), cause);
return NULL; return NULL;
} }
...@@ -301,23 +303,59 @@ LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2) ...@@ -301,23 +303,59 @@ LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2)
* (0,1,DRV_ENABLE,0 ,0) * (0,1,DRV_ENABLE,0 ,0)
* (0,1,DRV_OPEN ,buf[256],0) * (0,1,DRV_OPEN ,buf[256],0)
*/ */
HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lParam2) HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lParam)
{
INT len;
LPWSTR dn = NULL;
LPWSTR sn = NULL;
HDRVR ret;
if (lpDriverName)
{
len = MultiByteToWideChar( CP_ACP, 0, lpDriverName, -1, NULL, 0 );
dn = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
if (!dn) return 0;
MultiByteToWideChar( CP_ACP, 0, lpDriverName, -1, dn, len );
}
if (lpSectionName)
{
len = MultiByteToWideChar( CP_ACP, 0, lpSectionName, -1, NULL, 0 );
sn = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
if (!sn) return 0;
MultiByteToWideChar( CP_ACP, 0, lpSectionName, -1, sn, len );
}
ret = OpenDriver(dn, sn, lParam);
if (dn) HeapFree(GetProcessHeap(), 0, dn);
if (sn) HeapFree(GetProcessHeap(), 0, sn);
return ret;
}
/**************************************************************************
* OpenDriver [WINMM.@]
* DrvOpen [WINMM.@]
*/
HDRVR WINAPI OpenDriver(LPCWSTR lpDriverName, LPCWSTR lpSectionName, LPARAM lParam)
{ {
LPWINE_DRIVER lpDrv = NULL; LPWINE_DRIVER lpDrv = NULL;
char libName[128]; WCHAR libName[128];
LPCSTR lsn = lpSectionName; LPCWSTR lsn = lpSectionName;
TRACE("(%s, %s, 0x%08lx);\n", debugstr_a(lpDriverName), debugstr_a(lpSectionName), lParam2); TRACE("(%s, %s, 0x%08lx);\n",
debugstr_w(lpDriverName), debugstr_w(lpSectionName), lParam);
if (lsn == NULL) { if (lsn == NULL) {
lstrcpynA(libName, lpDriverName, sizeof(libName)); static const WCHAR wszDrivers32[] = {'D','r','i','v','e','r','s','3','2',0};
lstrcpynW(libName, lpDriverName, sizeof(libName) / sizeof(WCHAR));
if ((lpDrv = DRIVER_TryOpenDriver32(libName, lParam2))) if ((lpDrv = DRIVER_TryOpenDriver32(libName, lParam)))
goto the_end; goto the_end;
lsn = "Drivers32"; lsn = wszDrivers32;
} }
if (DRIVER_GetLibName(lpDriverName, lsn, libName, sizeof(libName)) && if (DRIVER_GetLibName(lpDriverName, lsn, libName, sizeof(libName)) &&
(lpDrv = DRIVER_TryOpenDriver32(libName, lParam2))) (lpDrv = DRIVER_TryOpenDriver32(libName, lParam)))
goto the_end; goto the_end;
/* now we will try a 16 bit driver (and add all the glue to make it work... which /* now we will try a 16 bit driver (and add all the glue to make it work... which
...@@ -326,12 +364,13 @@ HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lPara ...@@ -326,12 +364,13 @@ HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lPara
*/ */
WINMM_CheckForMMSystem(); WINMM_CheckForMMSystem();
if (pFnOpenDriver16 && if (pFnOpenDriver16 &&
(lpDrv = pFnOpenDriver16(lpDriverName, lpSectionName, lParam2))) (lpDrv = pFnOpenDriver16(lpDriverName, lpSectionName, lParam)))
{ {
if (DRIVER_AddToList(lpDrv, 0, lParam2)) goto the_end; if (DRIVER_AddToList(lpDrv, 0, lParam)) goto the_end;
HeapFree(GetProcessHeap(), 0, lpDrv); HeapFree(GetProcessHeap(), 0, lpDrv);
} }
TRACE("Failed to open driver %s from system.ini file, section %s\n", debugstr_a(lpDriverName), debugstr_a(lpSectionName)); TRACE("Failed to open driver %s from system.ini file, section %s\n",
debugstr_w(lpDriverName), debugstr_w(lpSectionName));
return 0; return 0;
the_end: the_end:
...@@ -340,40 +379,6 @@ HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lPara ...@@ -340,40 +379,6 @@ HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lPara
} }
/************************************************************************** /**************************************************************************
* OpenDriver [WINMM.@]
* DrvOpen [WINMM.@]
*/
HDRVR WINAPI OpenDriverW(LPCWSTR lpDriverName, LPCWSTR lpSectionName, LPARAM 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);
HeapFree(GetProcessHeap(), 0, dn);
HeapFree(GetProcessHeap(), 0, sn);
return ret;
}
/**************************************************************************
* CloseDriver [WINMM.@] * CloseDriver [WINMM.@]
* DrvClose [WINMM.@] * DrvClose [WINMM.@]
*/ */
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "wownt32.h" #include "wownt32.h"
#include "mmddk.h" #include "mmddk.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(mcianim); WINE_DEFAULT_DEBUG_CHANNEL(mcianim);
...@@ -40,7 +41,7 @@ typedef struct { ...@@ -40,7 +41,7 @@ typedef struct {
int nUseCount; /* Incremented for each shared open */ int nUseCount; /* Incremented for each shared open */
BOOL fShareable; /* TRUE if first open was shareable */ BOOL fShareable; /* TRUE if first open was shareable */
WORD wNotifyDeviceID; /* MCI device ID with a pending notification */ WORD wNotifyDeviceID; /* MCI device ID with a pending notification */
MCI_OPEN_PARMSA openParms; MCI_OPEN_PARMSW openParms;
DWORD dwTimeFormat; DWORD dwTimeFormat;
int mode; int mode;
UINT nCurTrack; UINT nCurTrack;
...@@ -56,7 +57,7 @@ typedef struct { ...@@ -56,7 +57,7 @@ typedef struct {
/************************************************************************** /**************************************************************************
* MCIANIM_drvOpen [internal] * MCIANIM_drvOpen [internal]
*/ */
static DWORD MCIANIM_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) static DWORD MCIANIM_drvOpen(LPCWSTR str, LPMCI_OPEN_DRIVER_PARMSW modp)
{ {
WINE_MCIANIM* wma; WINE_MCIANIM* wma;
...@@ -105,7 +106,7 @@ static WINE_MCIANIM* MCIANIM_mciGetOpenDrv(UINT16 wDevID) ...@@ -105,7 +106,7 @@ static WINE_MCIANIM* MCIANIM_mciGetOpenDrv(UINT16 wDevID)
/************************************************************************** /**************************************************************************
* MCIANIM_mciOpen [internal] * MCIANIM_mciOpen [internal]
*/ */
static DWORD MCIANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpOpenParms) static DWORD MCIANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSW lpOpenParms)
{ {
DWORD dwDeviceID; DWORD dwDeviceID;
WINE_MCIANIM* wma = (WINE_MCIANIM*)mciGetDriverData(wDevID); WINE_MCIANIM* wma = (WINE_MCIANIM*)mciGetDriverData(wDevID);
...@@ -136,8 +137,8 @@ static DWORD MCIANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpO ...@@ -136,8 +137,8 @@ static DWORD MCIANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpO
/*TRACE("lpParms->wDevID=%04X\n", lpParms->wDeviceID);*/ /*TRACE("lpParms->wDevID=%04X\n", lpParms->wDeviceID);*/
if (dwFlags & MCI_OPEN_ELEMENT) { if (dwFlags & MCI_OPEN_ELEMENT) {
TRACE("MCI_OPEN_ELEMENT '%s' !\n", lpOpenParms->lpstrElementName); TRACE("MCI_OPEN_ELEMENT %s!\n", debugstr_w(lpOpenParms->lpstrElementName));
if (lpOpenParms->lpstrElementName && strlen(lpOpenParms->lpstrElementName) > 0) { if (lpOpenParms->lpstrElementName && strlenW(lpOpenParms->lpstrElementName) > 0) {
} }
FIXME("element is not opened\n"); FIXME("element is not opened\n");
} }
...@@ -343,11 +344,13 @@ static DWORD MCIANIM_CalcFrame(WINE_MCIANIM* wma, DWORD dwFormatType, DWORD dwTi ...@@ -343,11 +344,13 @@ static DWORD MCIANIM_CalcFrame(WINE_MCIANIM* wma, DWORD dwFormatType, DWORD dwTi
/************************************************************************** /**************************************************************************
* MCIANIM_mciInfo [internal] * MCIANIM_mciInfo [internal]
*/ */
static DWORD MCIANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms) static DWORD MCIANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMSW lpParms)
{ {
WINE_MCIANIM* wma = MCIANIM_mciGetOpenDrv(wDevID); WINE_MCIANIM* wma = MCIANIM_mciGetOpenDrv(wDevID);
LPCSTR str = 0; LPCWSTR str = 0;
DWORD ret = 0; DWORD ret = 0;
static const WCHAR wszAnimation[] = {'W','i','n','e','\'','s',' ','a','n','i','m','a','t','i','o','n',0};
static const WCHAR wszWindow [] = {'A','n','i','m','a','t','i','o','n',' ','W','i','n','d','o','w',0};
TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
...@@ -360,26 +363,20 @@ static DWORD MCIANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpP ...@@ -360,26 +363,20 @@ static DWORD MCIANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpP
TRACE("buf=%p, len=%lu\n", lpParms->lpstrReturn, lpParms->dwRetSize); TRACE("buf=%p, len=%lu\n", lpParms->lpstrReturn, lpParms->dwRetSize);
switch(dwFlags) { switch(dwFlags) {
case MCI_INFO_PRODUCT: case MCI_INFO_PRODUCT: str = wszAnimation; break;
str = "Wine's animation"; case MCI_INFO_FILE: str = wma->openParms.lpstrElementName; break;
break; case MCI_ANIM_INFO_TEXT: str = wszWindow; break;
case MCI_INFO_FILE:
str = wma->openParms.lpstrElementName;
break;
case MCI_ANIM_INFO_TEXT:
str = "Animation Window";
break;
default: default:
WARN("Don't know this info command (%lu)\n", dwFlags); WARN("Don't know this info command (%lu)\n", dwFlags);
return MCIERR_UNRECOGNIZED_COMMAND; return MCIERR_UNRECOGNIZED_COMMAND;
} }
if (str) { if (str) {
if (lpParms->dwRetSize <= strlen(str)) { if (lpParms->dwRetSize <= strlenW(str)) {
lstrcpynA(lpParms->lpstrReturn, str, lpParms->dwRetSize - 1); lstrcpynW(lpParms->lpstrReturn, str, lpParms->dwRetSize - 1);
ret = MCIERR_PARAM_OVERFLOW; ret = MCIERR_PARAM_OVERFLOW;
} else { } else {
strcpy(lpParms->lpstrReturn, str); strcpyW(lpParms->lpstrReturn, str);
} }
} else { } else {
*lpParms->lpstrReturn = 0; *lpParms->lpstrReturn = 0;
...@@ -658,7 +655,7 @@ LONG WINAPI MCIANIM_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, ...@@ -658,7 +655,7 @@ LONG WINAPI MCIANIM_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
switch (wMsg) { switch (wMsg) {
case DRV_LOAD: return 1; case DRV_LOAD: return 1;
case DRV_FREE: return 1; case DRV_FREE: return 1;
case DRV_OPEN: return MCIANIM_drvOpen((LPSTR)dwParam1, (LPMCI_OPEN_DRIVER_PARMSA)dwParam2); case DRV_OPEN: return MCIANIM_drvOpen((LPCWSTR)dwParam1, (LPMCI_OPEN_DRIVER_PARMSW)dwParam2);
case DRV_CLOSE: return MCIANIM_drvClose(dwDevID); case DRV_CLOSE: return MCIANIM_drvClose(dwDevID);
case DRV_ENABLE: return 1; case DRV_ENABLE: return 1;
case DRV_DISABLE: return 1; case DRV_DISABLE: return 1;
...@@ -671,10 +668,10 @@ LONG WINAPI MCIANIM_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, ...@@ -671,10 +668,10 @@ LONG WINAPI MCIANIM_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
if (dwDevID == 0xFFFFFFFF) return MCIERR_UNSUPPORTED_FUNCTION; if (dwDevID == 0xFFFFFFFF) return MCIERR_UNSUPPORTED_FUNCTION;
switch (wMsg) { switch (wMsg) {
case MCI_OPEN_DRIVER: return MCIANIM_mciOpen(dwDevID, dwParam1, (LPMCI_OPEN_PARMSA)dwParam2); case MCI_OPEN_DRIVER: return MCIANIM_mciOpen(dwDevID, dwParam1, (LPMCI_OPEN_PARMSW)dwParam2);
case MCI_CLOSE_DRIVER: return MCIANIM_mciClose(dwDevID, dwParam1, (LPMCI_GENERIC_PARMS)dwParam2); case MCI_CLOSE_DRIVER: return MCIANIM_mciClose(dwDevID, dwParam1, (LPMCI_GENERIC_PARMS)dwParam2);
case MCI_GETDEVCAPS: return MCIANIM_mciGetDevCaps(dwDevID, dwParam1, (LPMCI_GETDEVCAPS_PARMS)dwParam2); case MCI_GETDEVCAPS: return MCIANIM_mciGetDevCaps(dwDevID, dwParam1, (LPMCI_GETDEVCAPS_PARMS)dwParam2);
case MCI_INFO: return MCIANIM_mciInfo(dwDevID, dwParam1, (LPMCI_INFO_PARMSA)dwParam2); case MCI_INFO: return MCIANIM_mciInfo(dwDevID, dwParam1, (LPMCI_INFO_PARMSW)dwParam2);
case MCI_STATUS: return MCIANIM_mciStatus(dwDevID, dwParam1, (LPMCI_STATUS_PARMS)dwParam2); case MCI_STATUS: return MCIANIM_mciStatus(dwDevID, dwParam1, (LPMCI_STATUS_PARMS)dwParam2);
case MCI_SET: return MCIANIM_mciSet(dwDevID, dwParam1, (LPMCI_SET_PARMS)dwParam2); case MCI_SET: return MCIANIM_mciSet(dwDevID, dwParam1, (LPMCI_SET_PARMS)dwParam2);
case MCI_PLAY: return MCIANIM_mciPlay(dwDevID, dwParam1, (LPMCI_PLAY_PARMS)dwParam2); case MCI_PLAY: return MCIANIM_mciPlay(dwDevID, dwParam1, (LPMCI_PLAY_PARMS)dwParam2);
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <string.h> #include <string.h>
#include "private_mciavi.h" #include "private_mciavi.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(mciavi); WINE_DEFAULT_DEBUG_CHANNEL(mciavi);
...@@ -148,11 +149,12 @@ DWORD MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS l ...@@ -148,11 +149,12 @@ DWORD MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS l
/*************************************************************************** /***************************************************************************
* MCIAVI_mciInfo [internal] * MCIAVI_mciInfo [internal]
*/ */
DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSA lpParms) DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSW lpParms)
{ {
LPCSTR str = 0; LPCWSTR str = 0;
WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
DWORD ret = 0; DWORD ret = 0;
static const WCHAR wszAviPlayer[] = {'W','i','n','e','\'','s',' ','A','V','I',' ','p','l','a','y','e','r',0};
if (lpParms == NULL || lpParms->lpstrReturn == NULL) if (lpParms == NULL || lpParms->lpstrReturn == NULL)
return MCIERR_NULL_PARAMETER_BLOCK; return MCIERR_NULL_PARAMETER_BLOCK;
...@@ -163,22 +165,18 @@ DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSA lpParms) ...@@ -163,22 +165,18 @@ DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSA lpParms)
EnterCriticalSection(&wma->cs); EnterCriticalSection(&wma->cs);
switch (dwFlags) { switch (dwFlags) {
case MCI_INFO_PRODUCT: case MCI_INFO_PRODUCT: str = wszAviPlayer; break;
str = "Wine's AVI player"; case MCI_INFO_FILE: str = wma->lpFileName; break;
break;
case MCI_INFO_FILE:
str = wma->lpFileName;
break;
default: default:
WARN("Don't know this info command (%lu)\n", dwFlags); WARN("Don't know this info command (%lu)\n", dwFlags);
LeaveCriticalSection(&wma->cs); LeaveCriticalSection(&wma->cs);
return MCIERR_UNRECOGNIZED_COMMAND; return MCIERR_UNRECOGNIZED_COMMAND;
} }
if (str) { if (str) {
if (strlen(str) + 1 > lpParms->dwRetSize) { if (strlenW(str) + 1 > lpParms->dwRetSize) {
ret = MCIERR_PARAM_OVERFLOW; ret = MCIERR_PARAM_OVERFLOW;
} else { } else {
lstrcpynA(lpParms->lpstrReturn, str, lpParms->dwRetSize); lstrcpynW(lpParms->lpstrReturn, str, lpParms->dwRetSize);
} }
} else { } else {
lpParms->lpstrReturn[0] = 0; lpParms->lpstrReturn[0] = 0;
...@@ -325,7 +323,7 @@ DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms) ...@@ -325,7 +323,7 @@ DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms)
/*************************************************************************** /***************************************************************************
* MCIAVI_mciStatus [internal] * MCIAVI_mciStatus [internal]
*/ */
DWORD MCIAVI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA lpParms) DWORD MCIAVI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSW lpParms)
{ {
WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
DWORD ret = 0; DWORD ret = 0;
......
...@@ -46,7 +46,7 @@ typedef struct { ...@@ -46,7 +46,7 @@ typedef struct {
BOOL fShareable; /* TRUE if first open was shareable */ BOOL fShareable; /* TRUE if first open was shareable */
WORD wCommandTable; /* custom MCI command table */ WORD wCommandTable; /* custom MCI command table */
DWORD dwStatus; /* One of MCI_MODE_XXX */ DWORD dwStatus; /* One of MCI_MODE_XXX */
LPSTR lpFileName; LPWSTR lpFileName;
DWORD dwMciTimeFormat; /* current time format */ DWORD dwMciTimeFormat; /* current time format */
DWORD dwSet; /* what's turned on: video & audio l&r */ DWORD dwSet; /* what's turned on: video & audio l&r */
/* information on the loaded AVI file */ /* information on the loaded AVI file */
...@@ -90,9 +90,9 @@ extern HINSTANCE MCIAVI_hInstance; ...@@ -90,9 +90,9 @@ extern HINSTANCE MCIAVI_hInstance;
DWORD MCIAVI_ConvertFrameToTimeFormat(WINE_MCIAVI* wma, DWORD val, LPDWORD lpRet); DWORD MCIAVI_ConvertFrameToTimeFormat(WINE_MCIAVI* wma, DWORD val, LPDWORD lpRet);
DWORD MCIAVI_ConvertTimeFormatToFrame(WINE_MCIAVI* wma, DWORD val); DWORD MCIAVI_ConvertTimeFormatToFrame(WINE_MCIAVI* wma, DWORD val);
DWORD MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms); DWORD MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms);
DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSA lpParms); DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSW lpParms);
DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms); DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms);
DWORD MCIAVI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA lpParms); DWORD MCIAVI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSW lpParms);
/* mmoutput.c */ /* mmoutput.c */
BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma); BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma);
...@@ -108,9 +108,9 @@ DWORD MCIAVI_mciClose(UINT, DWORD, LPMCI_GENERIC_PARMS); ...@@ -108,9 +108,9 @@ DWORD MCIAVI_mciClose(UINT, DWORD, LPMCI_GENERIC_PARMS);
/* wnd.c */ /* wnd.c */
BOOL MCIAVI_RegisterClass(void); BOOL MCIAVI_RegisterClass(void);
BOOL MCIAVI_UnregisterClass(void); BOOL MCIAVI_UnregisterClass(void);
BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSA lpOpenParms); BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSW lpOpenParms);
DWORD MCIAVI_mciPut(UINT wDevID, DWORD dwFlags, LPMCI_DGV_PUT_PARMS lpParms); DWORD MCIAVI_mciPut(UINT wDevID, DWORD dwFlags, LPMCI_DGV_PUT_PARMS lpParms);
DWORD MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms); DWORD MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms);
DWORD MCIAVI_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSA lpParms); DWORD MCIAVI_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSW lpParms);
#endif /* __WINE_PRIVATE_MCIAVI_H */ #endif /* __WINE_PRIVATE_MCIAVI_H */
...@@ -85,7 +85,6 @@ static LRESULT WINAPI MCIAVI_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA ...@@ -85,7 +85,6 @@ static LRESULT WINAPI MCIAVI_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
default: default:
return DefWindowProcW(hWnd, uMsg, wParam, lParam); return DefWindowProcW(hWnd, uMsg, wParam, lParam);
} }
return 0;
} }
BOOL MCIAVI_UnregisterClass(void) BOOL MCIAVI_UnregisterClass(void)
...@@ -112,7 +111,7 @@ BOOL MCIAVI_RegisterClass(void) ...@@ -112,7 +111,7 @@ BOOL MCIAVI_RegisterClass(void)
return FALSE; return FALSE;
} }
BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSA lpOpenParms) BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSW lpOpenParms)
{ {
static const WCHAR captionW[] = {'W','i','n','e',' ','M','C','I','-','A','V','I',' ','p','l','a','y','e','r',0}; static const WCHAR captionW[] = {'W','i','n','e',' ','M','C','I','-','A','V','I',' ','p','l','a','y','e','r',0};
HWND hParent = 0; HWND hParent = 0;
...@@ -264,7 +263,7 @@ DWORD MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms) ...@@ -264,7 +263,7 @@ DWORD MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms)
/*************************************************************************** /***************************************************************************
* MCIAVI_mciWindow [internal] * MCIAVI_mciWindow [internal]
*/ */
DWORD MCIAVI_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSA lpParms) DWORD MCIAVI_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSW lpParms)
{ {
WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
...@@ -288,8 +287,8 @@ DWORD MCIAVI_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSA lpPar ...@@ -288,8 +287,8 @@ DWORD MCIAVI_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSA lpPar
ShowWindow(wma->hWndPaint, lpParms->nCmdShow); ShowWindow(wma->hWndPaint, lpParms->nCmdShow);
} }
if (dwFlags & MCI_DGV_WINDOW_TEXT) { if (dwFlags & MCI_DGV_WINDOW_TEXT) {
TRACE("Setting caption to '%s'\n", lpParms->lpstrText); TRACE("Setting caption to %s\n", debugstr_w(lpParms->lpstrText));
SetWindowTextA(wma->hWndPaint, lpParms->lpstrText); SetWindowTextW(wma->hWndPaint, lpParms->lpstrText);
} }
LeaveCriticalSection(&wma->cs); LeaveCriticalSection(&wma->cs);
......
...@@ -4,6 +4,7 @@ SRCDIR = @srcdir@ ...@@ -4,6 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = mcicda.drv MODULE = mcicda.drv
IMPORTS = winmm user32 kernel32 IMPORTS = winmm user32 kernel32
EXTRALIBS = $(LIBUNICODE)
C_SRCS = \ C_SRCS = \
mcicda.c mcicda.c
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "ntddstor.h" #include "ntddstor.h"
#include "ntddcdrm.h" #include "ntddcdrm.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(mcicda); WINE_DEFAULT_DEBUG_CHANNEL(mcicda);
...@@ -60,7 +61,7 @@ typedef struct { ...@@ -60,7 +61,7 @@ typedef struct {
/************************************************************************** /**************************************************************************
* MCICDA_drvOpen [internal] * MCICDA_drvOpen [internal]
*/ */
static DWORD MCICDA_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) static DWORD MCICDA_drvOpen(LPCWSTR str, LPMCI_OPEN_DRIVER_PARMSW modp)
{ {
WINE_MCICDAUDIO* wmcda; WINE_MCICDAUDIO* wmcda;
...@@ -264,14 +265,13 @@ static DWORD MCICDA_Stop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms ...@@ -264,14 +265,13 @@ static DWORD MCICDA_Stop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms
/************************************************************************** /**************************************************************************
* MCICDA_Open [internal] * MCICDA_Open [internal]
*/ */
static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpOpenParms) static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSW lpOpenParms)
{ {
DWORD dwDeviceID; DWORD dwDeviceID;
DWORD ret = MCIERR_HARDWARE; DWORD ret = MCIERR_HARDWARE;
WINE_MCICDAUDIO* wmcda = (WINE_MCICDAUDIO*)mciGetDriverData(wDevID); WINE_MCICDAUDIO* wmcda = (WINE_MCICDAUDIO*)mciGetDriverData(wDevID);
char root[7]; WCHAR root[7], drive = 0;
int count; int count;
char drive = 0;
TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpOpenParms); TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpOpenParms);
...@@ -297,18 +297,18 @@ static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpOpenPar ...@@ -297,18 +297,18 @@ static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpOpenPar
WARN("MCI_OPEN_ELEMENT_ID %8lx ! Abort\n", (DWORD)lpOpenParms->lpstrElementName); WARN("MCI_OPEN_ELEMENT_ID %8lx ! Abort\n", (DWORD)lpOpenParms->lpstrElementName);
return MCIERR_NO_ELEMENT_ALLOWED; return MCIERR_NO_ELEMENT_ALLOWED;
} }
TRACE("MCI_OPEN_ELEMENT element name: %s\n", debugstr_a(lpOpenParms->lpstrElementName)); TRACE("MCI_OPEN_ELEMENT element name: %s\n", debugstr_w(lpOpenParms->lpstrElementName));
if (!isalpha(lpOpenParms->lpstrElementName[0]) || lpOpenParms->lpstrElementName[1] != ':' || if (!isalpha(lpOpenParms->lpstrElementName[0]) || lpOpenParms->lpstrElementName[1] != ':' ||
(lpOpenParms->lpstrElementName[2] && lpOpenParms->lpstrElementName[2] != '\\')) (lpOpenParms->lpstrElementName[2] && lpOpenParms->lpstrElementName[2] != '\\'))
{ {
WARN("MCI_OPEN_ELEMENT unsupported format: %s\n", lpOpenParms->lpstrElementName); WARN("MCI_OPEN_ELEMENT unsupported format: %s\n",
debugstr_w(lpOpenParms->lpstrElementName));
ret = MCIERR_NO_ELEMENT_ALLOWED; ret = MCIERR_NO_ELEMENT_ALLOWED;
goto the_error; goto the_error;
} }
drive = toupper(lpOpenParms->lpstrElementName[0]); drive = toupper(lpOpenParms->lpstrElementName[0]);
strcpy(root, "A:\\"); root[0] = drive; root[1] = ':'; root[2] = '\\'; root[3] = '\0';
root[0] = drive; if (GetDriveTypeW(root) != DRIVE_CDROM)
if (GetDriveTypeA(root) != DRIVE_CDROM)
{ {
ret = MCIERR_INVALID_DEVICE_NAME; ret = MCIERR_INVALID_DEVICE_NAME;
goto the_error; goto the_error;
...@@ -317,10 +317,10 @@ static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpOpenPar ...@@ -317,10 +317,10 @@ static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpOpenPar
else else
{ {
/* drive letter isn't passed... get the dwDeviceID'th cdrom in the system */ /* drive letter isn't passed... get the dwDeviceID'th cdrom in the system */
strcpy(root, "A:\\"); root[0] = 'A'; root[1] = ':'; root[2] = '\\'; root[3] = '\0';
for (count = 0; root[0] <= 'Z'; root[0]++) for (count = 0; root[0] <= 'Z'; root[0]++)
{ {
if (GetDriveTypeA(root) == DRIVE_CDROM && ++count >= dwDeviceID) if (GetDriveTypeW(root) == DRIVE_CDROM && ++count >= dwDeviceID)
{ {
drive = root[0]; drive = root[0];
break; break;
...@@ -337,9 +337,8 @@ static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpOpenPar ...@@ -337,9 +337,8 @@ static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpOpenPar
wmcda->dwTimeFormat = MCI_FORMAT_MSF; wmcda->dwTimeFormat = MCI_FORMAT_MSF;
/* now, open the handle */ /* now, open the handle */
strcpy(root, "\\\\.\\A:"); root[0] = root[1] = '\\'; root[2] = '.'; root[3] = '\\'; root[4] = drive; root[5] = ':'; root[6] = '\0';
root[4] = drive; wmcda->handle = CreateFileW(root, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
wmcda->handle = CreateFileA(root, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
if (wmcda->handle != INVALID_HANDLE_VALUE) if (wmcda->handle != INVALID_HANDLE_VALUE)
return 0; return 0;
...@@ -462,12 +461,12 @@ static DWORD CDROM_Audio_GetSerial(CDROM_TOC* toc) ...@@ -462,12 +461,12 @@ static DWORD CDROM_Audio_GetSerial(CDROM_TOC* toc)
/************************************************************************** /**************************************************************************
* MCICDA_Info [internal] * MCICDA_Info [internal]
*/ */
static DWORD MCICDA_Info(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms) static DWORD MCICDA_Info(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSW lpParms)
{ {
LPCSTR str = NULL; LPCWSTR str = NULL;
WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID); WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID);
DWORD ret = 0; DWORD ret = 0;
char buffer[16]; WCHAR buffer[16];
TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
...@@ -478,13 +477,15 @@ static DWORD MCICDA_Info(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms) ...@@ -478,13 +477,15 @@ static DWORD MCICDA_Info(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms)
TRACE("buf=%p, len=%lu\n", lpParms->lpstrReturn, lpParms->dwRetSize); TRACE("buf=%p, len=%lu\n", lpParms->lpstrReturn, lpParms->dwRetSize);
if (dwFlags & MCI_INFO_PRODUCT) { if (dwFlags & MCI_INFO_PRODUCT) {
str = "Wine's audio CD"; static const WCHAR wszAudioCd[] = {'W','i','n','e','\'','s',' ','a','u','d','i','o',' ','C','D',0};
str = wszAudioCd;
} else if (dwFlags & MCI_INFO_MEDIA_UPC) { } else if (dwFlags & MCI_INFO_MEDIA_UPC) {
ret = MCIERR_NO_IDENTITY; ret = MCIERR_NO_IDENTITY;
} else if (dwFlags & MCI_INFO_MEDIA_IDENTITY) { } else if (dwFlags & MCI_INFO_MEDIA_IDENTITY) {
DWORD res = 0; DWORD res = 0;
CDROM_TOC toc; CDROM_TOC toc;
DWORD br; DWORD br;
static const WCHAR wszLu[] = {'%','l','u',0};
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
&toc, sizeof(toc), &br, NULL)) { &toc, sizeof(toc), &br, NULL)) {
...@@ -492,23 +493,23 @@ static DWORD MCICDA_Info(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms) ...@@ -492,23 +493,23 @@ static DWORD MCICDA_Info(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms)
} }
res = CDROM_Audio_GetSerial(&toc); res = CDROM_Audio_GetSerial(&toc);
sprintf(buffer, "%lu", res); sprintfW(buffer, wszLu, res);
str = buffer; str = buffer;
} else { } else {
WARN("Don't know this info command (%lu)\n", dwFlags); WARN("Don't know this info command (%lu)\n", dwFlags);
ret = MCIERR_UNRECOGNIZED_COMMAND; ret = MCIERR_UNRECOGNIZED_COMMAND;
} }
if (str) { if (str) {
if (lpParms->dwRetSize <= strlen(str)) { if (lpParms->dwRetSize <= strlenW(str)) {
lstrcpynA(lpParms->lpstrReturn, str, lpParms->dwRetSize - 1); lstrcpynW(lpParms->lpstrReturn, str, lpParms->dwRetSize - 1);
ret = MCIERR_PARAM_OVERFLOW; ret = MCIERR_PARAM_OVERFLOW;
} else { } else {
strcpy(lpParms->lpstrReturn, str); strcpyW(lpParms->lpstrReturn, str);
} }
} else { } else {
*lpParms->lpstrReturn = 0; *lpParms->lpstrReturn = 0;
} }
TRACE("=> %s (%ld)\n", lpParms->lpstrReturn, ret); TRACE("=> %s (%ld)\n", debugstr_w(lpParms->lpstrReturn), ret);
return ret; return ret;
} }
...@@ -992,7 +993,7 @@ LONG CALLBACK MCICDA_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, ...@@ -992,7 +993,7 @@ LONG CALLBACK MCICDA_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
switch(wMsg) { switch(wMsg) {
case DRV_LOAD: return 1; case DRV_LOAD: return 1;
case DRV_FREE: return 1; case DRV_FREE: return 1;
case DRV_OPEN: return MCICDA_drvOpen((LPSTR)dwParam1, (LPMCI_OPEN_DRIVER_PARMSA)dwParam2); case DRV_OPEN: return MCICDA_drvOpen((LPCWSTR)dwParam1, (LPMCI_OPEN_DRIVER_PARMSW)dwParam2);
case DRV_CLOSE: return MCICDA_drvClose(dwDevID); case DRV_CLOSE: return MCICDA_drvClose(dwDevID);
case DRV_ENABLE: return 1; case DRV_ENABLE: return 1;
case DRV_DISABLE: return 1; case DRV_DISABLE: return 1;
...@@ -1005,10 +1006,10 @@ LONG CALLBACK MCICDA_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, ...@@ -1005,10 +1006,10 @@ LONG CALLBACK MCICDA_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
if (dwDevID == 0xFFFFFFFF) return MCIERR_UNSUPPORTED_FUNCTION; if (dwDevID == 0xFFFFFFFF) return MCIERR_UNSUPPORTED_FUNCTION;
switch (wMsg) { switch (wMsg) {
case MCI_OPEN_DRIVER: return MCICDA_Open(dwDevID, dwParam1, (LPMCI_OPEN_PARMSA)dwParam2); case MCI_OPEN_DRIVER: return MCICDA_Open(dwDevID, dwParam1, (LPMCI_OPEN_PARMSW)dwParam2);
case MCI_CLOSE_DRIVER: return MCICDA_Close(dwDevID, dwParam1, (LPMCI_GENERIC_PARMS)dwParam2); case MCI_CLOSE_DRIVER: return MCICDA_Close(dwDevID, dwParam1, (LPMCI_GENERIC_PARMS)dwParam2);
case MCI_GETDEVCAPS: return MCICDA_GetDevCaps(dwDevID, dwParam1, (LPMCI_GETDEVCAPS_PARMS)dwParam2); case MCI_GETDEVCAPS: return MCICDA_GetDevCaps(dwDevID, dwParam1, (LPMCI_GETDEVCAPS_PARMS)dwParam2);
case MCI_INFO: return MCICDA_Info(dwDevID, dwParam1, (LPMCI_INFO_PARMSA)dwParam2); case MCI_INFO: return MCICDA_Info(dwDevID, dwParam1, (LPMCI_INFO_PARMSW)dwParam2);
case MCI_STATUS: return MCICDA_Status(dwDevID, dwParam1, (LPMCI_STATUS_PARMS)dwParam2); case MCI_STATUS: return MCICDA_Status(dwDevID, dwParam1, (LPMCI_STATUS_PARMS)dwParam2);
case MCI_SET: return MCICDA_Set(dwDevID, dwParam1, (LPMCI_SET_PARMS)dwParam2); case MCI_SET: return MCICDA_Set(dwDevID, dwParam1, (LPMCI_SET_PARMS)dwParam2);
case MCI_PLAY: return MCICDA_Play(dwDevID, dwParam1, (LPMCI_PLAY_PARMS)dwParam2); case MCI_PLAY: return MCICDA_Play(dwDevID, dwParam1, (LPMCI_PLAY_PARMS)dwParam2);
......
/* -*- tab-width: 8; c-basic-offset: 4 -*- */
/* /*
* MMIO functions * MMIO functions
* *
...@@ -221,8 +220,6 @@ static LRESULT CALLBACK mmioMemIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, ...@@ -221,8 +220,6 @@ static LRESULT CALLBACK mmioMemIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage,
FIXME("unexpected message %u\n", uMessage); FIXME("unexpected message %u\n", uMessage);
return 0; return 0;
} }
return 0;
} }
/* This array will be the entire list for most apps /* This array will be the entire list for most apps
...@@ -1351,7 +1348,7 @@ MMRESULT WINAPI mmioRenameA(LPCSTR szFileName, LPCSTR szNewFileName, ...@@ -1351,7 +1348,7 @@ MMRESULT WINAPI mmioRenameA(LPCSTR szFileName, LPCSTR szNewFileName,
/* FIXME: should we actually pass lpmmioinfo down the drain ??? /* FIXME: should we actually pass lpmmioinfo down the drain ???
* or make a copy of it because it's const ??? * or make a copy of it because it's const ???
*/ */
return send_message(ioProc, (LPMMIOINFO)lpmmioinfo, MMIOM_RENAME, return send_message(ioProc, (MMIOINFO*)lpmmioinfo, MMIOM_RENAME,
(LPARAM)szFileName, (LPARAM)szNewFileName, MMIO_PROC_32A); (LPARAM)szFileName, (LPARAM)szNewFileName, MMIO_PROC_32A);
} }
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(mmsys); WINE_DEFAULT_DEBUG_CHANNEL(mmsys);
static WINE_MMTHREAD* WINMM_GetmmThread(HANDLE16); static WINE_MMTHREAD* WINMM_GetmmThread(HANDLE16);
static LPWINE_DRIVER DRIVER_OpenDriver16(LPCSTR, LPCSTR, LPARAM); static LPWINE_DRIVER DRIVER_OpenDriver16(LPCWSTR, LPCWSTR, LPARAM);
static LRESULT DRIVER_CloseDriver16(HDRVR16, LPARAM, LPARAM); static LRESULT DRIVER_CloseDriver16(HDRVR16, LPARAM, LPARAM);
static LRESULT DRIVER_SendMessage16(HDRVR16, UINT, LPARAM, LPARAM); static LRESULT DRIVER_SendMessage16(HDRVR16, UINT, LPARAM, LPARAM);
static LRESULT MMIO_Callback16(SEGPTR, LPMMIOINFO, UINT, LPARAM, LPARAM); static LRESULT MMIO_Callback16(SEGPTR, LPMMIOINFO, UINT, LPARAM, LPARAM);
...@@ -597,7 +597,7 @@ UINT16 WINAPI mciGetDeviceID16(LPCSTR lpstrName) ...@@ -597,7 +597,7 @@ UINT16 WINAPI mciGetDeviceID16(LPCSTR lpstrName)
{ {
TRACE("(\"%s\")\n", lpstrName); TRACE("(\"%s\")\n", lpstrName);
return MCI_GetDriverFromString(lpstrName); return mciGetDeviceIDA(lpstrName);
} }
/************************************************************************** /**************************************************************************
...@@ -731,6 +731,7 @@ UINT16 WINAPI midiOutGetDevCaps16(UINT16 uDeviceID, LPMIDIOUTCAPS16 lpCaps, ...@@ -731,6 +731,7 @@ UINT16 WINAPI midiOutGetDevCaps16(UINT16 uDeviceID, LPMIDIOUTCAPS16 lpCaps,
/************************************************************************** /**************************************************************************
* midiOutGetErrorText [MMSYSTEM.203] * midiOutGetErrorText [MMSYSTEM.203]
* midiInGetErrorText [MMSYSTEM.203]
*/ */
UINT16 WINAPI midiOutGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize) UINT16 WINAPI midiOutGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize)
{ {
...@@ -949,14 +950,6 @@ UINT16 WINAPI midiInGetDevCaps16(UINT16 uDeviceID, LPMIDIINCAPS16 lpCaps, ...@@ -949,14 +950,6 @@ UINT16 WINAPI midiInGetDevCaps16(UINT16 uDeviceID, LPMIDIINCAPS16 lpCaps,
} }
/************************************************************************** /**************************************************************************
* midiInGetErrorText [MMSYSTEM.303]
*/
UINT16 WINAPI midiInGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize)
{
return midiInGetErrorTextA(uError, lpText, uSize);
}
/**************************************************************************
* midiInOpen [MMSYSTEM.304] * midiInOpen [MMSYSTEM.304]
*/ */
UINT16 WINAPI midiInOpen16(HMIDIIN16* lphMidiIn, UINT16 uDeviceID, UINT16 WINAPI midiInOpen16(HMIDIIN16* lphMidiIn, UINT16 uDeviceID,
...@@ -1238,6 +1231,7 @@ UINT16 WINAPI waveOutGetDevCaps16(UINT16 uDeviceID, ...@@ -1238,6 +1231,7 @@ UINT16 WINAPI waveOutGetDevCaps16(UINT16 uDeviceID,
/************************************************************************** /**************************************************************************
* waveOutGetErrorText [MMSYSTEM.403] * waveOutGetErrorText [MMSYSTEM.403]
* waveInGetErrorText [MMSYSTEM.403]
*/ */
UINT16 WINAPI waveOutGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize) UINT16 WINAPI waveOutGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize)
{ {
...@@ -1536,14 +1530,6 @@ UINT16 WINAPI waveInGetDevCaps16(UINT16 uDeviceID, LPWAVEINCAPS16 lpCaps, ...@@ -1536,14 +1530,6 @@ UINT16 WINAPI waveInGetDevCaps16(UINT16 uDeviceID, LPWAVEINCAPS16 lpCaps,
} }
/************************************************************************** /**************************************************************************
* waveInGetErrorText [MMSYSTEM.503]
*/
UINT16 WINAPI waveInGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize)
{
return waveInGetErrorTextA(uError, lpText, uSize);
}
/**************************************************************************
* waveInOpen [MMSYSTEM.504] * waveInOpen [MMSYSTEM.504]
*/ */
UINT16 WINAPI waveInOpen16(HWAVEIN16* lphWaveIn, UINT16 uDeviceID, UINT16 WINAPI waveInOpen16(HWAVEIN16* lphWaveIn, UINT16 uDeviceID,
...@@ -2371,30 +2357,52 @@ static WINMM_MapType DRIVER_UnMapMsg32To16(WORD wMsg, DWORD lParam1, DWORD lPara ...@@ -2371,30 +2357,52 @@ static WINMM_MapType DRIVER_UnMapMsg32To16(WORD wMsg, DWORD lParam1, DWORD lPara
* *
* Tries to load a 16 bit driver whose DLL's (module) name is lpFileName. * Tries to load a 16 bit driver whose DLL's (module) name is lpFileName.
*/ */
static LPWINE_DRIVER DRIVER_OpenDriver16(LPCSTR fn, LPCSTR sn, LPARAM lParam2) static LPWINE_DRIVER DRIVER_OpenDriver16(LPCWSTR fn, LPCWSTR sn, LPARAM lParam2)
{ {
LPWINE_DRIVER lpDrv = NULL; LPWINE_DRIVER lpDrv = NULL;
LPCSTR cause = 0; LPCSTR cause = NULL;
LPSTR fnA = NULL, snA = NULL;
unsigned len;
TRACE("(%s, %08lX);\n", debugstr_a(sn), lParam2); TRACE("(%s, %s, %08lX);\n", debugstr_w(fn), debugstr_w(sn), lParam2);
lpDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_DRIVER)); lpDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_DRIVER));
if (lpDrv == NULL) {cause = "OOM"; goto exit;} if (lpDrv == NULL) {cause = "OOM"; goto exit;}
if (fn)
{
len = WideCharToMultiByte( CP_ACP, 0, fn, -1, NULL, 0, NULL, NULL );
fnA = HeapAlloc(GetProcessHeap(), 0, len);
if (fnA == NULL) {cause = "OOM"; goto exit;}
WideCharToMultiByte( CP_ACP, 0, fn, -1, fnA, len, NULL, NULL );
}
if (sn)
{
len = WideCharToMultiByte( CP_ACP, 0, sn, -1, NULL, 0, NULL, NULL );
snA = HeapAlloc(GetProcessHeap(), 0, len);
if (snA == NULL) {cause = "OOM"; goto exit;}
WideCharToMultiByte( CP_ACP, 0, sn, -1, snA, len, NULL, NULL );
}
/* FIXME: shall we do some black magic here on sn ? /* FIXME: shall we do some black magic here on sn ?
* drivers32 => drivers * drivers32 => drivers
* mci32 => mci * mci32 => mci
* ... * ...
*/ */
lpDrv->d.d16.hDriver16 = OpenDriver16(fn, sn, lParam2); lpDrv->d.d16.hDriver16 = OpenDriver16(fnA, snA, lParam2);
if (lpDrv->d.d16.hDriver16 == 0) {cause = "Not a 16 bit driver"; goto exit;} if (lpDrv->d.d16.hDriver16 == 0) {cause = "Not a 16 bit driver"; goto exit;}
lpDrv->dwFlags = WINE_GDF_16BIT; lpDrv->dwFlags = WINE_GDF_16BIT;
TRACE("=> %p\n", lpDrv); TRACE("=> %p\n", lpDrv);
return lpDrv; return lpDrv;
exit:
exit:
HeapFree(GetProcessHeap(), 0, lpDrv); HeapFree(GetProcessHeap(), 0, lpDrv);
TRACE("Unable to load 16 bit module %s: %s\n", debugstr_a(fn), cause); HeapFree(GetProcessHeap(), 0, fnA);
HeapFree(GetProcessHeap(), 0, snA);
TRACE("Unable to load 16 bit module %s[%s]: %s\n",
debugstr_w(fn), debugstr_w(sn), cause);
return NULL; return NULL;
} }
...@@ -2614,13 +2622,43 @@ UINT16 WINAPI mciLoadCommandResource16(HINSTANCE16 hInst, LPCSTR resname, UINT16 ...@@ -2614,13 +2622,43 @@ UINT16 WINAPI mciLoadCommandResource16(HINSTANCE16 hInst, LPCSTR resname, UINT16
{ {
HRSRC16 res; HRSRC16 res;
HGLOBAL16 handle; HGLOBAL16 handle;
void *ptr; const BYTE* ptr16;
BYTE* ptr32;
unsigned pos = 0, size = 1024, len;
const char* str;
DWORD flg;
WORD eid;
UINT16 ret = MCIERR_OUT_OF_MEMORY;
if (!(res = FindResource16( hInst, resname, (LPSTR)RT_RCDATA))) return MCI_NO_COMMAND_TABLE; if (!(res = FindResource16( hInst, resname, (LPSTR)RT_RCDATA))) return MCI_NO_COMMAND_TABLE;
if (!(handle = LoadResource16( hInst, res ))) return MCI_NO_COMMAND_TABLE; if (!(handle = LoadResource16( hInst, res ))) return MCI_NO_COMMAND_TABLE;
ptr = LockResource16(handle); ptr16 = LockResource16(handle);
return MCI_SetCommandTable(ptr, type); /* converting the 16 bit resource table into a 32W one */
/* FIXME: FreeResource */ if ((ptr32 = HeapAlloc(GetProcessHeap(), 0, size)))
{
do {
str = (LPCSTR)ptr16;
ptr16 += strlen(str) + 1;
flg = *(const DWORD*)ptr16;
eid = *(const WORD*)(ptr16 + sizeof(DWORD));
ptr16 += sizeof(DWORD) + sizeof(WORD);
len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0) * sizeof(WCHAR);
if (pos + len + sizeof(DWORD) + sizeof(WORD) > size)
{
while (pos + len * sizeof(WCHAR) + sizeof(DWORD) + sizeof(WORD) > size) size += 1024;
ptr32 = HeapReAlloc(GetProcessHeap(), 0, ptr32, size);
if (!ptr32) goto the_end;
}
MultiByteToWideChar(CP_ACP, 0, str, -1, (LPWSTR)(ptr32 + pos), len / sizeof(WCHAR));
*(DWORD*)(ptr32 + pos + len) = flg;
*(WORD*)(ptr32 + pos + len + sizeof(DWORD)) = eid;
pos += len + sizeof(DWORD) + sizeof(WORD);
} while (eid != MCI_END_COMMAND_LIST);
}
the_end:
FreeResource16( handle );
if (ptr32) ret = MCI_SetCommandTable(ptr32, type);
return ret;
} }
/************************************************************************** /**************************************************************************
...@@ -2630,7 +2668,7 @@ BOOL16 WINAPI mciFreeCommandResource16(UINT16 uTable) ...@@ -2630,7 +2668,7 @@ BOOL16 WINAPI mciFreeCommandResource16(UINT16 uTable)
{ {
TRACE("(%04x)!\n", uTable); TRACE("(%04x)!\n", uTable);
return mciFreeCommandResource(uTable); return MCI_DeleteCommandTable(uTable, TRUE);
} }
/* ################################################### /* ###################################################
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
257 pascal midiStreamStop(word) midiStreamStop16 257 pascal midiStreamStop(word) midiStreamStop16
301 pascal midiInGetNumDevs() midiInGetNumDevs16 301 pascal midiInGetNumDevs() midiInGetNumDevs16
302 pascal midiInGetDevCaps(word ptr word) midiInGetDevCaps16 302 pascal midiInGetDevCaps(word ptr word) midiInGetDevCaps16
303 pascal midiInGetErrorText(word ptr word) midiInGetErrorText16 303 pascal midiInGetErrorText(word ptr word) midiOutGetErrorText16
304 pascal midiInOpen(ptr word long long long) midiInOpen16 304 pascal midiInOpen(ptr word long long long) midiInOpen16
305 pascal midiInClose(word) midiInClose16 305 pascal midiInClose(word) midiInClose16
306 pascal midiInPrepareHeader(word segptr word) midiInPrepareHeader16 306 pascal midiInPrepareHeader(word segptr word) midiInPrepareHeader16
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
421 pascal waveOutMessage(word word long long) waveOutMessage16 421 pascal waveOutMessage(word word long long) waveOutMessage16
501 pascal waveInGetNumDevs() waveInGetNumDevs16 501 pascal waveInGetNumDevs() waveInGetNumDevs16
502 pascal waveInGetDevCaps(word ptr word) waveInGetDevCaps16 502 pascal waveInGetDevCaps(word ptr word) waveInGetDevCaps16
503 pascal waveInGetErrorText(word ptr word) waveInGetErrorText16 503 pascal waveInGetErrorText(word ptr word) waveOutGetErrorText16
504 pascal waveInOpen(ptr word ptr long long long) waveInOpen16 504 pascal waveInOpen(ptr word ptr long long long) waveInOpen16
505 pascal waveInClose(word) waveInClose16 505 pascal waveInClose(word) waveInClose16
506 pascal waveInPrepareHeader(word segptr word) waveInPrepareHeader16 506 pascal waveInPrepareHeader(word segptr word) waveInPrepareHeader16
......
...@@ -87,7 +87,7 @@ typedef struct tagWINE_MM_DRIVER_PART { ...@@ -87,7 +87,7 @@ typedef struct tagWINE_MM_DRIVER_PART {
typedef struct tagWINE_MM_DRIVER { typedef struct tagWINE_MM_DRIVER {
HDRVR hDriver; HDRVR hDriver;
LPSTR drvname; /* name of the driver */ LPSTR drvname; /* name of the driver */
BOOL bIs32 : 1, /* TRUE if 32 bit driver, FALSE for 16 */ unsigned bIs32 : 1, /* TRUE if 32 bit driver, FALSE for 16 */
bIsMapper : 1; /* TRUE if mapper */ bIsMapper : 1; /* TRUE if mapper */
WINE_MM_DRIVER_PART parts[MMDRV_MAX];/* Information for all known types */ WINE_MM_DRIVER_PART parts[MMDRV_MAX];/* Information for all known types */
} WINE_MM_DRIVER, *LPWINE_MM_DRIVER; } WINE_MM_DRIVER, *LPWINE_MM_DRIVER;
...@@ -139,9 +139,9 @@ typedef struct { ...@@ -139,9 +139,9 @@ typedef struct {
typedef struct tagWINE_MCIDRIVER { typedef struct tagWINE_MCIDRIVER {
UINT wDeviceID; UINT wDeviceID;
UINT wType; UINT wType;
LPSTR lpstrElementName; LPWSTR lpstrElementName;
LPSTR lpstrDeviceType; LPWSTR lpstrDeviceType;
LPSTR lpstrAlias; LPWSTR lpstrAlias;
HDRVR hDriver; HDRVR hDriver;
DWORD dwPrivate; DWORD dwPrivate;
YIELDPROC lpfnYieldProc; YIELDPROC lpfnYieldProc;
...@@ -181,14 +181,14 @@ typedef struct tagWINE_MMIO { ...@@ -181,14 +181,14 @@ typedef struct tagWINE_MMIO {
MMIOINFO info; MMIOINFO info;
struct tagWINE_MMIO* lpNext; struct tagWINE_MMIO* lpNext;
struct IOProcList* ioProc; struct IOProcList* ioProc;
BOOL bTmpIOProc : 1, unsigned bTmpIOProc : 1,
bBufferLoaded : 1; bBufferLoaded : 1;
DWORD segBuffer16; DWORD segBuffer16;
DWORD dwFileSize; DWORD dwFileSize;
} WINE_MMIO, *LPWINE_MMIO; } WINE_MMIO, *LPWINE_MMIO;
typedef struct tagWINE_PLAYSOUND { typedef struct tagWINE_PLAYSOUND {
BOOL bLoop : 1, unsigned bLoop : 1,
bAlloc : 1; bAlloc : 1;
LPCWSTR pszSound; LPCWSTR pszSound;
HMODULE hMod; HMODULE hMod;
...@@ -223,8 +223,8 @@ typedef WINMM_MapType (*MMDRV_MAPFUNC)(UINT wMsg, LPDWORD lpdwUser, LPDW ...@@ -223,8 +223,8 @@ typedef WINMM_MapType (*MMDRV_MAPFUNC)(UINT wMsg, LPDWORD lpdwUser, LPDW
typedef WINMM_MapType (*MMDRV_UNMAPFUNC)(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT ret); typedef WINMM_MapType (*MMDRV_UNMAPFUNC)(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT ret);
LPWINE_DRIVER DRIVER_FindFromHDrvr(HDRVR hDrvr); LPWINE_DRIVER DRIVER_FindFromHDrvr(HDRVR hDrvr);
BOOL DRIVER_GetLibName(LPCSTR keyName, LPCSTR sectName, LPSTR buf, int sz); BOOL DRIVER_GetLibName(LPCWSTR keyName, LPCWSTR sectName, LPWSTR buf, int sz);
LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2); LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCWSTR fn, LPARAM lParam2);
void DRIVER_UnloadAll(void); void DRIVER_UnloadAll(void);
BOOL MMDRV_Init(void); BOOL MMDRV_Init(void);
...@@ -244,15 +244,18 @@ void MMDRV_InstallMap(unsigned int, MMDRV_MAPFUNC, MMDRV_UNMAPFUNC, ...@@ -244,15 +244,18 @@ void MMDRV_InstallMap(unsigned int, MMDRV_MAPFUNC, MMDRV_UNMAPFUNC,
MMDRV_MAPFUNC, MMDRV_UNMAPFUNC, LPDRVCALLBACK); MMDRV_MAPFUNC, MMDRV_UNMAPFUNC, LPDRVCALLBACK);
WINE_MCIDRIVER* MCI_GetDriver(UINT16 uDevID); WINE_MCIDRIVER* MCI_GetDriver(UINT16 uDevID);
UINT MCI_GetDriverFromString(LPCSTR str); UINT MCI_GetDriverFromString(LPCWSTR str);
DWORD MCI_WriteString(LPSTR lpDstStr, DWORD dstSize, LPCSTR lpSrcStr); DWORD MCI_WriteString(LPWSTR lpDstStr, DWORD dstSize, LPCWSTR lpSrcStr);
const char* MCI_MessageToString(UINT16 wMsg); const char* MCI_MessageToString(UINT wMsg);
UINT WINAPI MCI_DefYieldProc(MCIDEVICEID wDevID, DWORD data); UINT WINAPI MCI_DefYieldProc(MCIDEVICEID wDevID, DWORD data);
LRESULT MCI_CleanUp(LRESULT dwRet, UINT wMsg, DWORD dwParam2); LRESULT MCI_CleanUp(LRESULT dwRet, UINT wMsg, DWORD dwParam2);
DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2, BOOL bFrom32); DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2, BOOL bFrom32);
DWORD MCI_SendCommandFrom32(UINT wDevID, UINT16 wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2); DWORD MCI_SendCommandFrom32(UINT wDevID, UINT16 wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
DWORD MCI_SendCommandFrom16(UINT wDevID, UINT16 wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2); DWORD MCI_SendCommandFrom16(UINT wDevID, UINT16 wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
UINT MCI_SetCommandTable(void *table, UINT uDevType); UINT MCI_SetCommandTable(void *table, UINT uDevType);
BOOL MCI_DeleteCommandTable(UINT uTbl, BOOL delete);
LPWSTR MCI_strdupAtoW(LPCSTR str);
LPSTR MCI_strdupWtoA(LPCWSTR str);
BOOL WINMM_CheckForMMSystem(void); BOOL WINMM_CheckForMMSystem(void);
const char* WINMM_ErrorToString(MMRESULT error); const char* WINMM_ErrorToString(MMRESULT error);
...@@ -290,13 +293,13 @@ extern LPWINE_MM_IDATA WINMM_IData; ...@@ -290,13 +293,13 @@ extern LPWINE_MM_IDATA WINMM_IData;
* NULL otherwise * NULL otherwise
*/ */
extern WINE_MMTHREAD* (*pFnGetMMThread16)(UINT16); extern WINE_MMTHREAD* (*pFnGetMMThread16)(UINT16);
extern LPWINE_DRIVER (*pFnOpenDriver16)(LPCSTR,LPCSTR,LPARAM); extern LPWINE_DRIVER (*pFnOpenDriver16)(LPCWSTR,LPCWSTR,LPARAM);
extern LRESULT (*pFnCloseDriver16)(UINT16,LPARAM,LPARAM); extern LRESULT (*pFnCloseDriver16)(UINT16,LPARAM,LPARAM);
extern LRESULT (*pFnSendMessage16)(UINT16,UINT,LPARAM,LPARAM); extern LRESULT (*pFnSendMessage16)(UINT16,UINT,LPARAM,LPARAM);
extern WINMM_MapType (*pFnMciMapMsg16To32A)(WORD,WORD,DWORD*); extern WINMM_MapType (*pFnMciMapMsg16To32W)(WORD,WORD,DWORD*);
extern WINMM_MapType (*pFnMciUnMapMsg16To32A)(WORD,WORD,DWORD); extern WINMM_MapType (*pFnMciUnMapMsg16To32W)(WORD,WORD,DWORD);
extern WINMM_MapType (*pFnMciMapMsg32ATo16)(WORD,WORD,DWORD,DWORD*); extern WINMM_MapType (*pFnMciMapMsg32WTo16)(WORD,WORD,DWORD,DWORD*);
extern WINMM_MapType (*pFnMciUnMapMsg32ATo16)(WORD,WORD,DWORD,DWORD); extern WINMM_MapType (*pFnMciUnMapMsg32WTo16)(WORD,WORD,DWORD,DWORD);
extern LRESULT (*pFnCallMMDrvFunc16)(DWORD /* in fact FARPROC16 */,WORD,WORD,LONG,LONG,LONG); extern LRESULT (*pFnCallMMDrvFunc16)(DWORD /* in fact FARPROC16 */,WORD,WORD,LONG,LONG,LONG);
extern unsigned (*pFnLoadMMDrvFunc16)(LPCSTR,LPWINE_DRIVER, LPWINE_MM_DRIVER); extern unsigned (*pFnLoadMMDrvFunc16)(LPCSTR,LPWINE_DRIVER, LPWINE_MM_DRIVER);
extern LRESULT (*pFnMmioCallback16)(DWORD,LPMMIOINFO,UINT,LPARAM,LPARAM); extern LRESULT (*pFnMmioCallback16)(DWORD,LPMMIOINFO,UINT,LPARAM,LPARAM);
......
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
@ stdcall DrvClose(long long long) CloseDriver @ stdcall DrvClose(long long long) CloseDriver
@ stdcall DrvDefDriverProc(long long long long long) DefDriverProc @ stdcall DrvDefDriverProc(long long long long long) DefDriverProc
@ stdcall DrvGetModuleHandle(long) GetDriverModuleHandle @ stdcall DrvGetModuleHandle(long) GetDriverModuleHandle
@ stdcall DrvOpen(wstr wstr long) OpenDriverW @ stdcall DrvOpen(wstr wstr long) OpenDriver
@ stdcall DrvOpenA(str str long) OpenDriverA @ stdcall DrvOpenA(str str long) OpenDriverA
@ stdcall DrvSendMessage(long long long long) SendDriverMessage @ stdcall DrvSendMessage(long long long long) SendDriverMessage
@ stdcall GetDriverFlags(long) @ stdcall GetDriverFlags(long)
@ stdcall GetDriverModuleHandle(long) @ stdcall GetDriverModuleHandle(long)
@ stdcall OpenDriver(wstr wstr long) OpenDriverW @ stdcall OpenDriver(wstr wstr long)
@ stdcall OpenDriverA(str str long) @ stdcall OpenDriverA(str str long)
@ stdcall PlaySound(ptr long long) PlaySoundA @ stdcall PlaySound(ptr long long) PlaySoundA
@ stdcall PlaySoundW(ptr long long) @ stdcall PlaySoundW(ptr long long)
...@@ -42,8 +42,9 @@ ...@@ -42,8 +42,9 @@
@ stdcall mciFreeCommandResource(long) @ stdcall mciFreeCommandResource(long)
@ stdcall mciGetCreatorTask(long) @ stdcall mciGetCreatorTask(long)
@ stdcall mciGetDeviceIDA(str) @ stdcall mciGetDeviceIDA(str)
@ stdcall mciGetDeviceIDFromElementIDW(long str) @ stdcall mciGetDeviceIDW(wstr)
@ stdcall mciGetDeviceIDW(str) @ stdcall mciGetDeviceIDFromElementIDA(long str)
@ stdcall mciGetDeviceIDFromElementIDW(long wstr)
@ stdcall mciGetDriverData(long) @ stdcall mciGetDriverData(long)
@ stdcall mciGetErrorStringA(long ptr long) @ stdcall mciGetErrorStringA(long ptr long)
@ stdcall mciGetErrorStringW(long ptr long) @ stdcall mciGetErrorStringW(long ptr long)
...@@ -61,8 +62,8 @@ ...@@ -61,8 +62,8 @@
@ stdcall midiInClose(long) @ stdcall midiInClose(long)
@ stdcall midiInGetDevCapsA(long ptr long) @ stdcall midiInGetDevCapsA(long ptr long)
@ stdcall midiInGetDevCapsW(long ptr long) @ stdcall midiInGetDevCapsW(long ptr long)
@ stdcall midiInGetErrorTextA(long ptr long) @ stdcall midiInGetErrorTextA(long ptr long) midiOutGetErrorTextA
@ stdcall midiInGetErrorTextW(long ptr long) @ stdcall midiInGetErrorTextW(long ptr long) midiOutGetErrorTextW
@ stdcall midiInGetID(long ptr) @ stdcall midiInGetID(long ptr)
@ stdcall midiInGetNumDevs() @ stdcall midiInGetNumDevs()
@ stdcall midiInMessage(long long long long) @ stdcall midiInMessage(long long long long)
...@@ -153,8 +154,8 @@ ...@@ -153,8 +154,8 @@
@ stdcall waveInClose(long) @ stdcall waveInClose(long)
@ stdcall waveInGetDevCapsA(long ptr long) @ stdcall waveInGetDevCapsA(long ptr long)
@ stdcall waveInGetDevCapsW(long ptr long) @ stdcall waveInGetDevCapsW(long ptr long)
@ stdcall waveInGetErrorTextA(long ptr long) @ stdcall waveInGetErrorTextA(long ptr long) waveOutGetErrorTextA
@ stdcall waveInGetErrorTextW(long ptr long) @ stdcall waveInGetErrorTextW(long ptr long) waveOutGetErrorTextW
@ stdcall waveInGetID(long ptr) @ stdcall waveInGetID(long ptr)
@ stdcall waveInGetNumDevs() @ stdcall waveInGetNumDevs()
@ stdcall waveInGetPosition(long ptr long) @ stdcall waveInGetPosition(long ptr long)
...@@ -188,3 +189,23 @@ ...@@ -188,3 +189,23 @@
@ stdcall waveOutSetVolume(long long) @ stdcall waveOutSetVolume(long long)
@ stdcall waveOutUnprepareHeader(long ptr long) @ stdcall waveOutUnprepareHeader(long ptr long)
@ stdcall waveOutWrite(long ptr long) @ stdcall waveOutWrite(long ptr long)
# MigrateAllDrivers
# MigrateSoundEvents
# NotifyCallbackData
# WOW32DriverCallback
# WOW32ResolveMultiMediaHandle
# WOWAppExit
# WinmmLogoff
# WinmmLogon
# mid32Message
# mmDrvInstall
# aux32Message
# joy32Message
# mci32Message
# mod32Message
# mxd32Message
# tid32Message
# wid32Message
# winmmDbgOut
# winmmSetDebugLevel
# wod32Message
...@@ -1649,15 +1649,19 @@ MMRESULT WINAPI mmioCreateChunk(HMMIO,MMCKINFO*,UINT); ...@@ -1649,15 +1649,19 @@ MMRESULT WINAPI mmioCreateChunk(HMMIO,MMCKINFO*,UINT);
typedef UINT (CALLBACK *YIELDPROC)(MCIDEVICEID,DWORD); typedef UINT (CALLBACK *YIELDPROC)(MCIDEVICEID,DWORD);
BOOL WINAPI mciExecute(LPCSTR);
DWORD WINAPI mciSendCommandA(MCIDEVICEID,UINT,DWORD_PTR,DWORD_PTR); DWORD WINAPI mciSendCommandA(MCIDEVICEID,UINT,DWORD_PTR,DWORD_PTR);
DWORD WINAPI mciSendCommandW(MCIDEVICEID,UINT,DWORD_PTR,DWORD_PTR); DWORD WINAPI mciSendCommandW(MCIDEVICEID,UINT,DWORD_PTR,DWORD_PTR);
#define mciSendCommand WINELIB_NAME_AW(mciSendCommand) #define mciSendCommand WINELIB_NAME_AW(mciSendCommand)
DWORD WINAPI mciSendStringA(LPCSTR,LPSTR,UINT,HWND); DWORD WINAPI mciSendStringA(LPCSTR,LPSTR,UINT,HWND);
DWORD WINAPI mciSendStringW(LPCWSTR,LPWSTR,UINT,HWND); DWORD WINAPI mciSendStringW(LPCWSTR,LPWSTR,UINT,HWND);
#define mciSendString WINELIB_NAME_AW(mciSendString) #define mciSendString WINELIB_NAME_AW(mciSendString)
UINT WINAPI mciGetDeviceIDA(LPCSTR); MCIDEVICEID WINAPI mciGetDeviceIDA(LPCSTR);
UINT WINAPI mciGetDeviceIDW(LPCWSTR); MCIDEVICEID WINAPI mciGetDeviceIDW(LPCWSTR);
#define mciGetDeviceID WINELIB_NAME_AW(mciGetDeviceID) #define mciGetDeviceID WINELIB_NAME_AW(mciGetDeviceID)
MCIDEVICEID WINAPI mciGetDeviceIDFromElementIDA(DWORD,LPCSTR);
MCIDEVICEID WINAPI mciGetDeviceIDFromElementIDW(DWORD,LPCWSTR);
#define mciGetDeviceIDFromElementID WINELIB_NAME_AW(mciGetDeviceIDFromElementID)
BOOL WINAPI mciGetErrorStringA(MCIERROR,LPSTR,UINT); BOOL WINAPI mciGetErrorStringA(MCIERROR,LPSTR,UINT);
BOOL WINAPI mciGetErrorStringW(MCIERROR,LPWSTR,UINT); BOOL WINAPI mciGetErrorStringW(MCIERROR,LPWSTR,UINT);
#define mciGetErrorString WINELIB_NAME_AW(mciGetErrorString) #define mciGetErrorString WINELIB_NAME_AW(mciGetErrorString)
...@@ -1978,7 +1982,7 @@ typedef struct tagMCI_INFO_PARMSA { ...@@ -1978,7 +1982,7 @@ typedef struct tagMCI_INFO_PARMSA {
typedef struct tagMCI_INFO_PARMSW { typedef struct tagMCI_INFO_PARMSW {
DWORD_PTR dwCallback; DWORD_PTR dwCallback;
LPSTR lpstrReturn; LPWSTR lpstrReturn;
DWORD dwRetSize; DWORD dwRetSize;
} MCI_INFO_PARMSW, *LPMCI_INFO_PARMSW; } MCI_INFO_PARMSW, *LPMCI_INFO_PARMSW;
...@@ -1991,7 +1995,7 @@ typedef struct tagMCI_GETDEVCAPS_PARMS { ...@@ -1991,7 +1995,7 @@ typedef struct tagMCI_GETDEVCAPS_PARMS {
DWORD dwItem; DWORD dwItem;
} MCI_GETDEVCAPS_PARMS, *LPMCI_GETDEVCAPS_PARMS; } MCI_GETDEVCAPS_PARMS, *LPMCI_GETDEVCAPS_PARMS;
typedef struct tagMCI_GETDEVCAPS_PARMSA { typedef struct tagMCI_SYSINFO_PARMSA {
DWORD_PTR dwCallback; DWORD_PTR dwCallback;
LPSTR lpstrReturn; LPSTR lpstrReturn;
DWORD dwRetSize; DWORD dwRetSize;
...@@ -1999,7 +2003,7 @@ typedef struct tagMCI_GETDEVCAPS_PARMSA { ...@@ -1999,7 +2003,7 @@ typedef struct tagMCI_GETDEVCAPS_PARMSA {
UINT wDeviceType; UINT wDeviceType;
} MCI_SYSINFO_PARMSA, *LPMCI_SYSINFO_PARMSA; } MCI_SYSINFO_PARMSA, *LPMCI_SYSINFO_PARMSA;
typedef struct tagMCI_GETDEVCAPS_PARMSW { typedef struct tagMCI_SYSINFO_PARMSW {
DWORD_PTR dwCallback; DWORD_PTR dwCallback;
LPWSTR lpstrReturn; LPWSTR lpstrReturn;
DWORD dwRetSize; DWORD dwRetSize;
...@@ -2023,15 +2027,31 @@ typedef struct tagMCI_BREAK_PARMS { ...@@ -2023,15 +2027,31 @@ typedef struct tagMCI_BREAK_PARMS {
} MCI_BREAK_PARMS, *LPMCI_BREAK_PARMS; } MCI_BREAK_PARMS, *LPMCI_BREAK_PARMS;
typedef struct tagMCI_SOUND_PARMS { typedef struct tagMCI_SOUND_PARMSA {
DWORD_PTR dwCallback; DWORD_PTR dwCallback;
LPCSTR lpstrSoundName; LPCSTR lpstrSoundName;
} MCI_SOUND_PARMS, *LPMCI_SOUND_PARMS; } MCI_SOUND_PARMSA, *LPMCI_SOUND_PARMSA;
typedef struct tagMCI_SOUND_PARMSW {
DWORD_PTR dwCallback;
LPCWSTR lpstrSoundName;
} MCI_SOUND_PARMSW, *LPMCI_SOUND_PARMSW;
DECL_WINELIB_TYPE_AW(MCI_SOUND_PARMS);
DECL_WINELIB_TYPE_AW(LPMCI_SOUND_PARMS);
typedef struct tagMCI_SAVE_PARMS { typedef struct tagMCI_SAVE_PARMSA {
DWORD_PTR dwCallback; DWORD_PTR dwCallback;
LPCSTR lpfilename; LPCSTR lpfilename;
} MCI_SAVE_PARMS, *LPMCI_SAVE_PARMS; } MCI_SAVE_PARMSA, *LPMCI_SAVE_PARMSA;
typedef struct tagMCI_SAVE_PARMSW {
DWORD_PTR dwCallback;
LPCWSTR lpfilename;
} MCI_SAVE_PARMSW, *LPMCI_SAVE_PARMSW;
DECL_WINELIB_TYPE_AW(MCI_SAVE_PARMS);
DECL_WINELIB_TYPE_AW(LPMCI_SAVE_PARMS);
typedef struct tagMCI_LOAD_PARMSA { typedef struct tagMCI_LOAD_PARMSA {
DWORD_PTR dwCallback; DWORD_PTR dwCallback;
......
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