From 096a651876acc9d4b19f665723587ee57e1d2a09 Mon Sep 17 00:00:00 2001 From: CleverMouse Date: Thu, 30 Dec 2010 11:31:25 +0000 Subject: [PATCH] Video subsystem: * export GetDisplay and SetScreen for COFF drivers * fix out-of-bound access to screen map in __sys_disable_mouse git-svn-id: svn://kolibrios.org@1730 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/core/exports.inc | 6 ++++++ kernel/trunk/drivers/imports.inc | 4 +++- kernel/trunk/hid/mousedrv.inc | 15 +++++++-------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/kernel/trunk/core/exports.inc b/kernel/trunk/core/exports.inc index b2c6a06de2..ebcd6ca845 100644 --- a/kernel/trunk/core/exports.inc +++ b/kernel/trunk/core/exports.inc @@ -75,6 +75,9 @@ iglobal szSleep db 'Sleep',0 szGetTimerTicks db 'GetTimerTicks',0 + szGetDisplay db 'GetDisplay',0 + szSetScreen db 'SetScreen',0 + szStrncat db 'strncat',0 szStrncpy db 'strncpy',0 szstrncmp db 'strncmp',0 @@ -147,6 +150,9 @@ kernel_export: dd szSleep , delay_ms dd szGetTimerTicks , get_timer_ticks + dd szGetDisplay , get_display + dd szSetScreen , set_screen + dd szStrncat , strncat dd szStrncpy , strncpy dd szstrncmp , strncmp diff --git a/kernel/trunk/drivers/imports.inc b/kernel/trunk/drivers/imports.inc index c1390a0f2f..cb703a0929 100644 --- a/kernel/trunk/drivers/imports.inc +++ b/kernel/trunk/drivers/imports.inc @@ -90,4 +90,6 @@ kernel_export \ strchr,\ strrchr,\ \ - LFBAddress + LFBAddress,\ + GetDisplay,\ + SetScreen diff --git a/kernel/trunk/hid/mousedrv.inc b/kernel/trunk/hid/mousedrv.inc index e6de7c5af6..f13442cfe9 100644 --- a/kernel/trunk/hid/mousedrv.inc +++ b/kernel/trunk/hid/mousedrv.inc @@ -292,21 +292,20 @@ __sys_disable_mouse: add ecx,eax add ecx, [_WinMapAddress] mov eax, [CURRENT_TASK] - movzx ebx, byte [ecx] - cmp eax,ebx + cmp al, [ecx] je yes_mouse_disable - movzx ebx, byte [ecx+16] - cmp eax,ebx + cmp al, [ecx+16] je yes_mouse_disable + add ebx, 10 + cmp ebx, [Screen_Max_Y] + jae no_mouse_disable mov ebx,[Screen_Max_X] inc ebx imul ebx,10 add ecx,ebx - movzx ebx, byte [ecx] - cmp eax,ebx + cmp al, [ecx] je yes_mouse_disable - movzx ebx, byte [ecx+16] - cmp eax,ebx + cmp al, [ecx+16] je yes_mouse_disable jmp no_mouse_disable yes_mouse_disable: