Subversion Repositories Kolibri OS

Rev

Rev 6611 | Rev 6787 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2288 clevermous 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
6462 pathoswith 3
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
4
;;  Distributed under terms of the GNU General Public License.  ;;
2288 clevermous 5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
 
8
$Revision: 6758 $
9
 
2889 turbanoff 10
ERROR_SUCCESS        = 0
11
ERROR_DISK_BASE      = 1
12
ERROR_UNSUPPORTED_FS = 2
13
ERROR_UNKNOWN_FS     = 3
14
ERROR_PARTITION      = 4
15
ERROR_FILE_NOT_FOUND = 5
16
ERROR_END_OF_FILE    = 6
17
ERROR_MEMORY_POINTER = 7
18
ERROR_DISK_FULL      = 8
19
ERROR_FS_FAIL        = 9
20
ERROR_ACCESS_DENIED  = 10
21
ERROR_DEVICE         = 11
5994 pathoswith 22
ERROR_OUT_OF_MEMORY  = 12
2288 clevermous 23
 
6468 pathoswith 24
maxPathLength = 1000h
25
 
2288 clevermous 26
image_of_eax EQU esp+32
27
image_of_ebx EQU esp+20
28
 
6464 pathoswith 29
; System function 70
2288 clevermous 30
 
3296 clevermous 31
file_system_lfn_protected:
32
        pushad
33
        call    protect_from_terminate
34
        call    file_system_lfn
35
        call    unprotect_from_terminate
36
        popad
37
        mov     [image_of_eax], eax
38
        mov     [image_of_ebx], ebx
39
        ret
40
 
2288 clevermous 41
file_system_lfn:
6464 pathoswith 42
; in: ebx -> parameter structure
43
;   operation codes:
44
; 0 = read file
45
; 1 = read folder
46
; 2 = create/rewrite file
47
; 3 = write/append to file
48
; 4 = set file end
49
; 5 = get file info
50
; 6 = set file info
51
; start application
52
; 8 = delete file/folder
53
; 9 = create folder
6468 pathoswith 54
        lea     ebp, [ebx+20]
55
        cmp     byte [ebp], 0
2288 clevermous 56
        jnz     @f
6468 pathoswith 57
        mov     ebp, [ebx+21]
2288 clevermous 58
@@:
6502 pathoswith 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
@@:
6464 pathoswith 72
        cmp     dword[ebx], 7   ; start application
6502 pathoswith 73
        jnz     @f
6333 serge 74
        mov     edx, [ebx+4]
75
        mov     ebx, [ebx+8]
6464 pathoswith 76
        call    fs_execute      ; ebp, ebx, edx
6333 serge 77
        mov     [image_of_eax], eax
78
        ret
6464 pathoswith 79
 
6333 serge 80
@@:
6468 pathoswith 81
        stdcall kernel_alloc, maxPathLength
82
        push    ebx
83
        mov     ebx, ebp
84
        mov     ebp, eax
6502 pathoswith 85
        stdcall get_full_file_name, eax, maxPathLength
6468 pathoswith 86
        pop     ebx
6471 pathoswith 87
        test    eax, eax
88
        jz      .notfound
6502 pathoswith 89
        lea     esi, [ebp+2]
90
        mov     ax, [esi]
6464 pathoswith 91
        or      ax, 2020h
92
        cmp     ax, 'cd'
93
        jz      .CD
94
        call    dyndisk_handler ; not returns if success
95
.notfound:
6468 pathoswith 96
        stdcall kernel_free, ebp
6464 pathoswith 97
        mov     dword[image_of_eax], ERROR_FILE_NOT_FOUND
98
        ret
99
 
100
.CD:
101
        add     esi, 2
102
        xor     eax, eax
103
        lodsb       ; disk number
104
        sub     eax, '0'
105
        cmp     eax, 10
106
        jnc     .notfound
107
        mov     edi, eax
2288 clevermous 108
        lodsb
6464 pathoswith 109
        test    eax, eax
110
        jz      .maindir
2288 clevermous 111
        cmp     al, '/'
6464 pathoswith 112
        jnz     .notfound
113
        lodsb       ; partition number
114
        test    eax, eax
115
        jz      .maindir
116
        cmp     al, '1'
117
        jnz     .notfound
118
        cmp     byte [esi], '/'
119
        jnz     @f
120
        inc     esi
121
@@:
122
        call    reserve_cd
123
        mov     eax, edi
124
        bt      eax, 0
125
        setc    [DiskNumber]
126
        bt      eax, 1
127
        setc    [ChannelNumber]
128
        inc     [ChannelNumber]
129
        inc     eax
130
        mov     [cdpos], eax
131
        call    reserve_cd_channel
132
        mov     eax, edi
133
        not     eax
134
        and     eax, 3
135
        shl     eax, 1
136
        inc     eax
137
        shr     edi, 2
138
        mov     dword[image_of_eax], ERROR_FILE_NOT_FOUND
139
        bt      [edi*5+DRIVE_DATA+1], ax
140
        jnc     @f
141
        mov     ecx, [ebx+12]
142
        mov     edx, [ebx+16]
143
        mov     eax, [ebx]
144
        mov     dword[image_of_eax], ERROR_UNSUPPORTED_FS
145
        cmp     eax, fs_NumCdServices
146
        jae     @f
147
        add     ebx, 4
6611 clevermous 148
        push    ebp
6464 pathoswith 149
        call    dword[fs_CdServices + eax*4]
6611 clevermous 150
        pop     ebp
6464 pathoswith 151
        mov     [image_of_eax], eax
152
        mov     [image_of_ebx], ebx
153
@@:
154
        call    free_cd_channel
155
        and     [cd_status], 0
6468 pathoswith 156
        stdcall kernel_free, ebp
6464 pathoswith 157
        ret
158
 
159
.nextCD:
160
        test    eax, eax    ; partition number
161
        stc
162
        jnz     @f      ; no more partitions
163
        mov     al, 1   ; /cdX/1
164
        clc
165
@@:
166
        ret
167
 
168
.maindir:   ; list partitions
169
        mov     esi, .nextCD
170
.maindir_noesi:     ; backjump from dyndisk_handler
6468 pathoswith 171
        push    ebp
172
        mov     ebp, ecx
173
        call    kernel_free
6464 pathoswith 174
        cmp     dword[ebx], 1
175
        jnz     .access_denied  ; read folder?
6468 pathoswith 176
        push    ebp
177
        pushd   [ebx+4]         ; first block
6464 pathoswith 178
        mov     ebp, [ebx+12]   ; the number of blocks to read
6468 pathoswith 179
        mov     edx, [ebx+16]   ; buffer
2288 clevermous 180
        mov     ebx, [ebx+8]    ; flags
6464 pathoswith 181
        mov     ecx, 32/4
2288 clevermous 182
        mov     edi, edx
6464 pathoswith 183
        xor     eax, eax
2288 clevermous 184
        rep stosd
185
        mov     byte [edx], 1   ; version
186
.maindir_loop:
187
        call    esi
188
        jc      .maindir_done
6464 pathoswith 189
        inc     dword[edx+8]
190
        dec     dword[esp]
2288 clevermous 191
        jns     .maindir_loop
192
        dec     ebp
193
        js      .maindir_loop
6464 pathoswith 194
        inc     dword[edx+4]
195
        mov     dword[edi], 16      ; attributes: folder
196
        mov     dword[edi+4], ebx   ; name encoding
2288 clevermous 197
        push    eax
6464 pathoswith 198
        mov     ecx, 32/4
199
        add     edi, 8
2288 clevermous 200
        xor     eax, eax
201
        rep stosd
202
        pop     eax
6464 pathoswith 203
        push    eax edx edi
204
; convert number in eax to decimal string
2288 clevermous 205
        push    -'0'
206
        mov     ecx, 10
207
@@:
208
        xor     edx, edx
209
        div     ecx
210
        push    edx
211
        test    eax, eax
212
        jnz     @b
6464 pathoswith 213
        cmp     ebx, 1
214
        jz      .uni
2288 clevermous 215
@@:
216
        pop     eax
6464 pathoswith 217
        add     eax, '0'
2288 clevermous 218
        stosb
6464 pathoswith 219
        test    eax, eax
2288 clevermous 220
        jnz     @b
6464 pathoswith 221
        pop     edi edx eax
222
        add     edi, 264
223
        jmp     .maindir_loop
224
 
225
.uni:
226
        pop     eax
227
        add     eax, '0'
228
        stosw
229
        test    eax, eax
230
        jnz     .uni
231
        pop     edi edx eax
2288 clevermous 232
        add     edi, 520
233
        jmp     .maindir_loop
6464 pathoswith 234
 
2288 clevermous 235
.maindir_done:
6464 pathoswith 236
        pop     eax eax
2288 clevermous 237
        mov     ebx, [edx+4]
238
        xor     eax, eax
239
        dec     ebp
240
        js      @f
241
        mov     al, ERROR_END_OF_FILE
242
@@:
243
        mov     [image_of_eax], eax
244
        mov     [image_of_ebx], ebx
245
        ret
6464 pathoswith 246
 
2288 clevermous 247
.access_denied:
6464 pathoswith 248
        mov     dword[image_of_eax], ERROR_ACCESS_DENIED
2288 clevermous 249
        ret
250
 
6464 pathoswith 251
.rootdir:   ; / - virtual root folder
252
        cmp     dword[ebx], 1   ; read folder?
253
        jnz     .access_denied
254
        mov     ebp, [ebx+12]   ; number of blocks
255
        mov     edx, [ebx+16]   ; return area
256
        push    dword[ebx+4]    ; first block
2288 clevermous 257
        mov     ebx, [ebx+8]    ; flags
6464 pathoswith 258
        mov     ecx, 32/4
259
        mov     edi, edx
2288 clevermous 260
        xor     eax, eax
261
        rep stosd
262
        mov     byte [edx], 1   ; version
4277 clevermous 263
        sub     esp, 16
6464 pathoswith 264
.rootdir_loop:
4277 clevermous 265
        push    edi
266
        lea     edi, [esp+4]
267
        call    dyndisk_enum_root
268
        pop     edi
269
        test    eax, eax
6464 pathoswith 270
        jz      .rootdirCD
271
        inc     dword[edx+8]
272
        dec     dword[esp+16]
273
        jns     .rootdir_loop
4277 clevermous 274
        dec     ebp
6464 pathoswith 275
        js      .rootdir_loop
276
        inc     dword[edx+4]
277
        mov     dword[edi], 16      ; attributes: folder
278
        mov     dword[edi+4], ebx   ; name encoding
4277 clevermous 279
        push    eax
6464 pathoswith 280
        mov     ecx, 32/4
281
        add     edi, 8
4277 clevermous 282
        xor     eax, eax
283
        rep stosd
6468 pathoswith 284
        push    edi
285
        lea     esi, [esp+8]
6464 pathoswith 286
        cmp     ebx, 1
287
        jz      .uni2
4277 clevermous 288
@@:
289
        lodsb
290
        stosb
6464 pathoswith 291
        test    eax, eax
4277 clevermous 292
        jnz     @b
6468 pathoswith 293
        pop     edi eax
6464 pathoswith 294
        add     edi, 264
295
        jmp     .rootdir_loop
296
 
297
.uni2:
298
        lodsb
299
        stosw
300
        test    eax, eax
301
        jnz     .uni2
6468 pathoswith 302
        pop     edi eax
4277 clevermous 303
        add     edi, 520
6464 pathoswith 304
        jmp     .rootdir_loop
305
 
306
.rootdirCD:
4277 clevermous 307
        add     esp, 16
6464 pathoswith 308
        or      esi, -1
309
.rootdirCD_loop:
310
        inc     esi
311
        cmp     esi, 10
312
        jnc     .rootdir_done
313
        mov     eax, esi
314
        not     eax
315
        and     eax, 3
316
        shl     eax, 1
317
        inc     eax
318
        mov     ecx, esi
319
        shr     ecx, 2
320
        bt      [ecx*5+DRIVE_DATA+1], ax
321
        jnc     .rootdirCD_loop
322
        inc     dword[edx+8]
323
        dec     dword[esp]
324
        jns     .rootdirCD_loop
2288 clevermous 325
        dec     ebp
6464 pathoswith 326
        js      .rootdirCD_loop
327
        inc     dword[edx+4]
328
        mov     dword[edi], 16      ; attributes: folder
329
        mov     dword[edi+4], ebx   ; name encoding
330
        mov     ecx, 32/4
2288 clevermous 331
        add     edi, 8
6464 pathoswith 332
        xor     eax, eax
2288 clevermous 333
        rep stosd
6464 pathoswith 334
        mov     eax, esi
335
        add     eax, '0'
336
        cmp     ebx, 1
337
        jz      @f
338
        mov     word [edi], 'cd'
339
        mov     [edi+2], ax
340
        add     edi, 264
341
        jmp     .rootdirCD_loop
342
 
2288 clevermous 343
@@:
6464 pathoswith 344
        mov     dword[edi], 640063h
345
        mov     [edi+4], eax
2288 clevermous 346
        add     edi, 520
6464 pathoswith 347
        jmp     .rootdirCD_loop
348
 
349
.rootdir_done:
2288 clevermous 350
        pop     eax
351
        mov     ebx, [edx+4]
352
        xor     eax, eax
353
        dec     ebp
354
        js      @f
355
        mov     al, ERROR_END_OF_FILE
356
@@:
357
        mov     [image_of_eax], eax
358
        mov     [image_of_ebx], ebx
359
        ret
360
 
4700 mario79 361
;-----------------------------------------------------------------------------
2288 clevermous 362
process_replace_file_name:
6464 pathoswith 363
; in: [esi] = virtual path
364
; out: [esi]+[ebp] = physical path
3689 mario79 365
        xor     edi, edi
6471 pathoswith 366
        xor     ebp, ebp
2288 clevermous 367
.loop:
3711 clevermous 368
        cmp     edi, [full_file_name_table.size]
3689 mario79 369
        jae     .notfound
2288 clevermous 370
        push    esi edi
6464 pathoswith 371
        shl     edi, 7
6471 pathoswith 372
        add     edi, [full_file_name_table]
2288 clevermous 373
@@:
6464 pathoswith 374
        cmp     byte [edi], 0
2288 clevermous 375
        jz      .dest_done
376
        lodsb
377
        test    al, al
378
        jz      .cont
6464 pathoswith 379
        or      al, 20h
2288 clevermous 380
        scasb
381
        jz      @b
6464 pathoswith 382
.cont:
383
        pop     edi esi
384
        inc     edi
385
        jmp     .loop
386
 
2288 clevermous 387
.dest_done:
388
        cmp     byte [esi], 0
389
        jz      .found
390
        cmp     byte [esi], '/'
391
        jnz     .cont
392
.found:
393
        pop     edi eax
6464 pathoswith 394
        shl     edi, 7
6471 pathoswith 395
        add     edi, [full_file_name_table]
2288 clevermous 396
        mov     ebp, esi
397
        lea     esi, [edi+64]
398
.notfound:
399
        ret
6464 pathoswith 400
 
3689 mario79 401
;-----------------------------------------------------------------------------
3663 mario79 402
uglobal
6471 pathoswith 403
addDirSeal db  ?
3663 mario79 404
endg
6338 serge 405
 
6464 pathoswith 406
sys_current_directory:  ; sysfunction 30
2288 clevermous 407
        mov     eax, [current_slot]
408
        mov     edi, [eax+APPDATA.cur_dir]
409
        dec     ebx
410
        jz      .set
411
        dec     ebx
412
        jz      .get
3663 mario79 413
        dec     ebx
414
        jz      .mount_additional_directory
6471 pathoswith 415
        dec     ebx
416
        jz      .get16
417
@@:
2288 clevermous 418
        ret
3663 mario79 419
 
420
.mount_additional_directory:
6464 pathoswith 421
; in: ecx -> dir name+dir path (128)
6471 pathoswith 422
        mov     al, 1
423
        xchg    [addDirSeal], al
424
        test    al, al
425
        jnz     @b
3663 mario79 426
        mov     esi, ecx
427
        mov     edi, sysdir_name1
428
        mov     ecx, 63
6464 pathoswith 429
        rep movsb   ; copying fake directory name
3663 mario79 430
        inc     esi
431
        xor     eax, eax
6464 pathoswith 432
        stosb       ; terminator of name, in case if we get the inlet trash
6471 pathoswith 433
        mov     cl, 63
434
        cmp     word [esi], 2
435
        jz      .utf16
436
        call    cp866toUTF8_string
437
@@:
438
        mov     byte [edi], 0
3663 mario79 439
        mov     [full_file_name_table.size], 2
440
        ret
6338 serge 441
 
6471 pathoswith 442
.utf16:
443
        add     esi, 2
444
        call    UTF16to8_string
445
        jmp     @b
446
 
6464 pathoswith 447
.get:       ; in: ecx -> buffer, edx = length
6471 pathoswith 448
        mov     esi, edi
6534 pathoswith 449
        inc     esi
6471 pathoswith 450
        mov     edi, ecx
451
        cmp     edx, maxPathLength
452
        jc      @f
453
        mov     edx, maxPathLength
2288 clevermous 454
@@:
455
        mov     ecx, edx
6471 pathoswith 456
@@:
457
        dec     ecx
458
        js      @f
459
        call    utf8to16
460
        call    uni2ansi_char
461
        stosb
462
        test    al, al
463
        jnz     @b
464
        sub     edx, ecx
465
        mov     ecx, edx
466
@@:
467
        mov     [esp+32], ecx
2288 clevermous 468
        ret
469
 
6471 pathoswith 470
.get16:
471
        mov     esi, edi
6534 pathoswith 472
        inc     esi
6471 pathoswith 473
        mov     edi, ecx
474
        cmp     edx, maxPathLength
475
        jc      @f
476
        mov     edx, maxPathLength
477
@@:
478
        shr     edx, 1
479
        mov     ecx, edx
480
@@:
481
        dec     ecx
482
        js      @f
483
        call    utf8to16
484
        stosw
485
        test    ax, ax
486
        jnz     @b
487
        sub     edx, ecx
488
        mov     ecx, edx
489
@@:
490
        mov     [esp+32], ecx
2288 clevermous 491
        ret
6464 pathoswith 492
 
2288 clevermous 493
.set:
6464 pathoswith 494
        pop     eax
6468 pathoswith 495
        push    maxPathLength
6464 pathoswith 496
        push    edi
497
        push    eax
2288 clevermous 498
        mov     ebx, ecx
499
get_full_file_name:
6464 pathoswith 500
; in: ebx -> file name, [esp+4] -> destination, [esp+8] = max length
6502 pathoswith 501
; out: UTF-8 string, eax=0 -> out of length
6471 pathoswith 502
        push    ebp ebx
6502 pathoswith 503
        cmp     byte [ebx], 0
504
        jz      .set_relative
6471 pathoswith 505
        mov     esi, ebx
6502 pathoswith 506
        cmp     byte [ebx], 4
507
        jnc     @f
6471 pathoswith 508
        inc     esi
509
@@:
510
        cmp     byte [esi], '/'
6468 pathoswith 511
        jnz     .set_relative
6471 pathoswith 512
        inc     esi
6758 pathoswith 513
        cmp     byte [esi], 4
514
        jnc     @f
515
        mov     ebx, esi
516
        inc     esi
517
        cmp     byte [esi], '/'
518
        jnz     .start
519
        inc     esi
520
@@:
6471 pathoswith 521
        cmp     byte [ebx], 2
6758 pathoswith 522
        jnz     .start
6471 pathoswith 523
        inc     esi
6758 pathoswith 524
.start:
6468 pathoswith 525
        call    process_replace_file_name
6471 pathoswith 526
        mov     edi, [esp+12]
527
        mov     ecx, [esp+16]
6502 pathoswith 528
        mov     al, 3
529
        mov     ah, '/'
530
        stosw
531
        sub     ecx, 2
6471 pathoswith 532
        test    ebp, ebp
533
        jz      .absolute
534
@@:
6468 pathoswith 535
        lodsb
536
        stosb
6471 pathoswith 537
        dec     ecx
6468 pathoswith 538
        test    al, al
6471 pathoswith 539
        jnz     @b
540
        mov     esi, ebp
6468 pathoswith 541
        dec     edi
6471 pathoswith 542
.absolute:
543
        cmp     byte [ebx], 2
6502 pathoswith 544
        jz      .utf16
545
        cmp     byte [ebx], 3
546
        jz      .utf8
6471 pathoswith 547
        call    cp866toUTF8_string
548
        jns     .ret
549
        jmp     .fail
550
 
6502 pathoswith 551
.utf8:
552
        dec     ecx
553
        js      .fail
554
        lodsb
555
        stosb
556
        test    al, al
557
        jz      .ret
558
        jmp     .utf8
559
 
560
.utf16:
6471 pathoswith 561
        call    UTF16to8_string
562
        jns     .ret
6468 pathoswith 563
.fail:
564
        mov     byte [edi], 0
565
        xor     eax, eax
6471 pathoswith 566
        pop     ebx ebp
6468 pathoswith 567
        ret     8
568
 
569
.set_relative:
570
        mov     edi, [current_slot]
571
        mov     edi, [edi+APPDATA.cur_dir]
572
        mov     edx, edi
6471 pathoswith 573
        mov     ecx, [esp+16]
6468 pathoswith 574
        xor     eax, eax
575
        repnz scasb
576
        mov     esi, edi
577
        dec     esi
6471 pathoswith 578
        mov     edi, [esp+12]
6468 pathoswith 579
        jecxz   .fail
6502 pathoswith 580
        cmp     byte [ebx], 0
581
        jz      .set_ok
582
        cmp     byte [ebx], 4
583
        jnc     .relative
584
        inc     ebx
585
        cmp     byte [ebx-1], 2
6471 pathoswith 586
        jz      .relative16
2288 clevermous 587
.relative:
588
        cmp     byte [ebx], 0
589
        jz      .set_ok
590
        cmp     word [ebx], '.'
591
        jz      .set_ok
592
        cmp     word [ebx], './'
6471 pathoswith 593
        jz      .next
2288 clevermous 594
        cmp     word [ebx], '..'
595
        jnz     .doset_relative
596
        cmp     byte [ebx+2], 0
597
        jz      @f
598
        cmp     byte [ebx+2], '/'
599
        jnz     .doset_relative
6471 pathoswith 600
        inc     ebx
2288 clevermous 601
@@:
602
        dec     esi
603
        cmp     byte [esi], '/'
604
        jnz     @b
6471 pathoswith 605
.next:
606
        add     ebx, 2
2288 clevermous 607
        jmp     .relative
6464 pathoswith 608
 
2288 clevermous 609
.set_ok:
6471 pathoswith 610
        cmp     edx, edi    ; is destination equal to cur_dir?
6468 pathoswith 611
        jz      @f
2288 clevermous 612
        mov     ecx, esi
6468 pathoswith 613
        sub     ecx, edx
2288 clevermous 614
        mov     esi, edx
615
        rep movsb
616
        mov     byte [edi], 0
6471 pathoswith 617
.ret:
6464 pathoswith 618
        mov     al, 1
6471 pathoswith 619
        pop     ebx ebp
2288 clevermous 620
        ret     8
6464 pathoswith 621
 
6468 pathoswith 622
@@:
2288 clevermous 623
        mov     byte [esi], 0
6471 pathoswith 624
        jmp     .ret
6464 pathoswith 625
 
2288 clevermous 626
.doset_relative:
6471 pathoswith 627
        cmp     edx, edi    ; is destination equal to cur_dir?
628
        mov     edi, esi
629
        jz      @f
630
        mov     edi, [esp+12]
2288 clevermous 631
        mov     ecx, esi
6468 pathoswith 632
        sub     ecx, edx
2288 clevermous 633
        mov     esi, edx
634
        mov     edx, edi
635
        rep movsb
6471 pathoswith 636
@@:
2288 clevermous 637
        mov     byte [edi], '/'
638
        inc     edi
6471 pathoswith 639
        mov     esi, ebx
640
        mov     ecx, edx
641
        add     ecx, [esp+16]
642
        sub     ecx, edi
643
        mov     ebx, [esp]
644
        jmp     .absolute
645
 
646
.relative16:
647
        cmp     word [ebx], 0
648
        jz      .set_ok
649
        cmp     word [ebx], '.'
650
        jnz     .doset_relative
651
        cmp     word [ebx+2], 0
652
        jz      .set_ok
653
        cmp     word [ebx+2], '/'
654
        jz      .next16
655
        cmp     word [ebx+2], '.'
656
        jnz     .doset_relative
657
        cmp     word [ebx+4], 0
658
        jz      @f
659
        cmp     word [ebx+4], '/'
660
        jnz     .doset_relative
661
        add     ebx, 2
2288 clevermous 662
@@:
6471 pathoswith 663
        dec     esi
664
        cmp     byte [esi], '/'
665
        jnz     @b
666
.next16:
667
        add     ebx, 4
668
        jmp     .relative16
6464 pathoswith 669
 
6462 pathoswith 670
include "parse_fn.inc"
671
include "fs_common.inc"
672
include "iso9660.inc"   ; read for CD filesystem
673
include "fat.inc"
674
include "ntfs.inc"
675
include "ext.inc"
6503 pathoswith 676
; include "xfs.asm"
677
 
678
xfs_create_partition:
679
        xor     eax, eax
680
        ret