Added support for MCI AVI driver

Added some fixes mixer functions
Fixed MCI string comparison (thanks to Lionel ULMER)
No longer using 16 bit USER functions (use their 32 bit counter part)
Reindenting.
Added function sndPlaySound32W
This commit is contained in:
Eric Pouech 1999-02-13 12:38:09 +00:00 committed by Alexandre Julliard
parent 6ccda0d582
commit c11b167f62
12 changed files with 1039 additions and 602 deletions

View File

@ -73,88 +73,90 @@
#define dbch_local 65
#define dbch_mci 66
#define dbch_mcianim 67
#define dbch_mcimidi 68
#define dbch_mciwave 69
#define dbch_mdi 70
#define dbch_menu 71
#define dbch_message 72
#define dbch_metafile 73
#define dbch_midi 74
#define dbch_mmaux 75
#define dbch_mmio 76
#define dbch_mmsys 77
#define dbch_mmtime 78
#define dbch_module 79
#define dbch_monthcal 80
#define dbch_mpr 81
#define dbch_msacm 82
#define dbch_msg 83
#define dbch_msvideo 84
#define dbch_nativefont 85
#define dbch_nonclient 86
#define dbch_ntdll 87
#define dbch_ole 88
#define dbch_pager 89
#define dbch_palette 90
#define dbch_pidl 91
#define dbch_print 92
#define dbch_process 93
#define dbch_profile 94
#define dbch_progress 95
#define dbch_prop 96
#define dbch_propsheet 97
#define dbch_psapi 98
#define dbch_psdrv 99
#define dbch_ras 100
#define dbch_rebar 101
#define dbch_reg 102
#define dbch_region 103
#define dbch_relay 104
#define dbch_resource 105
#define dbch_scroll 106
#define dbch_security 107
#define dbch_segment 108
#define dbch_selector 109
#define dbch_sem 110
#define dbch_sendmsg 111
#define dbch_server 112
#define dbch_shell 113
#define dbch_shm 114
#define dbch_snoop 115
#define dbch_sound 116
#define dbch_static 117
#define dbch_statusbar 118
#define dbch_stress 119
#define dbch_string 120
#define dbch_syscolor 121
#define dbch_system 122
#define dbch_tab 123
#define dbch_task 124
#define dbch_text 125
#define dbch_thread 126
#define dbch_thunk 127
#define dbch_timer 128
#define dbch_toolbar 129
#define dbch_toolhelp 130
#define dbch_tooltips 131
#define dbch_trackbar 132
#define dbch_treeview 133
#define dbch_ttydrv 134
#define dbch_tweak 135
#define dbch_uitools 136
#define dbch_updown 137
#define dbch_ver 138
#define dbch_virtual 139
#define dbch_vxd 140
#define dbch_wave 141
#define dbch_win 142
#define dbch_win16drv 143
#define dbch_win32 144
#define dbch_wing 145
#define dbch_winsock 146
#define dbch_wnet 147
#define dbch_x11 148
#define dbch_x11drv 149
#define dbch_mciavi 68
#define dbch_mcimidi 69
#define dbch_mciwave 70
#define dbch_mdi 71
#define dbch_menu 72
#define dbch_message 73
#define dbch_metafile 74
#define dbch_midi 75
#define dbch_mmaux 76
#define dbch_mmio 77
#define dbch_mmsys 78
#define dbch_mmtime 79
#define dbch_module 80
#define dbch_monthcal 81
#define dbch_mpr 82
#define dbch_msacm 83
#define dbch_msg 84
#define dbch_msvideo 85
#define dbch_nativefont 86
#define dbch_nonclient 87
#define dbch_ntdll 88
#define dbch_ole 89
#define dbch_pager 90
#define dbch_palette 91
#define dbch_pidl 92
#define dbch_print 93
#define dbch_process 94
#define dbch_profile 95
#define dbch_progress 96
#define dbch_prop 97
#define dbch_propsheet 98
#define dbch_psapi 99
#define dbch_psdrv 100
#define dbch_ras 101
#define dbch_rebar 102
#define dbch_reg 103
#define dbch_region 104
#define dbch_relay 105
#define dbch_resource 106
#define dbch_scroll 107
#define dbch_security 108
#define dbch_segment 109
#define dbch_selector 110
#define dbch_sem 111
#define dbch_sendmsg 112
#define dbch_server 113
#define dbch_shell 114
#define dbch_shm 115
#define dbch_snoop 116
#define dbch_sound 117
#define dbch_static 118
#define dbch_statusbar 119
#define dbch_stress 120
#define dbch_string 121
#define dbch_syscolor 122
#define dbch_system 123
#define dbch_tab 124
#define dbch_task 125
#define dbch_text 126
#define dbch_thread 127
#define dbch_thunk 128
#define dbch_timer 129
#define dbch_toolbar 130
#define dbch_toolhelp 131
#define dbch_tooltips 132
#define dbch_trackbar 133
#define dbch_treeview 134
#define dbch_ttydrv 135
#define dbch_tweak 136
#define dbch_uitools 137
#define dbch_unknown 138
#define dbch_updown 139
#define dbch_ver 140
#define dbch_virtual 141
#define dbch_vxd 142
#define dbch_wave 143
#define dbch_win 144
#define dbch_win16drv 145
#define dbch_win32 146
#define dbch_wing 147
#define dbch_winsock 148
#define dbch_wnet 149
#define dbch_x11 150
#define dbch_x11drv 151
/* Definitions for classes identifiers */
#define dbcl_fixme 0
#define dbcl_err 1

View File

@ -4,7 +4,7 @@
#include "debugtools.h"
#endif
#define DEBUG_CHANNEL_COUNT 150
#define DEBUG_CHANNEL_COUNT 152
#ifdef DEBUG_RUNTIME
short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0},
@ -157,6 +157,8 @@ short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
};
const char* debug_ch_name[] = {
"accel",
@ -227,6 +229,7 @@ const char* debug_ch_name[] = {
"local",
"mci",
"mcianim",
"mciavi",
"mcimidi",
"mciwave",
"mdi",
@ -296,6 +299,7 @@ const char* debug_ch_name[] = {
"ttydrv",
"tweak",
"uitools",
"unknown",
"updown",
"ver",
"virtual",

View File

@ -18,7 +18,6 @@
* a good way to do so.
*/
#define MAX_MIDIOUTDRV (16)
#define MAX_MCIMIDIDRV (1)
#if defined(HAVE_SYS_SOUNDCARD_H)
# include <sys/soundcard.h>
@ -81,5 +80,7 @@ LONG MCICDAUDIO_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
DWORD dwParam1, DWORD dwParam2);
LONG MCIANIM_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
DWORD dwParam1, DWORD dwParam2);
LONG MCIAVI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
DWORD dwParam1, DWORD dwParam2);
#endif /* __WINE_MULTIMEDIA_H */

View File

@ -12,6 +12,7 @@ C_SRCS = \
init.c \
joystick.c \
mcianim.c \
mciavi.c \
mcicda.c \
mcimidi.c \
mcistring.c \

View File

@ -597,7 +597,7 @@ LONG MCIANIM_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
case DRV_ENABLE: return 1;
case DRV_DISABLE: return 1;
case DRV_QUERYCONFIGURE: return 1;
case DRV_CONFIGURE: MessageBox16(0, "Sample MultiMedia Linux Driver !", "MMLinux Driver", MB_OK); return 1;
case DRV_CONFIGURE: MessageBox32A(0, "Sample MultiMedia Linux Driver !", "MMLinux Driver", MB_OK); return 1;
case DRV_INSTALL: return DRVCNF_RESTART;
case DRV_REMOVE: return DRVCNF_RESTART;

316
multimedia/mciavi.c Normal file
View File

@ -0,0 +1,316 @@
/*
* Digital video MCI Wine Driver
*
* Copyright 1999 Eric POUECH
*/
#include "wine/winuser16.h"
#include "multimedia.h"
#include "user.h"
#include "driver.h"
#include "xmalloc.h"
#include "debug.h"
#include "callback.h"
#include "options.h"
typedef struct {
int nUseCount; /* Incremented for each shared open */
BOOL16 fShareable; /* TRUE if first open was shareable */
WORD wNotifyDeviceID; /* MCI device ID with a pending notification */
HANDLE16 hCallback; /* Callback handle for pending notification */
HMMIO32 hFile; /* mmio file handle open as Element */
MCI_OPEN_PARMS32A openParms;
DWORD dwTimeFormat;
} WINE_MCIAVI;
#define MAX_MCIAVIDRV (1)
static WINE_MCIAVI MCIAviDev[MAX_MCIAVIDRV];
/*======================================================================*
* MCI AVI implemantation *
*======================================================================*/
/**************************************************************************
* AVI_mciGetOpenDev [internal]
*/
static WINE_MCIAVI* AVI_mciGetOpenDev(UINT16 wDevID)
{
if (wDevID >= MAX_MCIAVIDRV || MCIAviDev[wDevID].nUseCount == 0) {
WARN(mciavi, "Invalid wDevID=%u\n", wDevID);
return 0;
}
return &MCIAviDev[wDevID];
}
static DWORD AVI_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms);
static DWORD AVI_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS32A lpParms)
{
WINE_MCIAVI* wma;
TRACE(mciavi, "(%04x, %08lX, %p) : semi-stub\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if (wDevID > MAX_MCIAVIDRV) return MCIERR_INVALID_DEVICE_ID;
wma = &MCIAviDev[wDevID];
if (wma->nUseCount > 0) {
/* The driver is already open on this channel */
/* If the driver was opened shareable before and this open specifies */
/* shareable then increment the use count */
if (wma->fShareable && (dwFlags & MCI_OPEN_SHAREABLE))
++wma->nUseCount;
else
return MCIERR_MUST_USE_SHAREABLE;
} else {
wma->nUseCount = 1;
wma->fShareable = dwFlags & MCI_OPEN_SHAREABLE;
}
if (dwFlags & MCI_OPEN_ELEMENT) {
TRACE(cdaudio,"MCI_OPEN_ELEMENT !\n");
/* return MCIERR_NO_ELEMENT_ALLOWED; */
}
wma->openParms.dwCallback = lpParms->dwCallback;
wma->openParms.wDeviceID = (WORD)lpParms->wDeviceID;
wma->openParms.lpstrDeviceType = lpParms->lpstrDeviceType;
wma->openParms.lpstrElementName = lpParms->lpstrElementName;
wma->openParms.lpstrAlias = lpParms->lpstrAlias;
wma->wNotifyDeviceID = lpParms->wDeviceID;
/* FIXME: do real open */
/* wmcda->mciMode = MCI_MODE_STOP; */
wma->dwTimeFormat = MCI_FORMAT_TMSF;
return 0;
}
static DWORD AVI_mciClose(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{
WINE_MCIAVI* wma = AVI_mciGetOpenDev(wDevID);
TRACE(mciavi, "(%04x, %08lX, %p) : semi-stub\n", wDevID, dwFlags, lpParms);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
if (wma->nUseCount == 1) {
AVI_mciStop(wDevID, 0, NULL);
/* FIXME: do real closing */
}
wma->nUseCount--;
return 0;
}
static DWORD AVI_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
{
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
return 0;
}
static DWORD AVI_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpParms)
{
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
return 0;
}
static DWORD AVI_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
return 0;
}
static DWORD AVI_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
{
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
return 0;
}
static DWORD AVI_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
return 0;
}
static DWORD AVI_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
return 0;
}
static DWORD AVI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
{
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
return 0;
}
static DWORD AVI_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms)
{
WINE_MCIAVI* wmm = AVI_mciGetOpenDev(wDevID);
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if (wmm == NULL) return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_GETDEVCAPS_ITEM) {
switch (lpParms->dwItem) {
case MCI_GETDEVCAPS_DEVICE_TYPE:
TRACE(mciavi, "MCI_GETDEVCAPS_DEVICE_TYPE !\n");
lpParms->dwReturn = MCI_DEVTYPE_DIGITAL_VIDEO;
break;
case MCI_GETDEVCAPS_HAS_AUDIO:
TRACE(mciavi, "MCI_GETDEVCAPS_HAS_AUDIO !\n");
lpParms->dwReturn = TRUE;
break;
case MCI_GETDEVCAPS_HAS_VIDEO:
TRACE(mciavi, "MCI_GETDEVCAPS_HAS_VIDEO !\n");
lpParms->dwReturn = TRUE;
break;
case MCI_GETDEVCAPS_USES_FILES:
TRACE(mciavi, "MCI_GETDEVCAPS_USES_FILES !\n");
lpParms->dwReturn = TRUE;
break;
case MCI_GETDEVCAPS_COMPOUND_DEVICE:
TRACE(mciavi, "MCI_GETDEVCAPS_COMPOUND_DEVICE !\n");
lpParms->dwReturn = TRUE;
break;
case MCI_GETDEVCAPS_CAN_EJECT:
TRACE(mciavi, "MCI_GETDEVCAPS_CAN_EJECT !\n");
lpParms->dwReturn = FALSE;
break;
case MCI_GETDEVCAPS_CAN_PLAY:
TRACE(mciavi, "MCI_GETDEVCAPS_CAN_PLAY !\n");
lpParms->dwReturn = TRUE;
break;
case MCI_GETDEVCAPS_CAN_RECORD:
TRACE(mciavi, "MCI_GETDEVCAPS_CAN_RECORD !\n");
lpParms->dwReturn = FALSE;
break;
case MCI_GETDEVCAPS_CAN_SAVE:
TRACE(mciavi, "MCI_GETDEVCAPS_CAN_SAVE !\n");
lpParms->dwReturn = FALSE;
break;
default:
TRACE(mciavi, "Unknown capability (%08lx) !\n", lpParms->dwItem);
return MCIERR_UNRECOGNIZED_COMMAND;
}
} else {
TRACE(mciavi, "No GetDevCaps-Item !\n");
return MCIERR_UNRECOGNIZED_COMMAND;
}
return 0;
}
static DWORD AVI_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS32A lpParms)
{
DWORD ret = 0;
LPSTR str = 0;
WINE_MCIAVI* wma = AVI_mciGetOpenDev(wDevID);
TRACE(mciavi, "(%04X, %08lX, %p) : stub;\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL || lpParms->lpstrReturn == NULL) {
ret = MCIERR_NULL_PARAMETER_BLOCK;
} else if (wma == NULL) {
ret = MCIERR_INVALID_DEVICE_ID;
} else {
TRACE(mciavi, "buf=%p, len=%lu\n", lpParms->lpstrReturn, lpParms->dwRetSize);
switch (dwFlags) {
case MCI_INFO_PRODUCT:
str = "Wine's AVI player";
break;
case MCI_INFO_FILE:
str = "";
break;
#if 0
/* FIXME: the following manifest constants are not defined in <WINE>/include/mmsystem.h */
case MCI_INFO_COPYRIGHT:
break;
case MCI_INFO_NAME:
break;
#endif
default:
WARN(mciavi, "Don't know this info command (%lu)\n", dwFlags);
ret = MCIERR_UNRECOGNIZED_COMMAND;
}
}
if (str) {
ret = MCI_WriteString(lpParms->lpstrReturn, lpParms->dwRetSize, str);
} else {
lpParms->lpstrReturn[0] = 0;
}
return ret;
}
static DWORD AVI_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
{
TRACE(mciavi, "(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms);
return 0;
}
/*======================================================================*
* MCI AVI entry points *
*======================================================================*/
/**************************************************************************
* MCIAVI_DriverProc32 [sample driver]
*/
LONG WINAPI MCIAVI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{
switch (wMsg) {
case DRV_LOAD: return 1;
case DRV_FREE: return 1;
case DRV_OPEN: return 1;
case DRV_CLOSE: return 1;
case DRV_ENABLE: return 1;
case DRV_DISABLE: return 1;
case DRV_QUERYCONFIGURE: return 1;
case DRV_CONFIGURE: MessageBox32A(0, "Sample AVI Wine Driver !", "MM-Wine Driver", MB_OK); return 1;
case DRV_INSTALL: return DRVCNF_RESTART;
case DRV_REMOVE: return DRVCNF_RESTART;
case MCI_OPEN_DRIVER: return AVI_mciOpen (dwDevID, dwParam1, (LPMCI_OPEN_PARMS32A) dwParam2);
case MCI_CLOSE_DRIVER: return AVI_mciClose (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2);
case MCI_PLAY: return AVI_mciPlay (dwDevID, dwParam1, (LPMCI_PLAY_PARMS) dwParam2);
case MCI_RECORD: return AVI_mciRecord (dwDevID, dwParam1, (LPMCI_RECORD_PARMS) dwParam2);
case MCI_STOP: return AVI_mciStop (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2);
case MCI_SET: return AVI_mciSet (dwDevID, dwParam1, (LPMCI_SET_PARMS) dwParam2);
case MCI_PAUSE: return AVI_mciPause (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2);
case MCI_RESUME: return AVI_mciResume (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2);
case MCI_STATUS: return AVI_mciStatus (dwDevID, dwParam1, (LPMCI_STATUS_PARMS) dwParam2);
case MCI_GETDEVCAPS: return AVI_mciGetDevCaps(dwDevID, dwParam1, (LPMCI_GETDEVCAPS_PARMS)dwParam2);
case MCI_INFO: return AVI_mciInfo (dwDevID, dwParam1, (LPMCI_INFO_PARMS32A) dwParam2);
case MCI_SEEK: return AVI_mciSeek (dwDevID, dwParam1, (LPMCI_SEEK_PARMS) dwParam2);
case MCI_LOAD:
case MCI_SAVE:
case MCI_FREEZE:
case MCI_PUT:
case MCI_REALIZE:
case MCI_UNFREEZE:
case MCI_UPDATE:
case MCI_WHERE:
case MCI_WINDOW:
case MCI_STEP:
case MCI_SPIN:
case MCI_ESCAPE:
case MCI_COPY:
case MCI_CUT:
case MCI_DELETE:
case MCI_PASTE:
WARN(mciavi, "Unsupported command=%s\n", MCI_CommandToString(wMsg));
break;
case MCI_OPEN:
case MCI_CLOSE:
FIXME(mciavi, "Shouldn't receive a MCI_OPEN or CLOSE message\n");
break;
default:
TRACE(mciavi, "Sending msg=%s to default driver proc\n", MCI_CommandToString(wMsg));
return DefDriverProc32(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
}
return MCIERR_UNRECOGNIZED_COMMAND;
}

View File

@ -65,6 +65,7 @@ typedef struct {
DWORD dwStartTicks;
} WINE_MCIMIDI;
#define MAX_MCIMIDIDRV (1)
static WINE_MCIMIDI MCIMidiDev[MAX_MCIMIDIDRV];
/*======================================================================*
@ -1470,7 +1471,7 @@ static DWORD MIDI_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms
/**************************************************************************
* MCIMIDI_DriverProc32 [sample driver]
*/
LONG MCIMIDI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
LONG WINAPI MCIMIDI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{
switch (wMsg) {
@ -1481,7 +1482,7 @@ LONG MCIMIDI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
case DRV_ENABLE: return 1;
case DRV_DISABLE: return 1;
case DRV_QUERYCONFIGURE: return 1;
case DRV_CONFIGURE: MessageBox16(0, "Sample Midi Linux Driver !", "MMLinux Driver", MB_OK); return 1;
case DRV_CONFIGURE: MessageBox32A(0, "Sample Midi Linux Driver !", "MMLinux Driver", MB_OK); return 1;
case DRV_INSTALL: return DRVCNF_RESTART;
case DRV_REMOVE: return DRVCNF_RESTART;
#ifdef SNDCTL_MIDI_INFO
@ -1540,4 +1541,4 @@ LONG MCIMIDI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
return MCIERR_UNRECOGNIZED_COMMAND;
}
/*-----------------------------------------------------------------------*/

View File

@ -178,9 +178,13 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS32A
TRACE(mciwave, "wDevID=%04X (lpParams->wDeviceID=%08lX)\n", wDevID, dwDeviceID);
if (dwFlags & MCI_OPEN_ELEMENT) {
LPCSTR lpstrElementName;
lpstrElementName = lpOpenParms->lpstrElementName;
if (dwFlags & MCI_OPEN_ELEMENT_ID) {
/* could it be that (DWORD)lpOpenParms->lpstrElementName
* contains the hFile value ?
*/
dwRet = MCIERR_UNRECOGNIZED_COMMAND;
} else {
LPCSTR lpstrElementName = lpOpenParms->lpstrElementName;
/*FIXME : what should be done id wmw->hFile is already != 0, or the driver is playin' */
TRACE(mciwave,"MCI_OPEN_ELEMENT '%s' !\n", lpstrElementName);
@ -189,12 +193,13 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS32A
MMIO_ALLOCBUF | MMIO_READWRITE | MMIO_EXCLUSIVE);
if (wmw->hFile == 0) {
WARN(mciwave, "can't find file='%s' !\n", lpstrElementName);
return MCIERR_FILE_NOT_FOUND;
dwRet = MCIERR_FILE_NOT_FOUND;
}
} else {
wmw->hFile = 0;
}
}
}
TRACE(mciwave,"hFile=%u\n", wmw->hFile);
memcpy(&wmw->openParms, lpOpenParms, sizeof(MCI_WAVE_OPEN_PARMS32A));
@ -203,7 +208,7 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS32A
wmw->waveDesc.hWave = 0;
if (wmw->hFile != 0) {
if (dwRet == 0 && wmw->hFile != 0) {
MMCKINFO ckMainRIFF;
if (mmioDescend(wmw->hFile, &ckMainRIFF, NULL, 0) != 0) {
@ -757,8 +762,7 @@ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP
TRACE(mciwave,"MCI_WAVE_STATUS_CHANNELS => %lu!\n", lpParms->dwReturn);
break;
case MCI_WAVE_STATUS_FORMATTAG:
lpParms->dwReturn = wmw->WaveFormat.wf.
wFormatTag;
lpParms->dwReturn = wmw->WaveFormat.wf.wFormatTag;
TRACE(mciwave,"MCI_WAVE_FORMATTAG => %lu!\n", lpParms->dwReturn);
break;
case MCI_WAVE_STATUS_LEVEL:
@ -871,7 +875,7 @@ static DWORD WAVE_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpPar
break;
default:
WARN(mciwave, "Don't know this info command (%lu)\n", dwFlags);
return MCIERR_UNRECOGNIZED_COMMAND;
ret = MCIERR_UNRECOGNIZED_COMMAND;
}
}
if (str) {
@ -904,7 +908,7 @@ LONG MCIWAVE_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
case DRV_ENABLE: return 1;
case DRV_DISABLE: return 1;
case DRV_QUERYCONFIGURE: return 1;
case DRV_CONFIGURE: MessageBox16(0, "Sample MultiMedia Linux Driver !", "MMLinux Driver", MB_OK); return 1;
case DRV_CONFIGURE: MessageBox32A(0, "Sample MultiMedia Linux Driver !", "MMLinux Driver", MB_OK); return 1;
case DRV_INSTALL: return DRVCNF_RESTART;
case DRV_REMOVE: return DRVCNF_RESTART;
case MCI_OPEN_DRIVER: return WAVE_mciOpen (dwDevID, dwParam1, (LPMCI_WAVE_OPEN_PARMS32A)dwParam2);

View File

@ -1541,12 +1541,12 @@ LONG MIDI_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
case DRV_ENABLE: return 1;
case DRV_DISABLE: return 1;
case DRV_QUERYCONFIGURE: return 1;
case DRV_CONFIGURE: MessageBox16(0, "Sample Midi Linux Driver !", "MMLinux Driver", MB_OK); return 1;
case DRV_CONFIGURE: MessageBox32A(0, "Sample Midi Linux Driver !", "MMLinux Driver", MB_OK); return 1;
case DRV_INSTALL: return DRVCNF_RESTART;
case DRV_REMOVE: return DRVCNF_RESTART;
default:
TRACE(midi, "Sending msg=%lu to default driver proc\n", wMsg);
return DefDriverProc32(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
return DefDriverProc16(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
}
}
@ -1564,7 +1564,7 @@ LONG MIDI_DriverProc16(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg,
case DRV_ENABLE: return 1;
case DRV_DISABLE: return 1;
case DRV_QUERYCONFIGURE: return 1;
case DRV_CONFIGURE: MessageBox16(0, "Sample Midi Linux Driver !", "MMLinux Driver", MB_OK); return 1;
case DRV_CONFIGURE: MessageBox32A(0, "Sample Midi Linux Driver !", "MMLinux Driver", MB_OK); return 1;
case DRV_INSTALL: return DRVCNF_RESTART;
case DRV_REMOVE: return DRVCNF_RESTART;
default:

View File

@ -25,7 +25,7 @@ static DWORD MIX_GetDevCaps(WORD wDevID, LPMIXERCAPS16 lpCaps, DWORD dwSize)
int mixer,mask;
TRACE(mmaux, "(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize);
if (lpCaps == NULL) return MMSYSERR_NOTENABLED;
if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
WARN(mmaux, "mixer device not available !\n");
return MMSYSERR_NOTENABLED;
@ -53,6 +53,41 @@ static DWORD MIX_GetDevCaps(WORD wDevID, LPMIXERCAPS16 lpCaps, DWORD dwSize)
#ifdef HAVE_OSS
static char *sdlabels[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_LABELS;
static char *sdnames[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES;
static void MIX_GetLineInfoFromIndex(LPMIXERLINE16 lpml, int devmask, DWORD idx)
{
strcpy(lpml->szShortName, sdlabels[idx]);
strcpy(lpml->szName, sdnames[idx]);
lpml->dwLineID = idx;
lpml->dwDestination = 0; /* index for speakers */
lpml->cConnections = 1;
lpml->cControls = 1;
switch (idx) {
case SOUND_MIXER_SYNTH:
lpml->dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER;
lpml->fdwLine |= MIXERLINE_LINEF_SOURCE;
break;
case SOUND_MIXER_CD:
lpml->dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC;
lpml->fdwLine |= MIXERLINE_LINEF_SOURCE;
break;
case SOUND_MIXER_LINE:
lpml->dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_LINE;
lpml->fdwLine |= MIXERLINE_LINEF_SOURCE;
break;
case SOUND_MIXER_MIC:
lpml->dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE;
lpml->fdwLine |= MIXERLINE_LINEF_SOURCE;
break;
case SOUND_MIXER_PCM:
lpml->dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT;
lpml->fdwLine |= MIXERLINE_LINEF_SOURCE;
break;
default:
ERR(mmaux, "Index %ld not handled.\n", idx);
break;
}
}
#endif
/**************************************************************************
@ -62,9 +97,11 @@ static DWORD MIX_GetLineInfo(WORD wDevID, LPMIXERLINE16 lpml, DWORD fdwInfo)
{
#ifdef HAVE_OSS
int mixer, i, j, devmask, recsrc, recmask;
DWORD ret = MMSYSERR_NOERROR;
TRACE(mmaux, "(%04X, %p, %lu);\n", wDevID, lpml, fdwInfo);
if (lpml == NULL) return MMSYSERR_NOTENABLED;
if (lpml == NULL || lpml->cbStruct != sizeof(*lpml))
return MMSYSERR_INVALPARAM;
if ((mixer = open(MIXER_DEV, O_RDWR)) < 0)
return MMSYSERR_NOTENABLED;
@ -83,7 +120,7 @@ static DWORD MIX_GetLineInfo(WORD wDevID, LPMIXERLINE16 lpml, DWORD fdwInfo)
perror("ioctl mixer SOUND_MIXER_RECMASK");
return MMSYSERR_NOTENABLED;
}
lpml->cbStruct = sizeof(MIXERLINE16);
/* FIXME: set all the variables correctly... the lines below
* are very wrong...
*/
@ -110,48 +147,56 @@ static DWORD MIX_GetLineInfo(WORD wDevID, LPMIXERLINE16 lpml, DWORD fdwInfo)
i++;
}
}
MIX_GetLineInfoFromIndex(lpml, devmask, i);
break;
case MIXER_GETLINEINFOF_LINEID:
MIX_GetLineInfoFromIndex(lpml, devmask, lpml->dwLineID);
break;
case MIXER_GETLINEINFOF_COMPONENTTYPE:
TRACE(mmaux, "Getting component type (%08lx)\n", lpml->dwComponentType);
switch (lpml->dwComponentType) {
case MIXERLINE_COMPONENTTYPE_DST_SPEAKERS:
i = -1;
break;
case MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER:
i = SOUND_MIXER_SYNTH;
break;
case MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC:
i = SOUND_MIXER_CD;
break;
case MIXERLINE_COMPONENTTYPE_SRC_LINE:
i = SOUND_MIXER_LINE;
break;
case MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE:
i = SOUND_MIXER_MIC;
break;
case MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT:
i = SOUND_MIXER_PCM;
break;
default:
FIXME(mmaux, "Unhandled component type (%08lx)\n", lpml->dwComponentType);
return MMSYSERR_INVALPARAM;
}
if (i != -1 && (devmask & (1 << i))) {
strcpy(lpml->szShortName, sdlabels[i]);
strcpy(lpml->szName, sdnames[i]);
lpml->dwLineID = i;
switch (i) {
case SOUND_MIXER_SYNTH:
lpml->dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER;
lpml->fdwLine |= MIXERLINE_LINEF_SOURCE;
break;
case SOUND_MIXER_CD:
lpml->dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC;
lpml->fdwLine |= MIXERLINE_LINEF_SOURCE;
break;
case SOUND_MIXER_LINE:
lpml->dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_LINE;
lpml->fdwLine |= MIXERLINE_LINEF_SOURCE;
break;
case SOUND_MIXER_MIC:
lpml->dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE;
lpml->fdwLine |= MIXERLINE_LINEF_SOURCE;
break;
case SOUND_MIXER_PCM:
lpml->dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT;
lpml->fdwLine |= MIXERLINE_LINEF_SOURCE;
break;
default:
ERR(mmaux,"Mixertype %d not handle.\n",i);
break;
lpml->fdwLine = MIXERLINE_LINEF_SOURCE;
} else {
lpml->cConnections = 0;
for (j=0;j<31;j++)
if (devmask & (1<<j))
lpml->cConnections++;
lpml->dwLineID = 32;
}
break;
case MIXER_GETLINEINFOF_LINEID:
FIXME(mmaux,"_LINEID (%ld) not implemented yet.\n",lpml->dwLineID);
break;
case MIXER_GETLINEINFOF_COMPONENTTYPE:
FIXME(mmaux," _COMPONENTTYPE not implemented yet.\n");
break;
case MIXER_GETLINEINFOF_TARGETTYPE:
FIXME(mmaux, "_TARGETTYPE not implemented yet.\n");
break;
}
lpml->Target.dwType = MIXERLINE_TARGETTYPE_AUX;
close(mixer);
return MMSYSERR_NOERROR;
return ret;
#else
return MMSYSERR_NOTENABLED;
#endif
@ -165,7 +210,7 @@ static DWORD MIX_Open(WORD wDevID, LPMIXEROPENDESC lpmod, DWORD flags)
#ifdef HAVE_OSS
TRACE(mmaux, "(%04X, %p, %lu);\n", wDevID,lpmod,flags);
if (lpmod == NULL) return MMSYSERR_NOTENABLED;
if (lpmod == NULL) return MMSYSERR_INVALPARAM;
/* hmm. We don't keep the mixer device open. So just pretend it works */
return MMSYSERR_NOERROR;
#else
@ -181,16 +226,19 @@ DWORD WINAPI mixMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
{
TRACE(mmaux, "(%04X, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
switch(wMsg) {
case MXDM_GETDEVCAPS:
return MIX_GetDevCaps(wDevID, (LPMIXERCAPS16)dwParam1, dwParam2);
case MXDM_GETLINEINFO:
return MIX_GetLineInfo(wDevID, (LPMIXERLINE16)dwParam1, dwParam2);
case MXDM_GETNUMDEVS:
TRACE(mmsys,"return 1;\n");
TRACE(mmaux, "return 1;\n");
return 1;
case MXDM_OPEN:
return MIX_Open(wDevID, (LPMIXEROPENDESC)dwParam1, dwParam2);
case MXDM_CLOSE:
return MMSYSERR_NOERROR;
default:
WARN(mmaux, "unknown message %d!\n", wMsg);
}

View File

@ -73,6 +73,7 @@ MCIPROC32 MCI_GetProc32(UINT16 uDevType)
case MCI_DEVTYPE_WAVEFORM_AUDIO: proc = MCIWAVE_DriverProc32; break;
case MCI_DEVTYPE_SEQUENCER: proc = MCIMIDI_DriverProc32; break;
case MCI_DEVTYPE_ANIMATION: proc = MCIANIM_DriverProc32; break;
case MCI_DEVTYPE_DIGITAL_VIDEO: proc = MCIAVI_DriverProc32; break;
default: TRACE(mci, "Unknown device type %u\n", uDevType);
}
return proc;
@ -85,15 +86,15 @@ WORD MCI_GetDevType(LPCSTR str)
{
WORD uDevTyp = 0;
if (strcmp(str, "CDAUDIO") == 0) {
if (lstrcmpi32A(str, "CDAUDIO") == 0) {
uDevTyp = MCI_DEVTYPE_CD_AUDIO;
} else if (strcmp(str, "WAVEAUDIO") == 0) {
} else if (lstrcmpi32A(str, "WAVEAUDIO") == 0) {
uDevTyp = MCI_DEVTYPE_WAVEFORM_AUDIO;
} else if (strcmp(str, "SEQUENCER") == 0) {
} else if (lstrcmpi32A(str, "SEQUENCER") == 0) {
uDevTyp = MCI_DEVTYPE_SEQUENCER;
} else if (strcmp(str, "ANIMATION1") == 0) {
} else if (lstrcmpi32A(str, "ANIMATION1") == 0) {
uDevTyp = MCI_DEVTYPE_ANIMATION;
} else if (strcmp(str, "AVIVIDEO") == 0) {
} else if (lstrcmpi32A(str, "AVIVIDEO") == 0) {
uDevTyp = MCI_DEVTYPE_DIGITAL_VIDEO;
}
TRACE(mci, "str = %s => %u\n", str, uDevTyp);
@ -486,7 +487,7 @@ BOOL32 WINAPI PlaySound32W(LPCWSTR pszSound, HMODULE32 hmod, DWORD fdwSound)
}
/**************************************************************************
* sndPlaySound [MMSYSTEM.2]
* sndPlaySound [MMSYSTEM.2][WINMM135]
*/
BOOL16 WINAPI sndPlaySound(LPCSTR lpszSoundName, UINT16 uFlags)
{
@ -494,6 +495,15 @@ BOOL16 WINAPI sndPlaySound(LPCSTR lpszSoundName, UINT16 uFlags)
return PlaySound32A(lpszSoundName, 0, uFlags);
}
/**************************************************************************
* sndPlaySound [WINMM.136]
*/
BOOL16 WINAPI sndPlaySound32W(LPCWSTR lpszSoundName, UINT16 uFlags)
{
PlaySound_SearchMode = 1;
return PlaySound32W(lpszSoundName, 0, uFlags);
}
/**************************************************************************
* mmsystemGetVersion [WINMM.134]
*/
@ -540,7 +550,7 @@ BOOL16 WINAPI DriverCallback(DWORD dwCallBack, UINT16 uFlags, HANDLE16 hDev,
if (!IsWindow32(dwCallBack) || USER_HEAP_LIN_ADDR(hDev) == NULL)
return FALSE;
PostMessage16((HWND16)dwCallBack, wMsg, hDev, dwParam1);
PostMessage32A((HWND16)dwCallBack, wMsg, hDev, dwParam1);
break;
case DCB_TASK:
TRACE(mmsys, "CALLBACK_TASK !\n");
@ -823,10 +833,23 @@ UINT32 WINAPI mixerGetLineInfo32W(HMIXEROBJ32 hmix,LPMIXERLINE32W lpml,DWORD fdw
MIXERLINE16 ml16;
UINT32 ret;
TRACE(mmsys,"(%04x,%p,%08lx)\n", hmix, lpml, fdwInfo);
if (lpml == NULL || lpml->cbStruct != sizeof(*lpml))
return MMSYSERR_INVALPARAM;
ml16.cbStruct = sizeof(ml16);
ml16.dwDestination = lpml->dwDestination;
FIXME(mmsys,"(%04x,%p,%08lx): stub!\n",hmix,lpml,fdwInfo);
ml16.dwSource = lpml->dwSource;
ml16.dwLineID = lpml->dwLineID;
ml16.dwUser = lpml->dwUser;
ml16.dwComponentType = lpml->dwComponentType;
ml16.cChannels = lpml->cChannels;
ml16.cConnections = lpml->cConnections;
ml16.cControls = lpml->cControls;
ret = mixerGetLineInfo16(hmix, &ml16, fdwInfo);
lpml->cbStruct = sizeof(*lpml);
lpml->dwSource = ml16.dwSource;
lpml->dwLineID = ml16.dwLineID;
lpml->fdwLine = ml16.fdwLine;
@ -853,7 +876,7 @@ UINT16 WINAPI mixerGetLineInfo16(HMIXEROBJ16 hmix,LPMIXERLINE16 lpml,DWORD fdwIn
{
UINT16 devid = _get_mixerID_from_handle(hmix, fdwInfo);
FIXME(mmsys,"(%04x,%p[line %08lx],%08lx) - semi-stub?\n",
FIXME(mmsys, "(%04x, %p[line %08lx], %08lx)\n",
hmix, lpml, lpml->dwDestination, fdwInfo);
return mixMessage(devid, MXDM_GETLINEINFO, 0, (DWORD)lpml, fdwInfo);
}
@ -1362,9 +1385,10 @@ BOOL16 WINAPI mciGetErrorString16(DWORD wError,LPSTR lpstrBuffer,UINT16 uLength)
BOOL16 WINAPI mciDriverNotify16(HWND16 hWndCallBack, UINT16 wDevID, UINT16 wStatus)
{
TRACE(mmsys, "(%04X, %u, %04X)\n", hWndCallBack, wDevID, wStatus);
if (!IsWindow32(hWndCallBack)) return FALSE;
TRACE(mmsys, "before PostMessage\n");
PostMessage16(hWndCallBack, MM_MCINOTIFY, wStatus, MAKELONG(wDevID, 0));
PostMessage32A(hWndCallBack, MM_MCINOTIFY, wStatus, MAKELONG(wDevID, 0));
return TRUE;
}
@ -1374,6 +1398,7 @@ BOOL16 WINAPI mciDriverNotify16(HWND16 hWndCallBack, UINT16 wDevID, UINT16 wStat
BOOL32 WINAPI mciDriverNotify32(HWND32 hWndCallBack, UINT32 wDevID, UINT32 wStatus)
{
FIXME(mmsys, "stub(%04X, %u, %04X)\n", hWndCallBack, wDevID, wStatus);
return FALSE;
}
@ -1383,6 +1408,7 @@ BOOL32 WINAPI mciDriverNotify32(HWND32 hWndCallBack, UINT32 wDevID, UINT32 wStat
DWORD WINAPI mciGetDriverData16(HDRVR16 hdrv)
{
FIXME(mmsys,"(%04x): stub!\n", hdrv);
return 0x42;
}
@ -1392,6 +1418,7 @@ DWORD WINAPI mciGetDriverData16(HDRVR16 hdrv)
DWORD WINAPI mciGetDriverData32(HDRVR32 hdrv)
{
FIXME(mmsys,"(%04x): stub!\n", hdrv);
return 0x42;
}
@ -1401,6 +1428,7 @@ DWORD WINAPI mciGetDriverData32(HDRVR32 hdrv)
BOOL16 WINAPI mciSetDriverData16(HDRVR16 hdrv, DWORD data)
{
FIXME(mmsys,"(%04x,%08lx): stub!\n", hdrv, data);
return 0;
}
@ -1410,6 +1438,7 @@ BOOL16 WINAPI mciSetDriverData16(HDRVR16 hdrv, DWORD data)
BOOL32 WINAPI mciSetDriverData32(HDRVR32 hdrv, DWORD data)
{
FIXME(mmsys,"(%04x,%08lx): stub!\n", hdrv, data);
return 0;
}
@ -1579,9 +1608,9 @@ static DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMS32A lpParms)
TRACE(mmsys, "(%08lX, %p)\n", dwParam, lpParms);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if ((dwParam & ~(MCI_OPEN_ELEMENT|MCI_OPEN_ALIAS|MCI_OPEN_TYPE|MCI_OPEN_TYPE_ID|MCI_NOTIFY|MCI_WAIT)) != 0) {
if ((dwParam & ~(MCI_OPEN_SHAREABLE|MCI_OPEN_ELEMENT|MCI_OPEN_ALIAS|MCI_OPEN_TYPE|MCI_OPEN_TYPE_ID|MCI_NOTIFY|MCI_WAIT)) != 0) {
FIXME(mmsys, "unsupported yet dwFlags=%08lX\n",
(dwParam & ~(MCI_OPEN_ELEMENT|MCI_OPEN_ALIAS|MCI_OPEN_TYPE|MCI_OPEN_TYPE_ID|MCI_NOTIFY|MCI_WAIT)));
(dwParam & ~(MCI_OPEN_SHAREABLE|MCI_OPEN_ELEMENT|MCI_OPEN_ALIAS|MCI_OPEN_TYPE|MCI_OPEN_TYPE_ID|MCI_NOTIFY|MCI_WAIT)));
}
while (MCI_GetDrv(wDevID)->modp.wType != 0) {
@ -1613,13 +1642,13 @@ static DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMS32A lpParms)
#if testing32
/* FIXME has to be re-written, seems to be experimental 16 bit code anyway */
else {
HDRVR16 hdrv = OpenDriver(str, "mci", NULL);
HDRVR16 hdrv = OpenDriver32(str, "mci", NULL);
if (hdrv) {
HMODULE16 hmod;
hmod = GetDriverModuleHandle(hdrv);
MCI_GetDrv(wDevID)->hDrv = hdrv;
MCI_GetDrv(wDevID)->driverProc = GetProcAddress16(hmod,oouch SEGPTR_GET(SEGPTR_STRDUP("DRIVERPROC")));
MCI_GetDrv(wDevID)->driverProc = GetProcAddress32(hmod,oouch SEGPTR_GET(SEGPTR_STRDUP("DriverProc")));
uDevTyp = MCI_DEVTYPE_OTHER;
} else {
FIXME(mmsys, "[mci extensions] entry %s for %s not supported.\n", str, t);
@ -1661,13 +1690,13 @@ static DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMS32A lpParms)
/* FIXME has to be re-written, seems to be experimental 16 bit code anyway */
HDRVR16 hdrv;
TRACE(mmsys,"trying to load driver...\n");
hdrv = OpenDriver(str,"mci",NULL);
hdrv = OpenDriver32(str,"mci",NULL);
if (hdrv) {
HMODULE16 hmod;
hmod = GetDriverModuleHandle(hdrv);
MCI_GetDrv(wDevID)->hDrv = hdrv;
MCI_GetDrv(wDevID)->driverProc = GetProcAddress16(hmod,oouch SEGPTR_GET(SEGPTR_STRDUP("DRIVERPROC")));
MCI_GetDrv(wDevID)->driverProc = GetProcAddress32(hmod,oouch SEGPTR_GET(SEGPTR_STRDUP("DriverProc")));
uDevTyp = MCI_DEVTYPE_OTHER;
} else
#endif
@ -2006,6 +2035,22 @@ int MCI_MapMsg16To32A(WORD uDevType, WORD wMsg, DWORD* lParam)
*lParam = (DWORD)msip32a;
}
return 1;
case DRV_LOAD:
case DRV_ENABLE:
case DRV_OPEN:
case DRV_CLOSE:
case DRV_DISABLE:
case DRV_FREE:
case DRV_CONFIGURE:
case DRV_QUERYCONFIGURE:
case DRV_INSTALL:
case DRV_REMOVE:
case DRV_EXITSESSION:
case DRV_EXITAPPLICATION:
case DRV_POWER:
FIXME(mci, "This is a hack\n");
return 0;
default:
WARN(mci, "Don't know how to map msg=%s\n", MCI_CommandToString(wMsg));
}
@ -2060,13 +2105,28 @@ int MCI_UnMapMsg16To32A(WORD uDevTyp, WORD wMsg, DWORD lParam)
return 0;
case MCI_OPEN:
case MCI_OPEN_DRIVER:
{
if (lParam) {
LPMCI_OPEN_PARMS32A mop32a = (MCI_OPEN_PARMS32A*)lParam;
LPMCI_OPEN_PARMS16 mop16 = *(LPMCI_OPEN_PARMS16*)((char*)mop32a - sizeof(LPMCI_OPEN_PARMS16*));
mop16->wDeviceID = mop32a->wDeviceID;
}
HeapFree(SystemHeap, 0, (LPVOID)(lParam - sizeof(LPMCI_OPEN_PARMS16)));
}
return 0;
case DRV_LOAD:
case DRV_ENABLE:
case DRV_OPEN:
case DRV_CLOSE:
case DRV_DISABLE:
case DRV_FREE:
case DRV_CONFIGURE:
case DRV_QUERYCONFIGURE:
case DRV_INSTALL:
case DRV_REMOVE:
case DRV_EXITSESSION:
case DRV_EXITAPPLICATION:
case DRV_POWER:
FIXME(mci, "This is a hack\n");
return 0;
default:
FIXME(mci, "Map/Unmap internal error on msg=%s\n", MCI_CommandToString(wMsg));
@ -2109,8 +2169,7 @@ DWORD WINAPI mciSendCommand32W(UINT32 wDevID, UINT32 wMsg, DWORD dwParam1, DWORD
/**************************************************************************
* mciSendCommand [MMSYSTEM.701]
*/
DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1,
DWORD dwParam2)
DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2)
{
DWORD dwRet = MCIERR_UNRECOGNIZED_COMMAND;
@ -2160,7 +2219,7 @@ DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1,
case 1:
dwRet = MCI_SendCommand32(wDevID, wMsg, dwParam1, dwParam2);
if (res)
MCI_UnMapMsg16To32A(MCI_DEVTYPE_SEQUENCER, wMsg, dwParam2);
MCI_UnMapMsg16To32A(MCI_GetDrv(wDevID)->modp.wType, wMsg, dwParam2);
break;
}
}
@ -3855,6 +3914,7 @@ UINT32 WINAPI waveOutPrepareHeader32(HWAVEOUT32 hWaveOut,
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
lpWaveOutHdr->reserved = (DWORD)lpWaveOutHdr->lpData;
return wodMessage(lpDesc->uDeviceID, WODM_PREPARE, lpDesc->dwInstance,
(DWORD)lpWaveOutHdr,uSize);
}
@ -3866,17 +3926,17 @@ UINT16 WINAPI waveOutPrepareHeader16(HWAVEOUT16 hWaveOut,
WAVEHDR* lpWaveOutHdr, UINT16 uSize)
{
LPWAVEOPENDESC lpDesc;
LPBYTE saveddata = lpWaveOutHdr->lpData;
UINT16 ret;
TRACE(mmsys, "(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
lpWaveOutHdr->reserved = (DWORD)lpWaveOutHdr->lpData;
lpWaveOutHdr->lpData = PTR_SEG_TO_LIN(lpWaveOutHdr->lpData);
ret = wodMessage(lpDesc->uDeviceID, WODM_PREPARE, lpDesc->dwInstance,
(DWORD)lpWaveOutHdr,uSize);
lpWaveOutHdr->lpData = saveddata;
lpWaveOutHdr->lpData = lpWaveOutHdr->lpData;
return ret;
}
@ -3892,6 +3952,7 @@ UINT32 WINAPI waveOutUnprepareHeader32(HWAVEOUT32 hWaveOut,
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
lpWaveOutHdr->reserved = (DWORD)lpWaveOutHdr->lpData;
return wodMessage(lpDesc->uDeviceID, WODM_UNPREPARE, lpDesc->dwInstance,
(DWORD)lpWaveOutHdr, uSize);
}
@ -3903,17 +3964,17 @@ UINT16 WINAPI waveOutUnprepareHeader16(HWAVEOUT16 hWaveOut,
WAVEHDR* lpWaveOutHdr, UINT16 uSize)
{
LPWAVEOPENDESC lpDesc;
LPBYTE saveddata = lpWaveOutHdr->lpData;
UINT16 ret;
TRACE(mmsys, "(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
lpWaveOutHdr->reserved = (DWORD)lpWaveOutHdr->lpData;
lpWaveOutHdr->lpData = PTR_SEG_TO_LIN(lpWaveOutHdr->lpData);
ret = wodMessage(lpDesc->uDeviceID, WODM_UNPREPARE, lpDesc->dwInstance,
(DWORD)lpWaveOutHdr, uSize);
lpWaveOutHdr->lpData = saveddata;
lpWaveOutHdr->lpData = (LPBYTE)lpWaveOutHdr->reserved;
return ret;
}
@ -4082,7 +4143,6 @@ UINT16 WINAPI waveOut##xx##16(UINT16 devid, atype x) \
WAVEOUT_SHORTCUT_2(GetVolume,GETVOLUME, DWORD*)
WAVEOUT_SHORTCUT_2(SetVolume,SETVOLUME, DWORD)
/**************************************************************************
* waveOutBreakLoop [MMSYSTEM.419]
*/
@ -4667,7 +4727,7 @@ DWORD WINAPI waveInMessage32(HWAVEIN32 hWaveIn, UINT32 uMessage,
{
LPWAVEOPENDESC lpDesc;
FIXME(mmsys, "(%04X, %04X, %08lX, %08lX),FIXME!\n",
FIXME(mmsys, "(%04X, %04X, %08lX, %08lX)\n",
hWaveIn, uMessage, dwParam1, dwParam2);
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@ -4706,7 +4766,7 @@ DWORD WINAPI waveInMessage16(HWAVEIN16 hWaveIn, UINT16 uMessage,
{
LPWAVEOPENDESC lpDesc;
FIXME(mmsys, "(%04X, %04X, %08lX, %08lX),FIXME!\n",
FIXME(mmsys, "(%04X, %04X, %08lX, %08lX)\n",
hWaveIn, uMessage, dwParam1, dwParam2);
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn);
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
@ -4898,5 +4958,5 @@ HINSTANCE16 WINAPI mmTaskCreate16(LPWORD lphnd,HINSTANCE16 *hMmTask,DWORD x2)
LRESULT WINAPI mmTaskSignal16(HTASK16 ht)
{
TRACE(mmsys,"(%04x);\n", ht);
return PostAppMessage16(ht,WM_USER,0,0);
return PostAppMessage32A(ht, WM_USER, 0, 0);
}

View File

@ -136,7 +136,7 @@ type win32
133 stdcall mmioWrite(long ptr long) mmioWrite32
134 stdcall mmsystemGetVersion() mmsystemGetVersion32
135 stdcall sndPlaySoundA(ptr long) sndPlaySound
136 stub sndPlaySoundW
136 stdcall sndPlaySoundW(ptr long) sndPlaySound32W
137 stdcall timeBeginPeriod(long) timeBeginPeriod32
138 stdcall timeEndPeriod(long) timeEndPeriod32
139 stdcall timeGetDevCaps(ptr long) timeGetDevCaps32