mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 11:01:29 +00:00
mmdevapi: Move test_connect handling into mmdevapi.
This commit is contained in:
parent
ec9aab2c46
commit
a20e1df90e
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
#include "ntstatus.h"
|
#include "ntstatus.h"
|
||||||
#define COBJMACROS
|
#define COBJMACROS
|
||||||
|
@ -68,7 +69,8 @@ static const char *get_priority_string(int prio)
|
||||||
static BOOL load_driver(const WCHAR *name, DriverFuncs *driver)
|
static BOOL load_driver(const WCHAR *name, DriverFuncs *driver)
|
||||||
{
|
{
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
WCHAR driver_module[264];
|
WCHAR driver_module[264], path[MAX_PATH];
|
||||||
|
struct test_connect_params params;
|
||||||
|
|
||||||
lstrcpyW(driver_module, L"wine");
|
lstrcpyW(driver_module, L"wine");
|
||||||
lstrcatW(driver_module, name);
|
lstrcatW(driver_module, name);
|
||||||
|
@ -96,7 +98,6 @@ static BOOL load_driver(const WCHAR *name, DriverFuncs *driver)
|
||||||
|
|
||||||
#define LDFC(n) do { driver->p##n = (void*)GetProcAddress(driver->module, #n);\
|
#define LDFC(n) do { driver->p##n = (void*)GetProcAddress(driver->module, #n);\
|
||||||
if(!driver->p##n) { goto fail; } } while(0)
|
if(!driver->p##n) { goto fail; } } while(0)
|
||||||
LDFC(GetPriority);
|
|
||||||
LDFC(GetEndpointIDs);
|
LDFC(GetEndpointIDs);
|
||||||
LDFC(GetAudioEndpoint);
|
LDFC(GetAudioEndpoint);
|
||||||
LDFC(GetAudioSessionManager);
|
LDFC(GetAudioSessionManager);
|
||||||
|
@ -105,7 +106,18 @@ static BOOL load_driver(const WCHAR *name, DriverFuncs *driver)
|
||||||
/* optional - do not fail if not found */
|
/* optional - do not fail if not found */
|
||||||
driver->pGetPropValue = (void*)GetProcAddress(driver->module, "GetPropValue");
|
driver->pGetPropValue = (void*)GetProcAddress(driver->module, "GetPropValue");
|
||||||
|
|
||||||
driver->priority = driver->pGetPriority();
|
GetModuleFileNameW(NULL, path, ARRAY_SIZE(path));
|
||||||
|
params.name = wcsrchr(path, '\\');
|
||||||
|
params.name = params.name ? params.name + 1 : path;
|
||||||
|
params.priority = Priority_Neutral;
|
||||||
|
|
||||||
|
if ((status = __wine_unix_call(driver->module_unixlib, test_connect, ¶ms))) {
|
||||||
|
ERR("Unable to retrieve driver priority: %lx\n", status);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
driver->priority = params.priority;
|
||||||
|
|
||||||
lstrcpyW(driver->module_name, driver_module);
|
lstrcpyW(driver->module_name, driver_module);
|
||||||
|
|
||||||
TRACE("Successfully loaded %s with priority %s\n",
|
TRACE("Successfully loaded %s with priority %s\n",
|
||||||
|
|
|
@ -30,13 +30,12 @@ typedef struct _DriverFuncs {
|
||||||
HMODULE module;
|
HMODULE module;
|
||||||
unixlib_handle_t module_unixlib;
|
unixlib_handle_t module_unixlib;
|
||||||
WCHAR module_name[64];
|
WCHAR module_name[64];
|
||||||
int priority;
|
|
||||||
|
|
||||||
/* Returns a "priority" value for the driver. Highest priority wins.
|
/* Highest priority wins.
|
||||||
* If multiple drivers think they are valid, they will return a
|
* If multiple drivers think they are valid, they will return a
|
||||||
* priority value reflecting the likelihood that they are actually
|
* priority value reflecting the likelihood that they are actually
|
||||||
* valid. See enum _DriverPriority. */
|
* valid. See enum _DriverPriority. */
|
||||||
int (WINAPI *pGetPriority)(void);
|
int priority;
|
||||||
|
|
||||||
/* ids gets an array of human-friendly endpoint names
|
/* ids gets an array of human-friendly endpoint names
|
||||||
* keys gets an array of driver-specific stuff that is used
|
* keys gets an array of driver-specific stuff that is used
|
||||||
|
|
|
@ -212,11 +212,6 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int WINAPI AUDDRV_GetPriority(void)
|
|
||||||
{
|
|
||||||
return Priority_Neutral;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT alsa_stream_release(stream_handle stream, HANDLE timer_thread)
|
static HRESULT alsa_stream_release(stream_handle stream, HANDLE timer_thread)
|
||||||
{
|
{
|
||||||
struct release_stream_params params;
|
struct release_stream_params params;
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
@ stdcall -private modMessage(long long long long long) ALSA_modMessage
|
@ stdcall -private modMessage(long long long long long) ALSA_modMessage
|
||||||
|
|
||||||
# MMDevAPI driver functions
|
# MMDevAPI driver functions
|
||||||
@ stdcall -private GetPriority() AUDDRV_GetPriority
|
|
||||||
@ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs
|
@ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs
|
||||||
@ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint
|
@ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint
|
||||||
@ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager
|
@ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager
|
||||||
|
|
|
@ -213,11 +213,6 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int WINAPI AUDDRV_GetPriority(void)
|
|
||||||
{
|
|
||||||
return Priority_Neutral;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void set_device_guid(EDataFlow flow, HKEY drv_key, const WCHAR *key_name,
|
static void set_device_guid(EDataFlow flow, HKEY drv_key, const WCHAR *key_name,
|
||||||
GUID *guid)
|
GUID *guid)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
@ stdcall -private modMessage(long long long long long) CoreAudio_modMessage
|
@ stdcall -private modMessage(long long long long long) CoreAudio_modMessage
|
||||||
|
|
||||||
# MMDevAPI driver functions
|
# MMDevAPI driver functions
|
||||||
@ stdcall -private GetPriority() AUDDRV_GetPriority
|
|
||||||
@ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs
|
@ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs
|
||||||
@ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint
|
@ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint
|
||||||
@ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager
|
@ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager
|
||||||
|
|
|
@ -226,17 +226,6 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int WINAPI AUDDRV_GetPriority(void)
|
|
||||||
{
|
|
||||||
struct test_connect_params params;
|
|
||||||
|
|
||||||
params.name = NULL;
|
|
||||||
|
|
||||||
OSS_CALL(test_connect, ¶ms);
|
|
||||||
|
|
||||||
return params.priority;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT stream_release(stream_handle stream, HANDLE timer_thread)
|
static HRESULT stream_release(stream_handle stream, HANDLE timer_thread)
|
||||||
{
|
{
|
||||||
struct release_stream_params params;
|
struct release_stream_params params;
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
@ stdcall -private modMessage(long long long long long) OSS_modMessage
|
@ stdcall -private modMessage(long long long long long) OSS_modMessage
|
||||||
|
|
||||||
# MMDevAPI driver functions
|
# MMDevAPI driver functions
|
||||||
@ stdcall -private GetPriority() AUDDRV_GetPriority
|
|
||||||
@ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs
|
@ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs
|
||||||
@ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint
|
@ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint
|
||||||
@ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager
|
@ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager
|
||||||
|
|
|
@ -467,17 +467,6 @@ end:
|
||||||
return params.result;
|
return params.result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int WINAPI AUDDRV_GetPriority(void)
|
|
||||||
{
|
|
||||||
struct test_connect_params params;
|
|
||||||
WCHAR *name;
|
|
||||||
|
|
||||||
params.name = name = get_application_name(FALSE);
|
|
||||||
pulse_call(test_connect, ¶ms);
|
|
||||||
free(name);
|
|
||||||
return params.priority;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL get_pulse_name_by_guid(const GUID *guid, char pulse_name[MAX_PULSE_NAME_LEN], EDataFlow *flow)
|
static BOOL get_pulse_name_by_guid(const GUID *guid, char pulse_name[MAX_PULSE_NAME_LEN], EDataFlow *flow)
|
||||||
{
|
{
|
||||||
struct device_cache *device;
|
struct device_cache *device;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
# MMDevAPI driver functions
|
# MMDevAPI driver functions
|
||||||
@ stdcall -private GetPriority() AUDDRV_GetPriority
|
|
||||||
@ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs
|
@ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs
|
||||||
@ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint
|
@ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint
|
||||||
@ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager
|
@ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager
|
||||||
|
|
Loading…
Reference in a new issue