winmm: Trace DriverCallback once upon entry.

This commit is contained in:
Jörg Höhle 2011-03-29 20:51:15 +02:00 committed by Alexandre Julliard
parent 7c06fef8b6
commit e6a501bbd6
1 changed files with 17 additions and 7 deletions

View File

@ -530,6 +530,21 @@ LRESULT WINAPI DefDriverProc(DWORD_PTR dwDriverIdentifier, HDRVR hDrv,
} }
} }
/**************************************************************************
* DRIVER_getCallback [internal]
*/
static const char* DRIVER_getCallback(DWORD uFlags)
{
switch(uFlags & DCB_TYPEMASK) {
case DCB_NULL: return "null";
case DCB_WINDOW: return "window";
case DCB_TASK: return "task";
case DCB_EVENT: return "event";
case DCB_FUNCTION: return "32bit function";
default: return "UNKNOWN";
}
}
/************************************************************************** /**************************************************************************
* DriverCallback [WINMM.@] * DriverCallback [WINMM.@]
*/ */
@ -537,28 +552,23 @@ BOOL WINAPI DriverCallback(DWORD_PTR dwCallBack, DWORD uFlags, HDRVR hDev,
DWORD wMsg, DWORD_PTR dwUser, DWORD_PTR dwParam1, DWORD wMsg, DWORD_PTR dwUser, DWORD_PTR dwParam1,
DWORD_PTR dwParam2) DWORD_PTR dwParam2)
{ {
TRACE("(%08lX, %04X, %p, %04X, %08lX, %08lX, %08lX)\n", TRACE("(%08lX, %s %04X, %p, %04X, %08lX, %08lX, %08lX)\n",
dwCallBack, uFlags, hDev, wMsg, dwUser, dwParam1, dwParam2); dwCallBack, DRIVER_getCallback(uFlags), uFlags, hDev, wMsg, dwUser, dwParam1, dwParam2);
switch (uFlags & DCB_TYPEMASK) { switch (uFlags & DCB_TYPEMASK) {
case DCB_NULL: case DCB_NULL:
TRACE("Null !\n");
break; break;
case DCB_WINDOW: case DCB_WINDOW:
TRACE("Window(%04lX) handle=%p!\n", dwCallBack, hDev);
PostMessageA((HWND)dwCallBack, wMsg, (WPARAM)hDev, dwParam1); PostMessageA((HWND)dwCallBack, wMsg, (WPARAM)hDev, dwParam1);
break; break;
case DCB_TASK: /* aka DCB_THREAD */ case DCB_TASK: /* aka DCB_THREAD */
TRACE("Task(%04lx) !\n", dwCallBack);
PostThreadMessageA(dwCallBack, wMsg, (WPARAM)hDev, dwParam1); PostThreadMessageA(dwCallBack, wMsg, (WPARAM)hDev, dwParam1);
break; break;
case DCB_FUNCTION: case DCB_FUNCTION:
TRACE("Function (32 bit) !\n");
if (dwCallBack) if (dwCallBack)
((LPDRVCALLBACK)dwCallBack)(hDev, wMsg, dwUser, dwParam1, dwParam2); ((LPDRVCALLBACK)dwCallBack)(hDev, wMsg, dwUser, dwParam1, dwParam2);
break; break;
case DCB_EVENT: case DCB_EVENT:
TRACE("Event(%08lx) !\n", dwCallBack);
SetEvent((HANDLE)dwCallBack); SetEvent((HANDLE)dwCallBack);
break; break;
#if 0 #if 0