From a881989d7ceeadf9468410aaab0cd5ddef482822 Mon Sep 17 00:00:00 2001 From: "Evgeny Grechnikov (Diamond)" Date: Mon, 25 Aug 2008 16:37:47 +0000 Subject: [PATCH] bugfix in sysfn 67: avoid system crash for invalid parameter git-svn-id: svn://kolibrios.org@856 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/gui/window.inc | 8 ++++---- kernel/trunk/kernel.asm | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/kernel/trunk/gui/window.inc b/kernel/trunk/gui/window.inc index aa970f3ce1..34489c3194 100644 --- a/kernel/trunk/gui/window.inc +++ b/kernel/trunk/gui/window.inc @@ -562,10 +562,10 @@ check_window_position: pushad ; window inside screen ? - movsx eax,word [edi+WDATA.box.left] - movsx ebx,word [edi+WDATA.box.top] - movsx ecx,word [edi+WDATA.box.width] - movsx edx,word [edi+WDATA.box.height] + mov eax, [edi+WDATA.box.left] + mov ebx, [edi+WDATA.box.top] + mov ecx, [edi+WDATA.box.width] + mov edx, [edi+WDATA.box.height] cmp ecx,[Screen_Max_X] ; check x size jbe x_size_ok diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index df5f90c264..a88372ec1f 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -3018,12 +3018,14 @@ sys_set_window: add eax,100 mov [new_window_starting],eax - mov word[edi+WDATA.box.width],bx - mov word[edi+WDATA.box.height],cx + movsx eax,bx + mov [edi+WDATA.box.width],eax + movsx eax,cx + mov [edi+WDATA.box.height],eax sar ebx,16 sar ecx,16 - mov word[edi+WDATA.box.left],bx - mov word[edi+WDATA.box.top],cx + mov [edi+WDATA.box.left],ebx + mov [edi+WDATA.box.top],ecx call check_window_position