Subversion Repositories Kolibri OS

Rev

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

Rev 6845 Rev 6872
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: 6845 $
8
$Revision: 6872 $
9
 
9
 
10
; CD external functions
10
; CD external functions
11
;   in:
11
;   in:
12
; esi -> path string in UTF-8
12
; esi -> path string in UTF-8
13
; ebx -> offset in file (qword)
13
; ebx -> parameter structure +4
14
; ecx = bytes to read
14
; ecx = bytes to read
15
; edx -> buffer
15
; edx -> buffer
16
;   out:
16
;   out:
Line 482... Line 482...
482
        mov     [edi+32], eax
482
        mov     [edi+32], eax
483
        ret
483
        ret
Line 484... Line 484...
484
 
484
 
485
;-----------------------------------------------------------------------------
485
;-----------------------------------------------------------------------------
-
 
486
fs_CdGetFileInfo:
-
 
487
        call    cd_find_lfn
-
 
488
        movi    eax, ERROR_FILE_NOT_FOUND
-
 
489
        jc      @f
-
 
490
        mov     edi, edx
-
 
491
        mov     eax, [ebx+4]
486
fs_CdGetFileInfo:
492
        mov     [edx+4], eax
487
        cmp     byte [esi], 0
493
        cmp     byte [esi], 0
488
        jnz     @f
-
 
489
 
494
        jz      .volume
490
        mov     eax, 2
495
        mov     ebp, [cd_current_pointer_of_input]
491
        ret
496
        add     ebp, 33
-
 
497
        call    cd_get_parameters_of_file_1
492
;--------------------------------------
498
        xor     eax, eax
493
@@:
-
 
494
        push    edi
-
 
495
        call    cd_find_lfn
-
 
496
        pushfd
-
 
497
        cmp     [DevErrorCode], 0
-
 
498
        jz      @f
-
 
499
 
-
 
500
        popfd
-
 
501
        pop     edi
-
 
502
        mov     eax, 11
499
@@:
503
        ret
-
 
504
;--------------------------------------
-
 
505
@@:
-
 
506
        popfd
-
 
Line -... Line 500...
-
 
500
        ret
507
        jnc     @f
501
 
508
 
502
.volume:
-
 
503
        mov     ecx, 16
-
 
504
        mov     esi, CDDataBuf+40
509
        pop     edi
505
        add     edi, 40
510
        mov     eax, ERROR_FILE_NOT_FOUND
506
        cmp     eax, 2
-
 
507
        jz      .utf16
511
        ret
508
        cmp     eax, 3
-
 
509
        jz      .utf8
-
 
510
@@:
-
 
511
        lodsw
-
 
512
        xchg    al, ah
-
 
513
        call    uni2ansi_char
-
 
514
        stosb
Line -... Line 515...
-
 
515
        loop    @b
-
 
516
        jmp     .size
512
;--------------------------------------
517
 
-
 
518
.utf16:
-
 
519
        lodsw
513
@@:
520
        xchg    al, ah
-
 
521
        stosw
-
 
522
        loop    .utf16
514
 
523
        jmp     .size
515
        mov     edi, edx
524
 
-
 
525
.utf8:
-
 
526
        mov     ebx, ecx
-
 
527
        shl     ecx, 1
516
        push    ebp
528
@@:
517
        mov     ebp, [cd_current_pointer_of_input]
529
        lodsw
-
 
530
        xchg    ah, al
-
 
531
        call    UTF16to8
518
        add     ebp, 33
532
        dec     ebx
519
        call    cd_get_parameters_of_file_1
533
        jnz     @b
-
 
534
.size:
520
        pop     ebp
535
        mov     eax, [CDDataBuf+80]
-
 
536
        shl     eax, 11
-
 
537
        mov     [edx+32], eax
521
        and     dword [edi+4], 0
538
        xor     eax, eax
-
 
539
        mov     [edx+36], eax
522
        pop     edi
540
        stosw
523
        xor     eax, eax
541
        ret
524
        ret
542
 
525
;-----------------------------------------------------------------------------
543
;-----------------------------------------------------------------------------
526
cd_find_lfn:
544
cd_find_lfn: