wineoss: Move set_event_handle to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c634bd201b
commit
9ced8cc923
|
@ -994,7 +994,7 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface,
|
|||
HANDLE event)
|
||||
{
|
||||
ACImpl *This = impl_from_IAudioClient3(iface);
|
||||
struct oss_stream *stream = This->stream;
|
||||
struct set_event_handle_params params;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, event);
|
||||
|
||||
|
@ -1004,24 +1004,11 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface,
|
|||
if(!This->stream)
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
|
||||
oss_lock(stream);
|
||||
params.stream = This->stream;
|
||||
params.event = event;
|
||||
OSS_CALL(set_event_handle, ¶ms);
|
||||
|
||||
if(!(stream->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK)){
|
||||
oss_unlock(stream);
|
||||
return AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED;
|
||||
}
|
||||
|
||||
if (stream->event){
|
||||
oss_unlock(stream);
|
||||
FIXME("called twice\n");
|
||||
return HRESULT_FROM_WIN32(ERROR_INVALID_NAME);
|
||||
}
|
||||
|
||||
stream->event = event;
|
||||
|
||||
oss_unlock(stream);
|
||||
|
||||
return S_OK;
|
||||
return params.result;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid,
|
||||
|
|
|
@ -1043,6 +1043,26 @@ static NTSTATUS get_current_padding(void *args)
|
|||
return oss_unlock_result(stream, ¶ms->result, S_OK);
|
||||
}
|
||||
|
||||
static NTSTATUS set_event_handle(void *args)
|
||||
{
|
||||
struct set_event_handle_params *params = args;
|
||||
struct oss_stream *stream = params->stream;
|
||||
|
||||
oss_lock(stream);
|
||||
|
||||
if(!(stream->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK))
|
||||
return oss_unlock_result(stream, ¶ms->result, AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED);
|
||||
|
||||
if (stream->event){
|
||||
FIXME("called twice\n");
|
||||
return oss_unlock_result(stream, ¶ms->result, HRESULT_FROM_WIN32(ERROR_INVALID_NAME));
|
||||
}
|
||||
|
||||
stream->event = params->event;
|
||||
|
||||
return oss_unlock_result(stream, ¶ms->result, S_OK);
|
||||
}
|
||||
|
||||
unixlib_entry_t __wine_unix_call_funcs[] =
|
||||
{
|
||||
test_connect,
|
||||
|
@ -1058,4 +1078,5 @@ unixlib_entry_t __wine_unix_call_funcs[] =
|
|||
get_buffer_size,
|
||||
get_latency,
|
||||
get_current_padding,
|
||||
set_event_handle,
|
||||
};
|
||||
|
|
|
@ -152,6 +152,13 @@ struct get_current_padding_params
|
|||
UINT32 *padding;
|
||||
};
|
||||
|
||||
struct set_event_handle_params
|
||||
{
|
||||
struct oss_stream *stream;
|
||||
HANDLE event;
|
||||
HRESULT result;
|
||||
};
|
||||
|
||||
enum oss_funcs
|
||||
{
|
||||
oss_test_connect,
|
||||
|
@ -167,6 +174,7 @@ enum oss_funcs
|
|||
oss_get_buffer_size,
|
||||
oss_get_latency,
|
||||
oss_get_current_padding,
|
||||
oss_set_event_handle,
|
||||
};
|
||||
|
||||
extern unixlib_handle_t oss_handle;
|
||||
|
|
Loading…
Reference in New Issue