Subversion Repositories Kolibri OS

Rev

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

Rev 6844 Rev 6845
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2011-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2011-2015. 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: 6844 $
8
$Revision: 6845 $
9
 
9
 
10
; =============================================================================
10
; =============================================================================
11
; ================================= Constants =================================
11
; ================================= Constants =================================
Line 1391... Line 1391...
1391
        mov     esi, fs_dyndisk_next
1391
        mov     esi, fs_dyndisk_next
1392
@@:
1392
@@:
1393
; 11c. Let the procedure from fs_lfn.inc do the job.
1393
; 11c. Let the procedure from fs_lfn.inc do the job.
1394
        jmp     file_system_lfn.maindir_noesi
1394
        jmp     file_system_lfn.maindir_noesi
Line -... Line 1395...
-
 
1395
 
-
 
1396
.root:
-
 
1397
        pop     ecx edx
-
 
1398
        xor     eax, eax
-
 
1399
        cmp     byte [ebx], 9
1395
 
1400
        jz      .cleanup_ecx
1396
.access_denied:
1401
.access_denied:
-
 
1402
        movi    eax, ERROR_ACCESS_DENIED
-
 
1403
.cleanup_ecx:
1397
        mov     dword [esp+32], ERROR_ACCESS_DENIED
1404
        mov     [esp+32], eax
1398
        mov     esi, ecx        ; disk*dereference assume that esi points to DISK
-
 
1399
.cleanup_esi:
1405
        mov     esi, ecx        ; disk*dereference assume that esi points to DISK
1400
        test    edx, edx        ; if there are no media, we didn't reference it
1406
        test    edx, edx        ; if there are no media, we didn't reference it
1401
        jz      @f
1407
        jz      @f
1402
        call    disk_media_dereference
1408
        call    disk_media_dereference
1403
@@:
1409
@@:
1404
        call    disk_dereference
1410
        call    disk_dereference
1405
        stdcall kernel_free, ebp
1411
        stdcall kernel_free, ebp
Line 1406... Line 1412...
1406
        ret
1412
        ret
1407
 
-
 
1408
.dyndisk_cleanup:
1413
 
1409
        pop     esi
1414
.dyndisk_cleanup:
1410
        pop     edx
1415
        pop     ecx edx
Line 1411... Line 1416...
1411
        mov     dword [esp+32], ERROR_FILE_NOT_FOUND
1416
        movi    eax, ERROR_FILE_NOT_FOUND
1412
        jmp     .cleanup_esi
1417
        jmp     .cleanup_ecx
1413
 
-
 
1414
.haspartition:
1418
 
1415
; 12. The fs operation has specified some partition.
1419
.haspartition:
1416
        push    edx
1420
; 12. The fs operation has specified some partition.
1417
        push    ecx
1421
        push    edx ecx
1418
        xor     eax, eax
1422
        xor     eax, eax
1419
        lodsb
1423
        lodsb
Line 1427... Line 1431...
1427
        jz      @f
1431
        jz      @f
1428
        test    eax, eax
1432
        test    eax, eax
1429
        jnz     .dyndisk_cleanup
1433
        jnz     .dyndisk_cleanup
1430
        dec     esi
1434
        dec     esi
1431
@@:
1435
@@:
-
 
1436
        cmp     byte [esi], 0
-
 
1437
        jnz     @f
-
 
1438
        cmp     byte [ebx], 1
-
 
1439
        jz      @f
-
 
1440
        cmp     byte [ebx], 5
-
 
1441
        jnz     .root
-
 
1442
@@:
1432
        dec     ecx     ; convert to zero-based partition index
1443
        dec     ecx     ; convert to zero-based partition index
1433
        pop     edx     ; edx = pointer to DISK, dword [esp] = NULL or edx
1444
        pop     edx     ; edx = pointer to DISK, dword [esp] = NULL or edx
1434
; If the driver does not support insert notifications and we are the only fs
1445
; If the driver does not support insert notifications and we are the only fs
1435
; operation with this disk, ask the driver whether the media
1446
; operation with this disk, ask the driver whether the media
1436
; was inserted/removed/changed. Otherwise, assume that media status is valid.
1447
; was inserted/removed/changed. Otherwise, assume that media status is valid.
Line 1477... Line 1488...
1477
        push    ebp
1488
        push    ebp
1478
        mov     ebp, eax
1489
        mov     ebp, eax
1479
        call    dword [edi+8+ecx*4]
1490
        call    dword [edi+8+ecx*4]
1480
        pop     ebp
1491
        pop     ebp
1481
        pop     edx
1492
        pop     edx
1482
        mov     dword [esp+32], eax
-
 
1483
        mov     dword [esp+20], ebx
1493
        mov     dword [esp+20], ebx
1484
.cleanup:
1494
.cleanup:
-
 
1495
        mov     dword [esp+32], eax
1485
        mov     esi, edx
1496
        mov     esi, edx
1486
        call    disk_media_dereference
1497
        call    disk_media_dereference
1487
@@:
1498
@@:
1488
        call    disk_dereference
1499
        call    disk_dereference
1489
        stdcall kernel_free, ebp
1500
        stdcall kernel_free, ebp
1490
        ret
1501
        ret
Line 1491... Line 1502...
1491
 
1502
 
1492
.unsupported:
1503
.unsupported:
1493
        mov     dword [esp+32], ERROR_UNKNOWN_FS
1504
        movi    eax, ERROR_UNKNOWN_FS
1494
        cmp     edi, default_fs_functions
1505
        cmp     edi, default_fs_functions
1495
        jz      .cleanup
1506
        jz      .cleanup
1496
        mov     dword [esp+32], ERROR_UNSUPPORTED_FS
1507
        movi    eax, ERROR_UNSUPPORTED_FS
Line 1497... Line 1508...
1497
        jmp     .cleanup
1508
        jmp     .cleanup
1498
 
1509
 
1499
.notfound2:
1510
.notfound2:
Line 1500... Line 1511...
1500
        mov     dword [esp+32], ERROR_FILE_NOT_FOUND
1511
        movi    eax, ERROR_FILE_NOT_FOUND
1501
        jmp     .cleanup
1512
        jmp     .cleanup
1502
 
1513