Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
56f2c580
Commit
56f2c580
authored
Mar 06, 2011
by
Jörg Höhle
Committed by
Alexandre Julliard
Mar 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winealsa: CreateEvent and CreateThread return NULL on error, not INVALID_HANDLE_VALUE.
parent
3a5c79fa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
11 deletions
+9
-11
alsa.c
dlls/winealsa.drv/alsa.c
+3
-3
wavein.c
dlls/winealsa.drv/wavein.c
+2
-2
waveout.c
dlls/winealsa.drv/waveout.c
+4
-6
No files found.
dlls/winealsa.drv/alsa.c
View file @
56f2c580
...
@@ -127,7 +127,7 @@ void ALSA_WaitRingMessage(ALSA_MSG_RING* omr, DWORD sleep)
...
@@ -127,7 +127,7 @@ void ALSA_WaitRingMessage(ALSA_MSG_RING* omr, DWORD sleep)
*/
*/
int
ALSA_AddRingMessage
(
ALSA_MSG_RING
*
omr
,
enum
win_wm_message
msg
,
DWORD_PTR
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
;
HANDLE
hEvent
=
NULL
;
EnterCriticalSection
(
&
omr
->
msg_crst
);
EnterCriticalSection
(
&
omr
->
msg_crst
);
if
((
omr
->
msg_toget
==
((
omr
->
msg_tosave
+
1
)
%
omr
->
ring_buffer_size
)))
if
((
omr
->
msg_toget
==
((
omr
->
msg_tosave
+
1
)
%
omr
->
ring_buffer_size
)))
...
@@ -151,7 +151,7 @@ int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD_PTR p
...
@@ -151,7 +151,7 @@ int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD_PTR p
if
(
wait
)
if
(
wait
)
{
{
hEvent
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
hEvent
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
if
(
hEvent
==
INVALID_HANDLE_VALUE
)
if
(
!
hEvent
)
{
{
ERR
(
"can't create event !?
\n
"
);
ERR
(
"can't create event !?
\n
"
);
LeaveCriticalSection
(
&
omr
->
msg_crst
);
LeaveCriticalSection
(
&
omr
->
msg_crst
);
...
@@ -173,7 +173,7 @@ int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD_PTR p
...
@@ -173,7 +173,7 @@ int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD_PTR p
{
{
omr
->
messages
[
omr
->
msg_tosave
].
msg
=
msg
;
omr
->
messages
[
omr
->
msg_tosave
].
msg
=
msg
;
omr
->
messages
[
omr
->
msg_tosave
].
param
=
param
;
omr
->
messages
[
omr
->
msg_tosave
].
param
=
param
;
omr
->
messages
[
omr
->
msg_tosave
].
hEvent
=
INVALID_HANDLE_VALUE
;
omr
->
messages
[
omr
->
msg_tosave
].
hEvent
=
NULL
;
omr
->
msg_tosave
=
(
omr
->
msg_tosave
+
1
)
%
omr
->
ring_buffer_size
;
omr
->
msg_tosave
=
(
omr
->
msg_tosave
+
1
)
%
omr
->
ring_buffer_size
;
}
}
LeaveCriticalSection
(
&
omr
->
msg_crst
);
LeaveCriticalSection
(
&
omr
->
msg_crst
);
...
...
dlls/winealsa.drv/wavein.c
View file @
56f2c580
...
@@ -515,7 +515,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
...
@@ -515,7 +515,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
SetThreadPriority
(
wwi
->
hThread
,
THREAD_PRIORITY_TIME_CRITICAL
);
SetThreadPriority
(
wwi
->
hThread
,
THREAD_PRIORITY_TIME_CRITICAL
);
WaitForSingleObject
(
wwi
->
hStartUpEvent
,
INFINITE
);
WaitForSingleObject
(
wwi
->
hStartUpEvent
,
INFINITE
);
CloseHandle
(
wwi
->
hStartUpEvent
);
CloseHandle
(
wwi
->
hStartUpEvent
);
wwi
->
hStartUpEvent
=
INVALID_HANDLE_VALUE
;
wwi
->
hStartUpEvent
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
hw_params
);
HeapFree
(
GetProcessHeap
(),
0
,
hw_params
);
HeapFree
(
GetProcessHeap
(),
0
,
sw_params
);
HeapFree
(
GetProcessHeap
(),
0
,
sw_params
);
...
@@ -554,7 +554,7 @@ static DWORD widClose(WORD wDevID)
...
@@ -554,7 +554,7 @@ static DWORD widClose(WORD wDevID)
WARN
(
"buffers still playing !
\n
"
);
WARN
(
"buffers still playing !
\n
"
);
ret
=
WAVERR_STILLPLAYING
;
ret
=
WAVERR_STILLPLAYING
;
}
else
{
}
else
{
if
(
wwi
->
hThread
!=
INVALID_HANDLE_VALUE
)
{
if
(
wwi
->
hThread
)
{
ALSA_AddRingMessage
(
&
wwi
->
msgRing
,
WINE_WM_CLOSING
,
0
,
TRUE
);
ALSA_AddRingMessage
(
&
wwi
->
msgRing
,
WINE_WM_CLOSING
,
0
,
TRUE
);
}
}
ALSA_DestroyRingMessage
(
&
wwi
->
msgRing
);
ALSA_DestroyRingMessage
(
&
wwi
->
msgRing
);
...
...
dlls/winealsa.drv/waveout.c
View file @
56f2c580
...
@@ -782,18 +782,16 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
...
@@ -782,18 +782,16 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
wwo
->
hStartUpEvent
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
wwo
->
hStartUpEvent
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
wwo
->
hThread
=
CreateThread
(
NULL
,
0
,
wodPlayer
,
(
LPVOID
)(
DWORD_PTR
)
wDevID
,
0
,
&
(
wwo
->
dwThreadID
));
wwo
->
hThread
=
CreateThread
(
NULL
,
0
,
wodPlayer
,
(
LPVOID
)(
DWORD_PTR
)
wDevID
,
0
,
&
(
wwo
->
dwThreadID
));
if
(
wwo
->
hThread
)
if
(
!
wwo
->
hThread
)
{
SetThreadPriority
(
wwo
->
hThread
,
THREAD_PRIORITY_TIME_CRITICAL
);
else
{
ERR
(
"Thread creation for the wodPlayer failed!
\n
"
);
ERR
(
"Thread creation for the wodPlayer failed!
\n
"
);
CloseHandle
(
wwo
->
hStartUpEvent
);
CloseHandle
(
wwo
->
hStartUpEvent
);
retcode
=
MMSYSERR_NOMEM
;
retcode
=
MMSYSERR_NOMEM
;
goto
errexit
;
goto
errexit
;
}
}
SetThreadPriority
(
wwo
->
hThread
,
THREAD_PRIORITY_TIME_CRITICAL
);
WaitForSingleObject
(
wwo
->
hStartUpEvent
,
INFINITE
);
WaitForSingleObject
(
wwo
->
hStartUpEvent
,
INFINITE
);
CloseHandle
(
wwo
->
hStartUpEvent
);
CloseHandle
(
wwo
->
hStartUpEvent
);
wwo
->
hStartUpEvent
=
INVALID_HANDLE_VALUE
;
wwo
->
hStartUpEvent
=
NULL
;
TRACE
(
"handle=%p
\n
"
,
pcm
);
TRACE
(
"handle=%p
\n
"
,
pcm
);
TRACE
(
"wBitsPerSample=%u, nAvgBytesPerSec=%u, nSamplesPerSec=%u, nChannels=%u nBlockAlign=%u!
\n
"
,
TRACE
(
"wBitsPerSample=%u, nAvgBytesPerSec=%u, nSamplesPerSec=%u, nChannels=%u nBlockAlign=%u!
\n
"
,
...
@@ -856,7 +854,7 @@ static DWORD wodClose(WORD wDevID)
...
@@ -856,7 +854,7 @@ static DWORD wodClose(WORD wDevID)
WARN
(
"buffers still playing !
\n
"
);
WARN
(
"buffers still playing !
\n
"
);
ret
=
WAVERR_STILLPLAYING
;
ret
=
WAVERR_STILLPLAYING
;
}
else
{
}
else
{
if
(
wwo
->
hThread
!=
INVALID_HANDLE_VALUE
)
{
if
(
wwo
->
hThread
)
{
ALSA_AddRingMessage
(
&
wwo
->
msgRing
,
WINE_WM_CLOSING
,
0
,
TRUE
);
ALSA_AddRingMessage
(
&
wwo
->
msgRing
,
WINE_WM_CLOSING
,
0
,
TRUE
);
}
}
ALSA_DestroyRingMessage
(
&
wwo
->
msgRing
);
ALSA_DestroyRingMessage
(
&
wwo
->
msgRing
);
...
...
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