Additionally here are the codes in the MMCSS parts of Echo Audiofire ASIO drivers that their tech. programmers provided me by email:
void AsioEcho::AdjustMMCSS(HANDLE &hAv,BOOL &DwmLowered)
{
//
// Boost thread priority
//
if (m_fUseMmcss)
{
typedef HANDLE (WINAPI *PFN_SETMMTHREADCHARECTERISTICS)(LPCTSTR,LPDWORD);
typedef BOOL (WINAPI *PFN_SETMMTHREADPRIORITY)(HANDLE,AVRT_PRIORITY);
PFN_SETMMTHREADCHARECTERISTICS fnAvSetMmThreadCharacteristics;
PFN_SETMMTHREADPRIORITY fnAvSetMmThreadPriority;
fnAvSetMmThreadCharacteristics =
(PFN_SETMMTHREADCHARECTERISTICS) GetProcAddress(GetModuleHandle("Avrt.dll"),
"AvSetMmThreadCharacteristicsA");
fnAvSetMmThreadPriority = (PFN_SETMMTHREADPRIORITY) GetProcAddress( GetModuleHandle("Avrt.dll"),
"AvSetMmThreadPriority");
if (fnAvSetMmThreadCharacteristics && fnAvSetMmThreadPriority)
{
DWORD AvTaskIdx = 0;
hAv = fnAvSetMmThreadCharacteristics("Pro Audio",&AvTaskIdx);
if (hAv)
{
fnAvSetMmThreadPriority(hAv,AVRT_PRIORITY_CRITICAL);
dpf("======= Boosting ASIO driver thread priority with MMCSS\n");
}
}
}
//
// Lower desktop window manager priority
//
if (m_fLowerDwm)
{
fnDwmEnableMMCSS = (PFN_DWMENABLEMMCSS)GetProcAddress( GetModuleHandle("dwmapi.dll"),
"DwmEnableMMCSS");
if (fnDwmEnableMMCSS)
{
HRESULT hr;
hr = fnDwmEnableMMCSS(FALSE);
DwmLowered = hr == S_OK;
DPF1("======= Disabling MMCSS for DWM - returned 0x%x\n",hr);
}
}
}
As you see, when they boost the priority of audio, they have even dropped the priority of Desktop Window Manager which draws the desktop interfaces at the same time too.