tested the patch and FreeSolitaire works again. You can close the bug
entry.
Eric Pouech a écrit :
oops the last hunk of the patch isn't part of the patch
so Alexandre, please use this file instead
A+
Name: ps_a2w
ChangeLog: fixed hangs when playing an ASCII resource
License: X11
GenDate: 2002/05/16 19:48:36 UTC
ModifiedFiles: dlls/winmm/mmsystem.c
AddedFiles:
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/winmm/mmsystem.c,v
retrieving revision 1.52
diff -u -u -r1.52 mmsystem.c
--- dlls/winmm/mmsystem.c 12 May 2002 03:10:26 -0000 1.52
+++ dlls/winmm/mmsystem.c 16 May 2002 19:39:46 -0000
@@ -447,6 +447,7 @@
waveOutUnprepareHeader(hWave, &waveHdr[1], sizeof(WAVEHDR));
errCleanUp:
- TRACE("Done playing='%s' !\n", debugstr_w(wps->pszSound));
CloseHandle(s.hEvent);
HeapFree(GetProcessHeap(), 0, waveHdr);
HeapFree(GetProcessHeap(), 0, lpWaveFormat);
@@ -463,6 +464,21 @@
return bRet;
}
+static BOOL MULTIMEDIA_IsString(DWORD fdwSound, const void* psz)
+{
- /* SND_RESOURCE is 0x40004 while
* SND_MEMORY is 0x00004
*/
- switch (fdwSound & SND_RESOURCE)
- {
- case SND_RESOURCE: return HIWORD(psz) != 0; /* by name or by ID ? */
- case SND_MEMORY: return FALSE;
- /* any other case (SND_ALIAS, SND_FILENAME... shall drop into this one) */
- case 0: return TRUE;
- default: FIXME("WTF\n"); return FALSE;
- }
+}
static BOOL MULTIMEDIA_PlaySound(LPCWSTR pszSound, HMODULE hmod, DWORD fdwSound, DWORD search)
{
WINE_PLAYSOUND* wps = NULL;
@@ -515,10 +531,9 @@
} while (InterlockedCompareExchangePointer((void**)&iData->lpPlaySound, wps, NULL) != NULL);
if (fdwSound & SND_ASYNC) {
- if (!((fdwSound & SND_MEMORY) || ((fdwSound & SND_RESOURCE) &&
!((DWORD)pszSound >> 16)) ||
!pszSound)) {
wps->pszSound = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(pszSound)+1) * sizeof(WCHAR) );
- if (MULTIMEDIA_IsString(fdwSound, pszSound))
{
wps->pszSound = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(pszSound)+1) * sizeof(WCHAR));
lstrcpyW((LPWSTR)wps->pszSound, pszSound);
}
wps->bLoop = fdwSound & SND_LOOP;
@@ -541,16 +556,13 @@
{
LPWSTR pszSoundW;
BOOL bSound;
- bSound = PlaySoundW(pszSoundW, hmod, fdwSound);
- if ((void*)pszSoundW != (void*)pszSoundA) HeapFree(GetProcessHeap(), 0, pszSoundW);
- return bSound;
}
@@ -585,14 +597,12 @@
LPWSTR pszSoundW;
BOOL bSound;
}
--
Michael Stefaniuc Tel.: +49-711-96437-199
System Administration Fax.: +49-711-96437-111
Red Hat GmbH Email: mstefani@redhat.com
Hauptstaetterstr. 58
http://www.redhat.de/
D-70178 Stuttgart