[PATCH 1/5] [MMSystem]: move the 16-bit MCI functions to a new mci16.c file

Eric Pouech eric.pouech at orange.fr
Sat Oct 17 05:04:57 CDT 2009




A+
---

 dlls/winmm/Makefile.in |    1 
 dlls/winmm/mci16.c     |  196 ++++++++++++++++++++++++++++++++++++++++++++++++
 dlls/winmm/mmsystem.c  |  156 --------------------------------------
 3 files changed, 197 insertions(+), 156 deletions(-)
 create mode 100644 dlls/winmm/mci16.c


diff --git a/dlls/winmm/Makefile.in b/dlls/winmm/Makefile.in
index 6a755b4..416b56b 100644
--- a/dlls/winmm/Makefile.in
+++ b/dlls/winmm/Makefile.in
@@ -18,6 +18,7 @@ C_SRCS = \
 	winmm.c
 
 C_SRCS16 = \
+	mci16.c \
 	message16.c \
 	mmio16.c \
 	mmsystem.c
diff --git a/dlls/winmm/mci16.c b/dlls/winmm/mci16.c
new file mode 100644
index 0000000..5214afc
--- /dev/null
+++ b/dlls/winmm/mci16.c
@@ -0,0 +1,196 @@
+/*
+ * MMSYSTEM functions
+ *
+ * Copyright 1993      Martin Ayotte
+ *           1998-2003,2009 Eric Pouech
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+#include <string.h>
+
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+#include "windef.h"
+#include "winbase.h"
+#include "mmsystem.h"
+#include "winternl.h"
+#include "wownt32.h"
+#include "winnls.h"
+
+#include "wine/winuser16.h"
+#include "winemm16.h"
+#include "winemm.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(mmsys);
+
+/* ###################################################
+ * #                     MCI                         #
+ * ###################################################
+ */
+
+/**************************************************************************
+ * 				mciSetYieldProc			[MMSYSTEM.714]
+ */
+BOOL16 WINAPI mciSetYieldProc16(UINT16 uDeviceID, YIELDPROC16 fpYieldProc, DWORD dwYieldData)
+{
+    LPWINE_MCIDRIVER	wmd;
+
+    TRACE("(%u, %p, %08x)\n", uDeviceID, fpYieldProc, dwYieldData);
+
+    if (!(wmd = MCI_GetDriver(uDeviceID))) {
+	WARN("Bad uDeviceID\n");
+	return FALSE;
+    }
+
+    wmd->lpfnYieldProc = (YIELDPROC)fpYieldProc;
+    wmd->dwYieldData   = dwYieldData;
+    wmd->bIs32         = FALSE;
+
+    return TRUE;
+}
+
+/**************************************************************************
+ * 				mciGetYieldProc			[MMSYSTEM.716]
+ */
+YIELDPROC16 WINAPI mciGetYieldProc16(UINT16 uDeviceID, DWORD* lpdwYieldData)
+{
+    LPWINE_MCIDRIVER	wmd;
+
+    TRACE("(%u, %p)\n", uDeviceID, lpdwYieldData);
+
+    if (!(wmd = MCI_GetDriver(uDeviceID))) {
+	WARN("Bad uDeviceID\n");
+	return NULL;
+    }
+    if (!wmd->lpfnYieldProc) {
+	WARN("No proc set\n");
+	return NULL;
+    }
+    if (wmd->bIs32) {
+	WARN("Proc is 32 bit\n");
+	return NULL;
+    }
+    if (lpdwYieldData) *lpdwYieldData = wmd->dwYieldData;
+    return (YIELDPROC16)wmd->lpfnYieldProc;
+}
+
+/**************************************************************************
+ * 				mciGetErrorString		[MMSYSTEM.706]
+ */
+BOOL16 WINAPI mciGetErrorString16(DWORD wError, LPSTR lpstrBuffer, UINT16 uLength)
+{
+    return mciGetErrorStringA(wError, lpstrBuffer, uLength);
+}
+
+/**************************************************************************
+ * 				mciDriverNotify			[MMSYSTEM.711]
+ */
+BOOL16 WINAPI mciDriverNotify16(HWND16 hWndCallBack, UINT16 wDevID, UINT16 wStatus)
+{
+    TRACE("(%04X, %04x, %04X)\n", hWndCallBack, wDevID, wStatus);
+
+    return PostMessageA(HWND_32(hWndCallBack), MM_MCINOTIFY, wStatus, wDevID);
+}
+
+/**************************************************************************
+ * 			mciGetDriverData			[MMSYSTEM.708]
+ */
+DWORD WINAPI mciGetDriverData16(UINT16 uDeviceID)
+{
+    return mciGetDriverData(uDeviceID);
+}
+
+/**************************************************************************
+ * 			mciSetDriverData			[MMSYSTEM.707]
+ */
+BOOL16 WINAPI mciSetDriverData16(UINT16 uDeviceID, DWORD data)
+{
+    return mciSetDriverData(uDeviceID, data);
+}
+
+/**************************************************************************
+ * 				mciSendCommand			[MMSYSTEM.701]
+ */
+DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2)
+{
+    DWORD		dwRet;
+
+    TRACE("(%04X, %s, %08X, %08X)\n",
+	  wDevID, MCI_MessageToString(wMsg), dwParam1, dwParam2);
+
+    dwRet = MCI_SendCommand(wDevID, wMsg, dwParam1, dwParam2, FALSE);
+    dwRet = MCI_CleanUp(dwRet, wMsg, (DWORD)MapSL(dwParam2));
+    TRACE("=> %d\n", dwRet);
+    return dwRet;
+}
+
+/**************************************************************************
+ * 				mciGetDeviceID		       	[MMSYSTEM.703]
+ */
+UINT16 WINAPI mciGetDeviceID16(LPCSTR lpstrName)
+{
+    TRACE("(\"%s\")\n", lpstrName);
+
+    return mciGetDeviceIDA(lpstrName);
+}
+
+/**************************************************************************
+ * 				mciGetDeviceIDFromElementID	[MMSYSTEM.715]
+ */
+UINT16 WINAPI mciGetDeviceIDFromElementID16(DWORD dwElementID, LPCSTR lpstrType)
+{
+    FIXME("(%u, %s) stub\n", dwElementID, lpstrType);
+    return 0;
+}
+
+/**************************************************************************
+ * 				mciGetCreatorTask		[MMSYSTEM.717]
+ */
+HTASK16 WINAPI mciGetCreatorTask16(UINT16 uDeviceID)
+{
+    return HTASK_16(mciGetCreatorTask(uDeviceID));
+}
+
+/**************************************************************************
+ * 				mciDriverYield			[MMSYSTEM.710]
+ */
+UINT16 WINAPI mciDriverYield16(UINT16 uDeviceID)
+{
+    LPWINE_MCIDRIVER	wmd;
+    UINT16		ret = 0;
+
+    /*    TRACE("(%04x)\n", uDeviceID); */
+
+    if (!(wmd = MCI_GetDriver(uDeviceID)) || !wmd->lpfnYieldProc || wmd->bIs32) {
+	UserYield16();
+    } else {
+	ret = wmd->lpfnYieldProc(uDeviceID, wmd->dwYieldData);
+    }
+
+    return ret;
+}
+
+/**************************************************************************
+ * 				mciSendString			[MMSYSTEM.702]
+ */
+DWORD WINAPI mciSendString16(LPCSTR lpstrCommand, LPSTR lpstrRet,
+			     UINT16 uRetLen, HWND16 hwndCallback)
+{
+    return mciSendStringA(lpstrCommand, lpstrRet, uRetLen, HWND_32(hwndCallback));
+}
diff --git a/dlls/winmm/mmsystem.c b/dlls/winmm/mmsystem.c
index ced1709..3b36f8b 100644
--- a/dlls/winmm/mmsystem.c
+++ b/dlls/winmm/mmsystem.c
@@ -513,153 +513,6 @@ DWORD WINAPI auxOutMessage16(UINT16 uDeviceID, UINT16 uMessage, DWORD dw1, DWORD
 }
 
 /* ###################################################
- * #                     MCI                         #
- * ###################################################
- */
-
-/**************************************************************************
- * 				mciGetErrorString		[MMSYSTEM.706]
- */
-BOOL16 WINAPI mciGetErrorString16(DWORD wError, LPSTR lpstrBuffer, UINT16 uLength)
-{
-    return mciGetErrorStringA(wError, lpstrBuffer, uLength);
-}
-
-/**************************************************************************
- * 				mciDriverNotify			[MMSYSTEM.711]
- */
-BOOL16 WINAPI mciDriverNotify16(HWND16 hWndCallBack, UINT16 wDevID, UINT16 wStatus)
-{
-    TRACE("(%04X, %04x, %04X)\n", hWndCallBack, wDevID, wStatus);
-
-    return PostMessageA(HWND_32(hWndCallBack), MM_MCINOTIFY, wStatus, wDevID);
-}
-
-/**************************************************************************
- * 			mciGetDriverData			[MMSYSTEM.708]
- */
-DWORD WINAPI mciGetDriverData16(UINT16 uDeviceID)
-{
-    return mciGetDriverData(uDeviceID);
-}
-
-/**************************************************************************
- * 			mciSetDriverData			[MMSYSTEM.707]
- */
-BOOL16 WINAPI mciSetDriverData16(UINT16 uDeviceID, DWORD data)
-{
-    return mciSetDriverData(uDeviceID, data);
-}
-
-/**************************************************************************
- * 				mciSendCommand			[MMSYSTEM.701]
- */
-DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2)
-{
-    DWORD		dwRet;
-
-    TRACE("(%04X, %s, %08X, %08X)\n",
-	  wDevID, MCI_MessageToString(wMsg), dwParam1, dwParam2);
-
-    dwRet = MCI_SendCommand(wDevID, wMsg, dwParam1, dwParam2, FALSE);
-    dwRet = MCI_CleanUp(dwRet, wMsg, (DWORD)MapSL(dwParam2));
-    TRACE("=> %d\n", dwRet);
-    return dwRet;
-}
-
-/**************************************************************************
- * 				mciGetDeviceID		       	[MMSYSTEM.703]
- */
-UINT16 WINAPI mciGetDeviceID16(LPCSTR lpstrName)
-{
-    TRACE("(\"%s\")\n", lpstrName);
-
-    return mciGetDeviceIDA(lpstrName);
-}
-
-/**************************************************************************
- * 				mciSetYieldProc			[MMSYSTEM.714]
- */
-BOOL16 WINAPI mciSetYieldProc16(UINT16 uDeviceID, YIELDPROC16 fpYieldProc, DWORD dwYieldData)
-{
-    LPWINE_MCIDRIVER	wmd;
-
-    TRACE("(%u, %p, %08x)\n", uDeviceID, fpYieldProc, dwYieldData);
-
-    if (!(wmd = MCI_GetDriver(uDeviceID))) {
-	WARN("Bad uDeviceID\n");
-	return FALSE;
-    }
-
-    wmd->lpfnYieldProc = (YIELDPROC)fpYieldProc;
-    wmd->dwYieldData   = dwYieldData;
-    wmd->bIs32         = FALSE;
-
-    return TRUE;
-}
-
-/**************************************************************************
- * 				mciGetDeviceIDFromElementID	[MMSYSTEM.715]
- */
-UINT16 WINAPI mciGetDeviceIDFromElementID16(DWORD dwElementID, LPCSTR lpstrType)
-{
-    FIXME("(%u, %s) stub\n", dwElementID, lpstrType);
-    return 0;
-}
-
-/**************************************************************************
- * 				mciGetYieldProc			[MMSYSTEM.716]
- */
-YIELDPROC16 WINAPI mciGetYieldProc16(UINT16 uDeviceID, DWORD* lpdwYieldData)
-{
-    LPWINE_MCIDRIVER	wmd;
-
-    TRACE("(%u, %p)\n", uDeviceID, lpdwYieldData);
-
-    if (!(wmd = MCI_GetDriver(uDeviceID))) {
-	WARN("Bad uDeviceID\n");
-	return NULL;
-    }
-    if (!wmd->lpfnYieldProc) {
-	WARN("No proc set\n");
-	return NULL;
-    }
-    if (wmd->bIs32) {
-	WARN("Proc is 32 bit\n");
-	return NULL;
-    }
-    if (lpdwYieldData) *lpdwYieldData = wmd->dwYieldData;
-    return (YIELDPROC16)wmd->lpfnYieldProc;
-}
-
-/**************************************************************************
- * 				mciGetCreatorTask		[MMSYSTEM.717]
- */
-HTASK16 WINAPI mciGetCreatorTask16(UINT16 uDeviceID)
-{
-    return HTASK_16(mciGetCreatorTask(uDeviceID));
-}
-
-/**************************************************************************
- * 				mciDriverYield			[MMSYSTEM.710]
- */
-UINT16 WINAPI mciDriverYield16(UINT16 uDeviceID)
-{
-    LPWINE_MCIDRIVER	wmd;
-    UINT16		ret = 0;
-
-    /*    TRACE("(%04x)\n", uDeviceID); */
-
-    if (!(wmd = MCI_GetDriver(uDeviceID)) || !wmd->lpfnYieldProc || wmd->bIs32) {
-	UserYield16();
-    } else {
-	ret = wmd->lpfnYieldProc(uDeviceID, wmd->dwYieldData);
-    }
-
-    return ret;
-}
-
-/* ###################################################
  * #                     MIDI                        #
  * ###################################################
  */
@@ -2581,15 +2434,6 @@ MMRESULT16 WINAPI timeEndPeriod16(UINT16 wPeriod)
 }
 
 /**************************************************************************
- * 				mciSendString			[MMSYSTEM.702]
- */
-DWORD WINAPI mciSendString16(LPCSTR lpstrCommand, LPSTR lpstrRet,
-			     UINT16 uRetLen, HWND16 hwndCallback)
-{
-    return mciSendStringA(lpstrCommand, lpstrRet, uRetLen, HWND_32(hwndCallback));
-}
-
-/**************************************************************************
  *                    	mciLoadCommandResource			[MMSYSTEM.705]
  */
 UINT16 WINAPI mciLoadCommandResource16(HINSTANCE16 hInst, LPCSTR resname, UINT16 type)






More information about the wine-patches mailing list