| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | #endif |
| | | |
| | | |
| | | /* Sets an error message based on GetLastError() */ |
| | | /* Sets an error message based on an HRESULT */ |
| | | int |
| | | WIN_SetErrorFromHRESULT(const char *prefix, HRESULT hr) |
| | | { |
| | |
| | | } |
| | | #endif |
| | | |
| | | BOOL WIN_IsWindowsVistaOrGreater() |
| | | BOOL WIN_IsWindowsVistaOrGreater(void) |
| | | { |
| | | #ifdef __WINRT__ |
| | | return TRUE; |
| | | #else |
| | | return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 0); |
| | | #endif |
| | | } |
| | | |
| | | BOOL WIN_IsWindows7OrGreater(void) |
| | | { |
| | | #ifdef __WINRT__ |
| | | return TRUE; |
| | | #else |
| | | return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 0); |
| | | #endif |
| | | } |
| | | |
| | |
| | | |
| | | (Also, DirectSound shouldn't be limited to 32 chars, but its device enum |
| | | has the same problem.) |
| | | |
| | | WASAPI doesn't need this. This is just for DirectSound/WinMM. |
| | | */ |
| | | char * |
| | | WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid) |
| | |
| | | DWORD len = 0; |
| | | char *retval = NULL; |
| | | |
| | | if (SDL_memcmp(guid, &nullguid, sizeof (*guid)) == 0) { |
| | | if (WIN_IsEqualGUID(guid, &nullguid)) { |
| | | return WIN_StringToUTF8(name); /* No GUID, go with what we've got. */ |
| | | } |
| | | |
| | |
| | | #endif /* if __WINRT__ / else */ |
| | | } |
| | | |
| | | BOOL |
| | | WIN_IsEqualGUID(const GUID * a, const GUID * b) |
| | | { |
| | | return (SDL_memcmp(a, b, sizeof (*a)) == 0); |
| | | } |
| | | |
| | | BOOL |
| | | WIN_IsEqualIID(REFIID a, REFIID b) |
| | | { |
| | | return (SDL_memcmp(a, b, sizeof (*a)) == 0); |
| | | } |
| | | |
| | | #endif /* __WIN32__ || __WINRT__ */ |
| | | |
| | | /* vi: set ts=4 sw=4 expandtab: */ |