refactor/fix: Resolve some wmisc issues

> fix crashes around missing call convention/log hook
> enable wmisc for M39 as well, see #8
This commit is contained in:
[ ]
2026-01-11 21:11:55 +09:00
parent 26bc8fdda5
commit 244f4aa56a
4 changed files with 16 additions and 10 deletions
+6 -2
View File
@@ -9,7 +9,7 @@
namespace hooks::wmisc::msacm
{
typedef MMRESULT (*acmFormatSuggest_t)(HANDLE had, LPWAVEFORMATEX pwfxSrc, LPWAVEFORMATEX pwfxDst, DWORD cbwfxDst, DWORD fdwSuggest);
typedef MMRESULT (__stdcall *acmFormatSuggest_t)(HANDLE had, LPWAVEFORMATEX pwfxSrc, LPWAVEFORMATEX pwfxDst, DWORD cbwfxDst, DWORD fdwSuggest);
static acmFormatSuggest_t acmFormatSuggest;
static uint64_t hash_waveformatex(const WAVEFORMATEX *pwfx, DWORD fdwSuggest)
@@ -129,7 +129,7 @@ extern "C" void __cdecl on_log_msg(char level, const char *scope, const char *ms
}
void attach(HINSTANCE hmodule)
{
BmswLogInit_t BmswLogInit;
BmswLogInit_t BmswLogInit = nullptr;
HMODULE bmsw;
if ((bmsw = libutils::try_library(MODULE_PATH / "bmsound-wine.dll")))
{
@@ -161,6 +161,10 @@ void apply_performance_hacks(HINSTANCE hmodule, const char *model, const char *e
msacm::attach(hmodule);
bmsound::attach(hmodule);
break;
case to_hash("M39"):
msacm::attach(hmodule);
bmsound::attach(hmodule);
break;
case to_hash("FORCE"):
switch (to_hash(ext))
{