forked from KolibriOS/kolibrios
fix button [width & height & y pos]
"kernel" style code git-svn-id: svn://kolibrios.org@4977 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
0923c62681
commit
dd6485818f
@ -1,117 +1,106 @@
|
|||||||
;
|
;------------------------------------------------------------------------------
|
||||||
; DEBUG BOARD for APPLICATIONS and KERNEL DEVELOPMENT
|
; DEBUG BOARD for APPLICATIONS and KERNEL DEVELOPMENT
|
||||||
;
|
|
||||||
; See f63
|
; See f63
|
||||||
;
|
|
||||||
; Compile with FASM for KolibriOS
|
; Compile with FASM for KolibriOS
|
||||||
;
|
;------------------------------------------------------------------------------
|
||||||
|
include 'lang.inc'
|
||||||
WRITE_LOG equ 1
|
WRITE_LOG equ 1
|
||||||
P_LEN equ 11
|
P_LEN equ 11
|
||||||
include 'lang.inc'
|
;------------------------------------------------------------------------------
|
||||||
|
|
||||||
use32
|
use32
|
||||||
org 0x0
|
org 0x0
|
||||||
db 'MENUET01' ; 8 byte id
|
db 'MENUET01'
|
||||||
dd 0x01 ; header version
|
dd 0x01
|
||||||
dd START ; start of code
|
dd START
|
||||||
dd I_END ; size of image
|
dd I_END
|
||||||
dd mem ; memory for app
|
dd mem
|
||||||
dd mem ; esp
|
dd mem
|
||||||
dd filename , 0x0 ; I_Param , I_Icon
|
dd filename, 0x0
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
include '../../../macros.inc'
|
include '../../../macros.inc'
|
||||||
include '../../../debug.inc'
|
include '../../../debug.inc'
|
||||||
purge newline
|
purge newline
|
||||||
MAXSTRINGS = 16
|
MAXSTRINGS = 16
|
||||||
TMP = 80*(MAXSTRINGS+1)
|
TMP = 80*(MAXSTRINGS+1)
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
START: ; start of execution
|
START:
|
||||||
|
|
||||||
call CheckUnique
|
call CheckUnique
|
||||||
|
mov edi, filename
|
||||||
mov edi,filename
|
cmp [edi], byte 0
|
||||||
cmp [edi],byte 0
|
|
||||||
jnz param
|
jnz param
|
||||||
mov esi,default_filename
|
mov esi, default_filename
|
||||||
@@:
|
@@:
|
||||||
lodsb
|
lodsb
|
||||||
stosb
|
stosb
|
||||||
test al,al
|
test al,al
|
||||||
jnz @b
|
jnz @b
|
||||||
param:
|
param:
|
||||||
|
mov ecx, TMP
|
||||||
; allow user to see messages written before start
|
xor eax, eax
|
||||||
; mov ecx,4096
|
mov edi, [targ]
|
||||||
;flush:
|
|
||||||
; mcall 63,2
|
|
||||||
; loop flush
|
|
||||||
|
|
||||||
mov ecx,TMP
|
|
||||||
xor eax,eax
|
|
||||||
mov edi,[targ]
|
|
||||||
rep stosb
|
rep stosb
|
||||||
|
|
||||||
mov [tmp1],'x'
|
mov [tmp1], 'x'
|
||||||
mov [tmp2],'x'
|
mov [tmp2], 'x'
|
||||||
|
|
||||||
mcall 14
|
mcall 14
|
||||||
and eax,0xffff0000
|
and eax, 0xffff0000
|
||||||
sub eax,399 shl 16
|
sub eax, 399 shl 16
|
||||||
add eax,399
|
add eax, 399
|
||||||
mov [xstart],eax
|
mov [xstart], eax
|
||||||
mcall 48,3,sc,sizeof.system_colors
|
mcall 48, 3, sc, sizeof.sys_colors_new
|
||||||
|
|
||||||
mov esi,filename
|
mov esi, filename
|
||||||
call CreateFile
|
call CreateFile
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
red:
|
red:
|
||||||
call draw_window
|
call draw_window
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
still:
|
still:
|
||||||
cmp [buffer_length],0
|
cmp [buffer_length], 0
|
||||||
je @f
|
je @f
|
||||||
call write_buffer
|
call write_buffer
|
||||||
@@:
|
@@:
|
||||||
mcall 23,50 ; wait here for event
|
mcall 23, 50 ; wait here for event
|
||||||
cmp eax,1 ; redraw request ?
|
cmp eax, 1 ; redraw request ?
|
||||||
je red
|
je red
|
||||||
|
|
||||||
cmp eax,2 ; key in buffer ?
|
cmp eax, 2 ; key in buffer ?
|
||||||
je key
|
je key
|
||||||
|
|
||||||
cmp eax,3 ; button in buffer ?
|
cmp eax, 3 ; button in buffer ?
|
||||||
je button
|
je button
|
||||||
|
|
||||||
mcall 63,2
|
mcall 63, 2
|
||||||
cmp ebx,1
|
cmp ebx, 1
|
||||||
jne still
|
jne still
|
||||||
|
|
||||||
new_data:
|
new_data:
|
||||||
cmp [buffer_length],255
|
cmp [buffer_length], 255
|
||||||
jne @f
|
jne @f
|
||||||
call write_buffer
|
call write_buffer
|
||||||
@@:
|
@@:
|
||||||
movzx ebx,byte[buffer_length]
|
movzx ebx, byte[buffer_length]
|
||||||
mov [ebx+tmp],al
|
mov [ebx+tmp], al
|
||||||
inc [buffer_length]
|
inc [buffer_length]
|
||||||
|
mov ebp, [targ]
|
||||||
mov ebp,[targ]
|
.no4:
|
||||||
.no4:
|
cmp al, 13
|
||||||
cmp al,13
|
|
||||||
jne no13
|
jne no13
|
||||||
and [ebp-8],dword 0
|
and [ebp-8], dword 0
|
||||||
jmp new_check
|
jmp new_check
|
||||||
;------------------------------------------
|
;------------------------------------------
|
||||||
write_buffer:
|
write_buffer:
|
||||||
pusha
|
pusha
|
||||||
mov edx,tmp
|
mov edx, tmp
|
||||||
movzx ecx,byte[buffer_length] ;1
|
movzx ecx, byte[buffer_length] ;1
|
||||||
mov esi,filename
|
mov esi, filename
|
||||||
.write_to_logfile:
|
.write_to_logfile:
|
||||||
call WriteToFile
|
call WriteToFile
|
||||||
cmp eax,5
|
cmp eax, 5
|
||||||
jne @f
|
jne @f
|
||||||
mov esi,filename
|
mov esi, filename
|
||||||
mov [filepos],0
|
mov [filepos], 0
|
||||||
call CreateFile
|
call CreateFile
|
||||||
jnc .write_to_logfile
|
jnc .write_to_logfile
|
||||||
@@:
|
@@:
|
||||||
@ -123,229 +112,220 @@ write_buffer:
|
|||||||
ret
|
ret
|
||||||
;------------------------------------------
|
;------------------------------------------
|
||||||
no13:
|
no13:
|
||||||
cmp al,10
|
cmp al, 10
|
||||||
jne no10
|
jne no10
|
||||||
and [ebp-8],dword 0
|
and [ebp-8], dword 0
|
||||||
inc dword [ebp-4]
|
inc dword [ebp-4]
|
||||||
cmp [ebp-4],dword MAXSTRINGS
|
cmp [ebp-4], dword MAXSTRINGS
|
||||||
jbe .noypos
|
jbe .noypos
|
||||||
mov [ebp-4],dword MAXSTRINGS
|
mov [ebp-4], dword MAXSTRINGS
|
||||||
lea esi,[ebp+80]
|
lea esi, [ebp+80]
|
||||||
mov edi,ebp
|
mov edi, ebp
|
||||||
mov ecx,80*(MAXSTRINGS)
|
mov ecx, 80*(MAXSTRINGS)
|
||||||
cld
|
cld
|
||||||
rep movsb
|
rep movsb
|
||||||
|
|
||||||
mov esi,[ebp-4]
|
mov esi, [ebp-4]
|
||||||
imul esi,80
|
imul esi, 80
|
||||||
add esi,[ebp-8]
|
add esi, [ebp-8]
|
||||||
add esi,ebp
|
add esi, ebp
|
||||||
mov ecx,80
|
mov ecx, 80
|
||||||
xor al,al
|
xor al , al
|
||||||
rep stosb
|
rep stosb
|
||||||
.noypos:
|
.noypos:
|
||||||
mov [targ],text2
|
mov [targ],text2
|
||||||
and [krnl_cnt],0
|
and [krnl_cnt],0
|
||||||
jmp new_check
|
jmp new_check
|
||||||
;------------------------------------------
|
;------------------------------------------
|
||||||
no10:
|
no10:
|
||||||
cmp ebp,text1
|
cmp ebp, text1
|
||||||
je add2
|
je add2
|
||||||
mov ecx,[krnl_cnt]
|
mov ecx, [krnl_cnt]
|
||||||
cmp al,[krnl_msg+ecx]
|
cmp al, [krnl_msg+ecx]
|
||||||
jne .noknl
|
jne .noknl
|
||||||
inc [krnl_cnt]
|
inc [krnl_cnt]
|
||||||
cmp [krnl_cnt],4
|
cmp [krnl_cnt], 4
|
||||||
jne new_check
|
jne new_check
|
||||||
mov [targ],text1
|
mov [targ], text1
|
||||||
.noknl:
|
.noknl:
|
||||||
mov ebp,[targ]
|
mov ebp, [targ]
|
||||||
jecxz .add
|
jecxz .add
|
||||||
push eax
|
push eax
|
||||||
mov esi,krnl_msg
|
mov esi, krnl_msg
|
||||||
.l1:
|
.l1:
|
||||||
lodsb
|
lodsb
|
||||||
call add_char
|
call add_char
|
||||||
loop .l1
|
loop .l1
|
||||||
pop eax
|
pop eax
|
||||||
.add:
|
.add:
|
||||||
and [krnl_cnt],0
|
and [krnl_cnt], 0
|
||||||
add2:
|
add2:
|
||||||
call add_char
|
call add_char
|
||||||
|
|
||||||
new_check:
|
new_check:
|
||||||
mcall 63,2
|
mcall 63, 2
|
||||||
cmp ebx,1
|
cmp ebx, 1
|
||||||
je new_data
|
je new_data
|
||||||
call draw_text
|
call draw_text
|
||||||
jmp still
|
jmp still
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
key:
|
key:
|
||||||
mcall 2
|
mcall 2
|
||||||
cmp ah,' '
|
cmp ah, ' '
|
||||||
je button.noclose
|
je button.noclose
|
||||||
jmp still
|
jmp still
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
button:
|
button:
|
||||||
mcall 17 ; get id
|
mcall 17 ; get id
|
||||||
cmp ah,1 ; button id=1 ?
|
cmp ah, 1 ; button id=1 ?
|
||||||
jne .noclose
|
jne .noclose
|
||||||
or eax,-1 ; close this program
|
or eax, -1 ; close this program
|
||||||
mcall
|
mcall
|
||||||
.noclose:
|
.noclose:
|
||||||
xor [vmode],1
|
xor [vmode], 1
|
||||||
jmp red
|
jmp red
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
add_char:
|
add_char:
|
||||||
push esi
|
push esi
|
||||||
mov esi,[ebp-4]
|
mov esi, [ebp-4]
|
||||||
imul esi,80
|
imul esi, 80
|
||||||
add esi,[ebp-8]
|
add esi, [ebp-8]
|
||||||
mov [ebp+esi],al
|
mov [ebp+esi], al
|
||||||
inc dword[ebp-8]
|
inc dword[ebp-8]
|
||||||
cmp dword[ebp-8],80
|
cmp dword[ebp-8], 80
|
||||||
jb .ok
|
jb .ok
|
||||||
mov dword[ebp-8],79
|
mov dword[ebp-8], 79
|
||||||
.ok:
|
.ok:
|
||||||
pop esi
|
pop esi
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
; *********************************************
|
;************************ WINDOW DEFINITIONS AND DRAW ************************
|
||||||
; ******* WINDOW DEFINITIONS AND DRAW ********
|
;------------------------------------------------------------------------------
|
||||||
; *********************************************
|
|
||||||
draw_window:
|
draw_window:
|
||||||
mcall 12,1 ; 1, start of draw
|
mcall 12, 1 ; 1, start of draw
|
||||||
mcall 48, 5 ; GetClientTop
|
mcall 48, 5 ; GetClientTop
|
||||||
shr ebx, 16
|
shr ebx, 16
|
||||||
mov ecx,ebx
|
mov ecx, ebx
|
||||||
shl ecx,16
|
shl ecx, 16
|
||||||
add ecx,MAXSTRINGS*10+45 ; [y start] *65536 + [y size]
|
add ecx, MAXSTRINGS*10+45 ; [y start] *65536 + [y size]
|
||||||
xor eax,eax ; function 0 : define and draw window
|
xor eax, eax ; function 0 : define and draw window
|
||||||
; mov edx,[sc.work] ; color of work area RRGGBB,8->color gl
|
mov edx, 0xffffff
|
||||||
mov edx,0xffffff
|
or edx, 0x14000000
|
||||||
or edx,0x14000000
|
xor esi, esi
|
||||||
xor esi,esi
|
|
||||||
mcall ,[xstart],,,,title
|
mcall ,[xstart],,,,title
|
||||||
mov ebx,296 shl 16+5*6
|
mov ebx, 296 shl 16+31
|
||||||
mcall 8,,<5,12>,3,[sc.work]
|
mcall 8,,<4,13>,3,[sc.btn_face]
|
||||||
mov edx,[vmode]
|
mov edx, [vmode]
|
||||||
lea edx,[edx*4+duk]
|
lea edx, [edx*4+duk]
|
||||||
mcall 4,<300,8>,,,4
|
mcall 4,<300,7>,,,4
|
||||||
call draw_text
|
call draw_text
|
||||||
mcall 12,2 ; 2, end of draw
|
mcall 12, 2 ; 2, end of draw
|
||||||
ret
|
ret
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
draw_text:
|
draw_text:
|
||||||
mov ebx,15*65536+30 ; draw info text with function 4
|
mov ebx, 15*65536+30 ; draw info text with function 4
|
||||||
; mov ecx,[sc.work_text]
|
xor ecx, ecx
|
||||||
xor ecx,ecx
|
or ecx, 0x40000000
|
||||||
or ecx,0x40000000
|
mov edi, 0xffffff
|
||||||
; mov edi,[sc.work]
|
mov edx, text1
|
||||||
mov edi,0xffffff
|
cmp [vmode], 0
|
||||||
mov edx,text1
|
|
||||||
cmp [vmode],0
|
|
||||||
je .kern
|
je .kern
|
||||||
mov edx,text2
|
mov edx, text2
|
||||||
.kern:
|
.kern:
|
||||||
push ebx ecx edx
|
push ebx ecx edx
|
||||||
mcall 9,procinfo,-1
|
mcall 9, procinfo,-1
|
||||||
mov eax,[ebx+42]
|
mov eax, [ebx+42]
|
||||||
xor edx,edx
|
xor edx, edx
|
||||||
mov ebx,6
|
mov ebx, 6
|
||||||
div ebx
|
div ebx
|
||||||
pop edx ecx ebx
|
pop edx ecx ebx
|
||||||
mov esi,80
|
mov esi, 80
|
||||||
cmp eax,esi
|
cmp eax, esi
|
||||||
ja @f
|
ja @f
|
||||||
mov esi,eax
|
mov esi, eax
|
||||||
@@:
|
@@:
|
||||||
cmp esi,5
|
cmp esi, 5
|
||||||
ja @f
|
ja @f
|
||||||
mov esi,5
|
mov esi, 5
|
||||||
@@:
|
@@:
|
||||||
sub esi,4
|
sub esi, 4
|
||||||
mov eax,4
|
mov eax, 4
|
||||||
newline:
|
newline:
|
||||||
mcall
|
mcall
|
||||||
add ebx,10
|
add ebx, 10
|
||||||
add edx,80
|
add edx, 80
|
||||||
cmp [edx],byte 'x'
|
cmp [edx], byte 'x'
|
||||||
jne newline
|
jne newline
|
||||||
ret
|
ret
|
||||||
;------------------------------------------------------------------------------
|
|
||||||
;********************************************
|
|
||||||
;* input: esi = pointer to the file name *
|
|
||||||
;********************************************
|
|
||||||
|
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
;* input: esi = pointer to the file name *
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
CreateFile:
|
CreateFile:
|
||||||
pusha
|
pusha
|
||||||
mov dword [InfoStructure],2 ; create file
|
mov dword [InfoStructure+00], 2 ; create file
|
||||||
mov dword [InfoStructure+4],0 ; reserved
|
mov dword [InfoStructure+04], 0 ; reserved
|
||||||
mov dword [InfoStructure+8],0 ; reserved
|
mov dword [InfoStructure+08], 0 ; reserved
|
||||||
mov dword [InfoStructure+12],0 ; 0 bytes to write (just create)
|
mov dword [InfoStructure+12], 0 ; 0 bytes to write (just create)
|
||||||
mov dword [InfoStructure+16],0 ; NULL data pointer (no data)
|
mov dword [InfoStructure+16], 0 ; NULL data pointer (no data)
|
||||||
mov dword [InfoStructure+20],0 ; reserved
|
mov dword [InfoStructure+20], 0 ; reserved
|
||||||
mov dword [InfoStructure+21],esi ; pointer to the file name
|
mov dword [InfoStructure+21], esi ; pointer to the file name
|
||||||
mcall 70, InfoStructure
|
mcall 70, InfoStructure
|
||||||
test eax,eax
|
test eax, eax
|
||||||
jz .out
|
jz .out
|
||||||
stc
|
stc
|
||||||
.out:
|
.out:
|
||||||
popa
|
popa
|
||||||
ret
|
ret
|
||||||
;------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
;********************************************
|
|
||||||
;* input: esi = pointer to the file name *
|
;* input: esi = pointer to the file name *
|
||||||
;* edx = pointer to data buffer *
|
;* edx = pointer to data buffer *
|
||||||
;* ecx = data length *
|
;* ecx = data length *
|
||||||
;********************************************
|
;------------------------------------------------------------------------------
|
||||||
|
|
||||||
WriteToFile:
|
WriteToFile:
|
||||||
push ebx
|
push ebx
|
||||||
mov dword [InfoStructure],3 ; write to file
|
mov dword [InfoStructure+00], 3 ; write to file
|
||||||
mov eax, [filepos]
|
mov eax, [filepos]
|
||||||
mov dword [InfoStructure+4],eax ; lower position addr
|
mov dword [InfoStructure+04], eax ; lower position addr
|
||||||
mov dword [InfoStructure+8],0 ; upper position addr (0 for FAT)
|
mov dword [InfoStructure+08], 0 ; upper position addr (0 for FAT)
|
||||||
mov dword [InfoStructure+12],ecx ; number of bytes to write
|
mov dword [InfoStructure+12], ecx ; number of bytes to write
|
||||||
mov dword [InfoStructure+16],edx ; pointer to data buffer
|
mov dword [InfoStructure+16], edx ; pointer to data buffer
|
||||||
mov dword [InfoStructure+20],0 ; reserved
|
mov dword [InfoStructure+20], 0 ; reserved
|
||||||
mov dword [InfoStructure+21],esi ; pointer to the file name
|
mov dword [InfoStructure+21], esi ; pointer to the file name
|
||||||
mcall 70, InfoStructure
|
mcall 70, InfoStructure
|
||||||
clc
|
clc
|
||||||
test eax,eax
|
test eax, eax
|
||||||
jz .out
|
jz .out
|
||||||
stc
|
stc
|
||||||
.out:
|
.out:
|
||||||
pop ebx
|
pop ebx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;-------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
;********************************************
|
|
||||||
;* input: esi = pointer to string *
|
;* input: esi = pointer to string *
|
||||||
;* edi = pointer to string *
|
;* edi = pointer to string *
|
||||||
;* ecx = data length *
|
;* ecx = data length *
|
||||||
;********************************************
|
;------------------------------------------------------------------------------
|
||||||
StrCmp:
|
StrCmp:
|
||||||
repe cmpsb
|
repe cmpsb
|
||||||
ja .a_greater_b
|
ja .a_greater_b
|
||||||
jb .a_less_b
|
jb .a_less_b
|
||||||
.equal:
|
.equal:
|
||||||
mov eax, 0
|
mov eax, 0
|
||||||
jmp .end
|
jmp .end
|
||||||
.a_less_b:
|
.a_less_b:
|
||||||
mov eax, 1
|
mov eax, 1
|
||||||
jmp .end
|
jmp .end
|
||||||
.a_greater_b:
|
.a_greater_b:
|
||||||
mov eax, -1
|
mov eax, -1
|
||||||
.end:
|
.end:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;-------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
;********************************************
|
|
||||||
;* input: edi = pointer to string *
|
;* input: edi = pointer to string *
|
||||||
;* ecx = data length *
|
;* ecx = data length *
|
||||||
;********************************************
|
;------------------------------------------------------------------------------
|
||||||
; 'a' - 'A' = 32 -> 'A'|32 = 'a'
|
; 'a' - 'A' = 32 -> 'A'|32 = 'a'
|
||||||
ToLower:
|
ToLower:
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
@ -356,90 +336,82 @@ ToLower:
|
|||||||
.end:
|
.end:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
;-------------------------------------------------
|
;* get info on current thread, save pid/tid
|
||||||
|
;* look for another process with same name and different pid/tid
|
||||||
|
;* if found, close self
|
||||||
|
;* else continue normally
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
CheckUnique:
|
CheckUnique:
|
||||||
;get info on current thread, save pid/tid
|
.get_thread_info:
|
||||||
;look for another process with same name and different pid/tid
|
|
||||||
;if found, close self
|
|
||||||
;else continue normally
|
|
||||||
|
|
||||||
.get_thread_info:
|
|
||||||
mov ebx, procinfo
|
mov ebx, procinfo
|
||||||
mov ecx, -1
|
mov ecx, -1
|
||||||
mcall 9
|
mcall 9
|
||||||
.get_pid:
|
|
||||||
; check_buffer
|
.get_pid: ; check_buffer
|
||||||
mov [process_count], eax
|
mov [process_count], eax
|
||||||
mov eax, [ebx+process_information.PID]
|
mov eax, [ebx+process_information.PID]
|
||||||
mov [pid_tid], eax
|
mov [pid_tid], eax
|
||||||
mov ecx, 2
|
mov ecx, 2
|
||||||
|
|
||||||
.check_threads:
|
.check_threads:
|
||||||
cmp ecx, [process_count]
|
cmp ecx, [process_count]
|
||||||
ja .leave_check
|
ja .leave_check
|
||||||
mov eax, 9
|
mov eax, 9
|
||||||
mcall
|
mcall
|
||||||
|
|
||||||
.check_slot_free:
|
.check_slot_free:
|
||||||
cmp dword [ebx+process_information.slot_state], 9
|
cmp dword [ebx+process_information.slot_state], 9
|
||||||
je .next_thread
|
je .next_thread
|
||||||
|
|
||||||
.check_pid:
|
.check_pid:
|
||||||
mov eax, [pid_tid]
|
mov eax, [pid_tid]
|
||||||
cmp [ebx+process_information.PID], eax
|
cmp [ebx+process_information.PID], eax
|
||||||
je .next_thread
|
je .next_thread
|
||||||
|
|
||||||
.get_proc_name:
|
.get_proc_name:
|
||||||
lea edi, [ebx+process_information.process_name]
|
lea edi, [ebx+process_information.process_name]
|
||||||
push ecx
|
push ecx
|
||||||
mov ecx, my_name_size-1
|
mov ecx, my_name_size-1
|
||||||
.lower_case:
|
|
||||||
|
.lower_case:
|
||||||
call ToLower
|
call ToLower
|
||||||
lea esi, [my_name]
|
lea esi, [my_name]
|
||||||
|
|
||||||
mov ecx, my_name_size
|
mov ecx, my_name_size
|
||||||
call StrCmp
|
call StrCmp
|
||||||
|
|
||||||
pop ecx
|
pop ecx
|
||||||
|
|
||||||
cmp eax, 0
|
cmp eax, 0
|
||||||
je .close_program
|
je .close_program
|
||||||
|
|
||||||
.next_thread:
|
.next_thread:
|
||||||
inc ecx
|
inc ecx
|
||||||
jmp .check_threads
|
jmp .check_threads
|
||||||
|
|
||||||
.close_program:
|
.close_program:
|
||||||
mcall 18,3 ; restore and active window of previous thread
|
; restore and active window of previous thread
|
||||||
|
mcall 18, 3
|
||||||
mov eax, -1
|
mov eax, -1
|
||||||
mcall
|
mcall
|
||||||
|
|
||||||
.leave_check:
|
.leave_check:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
;--------------------------------------------------
|
;*********************************** DATA ************************************
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
align 4
|
||||||
InfoStructure:
|
InfoStructure:
|
||||||
dd 0x0 ; subfunction number
|
dd 0x0 ; subfunction number
|
||||||
dd 0x0 ; position in the file in bytes
|
dd 0x0 ; position in the file in bytes
|
||||||
dd 0x0 ; upper part of the position address
|
dd 0x0 ; upper part of the position address
|
||||||
dd 0x0 ; number of bytes to read
|
dd 0x0 ; number of bytes to read
|
||||||
dd 0x0 ; pointer to the buffer to write data
|
dd 0x0 ; pointer to the buffer to write data
|
||||||
db 0
|
db 0x0
|
||||||
dd 0 ; pointer to the filename
|
dd 0x0 ; pointer to the filename
|
||||||
|
filepos dd 0x0
|
||||||
filepos dd 0
|
|
||||||
default_filename db '/sys/boardlog.txt',0
|
default_filename db '/sys/boardlog.txt',0
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
krnl_msg db 'K : '
|
|
||||||
duk db 'KernUser'
|
|
||||||
|
|
||||||
; DATA AREA
|
|
||||||
|
|
||||||
; 11,11 > 0,-1
|
|
||||||
; 5,11 > 0,-1
|
|
||||||
if lang eq ru
|
if lang eq ru
|
||||||
title db '„®áª ®â« ¤ª¨ ¨ á®®¡é¥¨©',0
|
title db '„®áª ®â« ¤ª¨ ¨ á®®¡é¥¨©',0
|
||||||
else if lang eq it
|
else if lang eq it
|
||||||
@ -449,10 +421,12 @@ else if lang eq ge
|
|||||||
else
|
else
|
||||||
title db 'General debug & message board',0
|
title db 'General debug & message board',0
|
||||||
end if
|
end if
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
krnl_msg db 'K : '
|
||||||
|
duk db 'KernUser'
|
||||||
krnl_cnt dd 0
|
krnl_cnt dd 0
|
||||||
vmode dd 1
|
vmode dd 1
|
||||||
targ dd text2
|
targ dd text2
|
||||||
|
|
||||||
my_name db 'board',0
|
my_name db 'board',0
|
||||||
my_name_size = $-my_name
|
my_name_size = $-my_name
|
||||||
process_count dd 0x0
|
process_count dd 0x0
|
||||||
@ -463,24 +437,17 @@ I_END:
|
|||||||
offs dd ?
|
offs dd ?
|
||||||
flag rb 1
|
flag rb 1
|
||||||
rd 2
|
rd 2
|
||||||
;x1pos dd ?
|
|
||||||
;y1pos dd ?
|
|
||||||
text1 rb 80*(MAXSTRINGS+1)
|
text1 rb 80*(MAXSTRINGS+1)
|
||||||
tmp1 db ?
|
tmp1 db ?
|
||||||
rd 2
|
rd 2
|
||||||
;x2pos dd ?
|
|
||||||
;y2pos dd ?
|
|
||||||
text2 rb 80*(MAXSTRINGS+1)
|
text2 rb 80*(MAXSTRINGS+1)
|
||||||
tmp2 db ?
|
tmp2 db ?
|
||||||
xstart dd ?
|
xstart dd ?
|
||||||
|
sc sys_colors_new
|
||||||
sc system_colors
|
|
||||||
|
|
||||||
i_end:
|
i_end:
|
||||||
buffer_length rb 1
|
buffer_length rb 1
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
tmp rb 256
|
tmp rb 256
|
||||||
;------------------------------------------------------------------------------
|
|
||||||
filename rb 256
|
filename rb 256
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
align 4
|
align 4
|
||||||
|
Loading…
Reference in New Issue
Block a user