kernel: Fix memory corruption of clipboard data.

There were a few off-by-one errors in window size calculation.
As a result, winmap update code corrupted clipboard structures.

git-svn-id: svn://kolibrios.org@8928 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Ivan Baravy 2021-06-23 10:07:36 +00:00
parent 6f2937256a
commit 807afdadb8
2 changed files with 8 additions and 2 deletions

View File

@ -371,6 +371,7 @@ mouse._.move_handler:
cmp eax, [_display.width] cmp eax, [_display.width]
jl @f jl @f
sub eax, [_display.width] sub eax, [_display.width]
inc eax
sub [mouse.active_sys_window.new_box.left], eax sub [mouse.active_sys_window.new_box.left], eax
@@: @@:
mov eax, [mouse.active_sys_window.new_box.top] mov eax, [mouse.active_sys_window.new_box.top]
@ -383,6 +384,7 @@ mouse._.move_handler:
cmp eax, [_display.height] cmp eax, [_display.height]
jl .call_window_handler jl .call_window_handler
sub eax, [_display.height] sub eax, [_display.height]
inc eax
sub [mouse.active_sys_window.new_box.top], eax sub [mouse.active_sys_window.new_box.top], eax
jmp .call_window_handler jmp .call_window_handler

View File

@ -1686,7 +1686,8 @@ align 4
align 4 align 4
.fix_width_high: .fix_width_high:
mov ecx, esi mov ecx, esi
mov [edi + WDATA.box.width], esi dec ecx
mov [edi + WDATA.box.width], ecx
jmp .check_left jmp .check_left
;-------------------------------------- ;--------------------------------------
align 4 align 4
@ -1699,13 +1700,15 @@ align 4
.fix_left_high: .fix_left_high:
mov eax, esi mov eax, esi
sub eax, ecx sub eax, ecx
dec eax
mov [edi + WDATA.box.left], eax mov [edi + WDATA.box.left], eax
jmp .check_height jmp .check_height
;-------------------------------------- ;--------------------------------------
align 4 align 4
.fix_height_high: .fix_height_high:
mov edx, esi mov edx, esi
mov [edi + WDATA.box.height], esi dec edx
mov [edi + WDATA.box.height], edx
jmp .check_top jmp .check_top
;-------------------------------------- ;--------------------------------------
align 4 align 4
@ -1718,6 +1721,7 @@ align 4
.fix_top_high: .fix_top_high:
mov ebx, esi mov ebx, esi
sub ebx, edx sub ebx, edx
dec ebx
mov [edi + WDATA.box.top], ebx mov [edi + WDATA.box.top], ebx
jmp .exit jmp .exit
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------