Subversion Repositories Kolibri OS

Rev

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

Rev 6471 Rev 6502
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
4
;;  Distributed under terms of the GNU General Public License.  ;;
4
;;  Distributed under terms of the GNU General Public License.  ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 6471 $
8
$Revision: 6502 $
9
 
9
 
10
ERROR_SUCCESS        = 0
10
ERROR_SUCCESS        = 0
11
ERROR_DISK_BASE      = 1
11
ERROR_DISK_BASE      = 1
Line 54... Line 54...
54
        lea     ebp, [ebx+20]
54
        lea     ebp, [ebx+20]
55
        cmp     byte [ebp], 0
55
        cmp     byte [ebp], 0
56
        jnz     @f
56
        jnz     @f
57
        mov     ebp, [ebx+21]
57
        mov     ebp, [ebx+21]
58
@@:
58
@@:
-
 
59
        cmp     word [ebp], '/'
-
 
60
        jz      .rootdir
-
 
61
        cmp     byte [ebp], 4
-
 
62
        jnc     @f
-
 
63
        cmp     byte [ebp], 0
-
 
64
        jz      @f
-
 
65
        cmp     word [ebp+1], '/'
-
 
66
        jnz     @f
-
 
67
        cmp     byte [ebp], 2
-
 
68
        jnz     .rootdir
-
 
69
        cmp     word [ebp+3], 0
-
 
70
        jz      .rootdir
-
 
71
@@:
59
        cmp     dword[ebx], 7   ; start application
72
        cmp     dword[ebx], 7   ; start application
60
        jne     @f
73
        jnz     @f
61
        mov     edx, [ebx+4]
74
        mov     edx, [ebx+4]
62
        mov     ebx, [ebx+8]
75
        mov     ebx, [ebx+8]
63
        call    fs_execute      ; ebp, ebx, edx
76
        call    fs_execute      ; ebp, ebx, edx
64
        mov     [image_of_eax], eax
77
        mov     [image_of_eax], eax
65
        ret
78
        ret
Line 66... Line 79...
66
 
79
 
67
@@:
-
 
68
        cmp     word [ebp], '/'
-
 
69
        jz      .rootdir
-
 
70
        cmp     byte [ebp], 2
-
 
71
        jnz     @f
-
 
72
        cmp     dword[ebp+1], '/'
-
 
73
        jz      .rootdir
-
 
74
@@:
80
@@:
75
        stdcall kernel_alloc, maxPathLength
81
        stdcall kernel_alloc, maxPathLength
76
        push    ebx
82
        push    ebx
77
        mov     ebx, ebp
83
        mov     ebx, ebp
78
        mov     ebp, eax
-
 
79
        push    maxPathLength
-
 
80
        push    eax
84
        mov     ebp, eax
81
        call    get_full_file_name
85
        stdcall get_full_file_name, eax, maxPathLength
82
        pop     ebx
86
        pop     ebx
83
        test    eax, eax
87
        test    eax, eax
84
        jz      .notfound
88
        jz      .notfound
85
        mov     esi, ebp
89
        lea     esi, [ebp+2]
86
        mov     ax, [ebp]
90
        mov     ax, [esi]
87
        or      ax, 2020h
91
        or      ax, 2020h
88
        cmp     ax, 'cd'
92
        cmp     ax, 'cd'
89
        jz      .CD
93
        jz      .CD
90
        call    dyndisk_handler ; not returns if success
94
        call    dyndisk_handler ; not returns if success
Line 494... Line 498...
494
        push    edi
498
        push    edi
495
        push    eax
499
        push    eax
496
        mov     ebx, ecx
500
        mov     ebx, ecx
497
get_full_file_name:
501
get_full_file_name:
498
; in: ebx -> file name, [esp+4] -> destination, [esp+8] = max length
502
; in: ebx -> file name, [esp+4] -> destination, [esp+8] = max length
499
; out: eax=0 -> out of length
503
; out: UTF-8 string, eax=0 -> out of length
500
        push    ebp ebx
504
        push    ebp ebx
-
 
505
        cmp     byte [ebx], 0
-
 
506
        jz      .set_relative
501
        mov     esi, ebx
507
        mov     esi, ebx
502
        cmp     byte [ebx], 2
508
        cmp     byte [ebx], 4
503
        jnz     @f
509
        jnc     @f
504
        inc     esi
510
        inc     esi
505
@@:
511
@@:
506
        cmp     byte [esi], '/'
512
        cmp     byte [esi], '/'
507
        jnz     .set_relative
513
        jnz     .set_relative
508
        inc     esi
514
        inc     esi
Line 511... Line 517...
511
        inc     esi
517
        inc     esi
512
@@:
518
@@:
513
        call    process_replace_file_name
519
        call    process_replace_file_name
514
        mov     edi, [esp+12]
520
        mov     edi, [esp+12]
515
        mov     ecx, [esp+16]
521
        mov     ecx, [esp+16]
-
 
522
        mov     al, 3
-
 
523
        mov     ah, '/'
-
 
524
        stosw
-
 
525
        sub     ecx, 2
516
        test    ebp, ebp
526
        test    ebp, ebp
517
        jz      .absolute
527
        jz      .absolute
518
@@:
528
@@:
519
        lodsb
529
        lodsb
520
        stosb
530
        stosb
Line 523... Line 533...
523
        jnz     @b
533
        jnz     @b
524
        mov     esi, ebp
534
        mov     esi, ebp
525
        dec     edi
535
        dec     edi
526
.absolute:
536
.absolute:
527
        cmp     byte [ebx], 2
537
        cmp     byte [ebx], 2
-
 
538
        jz      .utf16
-
 
539
        cmp     byte [ebx], 3
528
        jz      @f
540
        jz      .utf8
529
        call    cp866toUTF8_string
541
        call    cp866toUTF8_string
530
        jns     .ret
542
        jns     .ret
531
        jmp     .fail
543
        jmp     .fail
Line 532... Line 544...
532
 
544
 
-
 
545
.utf8:
-
 
546
        dec     ecx
-
 
547
        js      .fail
-
 
548
        lodsb
-
 
549
        stosb
-
 
550
        test    al, al
-
 
551
        jz      .ret
-
 
552
        jmp     .utf8
-
 
553
 
533
@@:
554
.utf16:
534
        call    UTF16to8_string
555
        call    UTF16to8_string
535
        jns     .ret
556
        jns     .ret
536
.fail:
557
.fail:
537
        mov     byte [edi], 0
558
        mov     byte [edi], 0
Line 548... Line 569...
548
        repnz scasb
569
        repnz scasb
549
        mov     esi, edi
570
        mov     esi, edi
550
        dec     esi
571
        dec     esi
551
        mov     edi, [esp+12]
572
        mov     edi, [esp+12]
552
        jecxz   .fail
573
        jecxz   .fail
553
        cmp     byte [ebx], 2
574
        cmp     byte [ebx], 0
-
 
575
        jz      .set_ok
-
 
576
        cmp     byte [ebx], 4
-
 
577
        jnc     .relative
-
 
578
        inc     ebx
-
 
579
        cmp     byte [ebx-1], 2
554
        jz      .relative16
580
        jz      .relative16
555
.relative:
581
.relative:
556
        cmp     byte [ebx], 0
582
        cmp     byte [ebx], 0
557
        jz      .set_ok
583
        jz      .set_ok
558
        cmp     word [ebx], '.'
584
        cmp     word [ebx], '.'