Commit f8b670f1 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

winealsa: Move set_event_handle to the unixlib.

parent f3bd61ad
......@@ -1889,6 +1889,26 @@ static NTSTATUS get_current_padding(void *args)
return alsa_unlock_result(stream, &params->result, S_OK);
}
static NTSTATUS set_event_handle(void *args)
{
struct set_event_handle_params *params = args;
struct alsa_stream *stream = params->stream;
alsa_lock(stream);
if(!(stream->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK))
return alsa_unlock_result(stream, &params->result, AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED);
if (stream->event){
FIXME("called twice\n");
return alsa_unlock_result(stream, &params->result, HRESULT_FROM_WIN32(ERROR_INVALID_NAME));
}
stream->event = params->event;
return alsa_unlock_result(stream, &params->result, S_OK);
}
unixlib_entry_t __wine_unix_call_funcs[] =
{
get_endpoint_ids,
......@@ -1903,4 +1923,5 @@ unixlib_entry_t __wine_unix_call_funcs[] =
get_buffer_size,
get_latency,
get_current_padding,
set_event_handle,
};
......@@ -1038,7 +1038,7 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface,
HANDLE event)
{
ACImpl *This = impl_from_IAudioClient3(iface);
struct alsa_stream *stream = This->stream;
struct set_event_handle_params params;
TRACE("(%p)->(%p)\n", This, event);
......@@ -1048,24 +1048,12 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface,
if(!This->stream)
return AUDCLNT_E_NOT_INITIALIZED;
alsa_lock(stream);
if(!(stream->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK)){
alsa_unlock(stream);
return AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED;
}
if (stream->event){
alsa_unlock(stream);
FIXME("called twice\n");
return HRESULT_FROM_WIN32(ERROR_INVALID_NAME);
}
stream->event = event;
params.stream = This->stream;
params.event = event;
alsa_unlock(stream);
ALSA_CALL(set_event_handle, &params);
return S_OK;
return params.result;
}
static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid,
......
......@@ -153,6 +153,13 @@ struct get_current_padding_params
UINT32 *padding;
};
struct set_event_handle_params
{
struct alsa_stream *stream;
HANDLE event;
HRESULT result;
};
enum alsa_funcs
{
alsa_get_endpoint_ids,
......@@ -167,6 +174,7 @@ enum alsa_funcs
alsa_get_buffer_size,
alsa_get_latency,
alsa_get_current_padding,
alsa_set_event_handle,
};
extern unixlib_handle_t alsa_handle;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment