Commit 81f37503 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

mmdevice: require Vista, simplify

MMDevice is not available on older Windows versions anyway. Failing to
load the plugin there is fine. It is even arguably better: it prevents
impossible choices showing in the preferences.
parent 25d99492
......@@ -18,6 +18,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#define _WIN32_WINNT 0x600
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
......@@ -43,37 +44,6 @@ DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd,
#include <vlc_modules.h>
#include "audio_output/mmdevice.h"
#if (_WIN32_WINNT < 0x600)
static VOID (WINAPI *InitializeConditionVariable) (PCONDITION_VARIABLE);
static BOOL (WINAPI *SleepConditionVariableCS) (PCONDITION_VARIABLE,
PCRITICAL_SECTION, DWORD);
static VOID (WINAPI *WakeConditionVariable)(PCONDITION_VARIABLE);
#define LOOKUP(s) \
if (((s) = (void *)GetProcAddress(h, #s)) == NULL) return FALSE
BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID); /* avoid warning */
BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, LPVOID reserved)
{
(void) dll;
(void) reserved;
switch (reason)
{
case DLL_PROCESS_ATTACH:
{
HANDLE h = GetModuleHandle(TEXT("kernel32.dll"));
if (unlikely(h == NULL))
return FALSE;
LOOKUP(InitializeConditionVariable);
LOOKUP(SleepConditionVariableCS);
LOOKUP(WakeConditionVariable);
break;
}
}
return TRUE;
}
#endif
DEFINE_GUID (GUID_VLC_AUD_OUT, 0x4533f59d, 0x59ee, 0x00c6,
0xad, 0xb2, 0xc6, 0x8b, 0x50, 0x1a, 0x66, 0x55);
......
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