diff --git a/kernel/trunk/const.inc b/kernel/trunk/const.inc index e3b60e4a63..b21151c39f 100644 --- a/kernel/trunk/const.inc +++ b/kernel/trunk/const.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2017. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -505,7 +505,7 @@ struct APPDATA wait_param dd ? ;+100 +++ tls_base dd ? ;+104 dd ? ;+108 - event_filter dd ? ;+112 + dd ? ;+112 draw_bgr_x dd ? ;+116 draw_bgr_y dd ? ;+120 dd ? ;+124 @@ -516,7 +516,7 @@ struct APPDATA saved_box BOX ;+144 ipc_start dd ? ;+160 ipc_size dd ? ;+164 - event_mask dd ? ;+168 + event_mask dd ? ;+168 ; mask which accumulates occurred events debugger_slot dd ? ;+172 terminate_protection dd ? ;+176 keyboard_mode db ? ;+180 @@ -538,7 +538,7 @@ APP_OBJ_OFFSET = 48 APP_EV_OFFSET = 40 struct TASKDATA - event_mask dd ? + event_mask dd ? ; mask which stores event types allowed for task pid dd ? dw ? state db ? @@ -590,6 +590,7 @@ ends label WDATA.fl_wstyle byte at WDATA.cl_workarea + 3 +assert sizeof.WDATA = 32 struct SYS_VARS bpp dd ? diff --git a/kernel/trunk/core/sys32.inc b/kernel/trunk/core/sys32.inc index fc59323c34..6622926f2d 100644 --- a/kernel/trunk/core/sys32.inc +++ b/kernel/trunk/core/sys32.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2020. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License. ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -554,7 +554,7 @@ destroy_thread: pusha ; save window coordinates for window restoring cld - shl esi, 5 + shl esi, BSF sizeof.WDATA add esi, window_data mov eax, [esi+WDATA.box.left] mov [draw_limits.left], eax @@ -566,16 +566,12 @@ destroy_thread: mov [draw_limits.bottom], eax xor eax, eax - mov [esi+WDATA.box.left], eax - mov [esi+WDATA.box.width], eax - mov [esi+WDATA.box.top], eax - mov [esi+WDATA.box.height], eax - mov [esi+WDATA.cl_workarea], eax - mov [esi+WDATA.cl_titlebar], eax - mov [esi+WDATA.cl_frames], eax - mov dword [esi+WDATA.z_modif], eax; clear all flags: z_modif, wstate, redraw, wdrawn + mov edi, esi + mov ecx, sizeof.WDATA/4 + rep stosd + lea edi, [esi-window_data+draw_data] - mov ecx, 32/4 + mov ecx, sizeof.WDATA/4 rep stosd popa diff --git a/kernel/trunk/core/taskman.inc b/kernel/trunk/core/taskman.inc index b981fcb636..b7e397fb22 100644 --- a/kernel/trunk/core/taskman.inc +++ b/kernel/trunk/core/taskman.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License. ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -484,9 +484,9 @@ pid_to_slot: push ebx push ecx mov ebx, [TASK_COUNT] - shl ebx, 5 ; ebx *= 32 (32 is size of TASKDATA struct) + shl ebx, BSF sizeof.TASKDATA ; multiply by size ; add 2*32 cause: - ; 0x80003000 - 0x80003020 isnt a task actually + ; [TASK_TABLE; TASK_TABLE + 32) isnt a task actually ; skip first process in the task table mov ecx, 2*32 @@ -509,7 +509,7 @@ pid_to_slot: ret .pid_found: - shr ecx, 5 + shr ecx, BSF sizeof.TASKDATA ; divide by size mov eax, ecx ;convert offset to index of slot pop ecx pop ebx diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 04aa13c1d7..628025d361 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; -;; Copyright (C) KolibriOS team 2004-2020. All rights reserved. +;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; PROGRAMMING: ;; Ivan Poddubny ;; Marat Zakiyanov (Mario79) @@ -30,6 +30,12 @@ ;; turbanoff ;; Asper ;; art_zh +;; dunkaist +;; Coldy +;; rgimad +;; Boppan +;; Doczom +;; and others ;; ;; Data in this file was originally part of MenuetOS project which is ;; distributed under the terms of GNU GPL. It is modified and redistributed as @@ -4045,9 +4051,6 @@ align 4 set_app_param: mov edi, [TASK_BASE] mov eax, ebx - btr eax, 3 ; move MOUSE_FILTRATION - mov ebx, [current_slot] ; bit into event_filter - setc byte [ebx+APPDATA.event_filter] xchg eax, [edi + TASKDATA.event_mask] ; set new event mask mov [esp+32], eax ; return old mask value ret