27 #include "precompiled.h"
45 return name.find(L
"oal.dll") != Path::String::npos || name.find(L
"OpenAL") != Path::String::npos;
60 for(
size_t i = 0; i < files.size(); i++)
67 std::pair<StringSet::iterator, bool> ret = dlls.insert(name);
93 const wchar_t* module,
void*
UNUSED(cbData))
111 typedef BOOL (
CALLBACK* LPDSENUMCALLBACKW)(
void*,
const wchar_t*,
const wchar_t*,
void*);
112 HMODULE hDsoundDll = LoadLibraryW(L
"dsound.dll");
113 WUTIL_FUNC(pDirectSoundEnumerateW, HRESULT, (LPDSENUMCALLBACKW,
void*));
114 WUTIL_IMPORT(hDsoundDll, DirectSoundEnumerateW, pDirectSoundEnumerateW);
115 if(pDirectSoundEnumerateW)
120 FreeLibrary(hDsoundDll);
131 std::set<std::wstring> names;
132 for(WmiInstances::iterator it = instances.begin(); it != instances.end(); ++it)
134 if((*it)[L
"Availability"].intVal != 8)
135 names.insert(std::wstring((*it)[L
"ProductName"].bstrVal));
138 for(std::set<std::wstring>::const_iterator it = names.begin(); it != names.end(); ++it)
static BOOL CALLBACK DirectSoundCallback(void *guid, const wchar_t *description, const wchar_t *module, void *cbData)
#define WUTIL_IMPORT(hModule, procName, varName)
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning. ...
const size_t SND_CARD_LEN
#define WUTIL_FUNC(varName, ret, params)
Status GetDirectoryEntries(const OsPath &path, CFileInfos *files, DirectoryNames *subdirectoryNames)
int swprintf_s(wchar_t *buf, size_t max_chars, const wchar_t *fmt,...) WPRINTF_ARGS(3)
std::set< Path::String > StringSet
std::vector< WmiInstance > WmiInstances
int wcscpy_s(wchar_t *dst, size_t max_dst_chars, const wchar_t *src)
const size_t SND_DRV_VER_LEN
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
void wdll_ver_Append(const OsPath &pathname, VersionList &list)
Read DLL version information and append it to a string.
Status wmi_GetClassInstances(const wchar_t *className, WmiInstances &instances)
get all instances of the requested class.
static bool IsOpenAlDllName(const Path::String &name)
i64 Status
Error handling system.
static void add_oal_dlls_in_dir(const OsPath &path, StringSet &dlls, VersionList &versionList)
wchar_t snd_drv_ver[SND_DRV_VER_LEN]
sound driver identification and version.
wchar_t snd_card[SND_CARD_LEN]
description of sound card.
const OsPath & wutil_ExecutablePath()
const OsPath & wutil_SystemPath()
Status win_get_snd_info()
std::vector< CFileInfo > CFileInfos
static const OsPath & GetDirectSoundDriverPath()
static OsPath directSoundDriverPath
const size_t WVERSION_VISTA
#define RETURN_STATUS_IF_ERR(expression)