The windows CALLBACK functions like the
void CALLBACK waveOutProc(
HWAVEOUT hwo,
UINT uMsg,
DWORD_PTR dwInstance,
DWORD dwParam1,
DWORD dwParam2
);
defined in Waveform API,limited the function call used inside the
CALLBACK function. In MSDN,the waveOutProc is remarked as follow:

Remarks
Applications should not call any system-defined functions from inside
a callback function, except for EnterCriticalSection,
LeaveCriticalSection, midiOutLongMsg, midiOutShortMsg,
OutputDebugString, PostMessage, PostThreadMessage, SetEvent,
timeGetSystemTime, timeGetTime, timeKillEvent, and timeSetEvent.
Calling other wave functions will cause deadlock.


My question is: why does the waveOutProc callback has that
restriction? what happend in the other system calls such as the mutex
and semaphore series?

Thanks!