Author: sserapion Date: Mon Nov 9 09:31:11 2009 New Revision: 44041
URL: http://svn.reactos.org/svn/reactos?rev=44041&view=rev Log: Sync with trunk and additional 64bit build hacks^H^H^H^H^H fixes.
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/driver.c branches/ros-amd64-bringup/reactos/dll/win32/winmm/mci.c branches/ros-amd64-bringup/reactos/dll/win32/winmm/midimap/midimap.c branches/ros-amd64-bringup/reactos/dll/win32/winmm/mmio.c branches/ros-amd64-bringup/reactos/dll/win32/winmm/time.c branches/ros-amd64-bringup/reactos/dll/win32/winmm/winemm.h branches/ros-amd64-bringup/reactos/dll/win32/winmm/winemm16.h branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm.c branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm.rbuild branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Br.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Cs.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_De.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_En.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Es.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Fr.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Hu.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Id.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_It.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Ja.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Nl.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_No.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Pl.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Pt.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Ru.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Si.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Sk.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Uk.rc branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_res.rc
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/driver.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/driver.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/driver.c [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -144,8 +144,8 @@ * SendDriverMessage [WINMM.@] * DrvSendMessage [WINMM.@] */ -LRESULT WINAPI SendDriverMessage(HDRVR hDriver, UINT msg, LONG lParam1, - LONG lParam2) +LRESULT WINAPI SendDriverMessage(HDRVR hDriver, UINT msg, LPARAM lParam1, + LPARAM lParam2) { LPWINE_DRIVER lpDrv; LRESULT retval = 0; @@ -253,31 +253,23 @@ static const WCHAR wszSystemIni[] = {'S','Y','S','T','E','M','.','I','N','I',0}; WCHAR wsznull = '\0';
- /* This takes us as far as Windows NT\CurrentVersion */ + TRACE("registry: %s, %s, %p, %d\n", debugstr_w(keyName), debugstr_w(sectName), buf, sz); + lRet = RegOpenKeyExW(HKEY_LOCAL_MACHINE, HKLM_BASE, 0, KEY_QUERY_VALUE, &hKey); - - if (lRet == ERROR_SUCCESS) - { - /* Now we descend into the section name that we were given */ - lRet = RegOpenKeyExW(hKey, sectName, 0, KEY_QUERY_VALUE, &hSecKey); - - if (lRet == ERROR_SUCCESS) - { - /* Retrieve the desired value - this is the filename of the lib */ + if (lRet == ERROR_SUCCESS) { + lRet = RegOpenKeyExW(hKey, sectName, 0, KEY_QUERY_VALUE, &hSecKey); + if (lRet == ERROR_SUCCESS) { bufLen = sz; - lRet = RegQueryValueExW(hSecKey, keyName, 0, 0, (void*)buf, &bufLen); - RegCloseKey( hSecKey ); - } - + lRet = RegQueryValueExW(hSecKey, keyName, 0, 0, (void*)buf, &bufLen); + RegCloseKey( hSecKey ); + } RegCloseKey( hKey ); } - - /* Finish up if we've got what we want from the registry */ - 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, * to support native installations where system.ini is still used */ + TRACE("system.ini: %s, %s, %p, %d\n", debugstr_w(keyName), debugstr_w(sectName), buf, sz); return GetPrivateProfileStringW(sectName, keyName, &wsznull, buf, sz / sizeof(WCHAR), wszSystemIni); }
@@ -295,40 +287,21 @@
TRACE("(%s, %08lX);\n", debugstr_w(fn), lParam2);
- if ((ptr = strchrW(fn, ' ')) != NULL) - { - *ptr++ = '\0'; - - while (*ptr == ' ') - ptr++; - - if (*ptr == '\0') - ptr = NULL; + if ((ptr = strchrW(fn, ' ')) != NULL) { + *ptr++ = '\0'; + while (*ptr == ' ') ptr++; + if (*ptr == '\0') ptr = NULL; }
lpDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_DRIVER)); - - if (lpDrv == NULL) - { - cause = "OOM"; - goto exit; - } - - if ((hModule = LoadLibraryW(fn)) == 0) - { - cause = "Not a 32 bit lib"; - goto exit; - } + if (lpDrv == NULL) {cause = "OOM"; goto exit;} + + if ((hModule = LoadLibraryW(fn)) == 0) {cause = "Not a 32 bit lib"; goto exit;}
lpDrv->lpDrvProc = (DRIVERPROC)GetProcAddress(hModule, "DriverProc"); - - if (lpDrv->lpDrvProc == NULL) - { - cause = "no DriverProc"; - goto exit; - } - - lpDrv->dwFlags = 0; + if (lpDrv->lpDrvProc == NULL) {cause = "no DriverProc"; goto exit;} + + lpDrv->dwFlags = 0; lpDrv->hModule = hModule; lpDrv->dwDriverID = 0;
@@ -352,18 +325,15 @@ cause = "load1 failed"; goto exit; } + lpDrv->dwFlags |= WINE_GDF_SESSION; return ret; }
if (!DRIVER_AddToList(lpDrv, (LPARAM)ptr, lParam2)) - { - cause = "load failed"; - goto exit; - } + {cause = "load failed"; goto exit;}
TRACE("=> %p\n", lpDrv); return lpDrv; - exit: FreeLibrary(hModule); HeapFree(GetProcessHeap(), 0, lpDrv); @@ -413,61 +383,37 @@ * OpenDriver [WINMM.@] * DrvOpen [WINMM.@] */ -HDRVR WINAPI OpenDriver(LPCWSTR lpDriverName, LPCWSTR lpSectionName, LONG lParam) +HDRVR WINAPI OpenDriver(LPCWSTR lpDriverName, LPCWSTR lpSectionName, LPARAM lParam) { LPWINE_DRIVER lpDrv = NULL; - WCHAR libName[128]; + WCHAR libName[MAX_PATH + 1]; LPCWSTR lsn = lpSectionName;
TRACE("(%s, %s, 0x%08lx);\n", debugstr_w(lpDriverName), debugstr_w(lpSectionName), lParam);
- /* If no section name is specified, either the caller is intending on - opening a driver by filename, or wants to open a user-installable - driver that has an entry in the Drivers32 key in the registry */ - if (lsn == NULL) - { - /* Default registry key */ + DRIVER_Dump("BEFORE:"); + + if (lsn == NULL) { static const WCHAR wszDrivers32[] = {'D','r','i','v','e','r','s','3','2',0}; - - lstrcpynW(libName, lpDriverName, sizeof(libName) / sizeof(WCHAR)); - - /* Try and open the driver by filename */ - if ( (lpDrv = DRIVER_TryOpenDriver32(libName, lParam)) ) - goto the_end; - - /* If we got here, the file wasn't found. So we assume the caller - wanted a driver specified under the Drivers32 registry key */ - lsn = wszDrivers32; - } - - /* Attempt to locate the driver filename in the registry */ - if ( DRIVER_GetLibName(lpDriverName, lsn, libName, sizeof(libName)) ) - { - /* Now we have the filename, we can try and load it */ - if ( (lpDrv = DRIVER_TryOpenDriver32(libName, lParam)) ) - goto the_end; - } - - /* now we will try a 16 bit driver (and add all the glue to make it work... which - * is located in our mmsystem implementation) - * so ensure, we can load our mmsystem, otherwise just fail - */ - WINMM_CheckForMMSystem(); -#if 0 - if (pFnOpenDriver16 && - (lpDrv = pFnOpenDriver16(lpDriverName, lpSectionName, lParam))) - { - if (DRIVER_AddToList(lpDrv, 0, lParam)) goto the_end; - HeapFree(GetProcessHeap(), 0, lpDrv); - } + lstrcpynW(libName, lpDriverName, sizeof(libName) / sizeof(WCHAR)); + + if ((lpDrv = DRIVER_TryOpenDriver32(libName, lParam))) + goto the_end; + lsn = wszDrivers32; + } + if (DRIVER_GetLibName(lpDriverName, lsn, libName, sizeof(libName)) && + (lpDrv = DRIVER_TryOpenDriver32(libName, lParam))) + goto the_end; + TRACE("Failed to open driver %s from system.ini file, section %s\n", debugstr_w(lpDriverName), debugstr_w(lpSectionName)); -#endif - return 0; - - the_end: - if (lpDrv) TRACE("=> %p\n", lpDrv); + +the_end: + TRACE("=> %p\n", lpDrv); + + DRIVER_Dump("AFTER:"); + return (HDRVR)lpDrv; }
@@ -475,7 +421,7 @@ * CloseDriver [WINMM.@] * DrvClose [WINMM.@] */ -LRESULT WINAPI CloseDriver(HDRVR hDrvr, LONG lParam1, LONG lParam2) +LRESULT WINAPI CloseDriver(HDRVR hDrvr, LPARAM lParam1, LPARAM lParam2) { BOOL ret; LPWINE_DRIVER lpDrv; @@ -567,8 +513,8 @@ * DefDriverProc [WINMM.@] * DrvDefDriverProc [WINMM.@] */ -LONG WINAPI DefDriverProc(DWORD dwDriverIdentifier, HDRVR hDrv, - UINT Msg, LONG lParam1, LONG lParam2) +LRESULT WINAPI DefDriverProc(DWORD_PTR dwDriverIdentifier, HDRVR hDrv, + UINT Msg, LPARAM lParam1, LPARAM lParam2) { switch (Msg) { case DRV_LOAD:
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/mci.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/mci.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/mci.c [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -834,7 +834,7 @@
wmd->lpfnYieldProc = MCI_DefYieldProc; wmd->dwYieldData = VK_CANCEL; - wmd->CreatorThread = GetCurrentThreadId(); + wmd->CreatorThread = GetCurrentThread();
EnterCriticalSection(&WINMM_cs); /* wmd must be inserted in list before sending opening the driver, because it @@ -1155,8 +1155,8 @@ { static const WCHAR wszLd [] = {'%','l','d',0}; static const WCHAR wszLd4 [] = {'%','l','d',' ','%','l','d',' ','%','l','d',' ','%','l','d',0}; - static const WCHAR wszCol3[] = {'%','d',':','%','d',':','%','d',0}; - static const WCHAR wszCol4[] = {'%','d',':','%','d',':','%','d',':','%','d',0}; + static const WCHAR wszCol3[] = {'%','0','2','d',':','%','0','2','d',':','%','0','2','d',0}; + static const WCHAR wszCol4[] = {'%','0','2','d',':','%','0','2','d',':','%','0','2','d',':','%','0','2','d',0};
if (lpstrRet) { switch (retType) { @@ -1391,20 +1391,20 @@
/* set up call back */ if (dwFlags & MCI_NOTIFY) { - data[0] = (DWORD)hwndCallback; + data[0] = (DWORD_PTR)hwndCallback; }
/* FIXME: the command should get it's own notification window set up and * ask for device closing while processing the notification mechanism */ if (lpstrRet && uRetLen) *lpstrRet = '\0'; - +/* TRACE("[%d, %s, %08x, %08x/%s %08x/%s %08x/%s %08x/%s %08x/%s %08x/%s]\n", wmd->wDeviceID, MCI_MessageToString(MCI_GetMessage(lpCmd)), dwFlags, data[0], debugstr_w((WCHAR *)data[0]), data[1], debugstr_w((WCHAR *)data[1]), data[2], debugstr_w((WCHAR *)data[2]), data[3], debugstr_w((WCHAR *)data[3]), data[4], debugstr_w((WCHAR *)data[4]), data[5], debugstr_w((WCHAR *)data[5])); - +*/ if (strcmpW(verb, wszOpen) == 0) { if ((dwRet = MCI_FinishOpen(wmd, (LPMCI_OPEN_PARMSW)data, dwFlags))) MCI_UnLoadMciDriver(wmd); @@ -1466,7 +1466,7 @@ ret = mciSendStringA(lpstrCommand, strRet, sizeof(strRet), 0); if (ret != 0) { if (!mciGetErrorStringA(ret, strRet, sizeof(strRet))) { - sprintf(strRet, "Unknown MCI error (%lu)", ret); + sprintf(strRet, "Unknown MCI error (%d)", ret); } MessageBoxA(0, strRet, "Error in mciExecute()", MB_OK); } @@ -1676,7 +1676,7 @@
TRACE("(%04x, %08X, %p)\n", wDevID, dwParam, lpParms);
- if (wDevID == (UINT16)MCI_ALL_DEVICE_ID) { + if (wDevID == MCI_ALL_DEVICE_ID) { /* FIXME: shall I notify once after all is done, or for * each of the open drivers ? if the latest, which notif * to return when only one fails ? @@ -1746,8 +1746,8 @@ LPWINE_MCIDRIVER wmd; HKEY hKey;
- if (lpParms == NULL || lpParms->lpstrReturn == NULL) - return MCIERR_NULL_PARAMETER_BLOCK; + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; + if (lpParms->lpstrReturn == NULL) return MCIERR_PARAM_OVERFLOW;
TRACE("(%08x, %08X, %p[num=%d, wDevTyp=%u])\n", uDevID, dwFlags, lpParms, lpParms->dwNumber, lpParms->wDeviceType); @@ -2079,7 +2079,7 @@ * mciSendCommandW [WINMM.@] * */ -DWORD WINAPI mciSendCommandW(MCIDEVICEID wDevID, UINT wMsg, DWORD dwParam1, DWORD_PTR dwParam2) +DWORD WINAPI mciSendCommandW(MCIDEVICEID wDevID, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { DWORD dwRet;
@@ -2095,7 +2095,7 @@ /************************************************************************** * mciSendCommandA [WINMM.@] */ -DWORD WINAPI mciSendCommandA(MCIDEVICEID wDevID, UINT wMsg, DWORD dwParam1, DWORD_PTR dwParam2) +DWORD WINAPI mciSendCommandA(MCIDEVICEID wDevID, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { DWORD ret; int mapped;
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/midimap/midimap.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/midimap/midimap.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/midimap/midimap.c [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -16,7 +16,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * TODO: * notification has to be implemented @@ -270,7 +270,7 @@
if (MIDIMAP_LoadSettings(mom)) { - *lpdwUser = (DWORD_PTR)mom; + *lpdwUser = (DWORD)mom; mom->self = mom;
return MMSYSERR_NOERROR; @@ -306,7 +306,7 @@ return ret; }
-static DWORD modLongData(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2) +static DWORD modLongData(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD dwParam2) { WORD chn; DWORD ret = MMSYSERR_NOERROR; @@ -330,7 +330,7 @@ return ret; }
-static DWORD modData(MIDIMAPDATA* mom, DWORD_PTR dwParam) +static DWORD modData(MIDIMAPDATA* mom, DWORD dwParam) { BYTE lb = LOBYTE(LOWORD(dwParam)); WORD chn = lb & 0x0F; @@ -393,7 +393,7 @@ return ret; }
-static DWORD modPrepare(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2) +static DWORD modPrepare(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD dwParam2) { if (MIDIMAP_IsBadData(mom)) return MMSYSERR_ERROR; if (lpMidiHdr->dwFlags & (MHDR_ISSTRM|MHDR_PREPARED)) @@ -403,7 +403,7 @@ return MMSYSERR_NOERROR; }
-static DWORD modUnprepare(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2) +static DWORD modUnprepare(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD dwParam2) { if (MIDIMAP_IsBadData(mom)) return MMSYSERR_ERROR; if ((lpMidiHdr->dwFlags & MHDR_ISSTRM) || !(lpMidiHdr->dwFlags & MHDR_PREPARED)) @@ -413,7 +413,7 @@ return MMSYSERR_NOERROR; }
-static DWORD modGetDevCaps(UINT wDevID, MIDIMAPDATA* mom, LPMIDIOUTCAPSW lpMidiCaps, DWORD_PTR size) +static DWORD modGetDevCaps(UINT wDevID, MIDIMAPDATA* mom, LPMIDIOUTCAPSW lpMidiCaps, DWORD size) { static const WCHAR name[] = {'W','i','n','e',' ','m','i','d','i',' ','m','a','p','p','e','r',0}; lpMidiCaps->wMid = 0x00FF; @@ -451,8 +451,8 @@ /************************************************************************** * modMessage (MIDIMAP.@) */ -DWORD WINAPI MIDIMAP_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, - DWORD_PTR dwParam1, DWORD_PTR dwParam2) +DWORD WINAPI MIDIMAP_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser, + DWORD dwParam1, DWORD dwParam2) { TRACE("(%u, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); @@ -492,7 +492,7 @@ /************************************************************************** * MIDIMAP_drvOpen [internal] */ -static LRESULT MIDIMAP_drvOpen(LPSTR str) +static DWORD MIDIMAP_drvOpen(LPSTR str) { MIDIOUTCAPSW moc; unsigned dev, i; @@ -527,7 +527,7 @@ /************************************************************************** * MIDIMAP_drvClose [internal] */ -static LRESULT MIDIMAP_drvClose(DWORD_PTR dwDevID) +static DWORD MIDIMAP_drvClose(DWORD dwDevID) { if (midiOutPorts) { @@ -541,8 +541,8 @@ /************************************************************************** * DriverProc (MIDIMAP.@) */ -LRESULT CALLBACK MIDIMAP_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, - LPARAM dwParam1, LPARAM dwParam2) +LONG CALLBACK MIDIMAP_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, + DWORD dwParam1, DWORD dwParam2) { /* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */ /* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/mmio.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/mmio.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/mmio.c [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -666,7 +666,7 @@ (LPARAM)szFileName, 0, FALSE);
/* grab file size, when possible */ - wm->dwFileSize = GetFileSize((HANDLE)wm->info.adwInfo[0], NULL); + wm->dwFileSize = GetFileSize(LongToHandle(wm->info.adwInfo[0]), NULL);
if (refmminfo->wErrorRet == 0) return wm->info.hmmio;
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/time.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/time.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/time.c [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -17,14 +17,13 @@ * * 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 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "config.h" #include "wine/port.h"
#include <stdarg.h> -#include <errno.h> #include <time.h> #ifdef HAVE_SYS_TIME_H # include <sys/time.h> @@ -32,12 +31,6 @@ #ifdef HAVE_UNISTD_H # include <unistd.h> #endif -#ifdef HAVE_POLL_H -#include <poll.h> -#endif -#ifdef HAVE_SYS_POLL_H -#include <sys/poll.h> -#endif
#include "windef.h" #include "winbase.h" @@ -45,47 +38,26 @@
#include "winemm.h"
-#include "wine/list.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(mmtime);
typedef struct tagWINE_TIMERENTRY { - struct list entry; - UINT wDelay; - UINT wResol; + UINT wDelay; + UINT wResol; LPTIMECALLBACK lpFunc; /* can be lots of things */ - DWORD_PTR dwUser; - UINT16 wFlags; - UINT16 wTimerID; - DWORD dwTriggerTime; + DWORD dwUser; + UINT16 wFlags; + UINT16 wTimerID; + DWORD dwTriggerTime; + struct tagWINE_TIMERENTRY* lpNext; } WINE_TIMERENTRY, *LPWINE_TIMERENTRY;
-static struct list timer_list = LIST_INIT(timer_list); - -static CRITICAL_SECTION TIME_cbcrst; -static CRITICAL_SECTION_DEBUG critsect_debug = -{ - 0, 0, &TIME_cbcrst, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": TIME_cbcrst") } -}; -static CRITICAL_SECTION TIME_cbcrst = { &critsect_debug, -1, 0, 0, 0, 0 }; - static HANDLE TIME_hMMTimer; +static LPWINE_TIMERENTRY TIME_TimersList; +static HANDLE TIME_hKillEvent; +static HANDLE TIME_hWakeEvent; static BOOL TIME_TimeToDie = TRUE; -static int TIME_fdWake[2] = { -1, -1 }; - -/* link timer at the appropriate spot in the list */ -static inline void link_timer( WINE_TIMERENTRY *timer ) -{ - WINE_TIMERENTRY *next; - - LIST_FOR_EACH_ENTRY( next, &timer_list, WINE_TIMERENTRY, entry ) - if ((int)(next->dwTriggerTime - timer->dwTriggerTime) >= 0) break; - - list_add_before( &next->entry, &timer->entry ); -}
/* * Some observations on the behavior of winmm on Windows. @@ -94,7 +66,7 @@ * * Second, a brief survey of a variety of Win 2k and Win X * machines showed that a 'standard' (aka default) timer - * resolution was 1 ms (Win9x is documented as being 1). However, one + * resolution was 1 ms (Win9x is documented as being 1). However, one * machine had a standard timer resolution of 10 ms. * * Further, if we set our default resolution to 1, @@ -116,15 +88,54 @@ #define MMSYSTIME_MININTERVAL (1) #define MMSYSTIME_MAXINTERVAL (65535)
-#ifdef HAVE_POLL + +static void TIME_TriggerCallBack(LPWINE_TIMERENTRY lpTimer) +{ + TRACE("%04lx:CallBack => lpFunc=%p wTimerID=%04X dwUser=%08lX dwTriggerTime %ld(delta %ld)\n", + GetCurrentThreadId(), lpTimer->lpFunc, lpTimer->wTimerID, lpTimer->dwUser, + lpTimer->dwTriggerTime, GetTickCount() - lpTimer->dwTriggerTime); + + /* - TimeProc callback that is called here is something strange, under Windows 3.1x it is called + * during interrupt time, is allowed to execute very limited number of API calls (like + * PostMessage), and must reside in DLL (therefore uses stack of active application). So I + * guess current implementation via SetTimer has to be improved upon. + */ + switch (lpTimer->wFlags & 0x30) { + case TIME_CALLBACK_FUNCTION: + (lpTimer->lpFunc)(lpTimer->wTimerID, 0, lpTimer->dwUser, 0, 0); + break; + case TIME_CALLBACK_EVENT_SET: + SetEvent((HANDLE)lpTimer->lpFunc); + break; + case TIME_CALLBACK_EVENT_PULSE: + PulseEvent((HANDLE)lpTimer->lpFunc); + break; + default: + FIXME("Unknown callback type 0x%04x for mmtime callback (%p), ignored.\n", + lpTimer->wFlags, lpTimer->lpFunc); + break; + } +}
/************************************************************************** * TIME_MMSysTimeCallback */ -static int TIME_MMSysTimeCallback(void) -{ - WINE_TIMERENTRY *timer, *to_free; - int delta_time; +static DWORD CALLBACK TIME_MMSysTimeCallback() +{ +static int nSizeLpTimers; +static LPWINE_TIMERENTRY lpTimers; + + LPWINE_TIMERENTRY timer, *ptimer, *next_ptimer; + int idx; + DWORD cur_time; + DWORD delta_time; + DWORD ret_time = INFINITE; + DWORD adjust_time; + + + /* optimize for the most frequent case - no events */ + if (! TIME_TimersList) + return(ret_time);
/* since timeSetEvent() and timeKillEvent() can be called * from 16 bit code, there are cases where win16 lock is @@ -136,60 +147,84 @@ * To cope with that, we just copy the WINE_TIMERENTRY struct * that need to trigger the callback, and call it without the * mm timer crit sect locked. + * the hKillTimeEvent is used to mark the section where we + * handle the callbacks so we can do synchronous kills. + * EPP 99/07/13, updated 04/01/10 */ + idx = 0; + cur_time = GetTickCount();
EnterCriticalSection(&WINMM_cs); - for (;;) - { - struct list *ptr = list_head( &timer_list ); - if (!ptr) + for (ptimer = &TIME_TimersList; *ptimer != NULL; ) { + timer = *ptimer; + next_ptimer = &timer->lpNext; + if (cur_time >= timer->dwTriggerTime) { - delta_time = -1; - break; + if (timer->lpFunc) { + if (idx == nSizeLpTimers) { + if (lpTimers) + lpTimers = (LPWINE_TIMERENTRY) + HeapReAlloc(GetProcessHeap(), 0, lpTimers, + ++nSizeLpTimers * sizeof(WINE_TIMERENTRY)); + else + lpTimers = (LPWINE_TIMERENTRY) + HeapAlloc(GetProcessHeap(), 0, + ++nSizeLpTimers * sizeof(WINE_TIMERENTRY)); + } + lpTimers[idx++] = *timer; + + } + + /* Update the time after we make the copy to preserve + the original trigger time */ + timer->dwTriggerTime += timer->wDelay; + + /* TIME_ONESHOT is defined as 0 */ + if (!(timer->wFlags & TIME_PERIODIC)) + { + /* unlink timer from timers list */ + *ptimer = *next_ptimer; + HeapFree(GetProcessHeap(), 0, timer); + + /* We don't need to trigger oneshots again */ + delta_time = INFINITE; + } + else + { + /* Compute when this event needs this function + to be called again */ + if (timer->dwTriggerTime <= cur_time) + delta_time = 0; + else + delta_time = timer->dwTriggerTime - cur_time; + } } - - timer = LIST_ENTRY( ptr, WINE_TIMERENTRY, entry ); - delta_time = timer->dwTriggerTime - GetTickCount(); - if (delta_time > 0) break; - - list_remove( &timer->entry ); - if (timer->wFlags & TIME_PERIODIC) - { - timer->dwTriggerTime += timer->wDelay; - link_timer( timer ); /* restart it */ - to_free = NULL; - } - else to_free = timer; - - switch(timer->wFlags & (TIME_CALLBACK_EVENT_SET|TIME_CALLBACK_EVENT_PULSE)) - { - case TIME_CALLBACK_EVENT_SET: - SetEvent(timer->lpFunc); - break; - case TIME_CALLBACK_EVENT_PULSE: - PulseEvent(timer->lpFunc); - break; - case TIME_CALLBACK_FUNCTION: - { - DWORD_PTR user = timer->dwUser; - UINT16 id = timer->wTimerID; - UINT16 flags = timer->wFlags; - LPTIMECALLBACK func = timer->lpFunc; - - if (flags & TIME_KILL_SYNCHRONOUS) EnterCriticalSection(&TIME_cbcrst); - LeaveCriticalSection(&WINMM_cs); - - func(id, 0, user, 0, 0); - - EnterCriticalSection(&WINMM_cs); - if (flags & TIME_KILL_SYNCHRONOUS) LeaveCriticalSection(&TIME_cbcrst); - } - break; - } - HeapFree( GetProcessHeap(), 0, to_free ); - } + else + delta_time = timer->dwTriggerTime - cur_time; + + /* Determine when we need to return to this function */ + ret_time = min(ret_time, delta_time); + + ptimer = next_ptimer; + } + if (TIME_hKillEvent) ResetEvent(TIME_hKillEvent); LeaveCriticalSection(&WINMM_cs); - return delta_time; + + while (idx > 0) TIME_TriggerCallBack(&lpTimers[--idx]); + if (TIME_hKillEvent) SetEvent(TIME_hKillEvent); + + /* Finally, adjust the recommended wait time downward + by the amount of time the processing routines + actually took */ + adjust_time = GetTickCount() - cur_time; + if (adjust_time > ret_time) + ret_time = 0; + else + ret_time -= adjust_time; + + /* We return the amount of time our caller should sleep + before needing to check in on us again */ + return(ret_time); }
/************************************************************************** @@ -197,12 +232,8 @@ */ static DWORD CALLBACK TIME_MMSysTimeThread(LPVOID arg) { - int sleep_time, ret; - char readme[16]; - struct pollfd pfd; - - pfd.fd = TIME_fdWake[0]; - pfd.events = POLLIN; + DWORD sleep_time; + DWORD rc;
TRACE("Starting main winmm thread\n");
@@ -212,23 +243,19 @@ new event; it's not clear if that would be worth it or not. */
- while (! TIME_TimeToDie) + while (! TIME_TimeToDie) { - sleep_time = TIME_MMSysTimeCallback(); + sleep_time = TIME_MMSysTimeCallback();
if (sleep_time == 0) continue;
- if ((ret = poll(&pfd, 1, sleep_time)) < 0) + rc = WaitForSingleObject(TIME_hWakeEvent, sleep_time); + if (rc != WAIT_TIMEOUT && rc != WAIT_OBJECT_0) { - if (errno != EINTR && errno != EAGAIN) - { - ERR("Unexpected error in poll: %s(%d)\n", strerror(errno), errno); - break; - } - } - - while (ret > 0) ret = read(TIME_fdWake[0], readme, sizeof(readme)); + FIXME("Unexpected error %ld(%ld) in timer thread\n", rc, GetLastError()); + break; + } } TRACE("Exiting main winmm thread\n"); return 0; @@ -237,50 +264,34 @@ /************************************************************************** * TIME_MMTimeStart */ -static void TIME_MMTimeStart(void) +void TIME_MMTimeStart(void) { if (!TIME_hMMTimer) { - if (pipe(TIME_fdWake) < 0) - { - TIME_fdWake[0] = TIME_fdWake[1] = -1; - ERR("Cannot create pipe: %s\n", strerror(errno)); - } else { - fcntl(TIME_fdWake[0], F_SETFL, O_NONBLOCK); - fcntl(TIME_fdWake[1], F_SETFL, O_NONBLOCK); - } + TIME_TimersList = NULL; + TIME_hWakeEvent = CreateEventW(NULL, FALSE, FALSE, NULL); TIME_TimeToDie = FALSE; - TIME_hMMTimer = CreateThread(NULL, 0, TIME_MMSysTimeThread, NULL, 0, NULL); + TIME_hMMTimer = CreateThread(NULL, 0, TIME_MMSysTimeThread, NULL, 0, NULL); SetThreadPriority(TIME_hMMTimer, THREAD_PRIORITY_TIME_CRITICAL); } }
-#else /* HAVE_POLL */ - -static void TIME_MMTimeStart(void) -{ - FIXME( "not starting system thread\n" ); -} - -#endif /* HAVE_POLL */ - /************************************************************************** * TIME_MMTimeStop */ void TIME_MMTimeStop(void) { if (TIME_hMMTimer) { - const char a='a';
TIME_TimeToDie = TRUE; - write(TIME_fdWake[1], &a, sizeof(a)); - - WaitForSingleObject(TIME_hMMTimer, INFINITE); - close(TIME_fdWake[0]); - close(TIME_fdWake[1]); - TIME_fdWake[0] = TIME_fdWake[1] = -1; - CloseHandle(TIME_hMMTimer); - TIME_hMMTimer = 0; - DeleteCriticalSection(&TIME_cbcrst); + SetEvent(TIME_hWakeEvent); + + /* FIXME: in the worst case, we're going to wait 65 seconds here :-( */ + WaitForSingleObject(TIME_hMMTimer, INFINITE); + + CloseHandle(TIME_hMMTimer); + CloseHandle(TIME_hWakeEvent); + TIME_hMMTimer = 0; + TIME_TimersList = NULL; } }
@@ -300,15 +311,14 @@ }
/************************************************************************** - * timeSetEvent [WINMM.@] - */ -MMRESULT WINAPI timeSetEvent(UINT wDelay, UINT wResol, LPTIMECALLBACK lpFunc, - DWORD_PTR dwUser, UINT wFlags) + * TIME_SetEventInternal [internal] + */ +WORD TIME_SetEventInternal(UINT wDelay, UINT wResol, + LPTIMECALLBACK lpFunc, DWORD dwUser, UINT wFlags) { WORD wNewID = 0; LPWINE_TIMERENTRY lpNewTimer; LPWINE_TIMERENTRY lpTimer; - const char c = 'c';
TRACE("(%u, %u, %p, %08lX, %04X);\n", wDelay, wResol, lpFunc, dwUser, wFlags);
@@ -318,6 +328,8 @@ lpNewTimer = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_TIMERENTRY)); if (lpNewTimer == NULL) return 0; + + TIME_MMTimeStart();
lpNewTimer->wDelay = wDelay; lpNewTimer->dwTriggerTime = GetTickCount() + wDelay; @@ -331,18 +343,21 @@
EnterCriticalSection(&WINMM_cs);
- LIST_FOR_EACH_ENTRY( lpTimer, &timer_list, WINE_TIMERENTRY, entry ) - wNewID = max(wNewID, lpTimer->wTimerID); - - link_timer( lpNewTimer ); + if ((wFlags & TIME_KILL_SYNCHRONOUS) && !TIME_hKillEvent) + TIME_hKillEvent = CreateEventW(NULL, TRUE, TRUE, NULL); + + for (lpTimer = TIME_TimersList; lpTimer != NULL; lpTimer = lpTimer->lpNext) { + wNewID = max(wNewID, lpTimer->wTimerID); + } + + lpNewTimer->lpNext = TIME_TimersList; + TIME_TimersList = lpNewTimer; lpNewTimer->wTimerID = wNewID + 1;
- TIME_MMTimeStart(); - LeaveCriticalSection(&WINMM_cs);
/* Wake the service thread in case there is work to be done */ - write(TIME_fdWake[1], &c, sizeof(c)); + SetEvent(TIME_hWakeEvent);
TRACE("=> %u\n", wNewID + 1);
@@ -350,21 +365,30 @@ }
/************************************************************************** + * timeSetEvent [WINMM.@] + */ +MMRESULT WINAPI timeSetEvent(UINT wDelay, UINT wResol, LPTIMECALLBACK lpFunc, + DWORD_PTR dwUser, UINT wFlags) +{ + return TIME_SetEventInternal(wDelay, wResol, lpFunc, + dwUser, wFlags); +} + +/************************************************************************** * timeKillEvent [WINMM.@] */ MMRESULT WINAPI timeKillEvent(UINT wID) { - WINE_TIMERENTRY *lpSelf = NULL, *lpTimer; - DWORD wFlags; + LPWINE_TIMERENTRY lpSelf = NULL, *lpTimer;
TRACE("(%u)\n", wID); EnterCriticalSection(&WINMM_cs); /* remove WINE_TIMERENTRY from list */ - LIST_FOR_EACH_ENTRY( lpTimer, &timer_list, WINE_TIMERENTRY, entry ) - { - if (wID == lpTimer->wTimerID) { - lpSelf = lpTimer; - list_remove( &lpTimer->entry ); + for (lpTimer = &TIME_TimersList; *lpTimer; lpTimer = &(*lpTimer)->lpNext) { + if (wID == (*lpTimer)->wTimerID) { + lpSelf = *lpTimer; + /* unlink timer of id 'wID' */ + *lpTimer = (*lpTimer)->lpNext; break; } } @@ -375,12 +399,9 @@ WARN("wID=%u is not a valid timer ID\n", wID); return MMSYSERR_INVALPARAM; } - wFlags = lpSelf->wFlags; - if (wFlags & TIME_KILL_SYNCHRONOUS) - EnterCriticalSection(&TIME_cbcrst); + if (lpSelf->wFlags & TIME_KILL_SYNCHRONOUS) + WaitForSingleObject(TIME_hKillEvent, INFINITE); HeapFree(GetProcessHeap(), 0, lpSelf); - if (wFlags & TIME_KILL_SYNCHRONOUS) - LeaveCriticalSection(&TIME_cbcrst); return TIMERR_NOERROR; }
@@ -438,6 +459,7 @@ }
/************************************************************************** + * timeGetTime [MMSYSTEM.607] * timeGetTime [WINMM.@] */ DWORD WINAPI timeGetTime(void) @@ -446,7 +468,7 @@ DWORD count;
/* FIXME: releasing the win16 lock here is a temporary hack (I hope) - * that lets mciavi32.dll run correctly + * that lets mciavi.drv run correctly */ if (pFnReleaseThunkLock) pFnReleaseThunkLock(&count); if (pFnRestoreThunkLock) pFnRestoreThunkLock(count);
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winemm.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winemm.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winemm.h [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -99,14 +99,14 @@ typedef struct tagWINE_MCIDRIVER { UINT wDeviceID; UINT wType; - LPWSTR lpstrElementName; + LPWSTR lpstrElementName; LPWSTR lpstrDeviceType; LPWSTR lpstrAlias; HDRVR hDriver; - DWORD_PTR dwPrivate; + DWORD_PTR dwPrivate; YIELDPROC lpfnYieldProc; - DWORD dwYieldData; - DWORD CreatorThread; + DWORD dwYieldData; + HANDLE CreatorThread; UINT uTypeCmdTable; UINT uSpecificCmdTable; struct tagWINE_MCIDRIVER*lpNext;
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winemm16.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winemm16.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winemm16.h [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -18,7 +18,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ***************************************************************************** */ #include "winemm.h"
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm.c [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -65,13 +65,7 @@ HANDLE psLastEvent; HANDLE psStopEvent;
-static CRITICAL_SECTION_DEBUG critsect_debug = -{ - 0, 0, &WINMM_cs, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": WINMM_cs") } -}; -CRITICAL_SECTION WINMM_cs = { &critsect_debug, -1, 0, 0, 0, 0 }; +CRITICAL_SECTION WINMM_cs;
/************************************************************************** * WINMM_CreateIData [internal] @@ -81,6 +75,7 @@ hWinMM32Instance = hInstDLL; psStopEvent = CreateEventW(NULL, TRUE, FALSE, NULL); psLastEvent = CreateEventW(NULL, TRUE, FALSE, NULL); + InitializeCriticalSection(&WINMM_cs); return TRUE; }
@@ -717,7 +712,7 @@ /************************************************************************** * auxGetDevCapsW [WINMM.@] */ -MMRESULT WINAPI auxGetDevCapsW(UINT_PTR uDeviceID, LPAUXCAPSW lpCaps, UINT uSize) +UINT WINAPI auxGetDevCapsW(UINT_PTR uDeviceID, LPAUXCAPSW lpCaps, UINT uSize) { LPWINE_MLD wmld;
@@ -733,7 +728,7 @@ /************************************************************************** * auxGetDevCapsA [WINMM.@] */ -MMRESULT WINAPI auxGetDevCapsA(UINT_PTR uDeviceID, LPAUXCAPSA lpCaps, UINT uSize) +UINT WINAPI auxGetDevCapsA(UINT_PTR uDeviceID, LPAUXCAPSA lpCaps, UINT uSize) { AUXCAPSW acW; UINT ret; @@ -759,13 +754,13 @@ /************************************************************************** * auxGetVolume [WINMM.@] */ -MMRESULT WINAPI auxGetVolume(UINT uDeviceID, DWORD* lpdwVolume) +UINT WINAPI auxGetVolume(UINT uDeviceID, DWORD* lpdwVolume) { LPWINE_MLD wmld;
TRACE("(%04X, %p) !\n", uDeviceID, lpdwVolume);
- if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_AUX, TRUE)) == NULL) + if ((wmld = MMDRV_Get(UlongToHandle(uDeviceID), MMDRV_AUX, TRUE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, AUXDM_GETVOLUME, (DWORD_PTR)lpdwVolume, 0L); } @@ -779,7 +774,7 @@
TRACE("(%04X, %u) !\n", uDeviceID, dwVolume);
- if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_AUX, TRUE)) == NULL) + if ((wmld = MMDRV_Get(UlongToHandle(uDeviceID), MMDRV_AUX, TRUE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, AUXDM_SETVOLUME, dwVolume, 0L); } @@ -787,11 +782,11 @@ /************************************************************************** * auxOutMessage [WINMM.@] */ -MMRESULT WINAPI auxOutMessage(UINT uDeviceID, UINT uMessage, DWORD_PTR dw1, DWORD_PTR dw2) -{ - LPWINE_MLD wmld; - - if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_AUX, TRUE)) == NULL) +UINT WINAPI auxOutMessage(UINT uDeviceID, UINT uMessage, DWORD_PTR dw1, DWORD_PTR dw2) +{ + LPWINE_MLD wmld; + + if ((wmld = MMDRV_Get(UlongToHandle(uDeviceID), MMDRV_AUX, TRUE)) == NULL) return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, uMessage, dw1, dw2); @@ -934,7 +929,7 @@ /************************************************************************** * midiOutOpen [WINMM.@] */ -UINT WINAPI midiOutOpen(LPHMIDIOUT lphMidiOut, UINT uDeviceID, +MMRESULT WINAPI midiOutOpen(LPHMIDIOUT lphMidiOut, UINT_PTR uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags) { HMIDIOUT hMidiOut; @@ -1144,7 +1139,7 @@ /************************************************************************** * midiOutMessage [WINMM.@] */ -DWORD WINAPI midiOutMessage(HMIDIOUT hMidiOut, UINT uMessage, +UINT WINAPI midiOutMessage(HMIDIOUT hMidiOut, UINT uMessage, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { LPWINE_MLD wmld; @@ -1183,7 +1178,7 @@ /************************************************************************** * midiInGetDevCapsW [WINMM.@] */ -MMRESULT WINAPI midiInGetDevCapsW(UINT_PTR uDeviceID, LPMIDIINCAPSW lpCaps, UINT uSize) +UINT WINAPI midiInGetDevCapsW(UINT_PTR uDeviceID, LPMIDIINCAPSW lpCaps, UINT uSize) { LPWINE_MLD wmld;
@@ -1200,7 +1195,7 @@ /************************************************************************** * midiInGetDevCapsA [WINMM.@] */ -MMRESULT WINAPI midiInGetDevCapsA(UINT_PTR uDeviceID, LPMIDIINCAPSA lpCaps, UINT uSize) +UINT WINAPI midiInGetDevCapsA(UINT_PTR uDeviceID, LPMIDIINCAPSA lpCaps, UINT uSize) { MIDIINCAPSW micW; UINT ret; @@ -1225,7 +1220,7 @@ /************************************************************************** * midiInOpen [WINMM.@] */ -UINT WINAPI midiInOpen(HMIDIIN* lphMidiIn, UINT uDeviceID, +MMRESULT WINAPI midiInOpen(HMIDIIN* lphMidiIn, UINT_PTR uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags) { HANDLE hMidiIn; @@ -1403,7 +1398,7 @@ /************************************************************************** * midiInMessage [WINMM.@] */ -DWORD WINAPI midiInMessage(HMIDIIN hMidiIn, UINT uMessage, +UINT WINAPI midiInMessage(HMIDIIN hMidiIn, UINT uMessage, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { LPWINE_MLD wmld; @@ -1471,7 +1466,7 @@ return FALSE; }
- *lpMidiStrm = (WINE_MIDIStream*)lpwm->mod.rgIds.dwStreamID; + *lpMidiStrm = (WINE_MIDIStream*)(ULONG_PTR)lpwm->mod.rgIds.dwStreamID;
return *lpMidiStrm != NULL; } @@ -1586,7 +1581,7 @@ #endif if (((LPMIDIEVENT)lpData)->dwStreamID != 0 && ((LPMIDIEVENT)lpData)->dwStreamID != 0xFFFFFFFF && - ((LPMIDIEVENT)lpData)->dwStreamID != (DWORD)lpMidiStrm) { + ((LPMIDIEVENT)lpData)->dwStreamID != PtrToLong(lpMidiStrm)) { FIXME("Dropping bad %s lpMidiHdr (streamID=%08x)\n", (lpMidiHdr->dwFlags & MHDR_ISSTRM) ? "stream" : "regular", ((LPMIDIEVENT)lpData)->dwStreamID); @@ -1805,7 +1800,7 @@ lpMidiStrm->dwTimeDiv = 480; /* 480 is 120 quarter notes per minute *//* FIXME ??*/ lpMidiStrm->dwPositionMS = 0;
- mosm.dwStreamID = (DWORD)lpMidiStrm; + mosm.dwStreamID = PtrToLong(lpMidiStrm); /* FIXME: the correct value is not allocated yet for MAPPER */ mosm.wDeviceID = *lpuDeviceID; lpwm = MIDI_OutAlloc(&hMidiOut, &dwCallback, &dwInstance, &fdwOpen, 1, &mosm); @@ -2113,7 +2108,7 @@ /************************************************************************** * waveOutGetDevCapsA [WINMM.@] */ -MMRESULT WINAPI waveOutGetDevCapsA(UINT_PTR uDeviceID, LPWAVEOUTCAPSA lpCaps, +UINT WINAPI waveOutGetDevCapsA(UINT_PTR uDeviceID, LPWAVEOUTCAPSA lpCaps, UINT uSize) { WAVEOUTCAPSW wocW; @@ -2149,6 +2144,12 @@ TRACE("(%lu %p %u)!\n", uDeviceID, lpCaps, uSize);
if (lpCaps == NULL) return MMSYSERR_INVALPARAM; + + if (uDeviceID == WAVE_MAPPER) + { + FIXME("Support WAVE_MAPPER\n"); + uDeviceID = 0; + }
if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_WAVEOUT, TRUE)) == NULL) return MMSYSERR_BADDEVICEID; @@ -2500,7 +2501,7 @@ /************************************************************************** * waveOutMessage [WINMM.@] */ -DWORD WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage, +UINT WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { LPWINE_MLD wmld; @@ -2535,13 +2536,20 @@ /************************************************************************** * waveInGetDevCapsW [WINMM.@] */ -MMRESULT WINAPI waveInGetDevCapsW(UINT_PTR uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSize) +UINT WINAPI waveInGetDevCapsW(UINT_PTR uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSize) { LPWINE_MLD wmld;
TRACE("(%lu %p %u)!\n", uDeviceID, lpCaps, uSize);
if (lpCaps == NULL) return MMSYSERR_INVALPARAM; + + if (uDeviceID == WAVE_MAPPER) + { + FIXME("Support WAVE_MAPPER\n"); + uDeviceID = 0; + } +
if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_WAVEIN, TRUE)) == NULL) return MMSYSERR_BADDEVICEID; @@ -2768,7 +2776,7 @@ /************************************************************************** * waveInMessage [WINMM.@] */ -DWORD WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage, +UINT WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { LPWINE_MLD wmld;
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm.rbuild URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm.rbuild [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -21,9 +21,9 @@ <file>mci.c</file> <file>mmio.c</file> <file>playsound.c</file> + <file>registry.c</file> <file>time.c</file> <file>winmm.c</file> - <file>registry.c</file> <file>winmm_res.rc</file> </module> </group>
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Br.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Br.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Br.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -14,7 +14,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Cs.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Cs.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Cs.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -15,7 +15,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_De.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_De.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_De.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -13,7 +13,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_En.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_En.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_En.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -13,7 +13,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Es.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Es.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Es.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -14,7 +14,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Fr.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Fr.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Fr.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -16,7 +16,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Hu.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Hu.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Hu.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -14,7 +14,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Id.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Id.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Id.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -13,7 +13,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_INDONESIAN, SUBLANG_DEFAULT
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_It.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_It.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_It.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -14,7 +14,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Ja.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Ja.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Ja.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -13,7 +13,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Nl.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Nl.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Nl.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -13,7 +13,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_No.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_No.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_No.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -17,7 +17,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Pl.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Pl.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Pl.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -13,7 +13,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Pt.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Pt.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Pt.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -14,7 +14,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_PORTUGAL
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Ru.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Ru.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Ru.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -13,7 +13,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Si.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Si.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Si.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -13,7 +13,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Sk.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Sk.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Sk.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -13,7 +13,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Uk.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Uk.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_Uk.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -13,7 +13,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
STRINGTABLE LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
Modified: branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_res.rc URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/wi... ============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_res.rc [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/winmm/winmm_res.rc [iso-8859-1] Mon Nov 9 09:31:11 2009 @@ -14,7 +14,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Note: Win 9x (and of course Win 3.x) store their resources in MMSYSTEM.DLL * Wine stores all resources in WINMM.DLL (as NT does)