Commit d2c9a9f0 authored by Davide Beatrici's avatar Davide Beatrici Committed by Alexandre Julliard

mmdevapi: Integrate wineoss's additions in unixlib.h.

parent bad50922
......@@ -16,20 +16,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "unixlib.h"
#include <wine/list.h>
extern HRESULT MMDevEnum_Create(REFIID riid, void **ppv) DECLSPEC_HIDDEN;
extern void MMDevEnum_Free(void) DECLSPEC_HIDDEN;
/* Changes to this enum must be synced in drivers. */
enum _DriverPriority {
Priority_Unavailable = 0, /* driver won't work */
Priority_Low, /* driver may work, but unlikely */
Priority_Neutral, /* driver makes no judgment */
Priority_Preferred /* driver thinks it's correct */
};
typedef struct _DriverFuncs {
HMODULE module;
WCHAR module_name[64];
......
......@@ -22,6 +22,14 @@
typedef UINT64 stream_handle;
enum driver_priority
{
Priority_Unavailable = 0, /* driver won't work */
Priority_Low, /* driver may work, but unlikely */
Priority_Neutral, /* driver makes no judgment */
Priority_Preferred /* driver thinks it's correct */
};
struct endpoint
{
unsigned int name;
......@@ -211,7 +219,7 @@ struct set_event_handle_params
struct test_connect_params
{
const char *name;
HRESULT result;
enum driver_priority priority;
};
struct is_started_params
......@@ -273,6 +281,16 @@ struct midi_notify_wait_params
struct notify_context *notify;
};
struct aux_message_params
{
UINT dev_id;
UINT msg;
UINT_PTR user;
UINT_PTR param_1;
UINT_PTR param_2;
UINT *err;
};
enum unix_funcs
{
process_attach,
......@@ -307,4 +325,5 @@ enum unix_funcs
midi_out_message,
midi_in_message,
midi_notify_wait,
aux_message,
};
......@@ -2463,6 +2463,7 @@ unixlib_entry_t __wine_unix_call_funcs[] =
alsa_midi_out_message,
alsa_midi_in_message,
alsa_midi_notify_wait,
NULL,
};
#ifdef _WIN64
......@@ -2880,6 +2881,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] =
alsa_wow64_midi_out_message,
alsa_wow64_midi_in_message,
alsa_wow64_midi_notify_wait,
NULL,
};
#endif /* _WIN64 */
......@@ -216,14 +216,6 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved)
return TRUE;
}
/* From <dlls/mmdevapi/mmdevapi.h> */
enum DriverPriority {
Priority_Unavailable = 0,
Priority_Low,
Priority_Neutral,
Priority_Preferred
};
int WINAPI AUDDRV_GetPriority(void)
{
return Priority_Neutral;
......
......@@ -56,14 +56,6 @@ static unixlib_handle_t pulse_handle;
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
/* From <dlls/mmdevapi/mmdevapi.h> */
enum DriverPriority {
Priority_Unavailable = 0,
Priority_Low,
Priority_Neutral,
Priority_Preferred
};
static HANDLE pulse_thread;
static struct list g_sessions = LIST_INIT(g_sessions);
static struct list g_devices_cache = LIST_INIT(g_devices_cache);
......@@ -493,10 +485,10 @@ int WINAPI AUDDRV_GetPriority(void)
struct test_connect_params params;
char *name;
params.name = name = get_application_name(FALSE);
params.name = name = get_application_name(FALSE);
pulse_call(test_connect, &params);
free(name);
return SUCCEEDED(params.result) ? Priority_Preferred : Priority_Unavailable;
return params.priority;
}
static BOOL get_pulse_name_by_guid(const GUID *guid, char pulse_name[MAX_PULSE_NAME_LEN], EDataFlow *flow)
......
......@@ -773,7 +773,7 @@ static NTSTATUS pulse_test_connect(void *args)
pa_mainloop_free(pulse_ml);
pulse_ml = NULL;
pulse_unlock();
params->result = E_FAIL;
params->priority = Priority_Unavailable;
return STATUS_SUCCESS;
}
......@@ -839,7 +839,7 @@ static NTSTATUS pulse_test_connect(void *args)
pulse_unlock();
params->result = S_OK;
params->priority = Priority_Preferred;
return STATUS_SUCCESS;
fail:
......@@ -848,7 +848,7 @@ fail:
pa_mainloop_free(pulse_ml);
pulse_ml = NULL;
pulse_unlock();
params->result = E_FAIL;
params->priority = Priority_Unavailable;
return STATUS_SUCCESS;
}
......@@ -2392,6 +2392,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
NULL,
NULL,
NULL,
NULL,
};
#ifdef _WIN64
......@@ -2734,14 +2735,14 @@ static NTSTATUS pulse_wow64_test_connect(void *args)
struct
{
PTR32 name;
HRESULT result;
enum driver_priority priority;
} *params32 = args;
struct test_connect_params params =
{
.name = ULongToPtr(params32->name),
};
pulse_test_connect(&params);
params32->result = params.result;
params32->priority = params.priority;
return STATUS_SUCCESS;
}
......@@ -2835,6 +2836,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
NULL,
NULL,
NULL,
NULL,
};
#endif /* _WIN64 */
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