|
3 | 3 |
|
4 | 4 | // Modified copy of https://github.com/Erik-JS/proxy-dll-64/blob/master/winmm/main.cpp |
5 | 5 |
|
6 | | -// this shit has to be put here to thwart GCC into thinking the real winmm lib has been already included |
7 | | -// to avoid conflicts with the "fake" functions we're exporting here |
8 | | -#define _INC_MMSYSTEM |
9 | | - |
10 | 6 | namespace pluginloader::proxy { |
11 | 7 |
|
12 | 8 | namespace { |
@@ -194,8 +190,10 @@ FARPROC winmm_wave_out_set_volume = nullptr; |
194 | 190 | FARPROC winmm_wave_out_unprepare_header = nullptr; |
195 | 191 | FARPROC winmm_wave_out_write = nullptr; |
196 | 192 |
|
197 | | -} // namespace |
| 193 | +} // namespace |
198 | 194 |
|
| 195 | +// NOLINTBEGIN(readability-identifier-naming, readability-avoid-return-with-void-value) |
| 196 | +// clang-format off |
199 | 197 | DLL_EXPORT void CloseDriver() { return reinterpret_cast<decltype(&CloseDriver)>(winmm_close_driver)(); } |
200 | 198 | DLL_EXPORT void DefDriverProc() { return reinterpret_cast<decltype(&DefDriverProc)>(winmm_def_driver_proc)(); } |
201 | 199 | DLL_EXPORT void DriverCallback() { return reinterpret_cast<decltype(&DriverCallback)>(winmm_driver_callback)(); } |
@@ -376,9 +374,10 @@ DLL_EXPORT void waveOutSetPlaybackRate() { return reinterpret_cast<decltype(&wav |
376 | 374 | DLL_EXPORT void waveOutSetVolume() { return reinterpret_cast<decltype(&waveOutSetVolume)>(winmm_wave_out_set_volume)(); } |
377 | 375 | DLL_EXPORT void waveOutUnprepareHeader() { return reinterpret_cast<decltype(&waveOutUnprepareHeader)>(winmm_wave_out_unprepare_header)(); } |
378 | 376 | DLL_EXPORT void waveOutWrite() { return reinterpret_cast<decltype(&waveOutWrite)>(winmm_wave_out_write)(); } |
| 377 | +// clang-format on |
| 378 | +// NOLINTEND(readability-identifier-naming, readability-avoid-return-with-void-value) |
379 | 379 |
|
380 | 380 | void init(HMODULE /*this_dll*/) { |
381 | | - |
382 | 381 | // Suspend all other threads to prevent a giant race condition |
383 | 382 | const util::ThreadSuspender suspender{}; |
384 | 383 |
|
@@ -428,8 +427,10 @@ void init(HMODULE /*this_dll*/) { |
428 | 427 | winmm_mci_free_command_resource = GetProcAddress(winmm_dll_handle, "mciFreeCommandResource"); |
429 | 428 | winmm_mci_get_creator_task = GetProcAddress(winmm_dll_handle, "mciGetCreatorTask"); |
430 | 429 | winmm_mci_get_device_id_a = GetProcAddress(winmm_dll_handle, "mciGetDeviceIDA"); |
431 | | - winmm_mci_get_device_id_from_element_id_a = GetProcAddress(winmm_dll_handle, "mciGetDeviceIDFromElementIDA"); |
432 | | - winmm_mci_get_device_id_from_element_id_w = GetProcAddress(winmm_dll_handle, "mciGetDeviceIDFromElementIDW"); |
| 430 | + winmm_mci_get_device_id_from_element_id_a = |
| 431 | + GetProcAddress(winmm_dll_handle, "mciGetDeviceIDFromElementIDA"); |
| 432 | + winmm_mci_get_device_id_from_element_id_w = |
| 433 | + GetProcAddress(winmm_dll_handle, "mciGetDeviceIDFromElementIDW"); |
433 | 434 | winmm_mci_get_device_id_w = GetProcAddress(winmm_dll_handle, "mciGetDeviceIDW"); |
434 | 435 | winmm_mci_get_driver_data = GetProcAddress(winmm_dll_handle, "mciGetDriverData"); |
435 | 436 | winmm_mci_get_error_string_a = GetProcAddress(winmm_dll_handle, "mciGetErrorStringA"); |
@@ -584,4 +585,4 @@ void free(void) { |
584 | 585 | } |
585 | 586 | } |
586 | 587 |
|
587 | | -} // namespace pluginloader::proxy |
| 588 | +} // namespace pluginloader::proxy |
0 commit comments