Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
ff8a62d8
Commit
ff8a62d8
authored
May 16, 2002
by
Eric Pouech
Committed by
Alexandre Julliard
May 16, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed hangs when playing an ASCII resource.
parent
2fd4a55d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
20 deletions
+30
-20
mmsystem.c
dlls/winmm/mmsystem.c
+30
-20
No files found.
dlls/winmm/mmsystem.c
View file @
ff8a62d8
...
...
@@ -447,6 +447,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg)
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 @@ errCleanUp:
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 @@ static BOOL MULTIMEDIA_PlaySound(LPCWSTR pszSound, HMODULE hmod, DWORD fdwSound,
}
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 @@ BOOL WINAPI PlaySoundA(LPCSTR pszSoundA, HMODULE hmod, DWORD fdwSound)
{
LPWSTR
pszSoundW
;
BOOL
bSound
;
pszSoundW
=
(
MULTIMEDIA_IsString
(
fdwSound
,
pszSoundA
))
?
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pszSoundA
)
:
(
LPWSTR
)
pszSoundA
;
if
(
!
((
fdwSound
&
SND_MEMORY
)
||
((
fdwSound
&
SND_RESOURCE
)
&&
!
((
DWORD
)
pszSoundA
>>
16
))
||
!
pszSoundA
))
{
pszSoundW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pszSoundA
);
bSound
=
PlaySoundW
(
pszSoundW
,
hmod
,
fdwSound
);
HeapFree
(
GetProcessHeap
(),
0
,
pszSoundW
);
}
else
bSound
=
PlaySoundW
((
LPWSTR
)
pszSoundA
,
hmod
,
fdwSound
);
bSound
=
PlaySoundW
(
pszSoundW
,
hmod
,
fdwSound
);
if
((
void
*
)
pszSoundW
!=
(
void
*
)
pszSoundA
)
HeapFree
(
GetProcessHeap
(),
0
,
pszSoundW
);
return
bSound
;
}
...
...
@@ -585,14 +597,12 @@ BOOL WINAPI sndPlaySoundA(LPCSTR pszSoundA, UINT uFlags)
LPWSTR
pszSoundW
;
BOOL
bSound
;
if
(
!
((
uFlags
&
SND_MEMORY
)
||
((
uFlags
&
SND_RESOURCE
)
&&
!
((
DWORD
)
pszSoundA
>>
16
))
||
!
pszSoundA
))
{
pszSoundW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pszSoundA
);
bSound
=
sndPlaySoundW
(
pszSoundW
,
uFlags
);
pszSoundW
=
(
MULTIMEDIA_IsString
(
uFlags
,
pszSoundA
))
?
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pszSoundA
)
:
(
LPWSTR
)
pszSoundA
;
bSound
=
sndPlaySoundW
(
pszSoundW
,
uFlags
);
if
((
void
*
)
pszSoundW
!=
(
void
*
)
pszSoundA
)
HeapFree
(
GetProcessHeap
(),
0
,
pszSoundW
);
}
else
bSound
=
sndPlaySoundW
((
LPWSTR
)
pszSoundA
,
uFlags
);
return
bSound
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment