Subversion Repositories Kolibri OS

Rev

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

Rev 3165 Rev 8960
Line 1... Line 1...
1
delete_file_worker:
1
delete_file_worker:
2
; in: ecx=flags: 1=deleting directory
2
; in: ecx=flags: 1=deleting directory
3
; out: eax=0 - OK, eax=1 - retry, eax=2 - skip, eax=-1 - cancel,
3
; out: eax=0 - OK, eax=1 - retry, eax=2 - skip, eax=-1 - cancel,
4
;      PF, ZF, CF and SF set accordingly to 'cmp eax,2' (or 'cmp al,2')
4
;      PF, ZF, CF and SF set accordingly to 'cmp eax,2' (or 'cmp al,2')
5
        push    ebx
5
        push    ebx
6
        push    70
6
        push    SF_FILE
7
        pop     eax
7
        pop     eax
8
        mov     ebx, delinfo
8
        mov     ebx, delinfo
9
        int     0x40
9
        int     0x40
10
        pop     ebx
10
        pop     ebx
11
        test    eax, eax
11
        test    eax, eax
Line 49... Line 49...
49
delete_file:
49
delete_file:
50
; in: eax->BDFE block
50
; in: eax->BDFE block
51
; out: CF and ZF not set <=> cancel job ("ja cancel_label")
51
; out: CF and ZF not set <=> cancel job ("ja cancel_label")
52
        pushad
52
        pushad
53
        mov     [del_dir_stack_ptr], del_dir_stack
53
        mov     [del_dir_stack_ptr], del_dir_stack
54
        lea     esi, [ebp + panel1_dir - panel1_data]
54
        lea     esi, [ebp + PanelData.dir]
55
        mov     edi, execdata
55
        mov     edi, execdata
56
@@:
56
@@:
57
        lodsb
57
        lodsb
58
        test    al, al
58
        test    al, al
59
        jz      @f
59
        jz      @f
Line 97... Line 97...
97
        mov     ebx, dirinfo
97
        mov     ebx, dirinfo
98
        mov     [ebx+dirinfo.first-dirinfo], ebp
98
        mov     [ebx+dirinfo.first-dirinfo], ebp
99
        mov     [ebx+dirinfo.size-dirinfo], del_dir_query_size
99
        mov     [ebx+dirinfo.size-dirinfo], del_dir_query_size
100
        mov     [ebx+dirinfo.dirdata-dirinfo], del_dir_query_area
100
        mov     [ebx+dirinfo.dirdata-dirinfo], del_dir_query_area
101
        mov     [ebx+dirinfo.name-dirinfo], execdata
101
        mov     [ebx+dirinfo.name-dirinfo], execdata
102
        push    70
102
        push    SF_FILE
103
        pop     eax
103
        pop     eax
104
        int     0x40
104
        int     0x40
105
; if we get read error, the best available action is try to delete directory itself
105
; if we get read error, the best available action is try to delete directory itself
106
        test    eax, eax
106
        test    eax, eax
107
        jz      @f
107
        jz      @f
Line 212... Line 212...
212
 
212
 
213
makedir:
213
makedir:
214
; create directory with name from CopyDestEditBuf+12
214
; create directory with name from CopyDestEditBuf+12
215
; destroys eax
215
; destroys eax
216
        push    ebx
216
        push    ebx
217
        push    70
217
        push    SF_FILE
218
        pop     eax
218
        pop     eax
219
        mov     ebx, mkdirinfo
219
        mov     ebx, mkdirinfo
220
        int     0x40
220
        int     0x40
221
        pop     ebx
221
        pop     ebx
Line 350... Line 350...
350
        cmp     eax, -1
350
        cmp     eax, -1
351
        jz      .readerr
351
        jz      .readerr
352
        mov     ebx, eax
352
        mov     ebx, eax
353
        jmp     .copyreadok
353
        jmp     .copyreadok
354
.native:
354
.native:
355
        push    70
355
        push    SF_FILE
356
        pop     eax
356
        pop     eax
357
        int     0x40
357
        int     0x40
358
        test    eax, eax
358
        test    eax, eax
359
        jz      .copyreadok
359
        jz      .copyreadok
360
        cmp     eax, 6
360
        cmp     eax, 6
Line 388... Line 388...
388
        jnz     .copywrite
388
        jnz     .copywrite
389
        cmp     byte [writeinfo.code], 2
389
        cmp     byte [writeinfo.code], 2
390
        jnz     .copydone
390
        jnz     .copydone
391
.copywrite:
391
.copywrite:
392
        mov     ebx, writeinfo
392
        mov     ebx, writeinfo
393
        push    70
393
        push    SF_FILE
394
        pop     eax
394
        pop     eax
395
        int     0x40
395
        int     0x40
396
        test    eax, eax
396
        test    eax, eax
397
        jz      .copywriteok
397
        jz      .copywriteok
398
        cmp     [copy_bSkipAll2], 0
398
        cmp     [copy_bSkipAll2], 0
Line 470... Line 470...
470
        mov     [edi-32+28], ecx
470
        mov     [edi-32+28], ecx
471
@@:
471
@@:
472
        mov     ebx, attrinfo
472
        mov     ebx, attrinfo
473
        mov     [ebx+attrinfo.name-attrinfo], CopyDestEditBuf+12
473
        mov     [ebx+attrinfo.name-attrinfo], CopyDestEditBuf+12
474
        inc     dword [ebx]
474
        inc     dword [ebx]
475
        push    70
475
        push    SF_FILE
476
        pop     eax
476
        pop     eax
477
        push    ebx
477
        push    ebx
478
        int     0x40
478
        int     0x40
479
        pop     ebx
479
        pop     ebx
480
        dec     dword [ebx]
480
        dec     dword [ebx]
Line 518... Line 518...
518
        jnz     .copydone2
518
        jnz     .copydone2
519
.copyfailed_del:
519
.copyfailed_del:
520
        mov     ebx, delinfo
520
        mov     ebx, delinfo
521
        push    dword [ebx+21]
521
        push    dword [ebx+21]
522
        mov     dword [ebx+21], edi
522
        mov     dword [ebx+21], edi
523
        push    70
523
        push    SF_FILE
524
        pop     eax
524
        pop     eax
525
        int     0x40
525
        int     0x40
526
; ignore errors
526
; ignore errors
527
        pop     dword [delinfo+21]
527
        pop     dword [delinfo+21]
528
        jmp     .copydone2
528
        jmp     .copydone2
Line 535... Line 535...
535
; in: eax->BDFE block for source, CopyDestEditBuf+12 contains ASCIIZ full name for destination
535
; in: eax->BDFE block for source, CopyDestEditBuf+12 contains ASCIIZ full name for destination
536
; out: CF and ZF not set <=> cancel job ("ja cancel_label")
536
; out: CF and ZF not set <=> cancel job ("ja cancel_label")
537
        pushad
537
        pushad
538
        mov     [copy_dir_stack_ptr], copy_dir_stack
538
        mov     [copy_dir_stack_ptr], copy_dir_stack
539
        mov     [bNeedRestoreName], 0
539
        mov     [bNeedRestoreName], 0
540
        lea     esi, [ebp + panel1_dir - panel1_data]
540
        lea     esi, [ebp + PanelData.dir]
541
        mov     edi, execdata
541
        mov     edi, execdata
542
@@:
542
@@:
543
        lodsb
543
        lodsb
544
        test    al, al
544
        test    al, al
545
        jz      @f
545
        jz      @f
Line 672... Line 672...
672
        call    [eax+PluginInfo.ReadFolder]
672
        call    [eax+PluginInfo.ReadFolder]
673
        pop     ebp
673
        pop     ebp
674
        mov     ebx, dword [copy_dir_query_area+4]
674
        mov     ebx, dword [copy_dir_query_area+4]
675
        jmp     @f
675
        jmp     @f
676
.readfolder_native:
676
.readfolder_native:
677
        push    70
677
        push    SF_FILE
678
        pop     eax
678
        pop     eax
679
        int     0x40
679
        int     0x40
680
@@:
680
@@:
681
        test    eax, eax
681
        test    eax, eax
682
        jz      .readok
682
        jz      .readok
Line 1323... Line 1323...
1323
        lodsb
1323
        lodsb
1324
        stosb
1324
        stosb
1325
        test    al, al
1325
        test    al, al
1326
        jnz     @b
1326
        jnz     @b
1327
        mov     esi, ecx
1327
        mov     esi, ecx
1328
        lea     edi, [ebp + panel1_dir - panel1_data]
1328
        lea     edi, [ebp + PanelData.dir]
1329
        push    esi edi
1329
        push    esi edi
1330
        call    strcmpi
1330
        call    strcmpi
1331
        pop     edi esi
1331
        pop     edi esi
1332
        jz      .goto.samedir
1332
        jz      .goto.samedir
1333
@@:
1333
@@:
1334
        lodsb
1334
        lodsb
1335
        stosb
1335
        stosb
1336
        test    al, al
1336
        test    al, al
1337
        jnz     @b
1337
        jnz     @b
1338
        and     [ebp + panel1_start - panel1_data], 0
1338
        and     [ebp + PanelData.start], 0
1339
        and     [ebp + panel1_index - panel1_data], 0
1339
        and     [ebp + PanelData.index], 0
1340
.goto.samedir:
1340
.goto.samedir:
1341
        push    @f
1341
        push    @f
1342
        push    [ebp + panel1_index - panel1_data]
1342
        push    [ebp + PanelData.index]
1343
        jmp     panels_OnKey.ctrl_r.doread
1343
        jmp     panels_OnKey.ctrl_r.doread
1344
@@:
1344
@@:
1345
        pop     ebp
1345
        pop     ebp
1346
        jmp     .exit
1346
        jmp     .exit
1347
.newsearch:
1347
.newsearch:
Line 1351... Line 1351...
1351
.do.newsearch:
1351
.do.newsearch:
1352
        call    filesearch_free_result
1352
        call    filesearch_free_result
1353
        jmp     panels_OnKey.alt_f7.reinit
1353
        jmp     panels_OnKey.alt_f7.reinit
1354
.query:
1354
.query:
1355
        mov     esi, [active_panel]
1355
        mov     esi, [active_panel]
1356
        cmp     [esi + panel1_hPlugin - panel1_data], 0
1356
        cmp     [esi + PanelData.hPlugin], 0
1357
        jz      @f
1357
        jz      @f
1358
        push    aCannotSearchOnPlugin
1358
        push    aCannotSearchOnPlugin
1359
        mov     eax, esp
1359
        mov     eax, esp
1360
        push    ContinueBtn
1360
        push    ContinueBtn
1361
        push    1
1361
        push    1
Line 1363... Line 1363...
1363
        push    1
1363
        push    1
1364
        call    SayErr
1364
        call    SayErr
1365
        pop     eax
1365
        pop     eax
1366
        jmp     .exit
1366
        jmp     .exit
1367
@@:
1367
@@:
1368
        add     esi, panel1_dir - panel1_data
1368
        add     esi, PanelData.dir
1369
        lea     edi, [ebp+filesearch_data.curdir]
1369
        lea     edi, [ebp+filesearch_data.curdir]
1370
@@:
1370
@@:
1371
        lodsb
1371
        lodsb
1372
        stosb
1372
        stosb
1373
        test    al, al
1373
        test    al, al
1374
        jnz     @b
1374
        jnz     @b
1375
        push    51
1375
        push    SF_CREATE_THREAD
1376
        pop     eax
1376
        pop     eax
1377
        push    1
1377
        push    1
1378
        pop     ebx
1378
        pop     ebx
1379
        mov     ecx, filesearch_thread
1379
        mov     ecx, filesearch_thread
1380
        lea     edx, [ebp+filesearch_data.stacktop-4]
1380
        lea     edx, [ebp+filesearch_data.stacktop-4]
Line 1391... Line 1391...
1391
@@:
1391
@@:
1392
        mov     [ebp+filesearch_data.tid], eax
1392
        mov     [ebp+filesearch_data.tid], eax
1393
        mov     [ebp+filesearch_data.updating], 0
1393
        mov     [ebp+filesearch_data.updating], 0
1394
        mov     [ebp+filesearch_data.datachanged], 0
1394
        mov     [ebp+filesearch_data.datachanged], 0
1395
        xchg    eax, ecx
1395
        xchg    eax, ecx
1396
        push    18
1396
        push    SF_SYSTEM
1397
        pop     eax
1397
        pop     eax
1398
        push    21
1398
        push    SSF_GET_THREAD_SLOT
1399
        pop     ebx
1399
        pop     ebx
1400
        int     40h
1400
        int     40h
1401
        mov     [ebp+filesearch_data.slot], eax
1401
        mov     [ebp+filesearch_data.slot], eax
1402
        mov     [idle_interval], 10
1402
        mov     [idle_interval], 10
1403
        mov     esi, aFileSearch
1403
        mov     esi, aFileSearch
Line 1530... Line 1530...
1530
        mov     ecx, [ebp+filesearch_data.slot]
1530
        mov     ecx, [ebp+filesearch_data.slot]
1531
        mov     edx, [ebp+filesearch_data.tid]
1531
        mov     edx, [ebp+filesearch_data.tid]
1532
        jecxz   .secondary_thread_exited
1532
        jecxz   .secondary_thread_exited
1533
@@:
1533
@@:
1534
        mov     ebx, procinfo
1534
        mov     ebx, procinfo
1535
        push    9
1535
        push    SF_THREAD_INFO
1536
        pop     eax
1536
        pop     eax
1537
        int     40h
1537
        int     40h
1538
        cmp     word [ebx+50], 9
1538
        cmp     word [ebx+50], 9
1539
        jz      .secondary_thread_exited
1539
        jz      .secondary_thread_exited
1540
        cmp     dword [ebx+30], edx
1540
        cmp     dword [ebx+30], edx
1541
        jnz     .secondary_thread_exited
1541
        jnz     .secondary_thread_exited
1542
        push    5
1542
        push    SF_SLEEP
1543
        pop     eax
1543
        pop     eax
1544
        push    1
1544
        push    1
1545
        pop     ebx
1545
        pop     ebx
1546
        int     40h
1546
        int     40h
1547
        jmp     @b
1547
        jmp     @b
Line 1637... Line 1637...
1637
        mov     dword [ebx+4], esi
1637
        mov     dword [ebx+4], esi
1638
        and     dword [ebx+8], 0
1638
        and     dword [ebx+8], 0
1639
        mov     dword [ebx+12], search_dir_query_size
1639
        mov     dword [ebx+12], search_dir_query_size
1640
        lea     eax, [ebp+filesearch_data.dir_area]
1640
        lea     eax, [ebp+filesearch_data.dir_area]
1641
        mov     [ebx+16], eax
1641
        mov     [ebx+16], eax
1642
        push    70
1642
        push    SF_FILE
1643
        pop     eax
1643
        pop     eax
1644
        int     40h
1644
        int     40h
1645
        test    eax, eax
1645
        test    eax, eax
1646
        jz      .read_folder_ok
1646
        jz      .read_folder_ok
1647
        cmp     eax, 6
1647
        cmp     eax, 6
Line 1860... Line 1860...
1860
        jz      .cancel
1860
        jz      .cancel
1861
        ja      @f
1861
        ja      @f
1862
        ret
1862
        ret
1863
@@:
1863
@@:
1864
        push    eax ebx
1864
        push    eax ebx
1865
        push    5
1865
        push    SF_SLEEP
1866
        pop     eax
1866
        pop     eax
1867
        push    1
1867
        push    1
1868
        pop     ebx
1868
        pop     ebx
1869
        int     40h
1869
        int     40h
1870
        pop     ebx eax
1870
        pop     ebx eax
Line 1884... Line 1884...
1884
        jz      .loop
1884
        jz      .loop
1885
        add     edi, 256
1885
        add     edi, 256
1886
.loop:
1886
.loop:
1887
.read_retry:
1887
.read_retry:
1888
	call	filesearch_thread.check_stop
1888
	call	filesearch_thread.check_stop
1889
        push    70
1889
        push    SF_FILE
1890
        pop     eax
1890
        pop     eax
1891
        lea     ebx, [ebp+filesearch_data.fs.func]
1891
        lea     ebx, [ebp+filesearch_data.fs.func]
1892
        int     40h
1892
        int     40h
1893
        test    eax, eax
1893
        test    eax, eax
1894
        jz      .readok
1894
        jz      .readok
Line 2027... Line 2027...
2027
        stosd
2027
        stosd
2028
        stosd
2028
        stosd
2029
        stosd
2029
        stosd
2030
        lea     eax, [ecx+_FILE.attr]
2030
        lea     eax, [ecx+_FILE.attr]
2031
        stosd
2031
        stosd
2032
        push    70
2032
        push    SF_FILE
2033
        pop     eax
2033
        pop     eax
2034
        int     0x40
2034
        int     0x40
2035
        test    eax, eax
2035
        test    eax, eax
2036
        jz      .found
2036
        jz      .found
2037
        cmp     eax, 5
2037
        cmp     eax, 5
Line 2040... Line 2040...
2040
        test    [ecx+_FILE.mode], O_CREATE
2040
        test    [ecx+_FILE.mode], O_CREATE
2041
        jz      .ret0
2041
        jz      .ret0
2042
.truncate:
2042
.truncate:
2043
        lea     ebx, [ecx+_FILE.fileinfo]
2043
        lea     ebx, [ecx+_FILE.fileinfo]
2044
        mov     byte [ebx], 2
2044
        mov     byte [ebx], 2
2045
        push    70
2045
        push    SF_FILE
2046
        pop     eax
2046
        pop     eax
2047
        int     0x40
2047
        int     0x40
2048
        test    eax, eax
2048
        test    eax, eax
2049
        jz      .getattr
2049
        jz      .getattr
2050
        jmp     .ret0
2050
        jmp     .ret0
Line 2286... Line 2286...
2286
        xor     eax, eax
2286
        xor     eax, eax
2287
        jmp     .addpos
2287
        jmp     .addpos
2288
@@:
2288
@@:
2289
        ret
2289
        ret
2290
.native:
2290
.native:
2291
        push    70
2291
        push    SF_FILE
2292
        pop     eax
2292
        pop     eax
2293
        int     0x40
2293
        int     0x40
2294
        test    eax, eax
2294
        test    eax, eax
2295
        jz      .addpos
2295
        jz      .addpos
2296
        cmp     eax, 6
2296
        cmp     eax, 6