Author: tkreuzer
Date: Mon Jun 28 20:58:30 2010
New Revision: 47900
URL:
http://svn.reactos.org/svn/reactos?rev=47900&view=rev
Log:
[WINMM]
Fix a number of 64bit issues, add some comments where the code is not 64 bit safe. This
module should be synced with wine, but this still causes a problem with Flash videos on
FF2 (likely another timer problem)
Modified:
trunk/reactos/ (props changed)
trunk/reactos/dll/win32/winmm/driver.c
trunk/reactos/dll/win32/winmm/mci.c
trunk/reactos/dll/win32/winmm/midimap/midimap.c
trunk/reactos/dll/win32/winmm/mmio.c
trunk/reactos/dll/win32/winmm/winmm.c
Propchange: trunk/reactos/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jun 28 20:58:30 2010
@@ -1,4 +1,4 @@
/branches/header-work:45691-47721
/branches/reactos-yarotows:46848,46966,47800
/branches/ros-amd64-bringup:36852
-/branches/ros-amd64-bringup/reactos:34711-34712,34741,34743,34780-34782,34803,34812,34839,34842,34864,34870,34874,34877,34908-34909,34917,34965,35323-35324,35347-35348,35361,35436,35509,35515,35588,35655,35683,35739,35746,35762,35771,35777,35781,35789,35805,35823,35827,35902,35904-35906,35942,35947-35949,35952-35953,35966,36011-36013,36172,36360,36380,36388-36389,36393,36397,36445,36502-36503,36505,36570,36614,36898-36899,36930,36936,36949,36951,36958,36961,36964,36969,36972,36987-36988,36992,37323,37434,37472,37475,37536,37820-37821,37868-37869,37873,37990-37991,38013-38014,38092,38100,38148-38151,38264-38265,38268,38355,39151,39333,39335,39345,39639,40122-40123,40125,40127-40128,40155,40247,40324,40608,40753,40927-40928,40986-40987,40989,40991,40993,40995-40996,41000-41001,41027-41030,41044-41045,41047-41050,41052,41070,41082-41086,41097-41098,41101,41449,41479-41480,41484-41485,41499-41500,41502,41531,41536,41540,41546-41547,41549,43080,43426,43454,43506,43566,43574,43598,43600-43602,43604-43605,43677,43682,43757,43775,43836,43838-43840,43857-43858,43860,43905-43907,43965,43969,43992,44002,44036-44037,44039-44040,44044-44045,44065,44095,44123,44144,44205,44238,44294,44338-44339,44389,44391,44426,44460,44467-44468,44470-44471,44499,44501,44503-44504,44506,44510-44512,44521,44523-44526,44530,44540,44601,44634,44639,44772,45124,45126-45127,46394,46478,46511,46523-46524,46526,46534-46535,46537-46539,46589,46805,47472,47846-47847,47878,47882
+/branches/ros-amd64-bringup/reactos:34711-34712,34741,34743,34780-34782,34803,34812,34839,34842,34864,34870,34874,34877,34908-34909,34917,34965,35323-35324,35347-35348,35361,35436,35509,35515,35588,35655,35683,35739,35746,35762,35771,35777,35781,35789,35805,35823,35827,35902,35904-35906,35942,35947-35949,35952-35953,35966,36011-36013,36172,36360,36380,36388-36389,36393,36397,36445,36502-36503,36505,36570,36614,36898-36899,36930,36936,36949,36951,36958,36961,36964,36969,36972,36987-36988,36992,37323,37434,37472,37475,37536,37820-37821,37868-37869,37873,37990-37991,38013-38014,38092,38100,38148-38151,38264-38265,38268,38355,39151,39333,39335,39345,39639,40120,40122-40123,40125,40127-40128,40155,40247,40324,40608,40753,40927-40928,40986-40987,40989,40991,40993,40995-40996,41000-41001,41027-41030,41044-41045,41047-41050,41052,41070,41082-41086,41097-41098,41101,41449,41479-41480,41484-41485,41499-41500,41502,41531,41536,41540,41546-41547,41549,43080,43426,43454,43506,43566,43574,43598,43600-43602,43604-43605,43677,43682,43757,43775,43836,43838-43840,43857-43858,43860,43905-43907,43965,43969,43992,44002,44036-44037,44039-44040,44044-44045,44065,44095,44123,44144,44205,44238,44294,44338-44339,44385,44389,44391,44426,44460,44467-44468,44470-44471,44499,44501,44503-44504,44506,44510-44512,44521,44523-44526,44530,44540,44601,44634,44639,44772,44818,45124,45126-45127,46394,46478,46511,46523-46524,46526,46534-46535,46537-46539,46589,46805,47472,47846-47847,47878,47882
Modified: trunk/reactos/dll/win32/winmm/driver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winmm/driver.c?r…
==============================================================================
--- trunk/reactos/dll/win32/winmm/driver.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/winmm/driver.c [iso-8859-1] Mon Jun 28 20:58:30 2010
@@ -467,7 +467,7 @@
return 0;
the_end:
- if (lpDrv) TRACE("=> %08lx\n", (DWORD)lpDrv);
+ if (lpDrv) TRACE("=> %p\n", lpDrv);
return (HDRVR)lpDrv;
}
Modified: trunk/reactos/dll/win32/winmm/mci.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winmm/mci.c?rev=…
==============================================================================
--- trunk/reactos/dll/win32/winmm/mci.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/winmm/mci.c [iso-8859-1] Mon Jun 28 20:58:30 2010
@@ -975,7 +975,7 @@
/**************************************************************************
* MCI_GetDWord [internal]
*/
-static BOOL MCI_GetDWord(LPDWORD data, LPWSTR* ptr)
+static BOOL MCI_GetDWord(DWORD_PTR *data, LPWSTR* ptr)
{
DWORD val;
LPWSTR ret;
@@ -1028,7 +1028,7 @@
/**************************************************************************
* MCI_ParseOptArgs [internal]
*/
-static DWORD MCI_ParseOptArgs(LPDWORD data, int _offset, LPCWSTR lpCmd,
+static DWORD MCI_ParseOptArgs(DWORD_PTR *data, int _offset, LPCWSTR lpCmd,
LPWSTR args, LPDWORD dwFlags)
{
int len, offset;
@@ -1151,7 +1151,7 @@
* MCI_HandleReturnValues [internal]
*/
static DWORD MCI_HandleReturnValues(DWORD dwRet, LPWINE_MCIDRIVER wmd, DWORD retType,
- LPDWORD data, LPWSTR lpstrRet, UINT uRetLen)
+ DWORD_PTR *data, LPWSTR lpstrRet, UINT uRetLen)
{
static const WCHAR wszLd [] = {'%','l','d',0};
static const WCHAR wszLd4 [] = {'%','l','d','
','%','l','d','
','%','l','d','
','%','l','d',0};
@@ -1229,7 +1229,7 @@
LPWINE_MCIDRIVER wmd = 0;
DWORD dwFlags = 0, dwRet = 0;
int offset = 0;
- DWORD data[MCI_DATA_SIZE];
+ DWORD_PTR data[MCI_DATA_SIZE];
DWORD retType;
LPCWSTR lpCmd = 0;
LPWSTR devAlias = NULL;
@@ -1282,15 +1282,15 @@
tmp = devType; devType = dev; dev = tmp;
dwFlags |= MCI_OPEN_TYPE;
- data[2] = (DWORD)devType;
+ data[2] = (DWORD_PTR)devType;
devType = str_dup_upper(devType);
dwFlags |= MCI_OPEN_ELEMENT;
- data[3] = (DWORD)dev;
+ data[3] = (DWORD_PTR)dev;
} else if (DRIVER_GetLibName(dev, wszMci, buf, sizeof(buf))) {
/* this is the name of a mci driver's type */
tmp = strchrW(dev, ' ');
if (tmp) *tmp = '\0';
- data[2] = (DWORD)dev;
+ data[2] = (DWORD_PTR)dev;
devType = str_dup_upper(dev);
if (tmp) *tmp = ' ';
dwFlags |= MCI_OPEN_TYPE;
@@ -1309,7 +1309,7 @@
devType = str_dup_upper(buf);
}
dwFlags |= MCI_OPEN_ELEMENT;
- data[3] = (DWORD)dev;
+ data[3] = (DWORD_PTR)dev;
}
if ((devAlias = strstrW(args, wszSAliasS))) {
WCHAR* tmp2;
@@ -1319,7 +1319,7 @@
tmp2 = HeapAlloc(GetProcessHeap(), 0, (tmp - devAlias + 1) * sizeof(WCHAR)
);
memcpy( tmp2, devAlias, (tmp - devAlias) * sizeof(WCHAR) );
tmp2[tmp - devAlias] = 0;
- data[4] = (DWORD)tmp2;
+ data[4] = (DWORD_PTR)tmp2;
/* should be done in regular options parsing */
/* dwFlags |= MCI_OPEN_ALIAS; */
} else if (dev == 0) {
@@ -1378,7 +1378,7 @@
switch (retType = MCI_GetReturnType(lpCmd)) {
case 0: offset = 1; break;
case MCI_INTEGER: offset = 2; break;
- case MCI_STRING: data[1] = (DWORD)lpstrRet; data[2] = uRetLen; offset = 3; break;
+ case MCI_STRING: data[1] = (DWORD_PTR)lpstrRet; data[2] = uRetLen; offset = 3;
break;
case MCI_RECT: offset = 5; break;
default: ERR("oops\n");
}
@@ -1391,7 +1391,7 @@
/* 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
@@ -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 ?
Modified: trunk/reactos/dll/win32/winmm/midimap/midimap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winmm/midimap/mi…
==============================================================================
--- trunk/reactos/dll/win32/winmm/midimap/midimap.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/winmm/midimap/midimap.c [iso-8859-1] Mon Jun 28 20:58:30 2010
@@ -260,7 +260,7 @@
return ret;
}
-static DWORD modOpen(LPDWORD lpdwUser, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
+static DWORD modOpen(DWORD_PTR *lpdwUser, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
{
MIDIMAPDATA* mom = HeapAlloc(GetProcessHeap(), 0, sizeof(MIDIMAPDATA));
@@ -270,7 +270,7 @@
if (MIDIMAP_LoadSettings(mom))
{
- *lpdwUser = (DWORD)mom;
+ *lpdwUser = (DWORD_PTR)mom;
mom->self = mom;
return MMSYSERR_NOERROR;
@@ -306,7 +306,7 @@
return ret;
}
-static DWORD modLongData(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD dwParam2)
+static DWORD modLongData(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2)
{
WORD chn;
DWORD ret = MMSYSERR_NOERROR;
@@ -330,7 +330,7 @@
return ret;
}
-static DWORD modData(MIDIMAPDATA* mom, DWORD dwParam)
+static DWORD modData(MIDIMAPDATA* mom, DWORD_PTR dwParam)
{
BYTE lb = LOBYTE(LOWORD(dwParam));
WORD chn = lb & 0x0F;
@@ -393,7 +393,7 @@
return ret;
}
-static DWORD modPrepare(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD dwParam2)
+static DWORD modPrepare(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR 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 dwParam2)
+static DWORD modUnprepare(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR 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 size)
+static DWORD modGetDevCaps(UINT wDevID, MIDIMAPDATA* mom, LPMIDIOUTCAPSW lpMidiCaps,
DWORD_PTR 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 dwUser,
- DWORD dwParam1, DWORD dwParam2)
+DWORD WINAPI MIDIMAP_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
+ DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
TRACE("(%u, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
@@ -492,7 +492,7 @@
/**************************************************************************
* MIDIMAP_drvOpen [internal]
*/
-static DWORD MIDIMAP_drvOpen(LPSTR str)
+static LRESULT MIDIMAP_drvOpen(LPSTR str)
{
MIDIOUTCAPSW moc;
unsigned dev, i;
@@ -527,7 +527,7 @@
/**************************************************************************
* MIDIMAP_drvClose [internal]
*/
-static DWORD MIDIMAP_drvClose(DWORD dwDevID)
+static LRESULT MIDIMAP_drvClose(DWORD_PTR dwDevID)
{
if (midiOutPorts)
{
@@ -541,8 +541,8 @@
/**************************************************************************
* DriverProc (MIDIMAP.@)
*/
-LONG CALLBACK MIDIMAP_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
- DWORD dwParam1, DWORD dwParam2)
+LRESULT CALLBACK MIDIMAP_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
+ LPARAM dwParam1, LPARAM dwParam2)
{
/* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */
/* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */
Modified: trunk/reactos/dll/win32/winmm/mmio.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winmm/mmio.c?rev…
==============================================================================
--- trunk/reactos/dll/win32/winmm/mmio.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/winmm/mmio.c [iso-8859-1] Mon Jun 28 20:58:30 2010
@@ -665,8 +665,8 @@
refmminfo->wErrorRet = send_message(wm->ioProc, &wm->info, MMIOM_OPEN,
(LPARAM)szFileName, 0, FALSE);
- /* grab file size, when possible */
- wm->dwFileSize = GetFileSize((HANDLE)wm->info.adwInfo[0], NULL);
+ /* grab file size, when possible (FIXME: not 64 bit safe) */
+ wm->dwFileSize = GetFileSize((HANDLE)(ULONG_PTR)wm->info.adwInfo[0], NULL);
if (refmminfo->wErrorRet == 0)
return wm->info.hmmio;
Modified: trunk/reactos/dll/win32/winmm/winmm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winmm/winmm.c?re…
==============================================================================
--- trunk/reactos/dll/win32/winmm/winmm.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/winmm/winmm.c [iso-8859-1] Mon Jun 28 20:58:30 2010
@@ -760,7 +760,7 @@
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);
}
@@ -774,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);
}
@@ -786,7 +786,7 @@
{
LPWINE_MLD wmld;
- 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, uMessage, dw1, dw2);
@@ -929,7 +929,7 @@
/**************************************************************************
* midiOutOpen [WINMM.@]
*/
-UINT WINAPI midiOutOpen(LPHMIDIOUT lphMidiOut, UINT uDeviceID,
+MMRESULT WINAPI midiOutOpen(LPHMIDIOUT lphMidiOut, UINT uDeviceID,
DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
{
HMIDIOUT hMidiOut;
@@ -1220,7 +1220,7 @@
/**************************************************************************
* midiInOpen [WINMM.@]
*/
-UINT WINAPI midiInOpen(HMIDIIN* lphMidiIn, UINT uDeviceID,
+MMRESULT WINAPI midiInOpen(HMIDIIN* lphMidiIn, UINT uDeviceID,
DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
{
HANDLE hMidiIn;
@@ -1466,7 +1466,7 @@
return FALSE;
}
- *lpMidiStrm = (WINE_MIDIStream*)lpwm->mod.rgIds.dwStreamID;
+ *lpMidiStrm = (WINE_MIDIStream*)(ULONG_PTR)lpwm->mod.rgIds.dwStreamID; // FIXME:
not 64 bit safe
return *lpMidiStrm != NULL;
}
@@ -1581,7 +1581,8 @@
#endif
if (((LPMIDIEVENT)lpData)->dwStreamID != 0 &&
((LPMIDIEVENT)lpData)->dwStreamID != 0xFFFFFFFF &&
- ((LPMIDIEVENT)lpData)->dwStreamID != (DWORD)lpMidiStrm) {
+ /* FIXME: not 64 bit safe */
+ ((LPMIDIEVENT)lpData)->dwStreamID != (DWORD_PTR)lpMidiStrm) {
FIXME("Dropping bad %s lpMidiHdr (streamID=%08x)\n",
(lpMidiHdr->dwFlags & MHDR_ISSTRM) ? "stream" :
"regular",
((LPMIDIEVENT)lpData)->dwStreamID);
@@ -1800,7 +1801,7 @@
lpMidiStrm->dwTimeDiv = 480; /* 480 is 120 quarter notes per minute *//* FIXME
??*/
lpMidiStrm->dwPositionMS = 0;
- mosm.dwStreamID = (DWORD)lpMidiStrm;
+ mosm.dwStreamID = (DWORD_PTR)lpMidiStrm; // FIXME: not 64 bit safe
/* FIXME: the correct value is not allocated yet for MAPPER */
mosm.wDeviceID = *lpuDeviceID;
lpwm = MIDI_OutAlloc(&hMidiOut, &dwCallback, &dwInstance, &fdwOpen,
1, &mosm);