2009-09-17 13:55:38 +02:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
|
2009-09-17 13:55:38 +02:00
|
|
|
|
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
|
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
2012-04-02 17:18:46 +02:00
|
|
|
|
$Revision $
|
2009-09-17 13:55:38 +02:00
|
|
|
|
|
2012-02-22 17:06:05 +01:00
|
|
|
|
WINDOW_MOVE_AND_RESIZE_FLAGS = \
|
|
|
|
|
mouse.WINDOW_RESIZE_N_FLAG + \
|
|
|
|
|
mouse.WINDOW_RESIZE_W_FLAG + \
|
|
|
|
|
mouse.WINDOW_RESIZE_S_FLAG + \
|
|
|
|
|
mouse.WINDOW_RESIZE_E_FLAG + \
|
|
|
|
|
mouse.WINDOW_MOVE_FLAG
|
|
|
|
|
|
2009-10-07 11:59:35 +02:00
|
|
|
|
uglobal
|
2009-09-17 13:55:38 +02:00
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
event_start dd ?
|
|
|
|
|
event_end dd ?
|
|
|
|
|
event_uid dd 0
|
|
|
|
|
endg
|
|
|
|
|
EV_SPACE = 512
|
|
|
|
|
FreeEvents = event_start-EVENT.fd ; "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" event, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
2012-04-02 17:18:46 +02:00
|
|
|
|
; FreeEvents.fd=event_start <EFBFBD> FreeEvents.bk=event_end
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
init_events: ;; used from kernel.asm
|
|
|
|
|
stdcall kernel_alloc, EV_SPACE*sizeof.EVENT
|
|
|
|
|
or eax, eax
|
|
|
|
|
jz .fail
|
|
|
|
|
; eax - current event, ebx - previos event below
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov ecx, EV_SPACE ; current - in allocated space
|
|
|
|
|
mov ebx, FreeEvents ; previos - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2009-10-07 11:59:35 +02:00
|
|
|
|
push ebx ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
@@:
|
|
|
|
|
mov [ebx+EVENT.fd], eax
|
|
|
|
|
mov [eax+EVENT.bk], ebx
|
|
|
|
|
mov ebx, eax ; previos <- current
|
|
|
|
|
add eax, sizeof.EVENT ; new current
|
|
|
|
|
loop @b
|
|
|
|
|
pop eax ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov [ebx+EVENT.fd], eax
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov [eax+EVENT.bk], ebx
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2012-02-22 17:06:05 +01:00
|
|
|
|
.fail:
|
|
|
|
|
ret
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-10-07 11:59:35 +02:00
|
|
|
|
EVENT_WATCHED equ 0x10000000 ;<EFBFBD><EFBFBD><EFBFBD> 28
|
|
|
|
|
EVENT_SIGNALED equ 0x20000000 ;<EFBFBD><EFBFBD><EFBFBD> 29
|
|
|
|
|
MANUAL_RESET equ 0x40000000 ;<EFBFBD><EFBFBD><EFBFBD> 30
|
|
|
|
|
MANUAL_DESTROY equ 0x80000000 ;<EFBFBD><EFBFBD><EFBFBD> 31
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-09-17 13:55:38 +02:00
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
create_event: ;; EXPORT use
|
|
|
|
|
;info:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FreeEvents <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ObjList <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; EVENT.state <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> ecx, EVENT.code <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> esi (<EFBFBD><EFBFBD><EFBFBD><EFBFBD> esi<>0)
|
|
|
|
|
;param:
|
|
|
|
|
; esi - event data
|
|
|
|
|
; ecx - flags
|
|
|
|
|
;retval:
|
|
|
|
|
; eax - event (=0 => fail)
|
|
|
|
|
; edx - uid
|
|
|
|
|
;scratched: ebx,ecx,esi,edi
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov ebx, [current_slot]
|
|
|
|
|
add ebx, APP_OBJ_OFFSET
|
|
|
|
|
mov edx, [TASK_BASE]
|
|
|
|
|
mov edx, [edx+TASKDATA.pid]
|
2009-10-07 11:59:35 +02:00
|
|
|
|
pushfd
|
|
|
|
|
cli
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
set_event: ;; INTERNAL use !!! don't use for Call
|
|
|
|
|
;info:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> event <EFBFBD><EFBFBD> FreeEvents, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> ecx,edx,esi
|
|
|
|
|
; <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> ebx.
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> event (<EFBFBD> eax), <EFBFBD> <EFBFBD><EFBFBD><EFBFBD> uid (<EFBFBD> edx)
|
|
|
|
|
;param:
|
|
|
|
|
; ebx - start-chain "virtual" event for entry new event Right of him
|
|
|
|
|
; ecx - flags (copied to EVENT.state)
|
|
|
|
|
; edx - pid (copied to EVENT.pid)
|
|
|
|
|
; esi - event data (copied to EVENT.code indirect, =0 => skip)
|
|
|
|
|
;retval:
|
|
|
|
|
; eax - event (=0 => fail)
|
|
|
|
|
; edx - uid
|
|
|
|
|
;scratched: ebx,ecx,esi,edi
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov eax, FreeEvents
|
|
|
|
|
cmp eax, [eax+EVENT.fd]
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jne @f ; not empty ???
|
|
|
|
|
pushad
|
|
|
|
|
call init_events
|
|
|
|
|
popad
|
|
|
|
|
jz RemoveEventTo.break ; POPF+RET
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
@@:
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov eax, [eax+EVENT.fd]
|
|
|
|
|
mov [eax+EVENT.magic], 'EVNT'
|
|
|
|
|
mov [eax+EVENT.destroy], destroy_event.internal
|
|
|
|
|
mov [eax+EVENT.state], ecx
|
|
|
|
|
mov [eax+EVENT.pid], edx
|
2009-10-07 11:59:35 +02:00
|
|
|
|
inc [event_uid]
|
|
|
|
|
Mov [eax+EVENT.id],edx,[event_uid]
|
2012-04-02 17:18:46 +02:00
|
|
|
|
or esi, esi
|
|
|
|
|
jz RemoveEventTo
|
|
|
|
|
lea edi, [eax+EVENT.code]
|
|
|
|
|
mov ecx, (sizeof.EVENT -EVENT.code)/4
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
RemoveEventTo: ;; INTERNAL use !!! don't use for Call
|
|
|
|
|
;param:
|
|
|
|
|
; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> event, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; ebx - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> event, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;scratched: ebx,ecx
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov ecx, eax ; ecx=eax=Self, ebx=NewLeft
|
|
|
|
|
xchg ecx, [ebx+EVENT.fd] ; NewLeft.fd=Self, ecx=NewRight
|
|
|
|
|
cmp eax, ecx ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...
|
2009-10-07 11:59:35 +02:00
|
|
|
|
je .break ; - <EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD>?
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov [ecx+EVENT.bk], eax ; NewRight.bk=Self
|
|
|
|
|
xchg ebx, [eax+EVENT.bk] ; Self.bk=NewLeft, ebx=OldLeft
|
|
|
|
|
xchg ecx, [eax+EVENT.fd] ; Self.fd=NewRight, ecx=OldRight
|
|
|
|
|
mov [ebx+EVENT.fd], ecx ; OldLeft.fd=OldRight
|
|
|
|
|
mov [ecx+EVENT.bk], ebx ; OldRight.bk=OldLeft
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2012-02-22 17:06:05 +01:00
|
|
|
|
.break:
|
|
|
|
|
popfd
|
2009-10-07 11:59:35 +02:00
|
|
|
|
ret
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-10-07 11:59:35 +02:00
|
|
|
|
align 4
|
|
|
|
|
NotDummyTest: ;; INTERNAL use (not returned for fail !!!)
|
|
|
|
|
pop edi
|
|
|
|
|
call DummyTest ; not returned for fail !!!
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov ebx, eax
|
|
|
|
|
mov eax, [ebx+EVENT.pid]
|
2009-10-07 11:59:35 +02:00
|
|
|
|
push edi
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
.small: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD>...
|
|
|
|
|
pop edi
|
|
|
|
|
pushfd
|
|
|
|
|
cli
|
|
|
|
|
call pid_to_slot ; saved all registers (eax - retval)
|
2012-02-22 17:06:05 +01:00
|
|
|
|
shl eax, 8
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jz RemoveEventTo.break ; POPF+RET
|
|
|
|
|
jmp edi ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-10-07 11:59:35 +02:00
|
|
|
|
align 4
|
|
|
|
|
raise_event: ;; EXPORT use
|
|
|
|
|
;info:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT.code
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT_SIGNALED <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT_WATCHED <EFBFBD> edx
|
|
|
|
|
; <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT_SIGNALED <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT_WATCHED <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;param:
|
|
|
|
|
; eax - event
|
|
|
|
|
; ebx - uid (for Dummy testing)
|
|
|
|
|
; edx - flags
|
|
|
|
|
; esi - event data (=0 => skip)
|
|
|
|
|
;scratched: ebx,ecx,esi,edi
|
|
|
|
|
call NotDummyTest ; not returned for fail !!!
|
2012-04-02 17:18:46 +02:00
|
|
|
|
or esi, esi
|
|
|
|
|
jz @f
|
|
|
|
|
lea edi, [ebx+EVENT.code]
|
|
|
|
|
mov ecx, (sizeof.EVENT -EVENT.code)/4
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
@@:
|
2009-10-07 11:59:35 +02:00
|
|
|
|
test byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24
|
|
|
|
|
jnz RemoveEventTo.break ; POPF+RET
|
|
|
|
|
bt edx, 28 ;EVENT_WATCHED
|
|
|
|
|
jnc @f
|
2012-02-22 17:06:05 +01:00
|
|
|
|
test byte[ebx+EVENT.state+3], EVENT_WATCHED shr 24
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jz RemoveEventTo.break ; POPF+RET
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
@@:
|
2009-10-07 11:59:35 +02:00
|
|
|
|
or byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24
|
2012-02-22 17:06:05 +01:00
|
|
|
|
add eax, SLOT_BASE+APP_EV_OFFSET
|
|
|
|
|
xchg eax, ebx
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jmp RemoveEventTo
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-10-07 11:59:35 +02:00
|
|
|
|
align 4
|
|
|
|
|
clear_event: ;; EXPORT use
|
|
|
|
|
;info:
|
2009-09-17 13:55:38 +02:00
|
|
|
|
;
|
2009-10-07 11:59:35 +02:00
|
|
|
|
;param:
|
|
|
|
|
; eax - event
|
|
|
|
|
; ebx - uid (for Dummy testing)
|
|
|
|
|
;scratched: ebx,ecx
|
|
|
|
|
call NotDummyTest ; not returned for fail !!!
|
2012-02-22 17:06:05 +01:00
|
|
|
|
add eax, SLOT_BASE+APP_OBJ_OFFSET
|
2009-10-07 11:59:35 +02:00
|
|
|
|
and byte[ebx+EVENT.state+3], not((EVENT_SIGNALED+EVENT_WATCHED)shr 24)
|
2012-02-22 17:06:05 +01:00
|
|
|
|
xchg eax, ebx
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jmp RemoveEventTo
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-10-07 11:59:35 +02:00
|
|
|
|
align 4
|
|
|
|
|
send_event: ;; EXPORT use
|
|
|
|
|
;info:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FreeEvents) <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EventList
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (eax=pid), <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> esi <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD> state=EVENT_SIGNALED
|
|
|
|
|
;param:
|
|
|
|
|
; eax - slots pid, to sending new event
|
|
|
|
|
; esi - pointer to sending data (in code field of new event)
|
|
|
|
|
;retval:
|
|
|
|
|
; eax - event (=0 => fail)
|
|
|
|
|
; edx - uid
|
|
|
|
|
;warning:
|
|
|
|
|
; may be used as CDECL with such prefix...
|
|
|
|
|
; mov esi,[esp+8]
|
|
|
|
|
; mov eax,[esp+4]
|
|
|
|
|
; but not as STDCALL :(
|
|
|
|
|
;scratched: ebx,ecx,esi,edi
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov edx, eax
|
2009-10-07 11:59:35 +02:00
|
|
|
|
call NotDummyTest.small ; not returned for fail !!!
|
2012-02-22 17:06:05 +01:00
|
|
|
|
lea ebx, [eax+SLOT_BASE+APP_EV_OFFSET]
|
|
|
|
|
mov ecx, EVENT_SIGNALED
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jmp set_event
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-10-07 11:59:35 +02:00
|
|
|
|
align 4
|
|
|
|
|
DummyTest: ;; INTERNAL use (not returned for fail !!!)
|
|
|
|
|
;param:
|
|
|
|
|
; eax - event
|
|
|
|
|
; ebx - uid (for Dummy testing)
|
2012-02-22 17:06:05 +01:00
|
|
|
|
cmp [eax+EVENT.magic], 'EVNT'
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jne @f
|
2012-02-22 17:06:05 +01:00
|
|
|
|
cmp [eax+EVENT.id], ebx
|
2009-10-07 11:59:35 +02:00
|
|
|
|
je .ret
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
@@:
|
2012-02-22 17:06:05 +01:00
|
|
|
|
pop eax
|
|
|
|
|
xor eax, eax
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2012-02-22 17:06:05 +01:00
|
|
|
|
.ret:
|
|
|
|
|
ret
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-10-07 11:59:35 +02:00
|
|
|
|
align 4
|
|
|
|
|
Wait_events:
|
2012-02-22 17:06:05 +01:00
|
|
|
|
or ebx, -1; infinite timeout
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
Wait_events_ex:
|
|
|
|
|
;info:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> 5-<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> APPDATA.wait_test,
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> shed-<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD>" <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|
|
|
|
;param:
|
|
|
|
|
; edx - wait_test, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>-<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
; ecx - wait_param, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> [wait_test]
|
|
|
|
|
; ebx - wait_timeout
|
|
|
|
|
;retval:
|
|
|
|
|
; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [wait_test] (=0 => timeout)
|
|
|
|
|
;scratched: esi
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov esi, [current_slot]
|
|
|
|
|
mov [esi+APPDATA.wait_param], ecx
|
2009-10-07 11:59:35 +02:00
|
|
|
|
pushad
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov ebx, esi;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>..........
|
2009-10-07 11:59:35 +02:00
|
|
|
|
pushfd ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>-<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cli ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> shed
|
|
|
|
|
call edx
|
|
|
|
|
popfd
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov [esp+28], eax
|
2009-10-07 11:59:35 +02:00
|
|
|
|
popad
|
2012-02-22 17:06:05 +01:00
|
|
|
|
or eax, eax
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jnz @f ;RET
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov [esi+APPDATA.wait_test], edx
|
|
|
|
|
mov [esi+APPDATA.wait_timeout], ebx
|
2009-10-07 11:59:35 +02:00
|
|
|
|
Mov [esi+APPDATA.wait_begin],eax,[timer_ticks]
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov eax, [TASK_BASE]
|
2009-10-07 11:59:35 +02:00
|
|
|
|
mov [eax+TASKDATA.state], 5
|
|
|
|
|
call change_task
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov eax, [esi+APPDATA.wait_param]
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
@@:
|
2012-02-22 17:06:05 +01:00
|
|
|
|
ret
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-10-07 11:59:35 +02:00
|
|
|
|
align 4
|
|
|
|
|
wait_event: ;; EXPORT use
|
|
|
|
|
;info:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT_SIGNALED <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Event
|
|
|
|
|
; (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> raise_event)
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MANUAL_RESET - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT_SIGNALED <EFBFBD> EVENT_WATCHED <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
|
|
|
|
; <EFBFBD>, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MANUAL_DESTROY - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ObjList <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
|
|
|
|
; <EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (destroy_event.internal)
|
|
|
|
|
;param:
|
|
|
|
|
; eax - event
|
|
|
|
|
; ebx - uid (for Dummy testing)
|
|
|
|
|
;scratched: ecx,edx,esi
|
|
|
|
|
call DummyTest
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov ecx, eax ; wait_param
|
2009-10-07 11:59:35 +02:00
|
|
|
|
mov edx, get_event_alone ; wait_test
|
|
|
|
|
call Wait_events ; timeout ignored
|
2013-03-23 12:56:23 +01:00
|
|
|
|
jmp wait_finish
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
wait_event_timeout:
|
|
|
|
|
;param:
|
|
|
|
|
; eax - event
|
|
|
|
|
; ebx - uid (for Dummy testing)
|
|
|
|
|
; ecx - timeout in timer ticks
|
|
|
|
|
;retval:
|
|
|
|
|
; eax - EVENT handle or 0 if timeout
|
|
|
|
|
call DummyTest
|
|
|
|
|
mov ebx, ecx
|
|
|
|
|
mov ecx, eax ; wait_param
|
|
|
|
|
mov edx, get_event_alone ; wait_test
|
|
|
|
|
call Wait_events_ex
|
|
|
|
|
test eax, eax
|
|
|
|
|
jnz wait_finish
|
|
|
|
|
ret
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
get_event_ex: ;; f68:14
|
|
|
|
|
;info:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EventList <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2009-10-07 11:59:35 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> code - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> edi)
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MANUAL_RESET - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT_SIGNALED <EFBFBD> EVENT_WATCHED <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
|
|
|
|
; <EFBFBD>, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MANUAL_DESTROY - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ObjList <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
|
|
|
|
; <EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (destroy_event.internal)
|
|
|
|
|
;param:
|
|
|
|
|
; edi - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> EVENT.code
|
|
|
|
|
;retval:
|
|
|
|
|
; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
;scratched: ebx,ecx,edx,esi,edi
|
2012-04-02 17:18:46 +02:00
|
|
|
|
mov edx, get_event_queue ; wait_test
|
|
|
|
|
call Wait_events ; timeout ignored
|
|
|
|
|
lea esi, [eax+EVENT.code]
|
|
|
|
|
mov ecx, (sizeof.EVENT-EVENT.code)/4
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
|
|
|
|
mov byte[edi-(sizeof.EVENT-EVENT.code)+2], cl;clear priority field
|
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
wait_finish:
|
|
|
|
|
test byte[eax+EVENT.state+3], MANUAL_RESET shr 24
|
|
|
|
|
jnz get_event_queue.ret ; RET
|
2009-10-07 11:59:35 +02:00
|
|
|
|
and byte[eax+EVENT.state+3], not((EVENT_SIGNALED+EVENT_WATCHED)shr 24)
|
|
|
|
|
test byte[eax+EVENT.state+3], MANUAL_DESTROY shr 24
|
|
|
|
|
jz destroy_event.internal
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov ebx, [current_slot]
|
|
|
|
|
add ebx, APP_OBJ_OFFSET
|
2009-10-07 11:59:35 +02:00
|
|
|
|
pushfd
|
|
|
|
|
cli
|
|
|
|
|
jmp RemoveEventTo
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-10-07 11:59:35 +02:00
|
|
|
|
align 4
|
|
|
|
|
destroy_event: ;; EXPORT use
|
|
|
|
|
;info:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FreeEvents, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> magic,destroy,pid,id
|
|
|
|
|
;param:
|
|
|
|
|
; eax - event
|
|
|
|
|
; ebx - uid (for Dummy testing)
|
|
|
|
|
;retval:
|
|
|
|
|
; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT (=0 => fail)
|
|
|
|
|
;scratched: ebx,ecx
|
|
|
|
|
call DummyTest ; not returned for fail !!!
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2009-09-17 13:55:38 +02:00
|
|
|
|
.internal:
|
2012-02-22 17:06:05 +01:00
|
|
|
|
xor ecx, ecx ; clear common header
|
2009-10-07 11:59:35 +02:00
|
|
|
|
pushfd
|
|
|
|
|
cli
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov [eax+EVENT.magic], ecx
|
|
|
|
|
mov [eax+EVENT.destroy], ecx
|
|
|
|
|
mov [eax+EVENT.pid], ecx
|
|
|
|
|
mov [eax+EVENT.id], ecx
|
|
|
|
|
mov ebx, FreeEvents
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jmp RemoveEventTo
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-09-17 13:55:38 +02:00
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
get_event_queue:
|
|
|
|
|
;info:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>-<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> get_event_ex
|
|
|
|
|
;warning:
|
|
|
|
|
; -don't use [TASK_BASE],[current_slot],[CURRENT_TASK] - it is not for your slot
|
|
|
|
|
; -may be assumed, that interrupt are disabled
|
|
|
|
|
; -it is not restriction for scratched registers
|
|
|
|
|
;param:
|
|
|
|
|
; ebx - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> APPDATA <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;retval:
|
|
|
|
|
; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT (=0 => fail)
|
2012-02-22 17:06:05 +01:00
|
|
|
|
add ebx, APP_EV_OFFSET
|
|
|
|
|
mov eax, [ebx+APPOBJ.bk] ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FIFO
|
|
|
|
|
cmp eax, ebx ; empty ???
|
2009-10-07 11:59:35 +02:00
|
|
|
|
je get_event_alone.ret0
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2012-02-22 17:06:05 +01:00
|
|
|
|
.ret:
|
|
|
|
|
ret
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-09-17 13:55:38 +02:00
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
get_event_alone:
|
|
|
|
|
;info:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>-<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> wait_event
|
|
|
|
|
;warning:
|
|
|
|
|
; -don't use [TASK_BASE],[current_slot],[CURRENT_TASK] - it is not for your slot
|
|
|
|
|
; -may be assumed, that interrupt are disabled
|
|
|
|
|
; -it is not restriction for scratched registers
|
|
|
|
|
;param:
|
|
|
|
|
; ebx - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> APPDATA <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;retval:
|
|
|
|
|
; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT (=0 => fail)
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov eax, [ebx+APPDATA.wait_param]
|
2009-10-07 11:59:35 +02:00
|
|
|
|
test byte[eax+EVENT.state+3], EVENT_SIGNALED shr 24
|
|
|
|
|
jnz .ret
|
|
|
|
|
or byte[eax+EVENT.state+3], EVENT_WATCHED shr 24
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2012-02-22 17:06:05 +01:00
|
|
|
|
.ret0:
|
|
|
|
|
xor eax, eax; NO event!!!
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2012-02-22 17:06:05 +01:00
|
|
|
|
.ret:
|
|
|
|
|
ret
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-09-17 13:55:38 +02:00
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
sys_sendwindowmsg: ;; f72
|
|
|
|
|
dec ebx
|
|
|
|
|
jnz .ret ;subfunction==1 ?
|
2012-04-02 17:18:46 +02:00
|
|
|
|
pushfd
|
2009-10-07 11:59:35 +02:00
|
|
|
|
cli
|
2012-02-22 17:06:05 +01:00
|
|
|
|
sub ecx, 2
|
2009-10-07 11:59:35 +02:00
|
|
|
|
je .sendkey
|
2012-02-22 17:06:05 +01:00
|
|
|
|
dec ecx
|
|
|
|
|
jnz .retf
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
.sendbtn:
|
2012-02-22 17:06:05 +01:00
|
|
|
|
cmp byte[BTN_COUNT], 1
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jae .result ;overflow
|
|
|
|
|
inc byte[BTN_COUNT]
|
2012-02-22 17:06:05 +01:00
|
|
|
|
shl edx, 8
|
|
|
|
|
mov [BTN_BUFF], edx
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jmp .result
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
.sendkey:
|
2012-02-22 17:06:05 +01:00
|
|
|
|
movzx eax, byte[KEY_COUNT]
|
|
|
|
|
cmp al, 120
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jae .result ;overflow
|
|
|
|
|
inc byte[KEY_COUNT]
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov [KEY_COUNT+1+eax], dl
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
.result:
|
|
|
|
|
setae byte[esp+32] ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: dword[esp+32]==72
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
.retf:
|
|
|
|
|
popfd
|
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2012-02-22 17:06:05 +01:00
|
|
|
|
.ret:
|
|
|
|
|
ret
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-09-17 13:55:38 +02:00
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
sys_getevent: ;; f11
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov ebx, [current_slot];<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>..........
|
2009-10-07 11:59:35 +02:00
|
|
|
|
pushfd ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>-<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cli ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> shed
|
2009-09-17 13:55:38 +02:00
|
|
|
|
call get_event_for_app
|
2009-10-07 11:59:35 +02:00
|
|
|
|
popfd
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov [esp+32], eax
|
2009-10-07 11:59:35 +02:00
|
|
|
|
ret
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-10-07 11:59:35 +02:00
|
|
|
|
align 4
|
|
|
|
|
sys_waitforevent: ;; f10
|
2012-02-22 17:06:05 +01:00
|
|
|
|
or ebx, -1; infinite timeout
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
sys_wait_event_timeout: ;; f23
|
2013-03-10 13:28:37 +01:00
|
|
|
|
call unprotect_from_terminate
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov edx, get_event_for_app; wait_test
|
2009-10-07 11:59:35 +02:00
|
|
|
|
call Wait_events_ex ; ebx - timeout
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov [esp+32], eax
|
2013-03-10 13:28:37 +01:00
|
|
|
|
call protect_from_terminate
|
2009-09-17 13:55:38 +02:00
|
|
|
|
ret
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2009-10-07 11:59:35 +02:00
|
|
|
|
align 4
|
|
|
|
|
get_event_for_app: ;; used from f10,f11,f23
|
|
|
|
|
;info:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>-<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (f10,f23)
|
|
|
|
|
;warning:
|
|
|
|
|
; -don't use [TASK_BASE],[current_slot],[CURRENT_TASK] - it is not for your slot
|
|
|
|
|
; -may be assumed, that interrupt are disabled
|
|
|
|
|
; -it is not restriction for scratched registers
|
|
|
|
|
;param:
|
|
|
|
|
; ebx - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> APPDATA <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;retval:
|
|
|
|
|
; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (=0 => no events)
|
2012-02-22 17:06:05 +01:00
|
|
|
|
movzx edi, bh ; bh is assumed as [CURRENT_TASK]
|
|
|
|
|
shl edi, 5
|
|
|
|
|
add edi, CURRENT_TASK ; edi is assumed as [TASK_BASE]
|
|
|
|
|
mov ecx, [edi+TASKDATA.event_mask]
|
2012-04-02 17:18:46 +02:00
|
|
|
|
and ecx, 0x7FFFFFFF
|
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
.loop: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-02-22 17:06:05 +01:00
|
|
|
|
bsr eax, ecx ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (31 -> 0)
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jz .no_events ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ???
|
2012-02-22 17:06:05 +01:00
|
|
|
|
btr ecx, eax ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2009-10-07 11:59:35 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (eax) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-02-22 17:06:05 +01:00
|
|
|
|
cmp eax, 9
|
2012-04-02 17:18:46 +02:00
|
|
|
|
jae .loop ; eax=[9..31], ignored (event 10...32)
|
|
|
|
|
|
2012-02-22 17:06:05 +01:00
|
|
|
|
cmp eax, 3
|
2012-04-02 17:18:46 +02:00
|
|
|
|
je .loop ; eax=3, ignored (event 4)
|
|
|
|
|
|
|
|
|
|
cmp eax, 4
|
|
|
|
|
je .FlagAutoReset ; eax=4, retvals=eax+1 (event 5)
|
|
|
|
|
|
|
|
|
|
cmp eax, 5
|
|
|
|
|
je .mouse_check ; eax=5, retvals=eax+1 (event 6)
|
|
|
|
|
|
|
|
|
|
ja .FlagAutoReset ; eax=[6..8], retvals=eax+1 (event 7...9)
|
|
|
|
|
|
2012-02-22 17:06:05 +01:00
|
|
|
|
cmp eax, 1
|
2012-04-02 17:18:46 +02:00
|
|
|
|
jae .BtKy ; eax=[1,2], retvals=eax+1 (event 2,3)
|
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
.WndRedraw: ; eax=0, retval WndRedraw=1
|
2012-02-22 17:06:05 +01:00
|
|
|
|
cmp [edi-twdw+WDATA.fl_redraw], al;al==0
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jne .result
|
|
|
|
|
jmp .loop
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
.no_events:
|
2012-02-22 17:06:05 +01:00
|
|
|
|
xor eax, eax
|
2009-09-17 13:55:38 +02:00
|
|
|
|
ret
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
.mouse_check: ; Mouse 5+1=6
|
2012-02-22 17:06:05 +01:00
|
|
|
|
push eax
|
2012-04-02 17:18:46 +02:00
|
|
|
|
mov eax, [TASK_BASE]
|
|
|
|
|
mov eax, [eax + TASKDATA.event_mask]
|
|
|
|
|
test eax, 0x80000000 ; bit 31: active/inactive filter f.40
|
|
|
|
|
jz @f
|
|
|
|
|
pop eax
|
|
|
|
|
jmp .FlagAutoReset
|
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
@@:
|
2012-02-22 17:06:05 +01:00
|
|
|
|
; If the window is captured and moved by the user, then no mouse events!!!
|
|
|
|
|
mov al, [mouse.active_sys_window.action]
|
|
|
|
|
and al, WINDOW_MOVE_AND_RESIZE_FLAGS
|
|
|
|
|
test al, al
|
|
|
|
|
pop eax
|
|
|
|
|
jnz .loop
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
.FlagAutoReset: ; retvals: BgrRedraw=5, IPC=7, Stack=8, Debug=9
|
2012-02-22 17:06:05 +01:00
|
|
|
|
btr [ebx+APPDATA.event_mask], eax
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jnc .loop
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
.result: ; retval = eax+1
|
2009-10-07 11:59:35 +02:00
|
|
|
|
inc eax
|
2009-09-17 13:55:38 +02:00
|
|
|
|
ret
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
.BtKy:
|
2012-02-22 17:06:05 +01:00
|
|
|
|
movzx edx, bh
|
2009-10-07 11:59:35 +02:00
|
|
|
|
movzx edx, word[WIN_STACK+edx*2]
|
|
|
|
|
je .Keys ; eax=1, retval Keys=2
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
.Buttons: ; eax=2, retval Buttons=3
|
2012-02-22 17:06:05 +01:00
|
|
|
|
cmp byte[BTN_COUNT], 0
|
2009-10-07 11:59:35 +02:00
|
|
|
|
je .loop ; empty ???
|
2012-02-22 17:06:05 +01:00
|
|
|
|
cmp edx, [TASK_COUNT]
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jne .loop ; not Top ???
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov edx, [BTN_BUFF]
|
|
|
|
|
shr edx, 8
|
|
|
|
|
cmp edx, 0xFFFF ;-ID for Minimize-Button of Form
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jne .result
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov [window_minimize], 1
|
2009-10-07 11:59:35 +02:00
|
|
|
|
dec byte[BTN_COUNT]
|
|
|
|
|
jmp .loop
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
2009-10-07 11:59:35 +02:00
|
|
|
|
.Keys: ; eax==1
|
2012-02-22 17:06:05 +01:00
|
|
|
|
cmp edx, [TASK_COUNT]
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jne @f ; not Top ???
|
2012-02-22 17:06:05 +01:00
|
|
|
|
cmp [KEY_COUNT], al; al==1
|
2009-10-07 11:59:35 +02:00
|
|
|
|
jae .result ; not empty ???
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
@@:
|
2012-02-22 17:06:05 +01:00
|
|
|
|
mov edx, hotkey_buffer
|
2012-04-02 17:18:46 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
@@:
|
2012-02-22 17:06:05 +01:00
|
|
|
|
cmp [edx], bh ; bh - slot for testing
|
2009-10-07 11:59:35 +02:00
|
|
|
|
je .result
|
2012-02-22 17:06:05 +01:00
|
|
|
|
add edx, 8
|
2009-10-07 11:59:35 +02:00
|
|
|
|
cmp edx, hotkey_buffer+120*8
|
2013-03-23 12:56:23 +01:00
|
|
|
|
jb @b
|
|
|
|
|
jmp .loop
|
|
|
|
|
;end.
|
|
|
|
|
;-----------------------------------------------------------------------------
|