Signed-off-by: Huw Davies huw@codeweavers.com --- dlls/wineoss.drv/mmdevdrv.c | 6 +++--- dlls/wineoss.drv/oss.c | 43 +++++++++++++++++++++---------------- dlls/wineoss.drv/unixlib.h | 40 +++++++++++++++++----------------- 3 files changed, 47 insertions(+), 42 deletions(-)
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index 93bf775ebc8..c9aae98ec2e 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -96,7 +96,7 @@ struct ACImpl { EDataFlow dataflow; float *vols; UINT32 channel_count; - struct oss_stream *stream; + stream_handle stream;
HANDLE timer_thread;
@@ -239,7 +239,7 @@ int WINAPI AUDDRV_GetPriority(void) return params.priority; }
-static HRESULT stream_release(struct oss_stream *stream, HANDLE timer_thread) +static HRESULT stream_release(stream_handle stream, HANDLE timer_thread) { struct release_stream_params params;
@@ -651,7 +651,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, { ACImpl *This = impl_from_IAudioClient3(iface); struct create_stream_params params; - struct oss_stream *stream; + stream_handle stream; unsigned int i;
TRACE("(%p)->(%x, %x, %s, %s, %p, %s)\n", This, mode, flags, diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c index 6490081e069..a628548ddcd 100644 --- a/dlls/wineoss.drv/oss.c +++ b/dlls/wineoss.drv/oss.c @@ -111,6 +111,11 @@ static NTSTATUS oss_unlock_result(struct oss_stream *stream, return STATUS_SUCCESS; }
+static struct oss_stream *handle_get_stream(stream_handle h) +{ + return (struct oss_stream *)(UINT_PTR)h; +} + static NTSTATUS test_connect(void *args) { struct test_connect_params *params = args; @@ -615,7 +620,7 @@ exit: free(stream->fmt); free(stream); }else{ - *params->stream = stream; + *params->stream = (stream_handle)(UINT_PTR)stream; }
return STATUS_SUCCESS; @@ -624,7 +629,7 @@ exit: static NTSTATUS release_stream(void *args) { struct release_stream_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream); SIZE_T size;
if(params->timer_thread){ @@ -653,7 +658,7 @@ static NTSTATUS release_stream(void *args) static NTSTATUS start(void *args) { struct start_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream);
oss_lock(stream);
@@ -671,7 +676,7 @@ static NTSTATUS start(void *args) static NTSTATUS stop(void *args) { struct stop_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream);
oss_lock(stream);
@@ -687,7 +692,7 @@ static NTSTATUS stop(void *args) static NTSTATUS reset(void *args) { struct reset_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream);
oss_lock(stream);
@@ -860,7 +865,7 @@ static void oss_read_data(struct oss_stream *stream) static NTSTATUS timer_loop(void *args) { struct timer_loop_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream); LARGE_INTEGER delay, now, next; int adjust;
@@ -902,7 +907,7 @@ static NTSTATUS timer_loop(void *args) static NTSTATUS get_render_buffer(void *args) { struct get_render_buffer_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream); UINT32 write_pos, frames = params->frames; BYTE **data = params->data; SIZE_T size; @@ -968,7 +973,7 @@ static void oss_wrap_buffer(struct oss_stream *stream, BYTE *buffer, UINT32 writ static NTSTATUS release_render_buffer(void *args) { struct release_render_buffer_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream); UINT32 written_frames = params->written_frames; UINT flags = params->flags; BYTE *buffer; @@ -1008,7 +1013,7 @@ static NTSTATUS release_render_buffer(void *args) static NTSTATUS get_capture_buffer(void *args) { struct get_capture_buffer_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream); UINT64 *devpos = params->devpos, *qpcpos = params->qpcpos; UINT32 *frames = params->frames; UINT *flags = params->flags; @@ -1074,7 +1079,7 @@ static NTSTATUS get_capture_buffer(void *args) static NTSTATUS release_capture_buffer(void *args) { struct release_capture_buffer_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream); UINT32 done = params->done;
oss_lock(stream); @@ -1231,7 +1236,7 @@ static NTSTATUS get_mix_format(void *args) static NTSTATUS get_buffer_size(void *args) { struct get_buffer_size_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream);
oss_lock(stream);
@@ -1243,7 +1248,7 @@ static NTSTATUS get_buffer_size(void *args) static NTSTATUS get_latency(void *args) { struct get_latency_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream);
oss_lock(stream);
@@ -1257,7 +1262,7 @@ static NTSTATUS get_latency(void *args) static NTSTATUS get_current_padding(void *args) { struct get_current_padding_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream);
oss_lock(stream);
@@ -1269,7 +1274,7 @@ static NTSTATUS get_current_padding(void *args) static NTSTATUS get_next_packet_size(void *args) { struct get_next_packet_size_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream); UINT32 *frames = params->frames;
oss_lock(stream); @@ -1282,7 +1287,7 @@ static NTSTATUS get_next_packet_size(void *args) static NTSTATUS get_frequency(void *args) { struct get_frequency_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream); UINT64 *freq = params->frequency;
oss_lock(stream); @@ -1298,7 +1303,7 @@ static NTSTATUS get_frequency(void *args) static NTSTATUS get_position(void *args) { struct get_position_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream); UINT64 *pos = params->position, *qpctime = params->qpctime;
oss_lock(stream); @@ -1342,7 +1347,7 @@ static NTSTATUS get_position(void *args) static NTSTATUS set_volumes(void *args) { struct set_volumes_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream);
oss_lock(stream); stream->mute = !params->master_volume; @@ -1354,7 +1359,7 @@ static NTSTATUS set_volumes(void *args) static NTSTATUS set_event_handle(void *args) { struct set_event_handle_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream);
oss_lock(stream);
@@ -1374,7 +1379,7 @@ static NTSTATUS set_event_handle(void *args) static NTSTATUS is_started(void *args) { struct is_started_params *params = args; - struct oss_stream *stream = params->stream; + struct oss_stream *stream = handle_get_stream(params->stream);
oss_lock(stream);
diff --git a/dlls/wineoss.drv/unixlib.h b/dlls/wineoss.drv/unixlib.h index 25e9a7007b3..278dfdbe612 100644 --- a/dlls/wineoss.drv/unixlib.h +++ b/dlls/wineoss.drv/unixlib.h @@ -18,7 +18,7 @@
#include "mmdeviceapi.h"
-struct stream_oss; +typedef UINT64 stream_handle;
/* From <dlls/mmdevapi/mmdevapi.h> */ enum DriverPriority @@ -60,42 +60,42 @@ struct create_stream_params REFERENCE_TIME period; const WAVEFORMATEX *fmt; HRESULT result; - struct oss_stream **stream; + stream_handle *stream; };
struct release_stream_params { - struct oss_stream *stream; + stream_handle stream; HANDLE timer_thread; HRESULT result; };
struct start_params { - struct oss_stream *stream; + stream_handle stream; HRESULT result; };
struct stop_params { - struct oss_stream *stream; + stream_handle stream; HRESULT result; };
struct reset_params { - struct oss_stream *stream; + stream_handle stream; HRESULT result; };
struct timer_loop_params { - struct oss_stream *stream; + stream_handle stream; };
struct get_render_buffer_params { - struct oss_stream *stream; + stream_handle stream; UINT32 frames; HRESULT result; BYTE **data; @@ -103,7 +103,7 @@ struct get_render_buffer_params
struct release_render_buffer_params { - struct oss_stream *stream; + stream_handle stream; UINT32 written_frames; UINT flags; HRESULT result; @@ -111,7 +111,7 @@ struct release_render_buffer_params
struct get_capture_buffer_params { - struct oss_stream *stream; + stream_handle stream; HRESULT result; BYTE **data; UINT32 *frames; @@ -122,7 +122,7 @@ struct get_capture_buffer_params
struct release_capture_buffer_params { - struct oss_stream *stream; + stream_handle stream; UINT32 done; HRESULT result; }; @@ -147,42 +147,42 @@ struct get_mix_format_params
struct get_buffer_size_params { - struct oss_stream *stream; + stream_handle stream; HRESULT result; UINT32 *size; };
struct get_latency_params { - struct oss_stream *stream; + stream_handle stream; HRESULT result; REFERENCE_TIME *latency; };
struct get_current_padding_params { - struct oss_stream *stream; + stream_handle stream; HRESULT result; UINT32 *padding; };
struct get_next_packet_size_params { - struct oss_stream *stream; + stream_handle stream; HRESULT result; UINT32 *frames; };
struct get_frequency_params { - struct oss_stream *stream; + stream_handle stream; HRESULT result; UINT64 *frequency; };
struct get_position_params { - struct oss_stream *stream; + stream_handle stream; HRESULT result; UINT64 *position; UINT64 *qpctime; @@ -190,7 +190,7 @@ struct get_position_params
struct set_volumes_params { - struct oss_stream *stream; + stream_handle stream; float master_volume; const float *volumes; const float *session_volumes; @@ -198,14 +198,14 @@ struct set_volumes_params
struct set_event_handle_params { - struct oss_stream *stream; + stream_handle stream; HANDLE event; HRESULT result; };
struct is_started_params { - struct oss_stream *stream; + stream_handle stream; HRESULT result; };