Subversion Repositories Kolibri OS

Rev

Rev 9743 | Rev 9828 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9743 Rev 9823
Line 75... Line 75...
75
format binary as "mnt"
75
format binary as "mnt"
Line 76... Line 76...
76
 
76
 
77
include 'macros.inc'
77
include 'macros.inc'
Line 78... Line 78...
78
include 'struct.inc'
78
include 'struct.inc'
Line 79... Line 79...
79
 
79
 
80
$Revision: 9743 $
80
$Revision: 9823 $
Line 4818... Line 4818...
4818
@@:
4818
@@:
4819
        pop     eax
4819
        pop     eax
4820
        ret 
4820
        ret 
4821
endp
4821
endp
Line -... Line 4822...
-
 
4822
 
-
 
4823
align 4
-
 
4824
; @brief Check whether given string lays in userspace memory, i.e. below OS_BASE
-
 
4825
; @param base Base address of string
-
 
4826
; @return ZF = 1 if string in userspace memory,
-
 
4827
;         zf = 0 otherwise
-
 
4828
proc is_string_userspace stdcall, base:dword
-
 
4829
        push    eax ecx edi
-
 
4830
        xor     eax, eax
-
 
4831
        mov     edi, [base]
-
 
4832
 
-
 
4833
        mov     ecx, OS_BASE-1
-
 
4834
        sub     ecx, edi
-
 
4835
        jb      .done           ; zf
-
 
4836
        inc     ecx
-
 
4837
        cmp     ecx, 0x10000    ; don't allow strings larger than 64k?
-
 
4838
        jbe     @f
-
 
4839
        mov     ecx, 0x10000
-
 
4840
@@:
-
 
4841
        repnz scasb
-
 
4842
.done:
-
 
4843
        pop     edi ecx eax
-
 
4844
        ret
-
 
4845
endp
4822
 
4846
 
4823
if ~ lang eq sp
4847
if ~ lang eq sp
4824
diff16 "end of .text segment",0,$
4848
diff16 "end of .text segment",0,$
Line 4825... Line 4849...
4825
end if
4849
end if