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

mmdevice: do not override target Windows version

parent 8b9e6d16
......@@ -22,8 +22,6 @@
# include <config.h>
#endif
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x600 /* Windows Vista */
#define INITGUID
#define COBJMACROS
#define CONST_VTABLE
......@@ -44,6 +42,37 @@ 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