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
2754c750
Commit
2754c750
authored
Jul 18, 2011
by
Andrew Eikum
Committed by
Alexandre Julliard
Jul 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: Perform Open and Close callbacks from client thread.
parent
2a58273f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
10 deletions
+59
-10
wave.c
dlls/winmm/tests/wave.c
+5
-0
waveform.c
dlls/winmm/waveform.c
+54
-10
No files found.
dlls/winmm/tests/wave.c
View file @
2754c750
...
...
@@ -37,6 +37,8 @@
#include "winmm_test.h"
static
DWORD
g_tid
;
static
void
test_multiple_waveopens
(
void
)
{
HWAVEOUT
handle1
,
handle2
;
...
...
@@ -559,6 +561,8 @@ static void CALLBACK callback_func(HWAVEOUT hwo, UINT uMsg,
DWORD_PTR
dwInstance
,
DWORD
dwParam1
,
DWORD
dwParam2
)
{
if
(
uMsg
==
WOM_OPEN
||
uMsg
==
WOM_CLOSE
)
ok
(
GetCurrentThreadId
()
==
g_tid
,
"Got different thread ID
\n
"
);
SetEvent
((
HANDLE
)
dwInstance
);
}
...
...
@@ -648,6 +652,7 @@ static void wave_out_test_deviceOut(int device, double duration,
return
;
}
wout
=
NULL
;
g_tid
=
GetCurrentThreadId
();
rc
=
waveOutOpen
(
&
wout
,
device
,
pwfx
,
callback
,
callback_instance
,
flags
);
/* Note: Win9x doesn't know WAVE_FORMAT_DIRECT */
/* It is acceptable to fail on formats that are not specified to work */
...
...
dlls/winmm/waveform.c
View file @
2754c750
...
...
@@ -998,8 +998,6 @@ static LRESULT WOD_Open(WINMM_OpenInfo *info)
LeaveCriticalSection
(
&
device
->
lock
);
WINMM_NotifyClient
(
&
cb_info
,
WOM_OPEN
,
0
,
0
);
return
MMSYSERR_NOERROR
;
error:
...
...
@@ -1069,8 +1067,6 @@ static LRESULT WID_Open(WINMM_OpenInfo *info)
LeaveCriticalSection
(
&
device
->
lock
);
WINMM_NotifyClient
(
&
cb_info
,
WIM_OPEN
,
0
,
0
);
return
MMSYSERR_NOERROR
;
error:
...
...
@@ -1143,8 +1139,6 @@ static LRESULT WOD_Close(HWAVEOUT hwave)
LeaveCriticalSection
(
&
device
->
lock
);
WINMM_NotifyClient
(
&
cb_info
,
WOM_CLOSE
,
0
,
0
);
return
MMSYSERR_NOERROR
;
}
...
...
@@ -1167,8 +1161,6 @@ static LRESULT WID_Close(HWAVEIN hwave)
LeaveCriticalSection
(
&
device
->
lock
);
WINMM_NotifyClient
(
&
cb_info
,
WIM_CLOSE
,
0
,
0
);
return
MMSYSERR_NOERROR
;
}
...
...
@@ -2325,6 +2317,7 @@ MMRESULT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID,
LRESULT
res
;
HRESULT
hr
;
WINMM_OpenInfo
info
;
WINMM_CBInfo
cb_info
;
TRACE
(
"(%p, %u, %p, %lx, %lx, %08x)
\n
"
,
lphWaveOut
,
uDeviceID
,
lpFormat
,
dwCallback
,
dwInstance
,
dwFlags
);
...
...
@@ -2354,6 +2347,13 @@ MMRESULT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID,
if
(
lphWaveOut
)
*
lphWaveOut
=
(
HWAVEOUT
)
info
.
handle
;
cb_info
.
flags
=
HIWORD
(
dwFlags
&
CALLBACK_TYPEMASK
);
cb_info
.
callback
=
dwCallback
;
cb_info
.
user
=
dwInstance
;
cb_info
.
hwave
=
info
.
handle
;
WINMM_NotifyClient
(
&
cb_info
,
WOM_OPEN
,
0
,
0
);
return
res
;
}
...
...
@@ -2362,12 +2362,30 @@ MMRESULT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID,
*/
UINT
WINAPI
waveOutClose
(
HWAVEOUT
hWaveOut
)
{
UINT
res
;
WINMM_Device
*
device
;
WINMM_CBInfo
cb_info
;
TRACE
(
"(%p)
\n
"
,
hWaveOut
);
if
(
!
WINMM_StartDevicesThread
())
return
MMSYSERR_ERROR
;
return
SendMessageW
(
g_devices_hwnd
,
WODM_CLOSE
,
(
WPARAM
)
hWaveOut
,
0
);
device
=
WINMM_GetDeviceFromHWAVE
((
HWAVE
)
hWaveOut
);
if
(
!
WINMM_ValidateAndLock
(
device
))
return
MMSYSERR_INVALHANDLE
;
memcpy
(
&
cb_info
,
&
device
->
cb_info
,
sizeof
(
cb_info
));
LeaveCriticalSection
(
&
device
->
lock
);
res
=
SendMessageW
(
g_devices_hwnd
,
WODM_CLOSE
,
(
WPARAM
)
hWaveOut
,
0
);
if
(
res
==
MMSYSERR_NOERROR
)
WINMM_NotifyClient
(
&
cb_info
,
WOM_CLOSE
,
0
,
0
);
return
res
;
}
/**************************************************************************
...
...
@@ -2978,6 +2996,7 @@ MMRESULT WINAPI waveInOpen(HWAVEIN* lphWaveIn, UINT uDeviceID,
LRESULT
res
;
HRESULT
hr
;
WINMM_OpenInfo
info
;
WINMM_CBInfo
cb_info
;
TRACE
(
"(%p, %x, %p, %lx, %lx, %08x)
\n
"
,
lphWaveIn
,
uDeviceID
,
lpFormat
,
dwCallback
,
dwInstance
,
dwFlags
);
...
...
@@ -3007,6 +3026,13 @@ MMRESULT WINAPI waveInOpen(HWAVEIN* lphWaveIn, UINT uDeviceID,
if
(
lphWaveIn
)
*
lphWaveIn
=
(
HWAVEIN
)
info
.
handle
;
cb_info
.
flags
=
HIWORD
(
dwFlags
&
CALLBACK_TYPEMASK
);
cb_info
.
callback
=
dwCallback
;
cb_info
.
user
=
dwInstance
;
cb_info
.
hwave
=
info
.
handle
;
WINMM_NotifyClient
(
&
cb_info
,
WIM_OPEN
,
0
,
0
);
return
res
;
}
...
...
@@ -3015,12 +3041,30 @@ MMRESULT WINAPI waveInOpen(HWAVEIN* lphWaveIn, UINT uDeviceID,
*/
UINT
WINAPI
waveInClose
(
HWAVEIN
hWaveIn
)
{
WINMM_Device
*
device
;
WINMM_CBInfo
cb_info
;
UINT
res
;
TRACE
(
"(%p)
\n
"
,
hWaveIn
);
if
(
!
WINMM_StartDevicesThread
())
return
MMSYSERR_ERROR
;
return
SendMessageW
(
g_devices_hwnd
,
WIDM_CLOSE
,
(
WPARAM
)
hWaveIn
,
0
);
device
=
WINMM_GetDeviceFromHWAVE
((
HWAVE
)
hWaveIn
);
if
(
!
WINMM_ValidateAndLock
(
device
))
return
MMSYSERR_INVALHANDLE
;
memcpy
(
&
cb_info
,
&
device
->
cb_info
,
sizeof
(
cb_info
));
LeaveCriticalSection
(
&
device
->
lock
);
res
=
SendMessageW
(
g_devices_hwnd
,
WIDM_CLOSE
,
(
WPARAM
)
hWaveIn
,
0
);
if
(
res
==
MMSYSERR_NOERROR
)
WINMM_NotifyClient
(
&
cb_info
,
WIM_CLOSE
,
0
,
0
);
return
res
;
}
/**************************************************************************
...
...
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