Import and merge Wine-20041201
Added: trunk/reactos/lib/winmm/
Added: trunk/reactos/lib/winmm/Makefile
Added: trunk/reactos/lib/winmm/Makefile.ros-template
Modified: trunk/reactos/lib/winmm/joystick.c
Modified: trunk/reactos/lib/winmm/lolvldrv.c
Added: trunk/reactos/lib/winmm/midimap/Makefile.ros-template
Added: trunk/reactos/lib/winmm/midimap/makefile
Added: trunk/reactos/lib/winmm/midimap/midimap.rc
Added: trunk/reactos/lib/winmm/midimap/midimap.spec
Added: trunk/reactos/lib/winmm/wavemap/Makefile.ros-template
Added: trunk/reactos/lib/winmm/wavemap/makefile
Added: trunk/reactos/lib/winmm/wavemap/msacm.spec
Added: trunk/reactos/lib/winmm/wavemap/wavemap.rc
Modified: trunk/reactos/lib/winmm/winemm.h
Modified: trunk/reactos/lib/winmm/winmm.c
Modified: trunk/reactos/lib/winmm/winmm_res.rc

Copied: trunk/reactos/lib/winmm (from rev 12641, vendor/wine/dlls/winmm/current)

Added: trunk/reactos/lib/winmm/Makefile
--- vendor/wine/dlls/winmm/current/Makefile	2004-12-31 16:44:51 UTC (rev 12641)
+++ trunk/reactos/lib/winmm/Makefile	2004-12-31 16:48:25 UTC (rev 12642)
@@ -0,0 +1,9 @@
+# $Id: Makefile 8376 2004-02-25 20:00:42Z sedwards $
+
+PATH_TO_TOP = ../..
+
+TARGET_TYPE = winedll
+
+include $(PATH_TO_TOP)/rules.mak
+
+include $(TOOLS_PATH)/helper.mk

Added: trunk/reactos/lib/winmm/Makefile.ros-template
--- vendor/wine/dlls/winmm/current/Makefile.ros-template	2004-12-31 16:44:51 UTC (rev 12641)
+++ trunk/reactos/lib/winmm/Makefile.ros-template	2004-12-31 16:48:25 UTC (rev 12642)
@@ -0,0 +1,21 @@
+# $Id: Makefile.ros-template 11910 2004-12-03 23:37:44Z blight $
+
+TARGET_NAME = winmm
+
+TARGET_OBJECTS = @C_SRCS@
+
+TARGET_CFLAGS = @EXTRADEFS@ -D__REACTOS__
+
+TARGET_SDKLIBS = @IMPORTS@ wine.a wine_uuid.a ntdll.a
+
+TARGET_BASE = $(TARGET_BASE_LIB_WINMM)
+
+TARGET_RC_SRCS = @RC_SRCS@
+TARGET_RC_BINSRC = @RC_BINSRC@
+TARGET_RC_BINARIES = @RC_BINARIES@
+
+default: all
+
+DEP_OBJECTS = $(TARGET_OBJECTS)
+
+include $(TOOLS_PATH)/depend.mk

Modified: trunk/reactos/lib/winmm/joystick.c
--- vendor/wine/dlls/winmm/current/joystick.c	2004-12-31 16:44:51 UTC (rev 12641)
+++ trunk/reactos/lib/winmm/joystick.c	2004-12-31 16:48:25 UTC (rev 12642)
@@ -41,6 +41,7 @@
 #include "wingdi.h"
 #include "winuser.h"
 #include "winnls.h"
+#include "winemm.h"
 
 #include "mmddk.h"
 

Modified: trunk/reactos/lib/winmm/lolvldrv.c
--- vendor/wine/dlls/winmm/current/lolvldrv.c	2004-12-31 16:44:51 UTC (rev 12641)
+++ trunk/reactos/lib/winmm/lolvldrv.c	2004-12-31 16:48:25 UTC (rev 12642)
@@ -761,11 +761,18 @@
 {
     TRACE("()\n");
     /* first load hardware drivers */
+#ifndef __REACTOS__
     MMDRV_Install("wineoss.drv",   	"wineoss.drv",	FALSE);
+#endif /* __REACTOS__ */
 
+#ifdef __REACTOS__
+    // AG: TESTING:
+    MMDRV_Install("mmdrv.dll", "mmdrv.dll", FALSE);
+#endif
+
     /* finish with mappers */
-    MMDRV_Install("wavemapper",	   	"msacm.drv",	TRUE);
-    MMDRV_Install("midimapper",   	"midimap.drv",	TRUE);
+    MMDRV_Install("wavemapper",     "msacm32.dll",    TRUE);
+    MMDRV_Install("midimapper",     "midimap.dll",  TRUE);
 
     return TRUE;
 }

Added: trunk/reactos/lib/winmm/midimap/Makefile.ros-template
--- vendor/wine/dlls/winmm/current/midimap/Makefile.ros-template	2004-12-31 16:44:51 UTC (rev 12641)
+++ trunk/reactos/lib/winmm/midimap/Makefile.ros-template	2004-12-31 16:48:25 UTC (rev 12642)
@@ -0,0 +1,23 @@
+# $Id: Makefile.ros-template 11910 2004-12-03 23:37:44Z blight $
+
+TARGET_NAME = midimap
+
+TARGET_OBJECTS = @C_SRCS@
+
+TARGET_CFLAGS = @EXTRADEFS@ -D__REACTOS__
+
+TARGET_SDKLIBS = @IMPORTS@ winmm.a wine.a wine_uuid.a ntdll.a
+
+TARGET_BASE = $(TARGET_LIB_BASE_MIDIMAP)
+
+TARGET_RC_SRCS = @RC_SRCS@
+TARGET_RC_BINSRC = @RC_BINSRC@
+TARGET_RC_BINARIES = @RC_BINARIES@
+
+TARGET_EXTENSION = .dll
+
+default: all
+
+DEP_OBJECTS = $(TARGET_OBJECTS)
+
+include $(TOOLS_PATH)/depend.mk

Added: trunk/reactos/lib/winmm/midimap/makefile
--- vendor/wine/dlls/winmm/current/midimap/makefile	2004-12-31 16:44:51 UTC (rev 12641)
+++ trunk/reactos/lib/winmm/midimap/makefile	2004-12-31 16:48:25 UTC (rev 12642)
@@ -0,0 +1,9 @@
+# $Id: makefile 8620 2004-03-10 15:22:45Z silverblade $
+
+PATH_TO_TOP = ../../..
+
+TARGET_TYPE = winedll
+
+include $(PATH_TO_TOP)/rules.mak
+
+include $(TOOLS_PATH)/helper.mk

Added: trunk/reactos/lib/winmm/midimap/midimap.rc
--- vendor/wine/dlls/winmm/current/midimap/midimap.rc	2004-12-31 16:44:51 UTC (rev 12641)
+++ trunk/reactos/lib/winmm/midimap/midimap.rc	2004-12-31 16:48:25 UTC (rev 12642)
@@ -0,0 +1,7 @@
+/* $Id: midimap.rc 11297 2004-10-16 20:27:43Z gvg $ */
+
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION	"ReactOS/WINE MIDI Mapper\0"
+#define REACTOS_STR_INTERNAL_NAME	"midimap\0"
+#define REACTOS_STR_ORIGINAL_FILENAME	"midimap.drv\0"
+#include <reactos/version.rc>

Added: trunk/reactos/lib/winmm/midimap/midimap.spec
--- vendor/wine/dlls/winmm/current/midimap/midimap.spec	2004-12-31 16:44:51 UTC (rev 12641)
+++ trunk/reactos/lib/winmm/midimap/midimap.spec	2004-12-31 16:48:25 UTC (rev 12642)
@@ -0,0 +1,2 @@
+@ stdcall DriverProc(long long long long long) MIDIMAP_DriverProc
+@ stdcall modMessage(long long long long long) MIDIMAP_modMessage

Added: trunk/reactos/lib/winmm/wavemap/Makefile.ros-template
--- vendor/wine/dlls/winmm/current/wavemap/Makefile.ros-template	2004-12-31 16:44:51 UTC (rev 12641)
+++ trunk/reactos/lib/winmm/wavemap/Makefile.ros-template	2004-12-31 16:48:25 UTC (rev 12642)
@@ -0,0 +1,23 @@
+# $Id: Makefile.ros-template 11910 2004-12-03 23:37:44Z blight $
+
+TARGET_NAME = msacm
+
+TARGET_OBJECTS = @C_SRCS@
+
+TARGET_CFLAGS = @EXTRADEFS@ -D__REACTOS__
+
+TARGET_SDKLIBS = @IMPORTS@ winmm.a wine.a wine_uuid.a ntdll.a
+
+TARGET_BASE = 0x76160000
+
+TARGET_RC_SRCS = wavemap.rc
+TARGET_RC_BINSRC = @RC_BINSRC@
+TARGET_RC_BINARIES = @RC_BINARIES@
+
+TARGET_EXTENSION = .drv
+
+default: all
+
+DEP_OBJECTS = $(TARGET_OBJECTS)
+
+include $(TOOLS_PATH)/depend.mk

Added: trunk/reactos/lib/winmm/wavemap/makefile
--- vendor/wine/dlls/winmm/current/wavemap/makefile	2004-12-31 16:44:51 UTC (rev 12641)
+++ trunk/reactos/lib/winmm/wavemap/makefile	2004-12-31 16:48:25 UTC (rev 12642)
@@ -0,0 +1,9 @@
+# $Id: makefile 8620 2004-03-10 15:22:45Z silverblade $
+
+PATH_TO_TOP = ../../..
+
+TARGET_TYPE = winedll
+
+include $(PATH_TO_TOP)/rules.mak
+
+include $(TOOLS_PATH)/helper.mk

Added: trunk/reactos/lib/winmm/wavemap/msacm.spec
--- vendor/wine/dlls/winmm/current/wavemap/msacm.spec	2004-12-31 16:44:51 UTC (rev 12641)
+++ trunk/reactos/lib/winmm/wavemap/msacm.spec	2004-12-31 16:48:25 UTC (rev 12642)
@@ -0,0 +1,3 @@
+@ stdcall DriverProc(long long long long long) WAVEMAP_DriverProc
+@ stdcall widMessage(long long long long long) WAVEMAP_widMessage
+@ stdcall wodMessage(long long long long long) WAVEMAP_wodMessage

Added: trunk/reactos/lib/winmm/wavemap/wavemap.rc
--- vendor/wine/dlls/winmm/current/wavemap/wavemap.rc	2004-12-31 16:44:51 UTC (rev 12641)
+++ trunk/reactos/lib/winmm/wavemap/wavemap.rc	2004-12-31 16:48:25 UTC (rev 12642)
@@ -0,0 +1,7 @@
+/* $Id: wavemap.rc 11297 2004-10-16 20:27:43Z gvg $ */
+
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION	"ReactOS/WINE Wave Mapper\0"
+#define REACTOS_STR_INTERNAL_NAME	"wavemap\0"
+#define REACTOS_STR_ORIGINAL_FILENAME	"wavemap.drv\0"
+#include <reactos/version.rc>

Modified: trunk/reactos/lib/winmm/winemm.h
--- vendor/wine/dlls/winmm/current/winemm.h	2004-12-31 16:44:51 UTC (rev 12641)
+++ trunk/reactos/lib/winmm/winemm.h	2004-12-31 16:48:25 UTC (rev 12642)
@@ -222,6 +222,7 @@
 typedef	WINMM_MapType	        (*MMDRV_MAPFUNC)(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2);
 typedef	WINMM_MapType	        (*MMDRV_UNMAPFUNC)(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT ret);
 
+HDRVR WINAPI	OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lParam2);
 LPWINE_DRIVER	DRIVER_FindFromHDrvr(HDRVR hDrvr);
 BOOL		DRIVER_GetLibName(LPCSTR keyName, LPCSTR sectName, LPSTR buf, int sz);
 LPWINE_DRIVER	DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2);

Modified: trunk/reactos/lib/winmm/winmm.c
--- vendor/wine/dlls/winmm/current/winmm.c	2004-12-31 16:44:51 UTC (rev 12641)
+++ trunk/reactos/lib/winmm/winmm.c	2004-12-31 16:48:25 UTC (rev 12642)
@@ -94,7 +94,9 @@
 	return FALSE;
     WINMM_IData->hWinMM32Instance = hInstDLL;
     InitializeCriticalSection(&WINMM_IData->cs);
+/* FIXME crashes in ReactOS
     WINMM_IData->cs.DebugInfo->Spare[1] = (DWORD)"WINMM_IData";
+*/
     WINMM_IData->psStopEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
     WINMM_IData->psLastEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
     TRACE("Created IData (%p)\n", WINMM_IData);
@@ -137,10 +139,12 @@
         loaded = -1;
         if (h)
         {
+#ifndef __REACTOS__
             pGetModuleHandle16 = (void*)GetProcAddress(h, "GetModuleHandle16");
             pLoadLibrary16 = (void*)GetProcAddress(h, "LoadLibrary16");
             if (pGetModuleHandle16 && pLoadLibrary16 &&
                 (pGetModuleHandle16("MMSYSTEM.DLL") || pLoadLibrary16("MMSYSTEM.DLL")))
+#endif /* __REACTOS__ */
                 loaded = 1;
         }
     }
@@ -669,7 +673,7 @@
 /**************************************************************************
  * 				mixerMessage		[WINMM.@]
  */
-UINT WINAPI mixerMessage(HMIXER hmix, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
+DWORD WINAPI mixerMessage(HMIXER hmix, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
 {
     LPWINE_MLD		wmld;
 
@@ -2669,8 +2673,8 @@
  *			waveOutOpen			[WINMM.@]
  * All the args/structs have the same layout as the win16 equivalents
  */
-UINT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID,
-                       const LPWAVEFORMATEX lpFormat, DWORD_PTR dwCallback,
+MMRESULT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID,
+                       LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback,
                        DWORD_PTR dwInstance, DWORD dwFlags)
 {
     return WAVE_Open((HANDLE*)lphWaveOut, uDeviceID, MMDRV_WAVEOUT, lpFormat,
@@ -3054,8 +3058,8 @@
 /**************************************************************************
  * 				waveInOpen			[WINMM.@]
  */
-UINT WINAPI waveInOpen(HWAVEIN* lphWaveIn, UINT uDeviceID,
-		       const LPWAVEFORMATEX lpFormat, DWORD_PTR dwCallback,
+MMRESULT WINAPI waveInOpen(HWAVEIN* lphWaveIn, UINT uDeviceID,
+		       LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback,
 		       DWORD_PTR dwInstance, DWORD dwFlags)
 {
     return WAVE_Open((HANDLE*)lphWaveIn, uDeviceID, MMDRV_WAVEIN, lpFormat,

Modified: trunk/reactos/lib/winmm/winmm_res.rc
--- vendor/wine/dlls/winmm/current/winmm_res.rc	2004-12-31 16:44:51 UTC (rev 12641)
+++ trunk/reactos/lib/winmm/winmm_res.rc	2004-12-31 16:48:25 UTC (rev 12642)
@@ -34,7 +34,7 @@
 #include "winmm_Es.rc"
 #include "winmm_Fr.rc"
 #include "winmm_It.rc"
-#include "winmm_Ja.rc"
+/* #include "winmm_Ja.rc" */ /* Gives error during ReactOS build */
 #include "winmm_Nl.rc"
 #include "winmm_Pt.rc"
 #include "winmm_Ru.rc"