コード例 #1
0
    def GetMessage(self, emu, argv, ctx={}):
        '''
        BOOL GetMessage(
            LPMSG lpMsg,
            HWND  hWnd,
            UINT  wMsgFilterMin,
            UINT  wMsgFilterMax
        );
        '''
        lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax = argv

        t = emu.get_current_thread()
        try:
            msg = t.message_queue.pop(0)
        except IndexError:
            # If the queue is empty but a timer is active, write a WM_TIMER message and return True
            if self.timer_count > 0:
                msg = windefs.MSG(emu.get_ptr_size())
                msg.hwnd = hWnd
                msg.message = windefs.WM_TIMER
            else:
                return False

        self.mem_write(lpMsg, msg.get_bytes())

        return True
コード例 #2
0
    def DispatchMessage(self, emu, argv, ctx={}):
        '''
        LRESULT DispatchMessage(
            const MSG *lpMsg
        );
        '''
        lpMsg, = argv

        msg = windefs.MSG(emu.get_ptr_size())
        msg = self.mem_cast(msg, lpMsg)

        return 0