winealsa.drv: Fix 64-bits incompatibilities.

This commit is contained in:
Maarten Lankhorst 2008-12-02 15:07:58 +01:00 committed by Alexandre Julliard
parent 1d9637f5cd
commit 2614269d93
5 changed files with 52 additions and 52 deletions

View File

@ -124,7 +124,7 @@ void ALSA_WaitRingMessage(ALSA_MSG_RING* omr, DWORD sleep)
*
* Inserts a new message into the ring (should be called from DriverProc derived routines)
*/
int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD param, BOOL wait)
int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD_PTR param, BOOL wait)
{
HANDLE hEvent = INVALID_HANDLE_VALUE;
@ -192,8 +192,8 @@ int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD param
*
* Get a message from the ring. Should be called by the playback/record thread.
*/
int ALSA_RetrieveRingMessage(ALSA_MSG_RING* omr,
enum win_wm_message *msg, DWORD *param, HANDLE *hEvent)
int ALSA_RetrieveRingMessage(ALSA_MSG_RING* omr, enum win_wm_message *msg,
DWORD_PTR *param, HANDLE *hEvent)
{
EnterCriticalSection(&omr->msg_crst);
@ -220,15 +220,15 @@ int ALSA_RetrieveRingMessage(ALSA_MSG_RING* omr,
* Should be called by the playback/record thread.
*/
int ALSA_PeekRingMessage(ALSA_MSG_RING* omr,
enum win_wm_message *msg,
DWORD *param, HANDLE *hEvent)
enum win_wm_message *msg,
DWORD_PTR *param, HANDLE *hEvent)
{
EnterCriticalSection(&omr->msg_crst);
if (omr->msg_toget == omr->msg_tosave) /* buffer empty ? */
{
LeaveCriticalSection(&omr->msg_crst);
return 0;
LeaveCriticalSection(&omr->msg_crst);
return 0;
}
*msg = omr->messages[omr->msg_toget].msg;

View File

@ -81,9 +81,9 @@ enum win_wm_message {
};
typedef struct {
enum win_wm_message msg; /* message identifier */
DWORD param; /* parameter for this message */
HANDLE hEvent; /* if message is synchronous, handle of event for synchro */
enum win_wm_message msg; /* message identifier */
DWORD_PTR param; /* parameter for this message */
HANDLE hEvent; /* if message is synchronous, handle of event for synchro */
} ALSA_MSG;
/* implement an in-process message ring for better performance
@ -178,9 +178,9 @@ int ALSA_InitRingMessage(ALSA_MSG_RING* omr);
int ALSA_DestroyRingMessage(ALSA_MSG_RING* omr);
void ALSA_ResetRingMessage(ALSA_MSG_RING* omr);
void ALSA_WaitRingMessage(ALSA_MSG_RING* omr, DWORD sleep);
int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD param, BOOL wait);
int ALSA_RetrieveRingMessage(ALSA_MSG_RING* omr, enum win_wm_message *msg, DWORD *param, HANDLE *hEvent);
int ALSA_PeekRingMessage(ALSA_MSG_RING* omr, enum win_wm_message *msg, DWORD *param, HANDLE *hEvent);
int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD_PTR param, BOOL wait);
int ALSA_RetrieveRingMessage(ALSA_MSG_RING* omr, enum win_wm_message *msg, DWORD_PTR *param, HANDLE *hEvent);
int ALSA_PeekRingMessage(ALSA_MSG_RING* omr, enum win_wm_message *msg, DWORD_PTR *param, HANDLE *hEvent);
int ALSA_CheckSetVolume(snd_hctl_t *hctl, int *out_left, int *out_right, int *out_min, int *out_max, int *out_step, int *new_left, int *new_right);
const char * ALSA_getCmdString(enum win_wm_message msg);

View File

@ -173,14 +173,14 @@ static int MIDI_AlsaToWindowsDeviceType(int type)
* MIDI_NotifyClient [internal]
*/
static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg,
DWORD dwParam1, DWORD dwParam2)
DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
DWORD dwCallBack;
UINT uFlags;
HANDLE hDev;
DWORD dwInstance;
TRACE("wDevID = %04X wMsg = %d dwParm1 = %04X dwParam2 = %04X\n",
TRACE("wDevID = %04X wMsg = %d dwParm1 = %04lX dwParam2 = %04lX\n",
wDevID, wMsg, dwParam1, dwParam2);
switch (wMsg) {
@ -388,7 +388,7 @@ static DWORD WINAPI midRecThread(LPVOID arg)
lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
lpMidiHdr->dwFlags |= MHDR_DONE;
MidiInDev[wDevID].lpQueueHdr = (LPMIDIHDR)lpMidiHdr->lpNext;
if (MIDI_NotifyClient(wDevID, MIM_LONGDATA, (DWORD)lpMidiHdr, dwTime) != MMSYSERR_NOERROR)
if (MIDI_NotifyClient(wDevID, MIM_LONGDATA, (DWORD_PTR)lpMidiHdr, dwTime) != MMSYSERR_NOERROR)
WARN("Couldn't notify client\n");
}
} else
@ -653,7 +653,7 @@ static DWORD midReset(WORD wDevID)
MidiInDev[wDevID].lpQueueHdr->dwFlags |= MHDR_DONE;
/* FIXME: when called from 16 bit, lpQueueHdr needs to be a segmented ptr */
if (MIDI_NotifyClient(wDevID, MIM_LONGDATA,
(DWORD)MidiInDev[wDevID].lpQueueHdr, dwTime) != MMSYSERR_NOERROR) {
(DWORD_PTR)MidiInDev[wDevID].lpQueueHdr, dwTime) != MMSYSERR_NOERROR) {
WARN("Couldn't notify client\n");
}
MidiInDev[wDevID].lpQueueHdr = (LPMIDIHDR)MidiInDev[wDevID].lpQueueHdr->lpNext;
@ -1024,7 +1024,7 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
lpMidiHdr->dwFlags |= MHDR_DONE;
if (MIDI_NotifyClient(wDevID, MOM_DONE, (DWORD)lpMidiHdr, 0L) != MMSYSERR_NOERROR) {
if (MIDI_NotifyClient(wDevID, MOM_DONE, (DWORD_PTR)lpMidiHdr, 0L) != MMSYSERR_NOERROR) {
WARN("can't notify client !\n");
return MMSYSERR_INVALPARAM;
}
@ -1313,10 +1313,10 @@ LONG ALSA_MidiInit(void)
/**************************************************************************
* midMessage (WINEOSS.4)
*/
DWORD WINAPI ALSA_midMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
DWORD WINAPI ALSA_midMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
TRACE("(%04X, %04X, %08X, %08X, %08X);\n",
TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
switch (wMsg) {
#ifdef HAVE_ALSA
@ -1356,10 +1356,10 @@ DWORD WINAPI ALSA_midMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
/**************************************************************************
* modMessage (WINEOSS.5)
*/
DWORD WINAPI ALSA_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
DWORD WINAPI ALSA_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
TRACE("(%04X, %04X, %08X, %08X, %08X);\n",
TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
switch (wMsg) {

View File

@ -68,9 +68,9 @@ DWORD ALSA_WidNumDevs;
/**************************************************************************
* widNotifyClient [internal]
*/
static DWORD widNotifyClient(WINE_WAVEDEV* wwi, WORD wMsg, DWORD dwParam1, DWORD dwParam2)
static DWORD widNotifyClient(WINE_WAVEDEV* wwi, WORD wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
TRACE("wMsg = 0x%04x dwParm1 = %04X dwParam2 = %04X\n", wMsg, dwParam1, dwParam2);
TRACE("wMsg = 0x%04x dwParm1 = %04lX dwParam2 = %04lX\n", wMsg, dwParam1, dwParam2);
switch (wMsg) {
case WIM_OPEN:
@ -114,7 +114,7 @@ static DWORD widGetDevCaps(WORD wDevID, LPWAVEINCAPSW lpCaps, DWORD dwSize)
static void widRecorder_ReadHeaders(WINE_WAVEDEV * wwi)
{
enum win_wm_message tmp_msg;
DWORD tmp_param;
DWORD_PTR tmp_param;
HANDLE tmp_ev;
WAVEHDR* lpWaveHdr;
@ -141,13 +141,13 @@ static void widRecorder_ReadHeaders(WINE_WAVEDEV * wwi)
*/
static DWORD CALLBACK widRecorder(LPVOID pmt)
{
WORD uDevID = (DWORD)pmt;
WORD uDevID = (DWORD_PTR)pmt;
WINE_WAVEDEV* wwi = (WINE_WAVEDEV*)&WInDev[uDevID];
WAVEHDR* lpWaveHdr;
DWORD dwSleepTime;
DWORD bytesRead;
enum win_wm_message msg;
DWORD param;
DWORD_PTR param;
HANDLE ev;
DWORD frames_per_period;
@ -219,7 +219,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
lpWaveHdr->dwFlags |= WHDR_DONE;
wwi->lpQueuePtr = lpNext;
widNotifyClient(wwi, WIM_DATA, (DWORD)lpWaveHdr, 0);
widNotifyClient(wwi, WIM_DATA, (DWORD_PTR)lpWaveHdr, 0);
lpWaveHdr = lpNext;
}
} else {
@ -234,7 +234,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
while (ALSA_RetrieveRingMessage(&wwi->msgRing, &msg, &param, &ev))
{
TRACE("msg=%s param=0x%x\n", ALSA_getCmdString(msg), param);
TRACE("msg=%s param=0x%lx\n", ALSA_getCmdString(msg), param);
switch (msg) {
case WINE_WM_PAUSING:
wwi->state = WINE_WS_PAUSED;
@ -274,7 +274,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
lpWaveHdr->dwFlags &= ~WHDR_INQUEUE;
lpWaveHdr->dwFlags |= WHDR_DONE;
wwi->lpQueuePtr = lpNext;
widNotifyClient(wwi, WIM_DATA, (DWORD)lpWaveHdr, 0);
widNotifyClient(wwi, WIM_DATA, (DWORD_PTR)lpWaveHdr, 0);
}
}
wwi->state = WINE_WS_STOPPED;
@ -297,7 +297,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
lpWaveHdr->dwFlags &= ~WHDR_INQUEUE;
lpWaveHdr->dwFlags |= WHDR_DONE;
wwi->lpQueuePtr = lpWaveHdr->lpNext;
widNotifyClient(wwi, WIM_DATA, (DWORD)lpWaveHdr, 0);
widNotifyClient(wwi, WIM_DATA, (DWORD_PTR)lpWaveHdr, 0);
}
wwi->lpQueuePtr = NULL;
@ -512,7 +512,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
wwi->format.Format.nBlockAlign);
wwi->hStartUpEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
wwi->hThread = CreateThread(NULL, 0, widRecorder, (LPVOID)(DWORD)wDevID, 0, &(wwi->dwThreadID));
wwi->hThread = CreateThread(NULL, 0, widRecorder, (LPVOID)(DWORD_PTR)wDevID, 0, &(wwi->dwThreadID));
if (wwi->hThread)
SetThreadPriority(wwi->hThread, THREAD_PRIORITY_TIME_CRITICAL);
WaitForSingleObject(wwi->hStartUpEvent, INFINITE);
@ -603,7 +603,7 @@ static DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
lpWaveHdr->dwBytesRecorded = 0;
lpWaveHdr->lpNext = 0;
ALSA_AddRingMessage(&WInDev[wDevID].msgRing, WINE_WM_HEADER, (DWORD)lpWaveHdr, FALSE);
ALSA_AddRingMessage(&WInDev[wDevID].msgRing, WINE_WM_HEADER, (DWORD_PTR)lpWaveHdr, FALSE);
return MMSYSERR_NOERROR;
}
@ -742,10 +742,10 @@ static DWORD widDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2)
/**************************************************************************
* widMessage (WINEALSA.@)
*/
DWORD WINAPI ALSA_widMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
DWORD WINAPI ALSA_widMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
TRACE("(%u, %s, %08X, %08X, %08X);\n",
TRACE("(%u, %s, %08lX, %08lX, %08lX);\n",
wDevID, ALSA_getMessage(wMsg), dwUser, dwParam1, dwParam2);
switch (wMsg) {
@ -781,8 +781,8 @@ DWORD WINAPI ALSA_widMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
/**************************************************************************
* widMessage (WINEALSA.@)
*/
DWORD WINAPI ALSA_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
DWORD WINAPI ALSA_widMessage(WORD wDevID, WORD wMsg, DWORD_PTR dwUser,
DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
FIXME("(%u, %04X, %08X, %08X, %08X):stub\n", wDevID, wMsg, dwUser, dwParam1, dwParam2);
return MMSYSERR_NOTENABLED;

View File

@ -69,9 +69,9 @@ DWORD ALSA_WodNumDevs;
/**************************************************************************
* wodNotifyClient [internal]
*/
static DWORD wodNotifyClient(WINE_WAVEDEV* wwo, WORD wMsg, DWORD dwParam1, DWORD dwParam2)
static DWORD wodNotifyClient(WINE_WAVEDEV* wwo, WORD wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
TRACE("wMsg = 0x%04x dwParm1 = %04X dwParam2 = %04X\n", wMsg, dwParam1, dwParam2);
TRACE("wMsg = 0x%04x dwParm1 = %lx dwParam2 = %lx\n", wMsg, dwParam1, dwParam2);
switch (wMsg) {
case WOM_OPEN:
@ -306,7 +306,7 @@ static DWORD wodPlayer_NotifyCompletions(WINE_WAVEDEV* wwo, BOOL force)
lpWaveHdr->dwFlags &= ~WHDR_INQUEUE;
lpWaveHdr->dwFlags |= WHDR_DONE;
wodNotifyClient(wwo, WOM_DONE, (DWORD)lpWaveHdr, 0);
wodNotifyClient(wwo, WOM_DONE, (DWORD_PTR)lpWaveHdr, 0);
}
return (lpWaveHdr && lpWaveHdr != wwo->lpPlayPtr && lpWaveHdr != wwo->lpLoopPtr) ?
wodPlayer_NotifyWait(wwo, lpWaveHdr) : INFINITE;
@ -341,7 +341,7 @@ static void wodPlayer_Reset(WINE_WAVEDEV* wwo, BOOL reset)
if (reset) {
enum win_wm_message msg;
DWORD param;
DWORD_PTR param;
HANDLE ev;
/* remove any buffer */
@ -404,12 +404,12 @@ static void wodPlayer_ProcessMessages(WINE_WAVEDEV* wwo)
{
LPWAVEHDR lpWaveHdr;
enum win_wm_message msg;
DWORD param;
DWORD_PTR param;
HANDLE ev;
int err;
while (ALSA_RetrieveRingMessage(&wwo->msgRing, &msg, &param, &ev)) {
TRACE("Received %s %x\n", ALSA_getCmdString(msg), param);
TRACE("Received %s %lx\n", ALSA_getCmdString(msg), param);
switch (msg) {
case WINE_WM_PAUSING:
@ -520,7 +520,7 @@ static DWORD wodPlayer_FeedDSP(WINE_WAVEDEV* wwo)
*/
static DWORD CALLBACK wodPlayer(LPVOID pmt)
{
WORD uDevID = (DWORD)pmt;
WORD uDevID = (DWORD_PTR)pmt;
WINE_WAVEDEV* wwo = (WINE_WAVEDEV*)&WOutDev[uDevID];
DWORD dwNextFeedTime = INFINITE; /* Time before DSP needs feeding */
DWORD dwNextNotifyTime = INFINITE; /* Time before next wave completion */
@ -796,7 +796,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
ALSA_InitRingMessage(&wwo->msgRing);
wwo->hStartUpEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
wwo->hThread = CreateThread(NULL, 0, wodPlayer, (LPVOID)(DWORD)wDevID, 0, &(wwo->dwThreadID));
wwo->hThread = CreateThread(NULL, 0, wodPlayer, (LPVOID)(DWORD_PTR)wDevID, 0, &(wwo->dwThreadID));
if (wwo->hThread)
SetThreadPriority(wwo->hThread, THREAD_PRIORITY_TIME_CRITICAL);
else
@ -926,7 +926,7 @@ static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
lpWaveHdr->dwFlags |= WHDR_INQUEUE;
lpWaveHdr->lpNext = 0;
ALSA_AddRingMessage(&WOutDev[wDevID].msgRing, WINE_WM_HEADER, (DWORD)lpWaveHdr, FALSE);
ALSA_AddRingMessage(&WOutDev[wDevID].msgRing, WINE_WM_HEADER, (DWORD_PTR)lpWaveHdr, FALSE);
return MMSYSERR_NOERROR;
}
@ -1167,10 +1167,10 @@ static DWORD wodDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2)
/**************************************************************************
* wodMessage (WINEALSA.@)
*/
DWORD WINAPI ALSA_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
DWORD WINAPI ALSA_wodMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
TRACE("(%u, %s, %08X, %08X, %08X);\n",
TRACE("(%u, %s, %08lX, %08lX, %08lX);\n",
wDevID, ALSA_getMessage(wMsg), dwUser, dwParam1, dwParam2);
switch (wMsg) {