Author: dchapyshev
Date: Wed May 6 12:46:19 2009
New Revision: 40813
URL:
http://svn.reactos.org/svn/reactos?rev=40813&view=rev
Log:
- Sync mciavi32 and mciqtz32 with Wine 1.1.20
Modified:
trunk/reactos/dll/win32/mciavi32/info.c
trunk/reactos/dll/win32/mciqtz32/mciqtz.c
trunk/reactos/dll/win32/mciqtz32/mciqtz_private.h
Modified: trunk/reactos/dll/win32/mciavi32/info.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mciavi32/info.c?…
==============================================================================
--- trunk/reactos/dll/win32/mciavi32/info.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mciavi32/info.c [iso-8859-1] Wed May 6 12:46:19 2009
@@ -225,72 +225,73 @@
}
if (dwFlags & MCI_SET_ON) {
- char buffer[256];
-
- strcpy(buffer, "MCI_SET_ON:");
+ const char *szVideo="";
+ const char *szAudio="";
+ const char *szSeek="";
if (dwFlags & MCI_SET_VIDEO) {
- strncat(buffer, " video",
sizeof(buffer)-sizeof("MCI_SET_ON:"));
+ szVideo = " video";
wma->dwSet |= 4;
}
if (dwFlags & MCI_SET_AUDIO) {
- strncat(buffer, " audio",
sizeof(buffer)-sizeof("MCI_SET_ON:"));
switch (lpParms->dwAudio) {
case MCI_SET_AUDIO_ALL:
- strncat(buffer, " all", sizeof(buffer)-sizeof("MCI_SET_ON:"));
+ szAudio = " audio all";
wma->dwSet |= 3;
break;
case MCI_SET_AUDIO_LEFT:
- strncat(buffer, " left", sizeof(buffer)-sizeof("MCI_SET_ON:"));
+ szAudio = " audio left";
wma->dwSet |= 1;
break;
case MCI_SET_AUDIO_RIGHT:
- strncat(buffer, " right", sizeof(buffer)-sizeof("MCI_SET_ON:"));
+ szAudio = " audio right";
wma->dwSet |= 2;
break;
default:
+ szAudio = " audio unknown";
WARN("Unknown audio channel %u\n", lpParms->dwAudio);
break;
}
}
if (dwFlags & MCI_DGV_SET_SEEK_EXACTLY) {
- strncat(buffer, " seek_exactly", sizeof(buffer));
- }
- FIXME("%s\n", buffer);
+ szSeek = " seek_exactly";
+ }
+ FIXME("MCI_SET_ON:%s%s%s\n", szVideo, szAudio, szSeek);
}
if (dwFlags & MCI_SET_OFF) {
- char buffer[256];
-
- strcpy(buffer, "MCI_SET_OFF:");
+ const char *szVideo="";
+ const char *szAudio="";
+ const char *szSeek="";
+
if (dwFlags & MCI_SET_VIDEO) {
- strncat(buffer, " video",
sizeof(buffer)-sizeof("MCI_SET_OFF:"));
+ szVideo = " video";
wma->dwSet &= ~4;
}
if (dwFlags & MCI_SET_AUDIO) {
- strncat(buffer, " audio",
sizeof(buffer)-sizeof("MCI_SET_OFF:"));
switch (lpParms->dwAudio) {
case MCI_SET_AUDIO_ALL:
- strncat(buffer, " all", sizeof(buffer)-sizeof("MCI_SET_OFF:"));
+ szAudio = " audio all";
wma->dwSet &= ~3;
break;
case MCI_SET_AUDIO_LEFT:
- strncat(buffer, " left", sizeof(buffer)-sizeof("MCI_SET_OFF:"));
+ szAudio = " audio left";
wma->dwSet &= ~2;
break;
case MCI_SET_AUDIO_RIGHT:
- strncat(buffer, " right", sizeof(buffer)-sizeof("MCI_SET_OFF:"));
+ szAudio = " audio right";
wma->dwSet &= ~2;
break;
default:
+ szAudio = " audio unknown";
WARN("Unknown audio channel %u\n", lpParms->dwAudio);
break;
}
}
if (dwFlags & MCI_DGV_SET_SEEK_EXACTLY) {
- strncat(buffer, " seek_exactly", sizeof(buffer)-strlen(buffer)-1);
- }
- FIXME("%s\n", buffer);
+ szSeek = " seek_exactly";
+ }
+ FIXME("MCI_SET_OFF:%s%s%s\n", szVideo, szAudio, szSeek);
}
if (dwFlags & MCI_DGV_SET_FILEFORMAT) {
LPCSTR str = "save";
Modified: trunk/reactos/dll/win32/mciqtz32/mciqtz.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mciqtz32/mciqtz.…
==============================================================================
--- trunk/reactos/dll/win32/mciqtz32/mciqtz.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mciqtz32/mciqtz.c [iso-8859-1] Wed May 6 12:46:19 2009
@@ -34,23 +34,37 @@
static DWORD MCIQTZ_mciStop(UINT, DWORD, LPMCI_GENERIC_PARMS);
/*======================================================================*
- * MCI QTZ implementation *
+ * MCI QTZ implementation *
*======================================================================*/
HINSTANCE MCIQTZ_hInstance = 0;
/***********************************************************************
- * DllMain (MCIQTZ.0)
+ * DllMain (MCIQTZ.0)
*/
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID fImpLoad)
{
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hInstDLL);
- MCIQTZ_hInstance = hInstDLL;
- break;
+ MCIQTZ_hInstance = hInstDLL;
+ break;
}
return TRUE;
+}
+
+/**************************************************************************
+ * MCIQTZ_mciGetOpenDev [internal]
+ */
+static WINE_MCIQTZ* MCIQTZ_mciGetOpenDev(UINT wDevID)
+{
+ WINE_MCIQTZ* wma = (WINE_MCIQTZ*)mciGetDriverData(wDevID);
+
+ if (!wma) {
+ WARN("Invalid wDevID=%u\n", wDevID);
+ return NULL;
+ }
+ return wma;
}
/**************************************************************************
@@ -60,7 +74,7 @@
{
WINE_MCIQTZ* wma;
- TRACE("%s, %p\n", debugstr_w(str), modp);
+ TRACE("(%s, %p)\n", debugstr_w(str), modp);
/* session instance */
if (!modp)
@@ -83,14 +97,14 @@
{
WINE_MCIQTZ* wma;
- TRACE("%04x\n", dwDevID);
-
- /* finish all outstanding things */
- MCIQTZ_mciClose(dwDevID, MCI_WAIT, NULL);
-
- wma = (WINE_MCIQTZ*)mciGetDriverData(dwDevID);
+ TRACE("(%04x)\n", dwDevID);
+
+ wma = MCIQTZ_mciGetOpenDev(dwDevID);
if (wma) {
+ /* finish all outstanding things */
+ MCIQTZ_mciClose(dwDevID, MCI_WAIT, NULL);
+
HeapFree(GetProcessHeap(), 0, wma);
return 1;
}
@@ -105,32 +119,17 @@
{
WINE_MCIQTZ* wma;
- TRACE("%04x\n", dwDevID);
+ TRACE("(%04x)\n", dwDevID);
+
+ wma = MCIQTZ_mciGetOpenDev(dwDevID);
+ if (!wma)
+ return 0;
MCIQTZ_mciStop(dwDevID, MCI_WAIT, NULL);
- wma = (WINE_MCIQTZ*)mciGetDriverData(dwDevID);
-
- if (wma) {
- MessageBoxA(0, "Sample QTZ Wine Driver !", "MM-Wine Driver",
MB_OK);
- return 1;
- }
-
- return 0;
-}
-
-/**************************************************************************
- * MCIQTZ_mciGetOpenDev [internal]
- */
-static WINE_MCIQTZ* MCIQTZ_mciGetOpenDev(UINT wDevID)
-{
- WINE_MCIQTZ* wma = (WINE_MCIQTZ*)mciGetDriverData(wDevID);
-
- if (!wma) {
- WARN("Invalid wDevID=%u\n", wDevID);
- return 0;
- }
- return wma;
+ MessageBoxA(0, "Sample QTZ Wine Driver !", "MM-Wine Driver",
MB_OK);
+
+ return 1;
}
/***************************************************************************
@@ -144,14 +143,14 @@
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpOpenParms);
- MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL);
-
if (!lpOpenParms)
return MCIERR_NULL_PARAMETER_BLOCK;
- wma = (WINE_MCIQTZ*)mciGetDriverData(wDevID);
+ wma = MCIQTZ_mciGetOpenDev(wDevID);
if (!wma)
return MCIERR_INVALID_DEVICE_ID;
+
+ MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL);
CoInitializeEx(NULL, COINIT_MULTITHREADED);
@@ -184,6 +183,8 @@
TRACE("Cannot render file (hr = %x)\n", hr);
goto err;
}
+
+ wma->opened = TRUE;
return 0;
@@ -209,20 +210,18 @@
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
+ wma = MCIQTZ_mciGetOpenDev(wDevID);
+ if (!wma)
+ return MCIERR_INVALID_DEVICE_ID;
+
MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL);
- wma = MCIQTZ_mciGetOpenDev(wDevID);
- if (!wma)
- return MCIERR_INVALID_DEVICE_ID;
-
- if (wma->pgraph)
+ if (wma->opened) {
IGraphBuilder_Release(wma->pgraph);
- wma->pgraph = NULL;
- if (wma->pmctrl)
IMediaControl_Release(wma->pmctrl);
- wma->pmctrl = NULL;
-
- CoUninitialize();
+ CoUninitialize();
+ wma->opened = FALSE;
+ }
return 0;
}
@@ -241,6 +240,8 @@
return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIQTZ_mciGetOpenDev(wDevID);
+ if (!wma)
+ return MCIERR_INVALID_DEVICE_ID;
hr = IMediaControl_Run(wma->pmctrl);
if (FAILED(hr)) {
@@ -265,14 +266,14 @@
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
- MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL);
-
if (!lpParms)
return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIQTZ_mciGetOpenDev(wDevID);
if (!wma)
return MCIERR_INVALID_DEVICE_ID;
+
+ MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL);
if (dwFlags & MCI_SEEK_TO_START) {
newpos = 0;
@@ -415,11 +416,11 @@
}
/*======================================================================*
- * MCI QTZ entry points *
+ * MCI QTZ entry points *
*======================================================================*/
/**************************************************************************
- * DriverProc (MCIQTZ.@)
+ * DriverProc (MCIQTZ.@)
*/
LRESULT CALLBACK MCIQTZ_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
LPARAM dwParam1, LPARAM dwParam2)
@@ -449,9 +450,9 @@
case MCI_CLOSE_DRIVER: return MCIQTZ_mciClose (dwDevID, dwParam1,
(LPMCI_GENERIC_PARMS) dwParam2);
case MCI_PLAY: return MCIQTZ_mciPlay (dwDevID, dwParam1,
(LPMCI_PLAY_PARMS) dwParam2);
case MCI_SEEK: return MCIQTZ_mciSeek (dwDevID, dwParam1,
(LPMCI_SEEK_PARMS) dwParam2);
+ case MCI_STOP: return MCIQTZ_mciStop (dwDevID, dwParam1,
(LPMCI_GENERIC_PARMS) dwParam2);
case MCI_STATUS: return MCIQTZ_mciStatus (dwDevID, dwParam1,
(LPMCI_DGV_STATUS_PARMSW) dwParam2);
case MCI_RECORD:
- case MCI_STOP:
case MCI_SET:
case MCI_PAUSE:
case MCI_RESUME:
@@ -484,18 +485,18 @@
case MCI_UNDO:
case MCI_CONFIGURE:
case MCI_RESTORE:
- FIXME("Unimplemented command [%u]\n", wMsg);
+ FIXME("Unimplemented command [%08X]\n", wMsg);
break;
case MCI_SPIN:
case MCI_ESCAPE:
- WARN("Unsupported command [%u]\n", wMsg);
+ WARN("Unsupported command [%08X]\n", wMsg);
break;
case MCI_OPEN:
case MCI_CLOSE:
FIXME("Shouldn't receive a MCI_OPEN or CLOSE message\n");
break;
default:
- TRACE("Sending msg [%u] to default driver proc\n", wMsg);
+ TRACE("Sending msg [%08X] to default driver proc\n", wMsg);
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
}
Modified: trunk/reactos/dll/win32/mciqtz32/mciqtz_private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mciqtz32/mciqtz_…
==============================================================================
--- trunk/reactos/dll/win32/mciqtz32/mciqtz_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mciqtz32/mciqtz_private.h [iso-8859-1] Wed May 6 12:46:19
2009
@@ -27,6 +27,7 @@
typedef struct {
MCIDEVICEID wDevID;
+ BOOL opened;
IGraphBuilder* pgraph;
IMediaControl* pmctrl;
BOOL started;