From: John Hodge Date: Tue, 15 May 2012 06:31:23 +0000 (+0800) Subject: Usermode/AxWin3 - Debugging X-Git-Tag: rel0.15~611^2~107 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=24cfd20bdec5f1f3a23a2e5cba9cba984e12683e;p=tpg%2Facess2.git Usermode/AxWin3 - Debugging --- diff --git a/Usermode/Applications/axwin3_src/WM/ipc.c b/Usermode/Applications/axwin3_src/WM/ipc.c index 46aff215..fee78bb1 100644 --- a/Usermode/Applications/axwin3_src/WM/ipc.c +++ b/Usermode/Applications/axwin3_src/WM/ipc.c @@ -537,8 +537,7 @@ void IPC_Handle(const tIPC_Type *IPCType, const void *Ident, size_t MsgLen, tAxW _SysDebug("WARNING: Unknown message %i (%p)", Msg->ID, IPCType); break; } - if(rv) - _SysDebug("IPC_Handle: rv = %i", rv); + _SysDebug("IPC_Handle: rv = %i", rv); } // --- Server->Client replies diff --git a/Usermode/Applications/axwin3_src/WM/wm_input.c b/Usermode/Applications/axwin3_src/WM/wm_input.c index 3220f773..232407ae 100644 --- a/Usermode/Applications/axwin3_src/WM/wm_input.c +++ b/Usermode/Applications/axwin3_src/WM/wm_input.c @@ -125,6 +125,8 @@ void WM_Input_KeyFire(uint32_t Character, uint32_t Scancode) // TODO: Properly translate into KeySyms and Unicode + // TODO: Shortcuts + msg.KeySym = Scancode; msg.UCS32 = Character; WM_SendMessage(NULL, gpWM_FocusedWindow, WNDMSG_KEYFIRE, sizeof(msg), &msg); diff --git a/Usermode/Applications/axwin3_src/libaxwin3.so_src/wm.c b/Usermode/Applications/axwin3_src/libaxwin3.so_src/wm.c index 4a6242b1..8b138606 100644 --- a/Usermode/Applications/axwin3_src/libaxwin3.so_src/wm.c +++ b/Usermode/Applications/axwin3_src/libaxwin3.so_src/wm.c @@ -188,11 +188,21 @@ void AxWin3_int_HandleMessage(tAxWin_IPCMessage *Msg) { case IPCMSG_SENDMSG: { tIPCMsg_SendMsg *info = (void*)Msg->Data; - if(Msg->Size < sizeof(*info)) return ; - if(Msg->Size < sizeof(*info) + info->Length) return ; - if(!dest || !dest->Handler) return ; + if(Msg->Size < sizeof(*info) || Msg->Size < sizeof(*info) + info->Length) { + _SysDebug("Message is undersized (%i < %i + %i)", + Msg->Size < sizeof(*info), info->Length); + return ; + } + if(!dest || !dest->Handler) { + _SysDebug("No handler for destination %p", dest); + return ; + } + _SysDebug("IPC Message 0x%x - %i bytes", info->ID, info->Length); dest->Handler(dest, info->ID, info->Length, info->Data); break; } + default: + _SysDebug("Unknow message ID %i", Msg->ID); + break; } }