winewayland.drv: Ensure outputs can access xdg information robustly.
[wine.git] / dlls / mmdevapi / mmdevapi_private.h
blob0ed9140c3edd02c721c5a09f55251f2cf89934de
1 /*
2 * Copyright 2009 Maarten Lankhorst
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include <assert.h>
21 #include <endpointvolume.h>
22 #include <spatialaudioclient.h>
23 #include <winternl.h>
25 #include <wine/list.h>
26 #include <wine/unixlib.h>
28 #include "unixlib.h"
29 #include "mmdevdrv.h"
31 extern HRESULT MMDevEnum_Create(REFIID riid, void **ppv) DECLSPEC_HIDDEN;
32 extern void MMDevEnum_Free(void) DECLSPEC_HIDDEN;
34 typedef struct _DriverFuncs {
35 HMODULE module;
36 unixlib_handle_t module_unixlib;
37 WCHAR module_name[64];
39 /* Highest priority wins.
40 * If multiple drivers think they are valid, they will return a
41 * priority value reflecting the likelihood that they are actually
42 * valid. See enum _DriverPriority. */
43 int priority;
45 void (WINAPI *pget_device_guid)(EDataFlow flow, const char *name, GUID *guid);
46 BOOL (WINAPI *pget_device_name_from_guid)(GUID *guid, char **name, EDataFlow *flow);
47 } DriverFuncs;
49 extern DriverFuncs drvs DECLSPEC_HIDDEN;
51 typedef struct MMDevice {
52 IMMDevice IMMDevice_iface;
53 IMMEndpoint IMMEndpoint_iface;
54 LONG ref;
56 CRITICAL_SECTION crst;
58 EDataFlow flow;
59 DWORD state;
60 GUID devguid;
61 WCHAR *drv_id;
63 struct list entry;
64 } MMDevice;
66 static inline void wine_unix_call(const unsigned int code, void *args)
68 const NTSTATUS status = __wine_unix_call(drvs.module_unixlib, code, args);
69 assert(!status);
72 extern HRESULT AudioClient_Create(GUID *guid, IMMDevice *device, IAudioClient **out) DECLSPEC_HIDDEN;
73 extern HRESULT AudioEndpointVolume_Create(MMDevice *parent, IAudioEndpointVolumeEx **ppv) DECLSPEC_HIDDEN;
74 extern HRESULT AudioSessionManager_Create(IMMDevice *device, IAudioSessionManager2 **ppv) DECLSPEC_HIDDEN;
75 extern HRESULT SpatialAudioClient_Create(IMMDevice *device, ISpatialAudioClient **out) DECLSPEC_HIDDEN;
77 extern HRESULT load_devices_from_reg(void) DECLSPEC_HIDDEN;
78 extern HRESULT load_driver_devices(EDataFlow flow) DECLSPEC_HIDDEN;
80 extern void main_loop_stop(void) DECLSPEC_HIDDEN;
82 extern const WCHAR drv_keyW[] DECLSPEC_HIDDEN;