add validate cursor in 37.5

fix maximal cursors count in init_cursors

git-svn-id: svn://kolibrios.org@230 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2006-12-05 08:31:44 +00:00
parent 1c9a42e362
commit 01056f99f2
3 changed files with 34 additions and 11 deletions

View File

@ -124,14 +124,6 @@ endp
align 4
proc get_event_ex stdcall, p_ev:dword, timeout:dword
; push eax
; push edx
; mov edx, 0x400 ;bocsh
; mov al,0xff ;bocsh
; out dx, al ;bocsh
; pop edx
; pop eax
.wait:
mov ebx,[CURRENT_TASK]
shl ebx,8
@ -142,11 +134,13 @@ proc get_event_ex stdcall, p_ev:dword, timeout:dword
mov edx, [esi+EVENT.next]
mov [PROC_BASE+ebx+APPDATA.ev_first], edx
test edx, edx
jz @F
mov [edx+EVENT.prev], 0
@@:
jnz @F
mov [PROC_BASE+ebx+APPDATA.ev_last], edx
and dword [PROC_BASE+ebx+APPDATA.event_mask], not EVENT_EXTENDED
@@:
mov [edx+EVENT.prev], 0
dec [PROC_BASE+ebx+APPDATA.ev_count]
mov eax, esi

View File

@ -102,10 +102,24 @@ save_draw_mouse:
mul ecx
movzx edx, byte [display_data+ebx+eax]
shl edx, 8
push [edx+PROC_BASE+APPDATA.cursor]
mov ecx, [edx+PROC_BASE+APPDATA.cursor]
cmp [ecx+CURSOR.magic], 'CURS'
jne .fail
cmp [ecx+CURSOR.size], CURSOR_SIZE
jne .fail
push ecx
call [set_hw_cursor]
popad
ret
.fail:
mov ecx, [def_cursor]
mov [edx+PROC_BASE+APPDATA.cursor], ecx
push ecx
call [set_hw_cursor]
popad
ret
@@:
pushad
; save & draw

View File

@ -192,6 +192,16 @@ endp
align 4
proc set_cursor stdcall, hcursor:dword
mov eax, [hcursor]
cmp [eax+CURSOR.magic], 'CURS'
jne .fail
cmp [eax+CURSOR.size], CURSOR_SIZE
jne .fail
mov ebx, [CURRENT_TASK]
shl ebx, 8
xchg eax, [ebx+PROC_BASE+APPDATA.cursor]
ret
.fail:
mov eax, [def_cursor]
mov ebx, [CURRENT_TASK]
shl ebx, 8
xchg eax, [ebx+PROC_BASE+APPDATA.cursor]
@ -255,6 +265,11 @@ proc load_cursor stdcall, src:dword, flags:dword
test eax, eax
jz .fail
mov ebx, [CURRENT_TASK]
shl ebx, 5
mov ebx, [0x3000+ebx+4]
mov [eax+CURSOR.pid], ebx
stdcall [create_cursor], eax, [src], [flags]
mov [handle], eax
.fail:
@ -292,7 +307,7 @@ proc init_cursors
mov [cursor_map+4], eax
mov edx, cursor_map
mov [cursor_start], edx
add edx, 4
add edx, 8
mov [cursor_end], edx
stdcall load_driver, drv_hw_mouse