Usermode/AxWin3 - Debugging
authorJohn Hodge <[email protected]>
Tue, 15 May 2012 06:31:23 +0000 (14:31 +0800)
committerJohn Hodge <[email protected]>
Tue, 15 May 2012 06:31:23 +0000 (14:31 +0800)
Usermode/Applications/axwin3_src/WM/ipc.c
Usermode/Applications/axwin3_src/WM/wm_input.c
Usermode/Applications/axwin3_src/libaxwin3.so_src/wm.c

index 46aff21..fee78bb 100644 (file)
@@ -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
index 3220f77..232407a 100644 (file)
@@ -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);
index 4a6242b..8b13860 100644 (file)
@@ -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;
        }
 }
 

UCC git Repository :: git.ucc.asn.au