Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6019 → Rev 5994

/kernel/trunk/fs/ntfs.inc
46,10 → 46,9
nonResidentFlag = 8
nameLength = 9
nameOffset = 10
attributeFlags = 12
attributeID = 14
sizeWithoutHeader = 16
indexedFlag = 16h
attributeFlags = 16h
; non resident attribute header
lastVCN = 18h
dataRunsOffset = 20h
273,6 → 272,10
mov dword [eax+NTFS.FirstSector], ecx
mov ecx, dword [ebp+PARTITION.FirstSector+4]
mov dword [eax+NTFS.FirstSector+4], ecx
mov ecx, dword [ebp+PARTITION.Length]
mov dword [eax+NTFS.Length], ecx
mov ecx, dword [ebp+PARTITION.Length+4]
mov dword [eax+NTFS.Length+4], ecx
mov ecx, [ebp+PARTITION.Disk]
mov [eax+NTFS.Disk], ecx
mov [eax+NTFS.FSUserFunctions], ntfs_user_functions
1162,14 → 1165,6
ret
 
ntfs_decode_mcb_entry:
; in:
; esi -> mcb entry
; esp -> buffer (16 bytes)
; out:
; esi -> next mcb entry
; esp -> data run size
; esp+8 -> cluster (delta)
; CF=0 -> mcb end
push eax ecx edi
lea edi, [esp+16]
xor eax, eax
1994,7 → 1989,7
cmp byte [esi], 0
jnz @f
xor ebx, ebx
movi eax, ERROR_ACCESS_DENIED
movi eax, ERROR_ACCESS_DENIED ; root directory itself
ret
@@: ; 1. Search file
call ntfs_lock
2001,50 → 1996,57
stdcall ntfs_find_lfn, [esp+4]
jnc .found
cmp [ebp+NTFS.ntfsFragmentCount], 1
jnz ntfsUnsupported ; record fragmented
jnz @f ; record fragmented
test eax, eax
jz ntfsFail
jmp .notFound
jnz .notFound
push ERROR_FS_FAIL
jmp ntfsError
@@:
push ERROR_UNSUPPORTED_FS
jmp ntfsError
 
.found: ; rewrite
cmp [ebp+NTFS.ntfs_cur_iRecord], 16
jc ntfsDenied
cmp [ebp+NTFS.ntfsFolder], 1
jz ntfsDenied
mov [ebp+NTFS.ntfs_cur_attr], 0x80
mov [ebp+NTFS.ntfs_cur_offs], 0
mov [ebp+NTFS.ntfs_cur_size], 0
call ntfs_read_attr
jc ntfsDenied
jnc @f
push ERROR_ACCESS_DENIED
jmp ntfsError
@@:
push ERROR_UNSUPPORTED_FS
mov eax, [ebp+NTFS.frs_buffer]
cmp word [eax+baseRecordReuse], 0
jnz ntfsUnsupported ; auxiliary record
jnz ntfsError ; auxiliary record
cmp byte [eax+hardLinkCounter], 1
jnz ntfsUnsupported ; file copying required
jnz ntfsError ; file copying required
mov ecx, [ebp+NTFS.ntfs_attr_offs]
cmp byte [ecx+nonResidentFlag], 1
jnz ntfsUnsupported ; resident $DATA
jnz ntfsError ; resident $DATA
mov eax, [ebx+4]
mov edx, [ebx+8]
add eax, [ebx+12]
adc edx, 0
cmp edx, [ecx+attributeRealSize+4]
jnz ntfsUnsupported
jnz ntfsError
cmp [ecx+attributeRealSize], eax
jnz ntfsUnsupported
jnz ntfsError
jmp ntfs_WriteFile.write
 
.notFound: ; create; check path folders
.notFound: ; create; check name
cmp dword [esp+4], 0
jnz ntfsNotFound
jnz .bad
cmp byte [esi], 0
jz ntfsNotFound
; 2. Prepare directory record
jnz @f
.bad: ; path folder not found
push ERROR_FILE_NOT_FOUND
jmp ntfsError
@@: ; 2. Prepair directory record
mov ecx, esi
@@: ; count characters
inc ecx
cmp byte [ecx], '/'
jz ntfsNotFound
jz .bad
cmp byte [ecx], 0
jnz @b
sub ecx, esi
2055,15 → 2057,16
mov edi, [ebp+NTFS.cur_index_buf]
push esi
push ecx
cmp dword [edi], 'INDX'
cmp dword [edi], 'INDX' ; where are we?
jz .indexRecord
mov esi, [ebp+NTFS.frs_buffer] ; indexRoot
mov esi, [ebp+NTFS.frs_buffer] ; mftRecord
mov edx, [esi+recordRealSize]
add edx, ecx
cmp [esi+recordAllocatedSize], edx
jnc @f
add esp, 12
jmp ntfsUnsupported ; indexAllocation required
push ERROR_UNSUPPORTED_FS ; indexAllocation required
jmp ntfsError
@@: ; index fits in the indexRoot
mov [esi+recordRealSize], edx
mov ecx, edx
2075,7 → 2078,7
mov esi, [esp]
add [edi+sizeWithHeader], esi
add [edi+sizeWithoutHeader], esi
mov cl, [edi+attributeOffset]
mov cx, [edi+attributeOffset]
add edi, ecx
add [edi+16+nodeRealSize], esi
add [edi+16+nodeAllocatedSize], esi
2087,15 → 2090,16
jmp .common
 
.indexRecord:
mov edx, [edi+28]
mov edx, [edi+1ch]
add edx, ecx
cmp [edi+32], edx
cmp [edi+20h], edx
jnc @f
add esp, 12
jmp ntfsUnsupported ; new node required
push ERROR_UNSUPPORTED_FS ; new node required
jmp ntfsError
@@: ; index fits in the node
mov [edi+28], edx
lea edi, [edi+edx+24-4]
mov [edi+1ch], edx
lea edi, [edi+edx+14h]
.common:
mov esi, edi
sub esi, [esp]
2163,10 → 2167,12
jz .small
push eax ; bitmap dwords
add edi, 4
xor edx, edx
.start:
mov ecx, [ebp+NTFS.BitmapSize]
add ecx, [ebp+NTFS.BitmapBuffer]
sub ecx, edi
mov eax, edi
sub eax, [ebp+NTFS.BitmapBuffer]
sub ecx, eax
shr ecx, 2
@@:
xor eax, eax
2188,7 → 2194,6
jnz .start
sub esi, 4
mov eax, [esi]
xor edx, edx
bsr edx, eax
inc edx
push edx ; starting bit
2269,34 → 2274,36
mov [esp+4], ecx
@@:
mov edi, [esp]
xor eax, eax
dec eax
shr eax, cl
shl eax, cl
mov esi, [ebp+NTFS.fileDataSize]
mov edx, [edi]
ror edx, cl
neg ecx
add ecx, 32
sub ecx, [ebp+NTFS.fileDataSize]
jc @f
shl eax, cl ; fits inside dword
shr eax, cl
or [edi], eax
mov eax, -1
sub esi, ecx
jnc @f
mov esi, ecx ; fits inside
mov ecx, [ebp+NTFS.fileDataSize]
shrd edx, eax, cl
sub esi, ecx
mov ecx, esi
ror edx, cl
mov [edi], edx
jmp .writeData
 
@@:
or [edi], eax
neg ecx
push ecx
shrd edx, eax, cl
mov [edi], edx
mov ecx, esi
shr ecx, 5
add edi, 4
xor eax, eax
dec eax
rep stosd
pop ecx
mov ecx, esi
and ecx, 31
shr eax, cl
shl eax, cl
not eax
or [edi], eax
mov edx, [edi]
shr edx, cl
shld edx, eax, cl
mov [edi], edx
.writeData:
pop edx
sub edx, [ebp+NTFS.BitmapBuffer]
2312,7 → 2319,10
mov ebx, [ebx+16]
call fs_write64_app
test eax, eax
jnz ntfsDevice
jz .mftBitmap
push ERROR_DEVICE
jmp ntfsError
 
; 4. MFT record
.mftBitmap: ; search for free record
mov edi, [ebp+NTFS.mftBitmapBuffer]
2325,8 → 2335,13
movzx eax, byte [edi]
not al
bsf ecx, eax
jz ntfsUnsupported ; no free records
bts [edi], ecx
jnz @f
push ERROR_UNSUPPORTED_FS ; no free records
jmp ntfsError
@@: ; mark record
mov al, [edi]
bts eax, ecx
mov [edi], al
; get record location
sub edi, [ebp+NTFS.mftBitmapBuffer]
shl edi, 3
2347,8 → 2362,9
; extend MFT $DATA
mov eax, [ebp+NTFS.mft_cluster]
mul [ebp+NTFS.sectors_per_cluster]
push ERROR_UNSUPPORTED_FS
cmp eax, [ebp+NTFS.ntfsLastRead]
jnz ntfsUnsupported ; auxiliary record
jnz ntfsError ; auxiliary record
mov edi, [ebp+NTFS.ntfs_attr_offs]
mov ebx, [ebp+NTFS.sectors_per_cluster]
shl ebx, 9+3
2359,9 → 2375,8
adc byte [edi+attributeRealSize+4], 0
add [edi+initialDataSize], ebx
adc byte [edi+initialDataSize+4], 0
movzx eax, byte [edi+dataRunsOffset]
add edi, eax
mov al, [edi]
add edi, [edi+dataRunsOffset]
movzx eax, byte [edi]
inc edi
shl eax, 4
shr al, 4
2371,13 → 2386,13
add ah, al
shr eax, 8
cmp byte [edi+eax], 0
jnz ntfsUnsupported ; $MFT fragmented
jnz ntfsError ; $MFT fragmented
mov al, 8
mov edx, [edi]
rol eax, cl
rol edx, cl
add eax, edx
jc ntfsUnsupported
jc ntfsError
ror eax, cl
shr edx, cl
mov [edi], eax
2390,13 → 2405,15
mov ax, [edx]
shr ax, cl
test al, al
jnz ntfsUnsupported
jnz ntfsError
dec al
xchg [edx], al
mov [edx+1], al
pop eax
push ERROR_OUT_OF_MEMORY
stdcall kernel_alloc, ebx
test eax, eax
jz ntfsNoMemory
jz ntfsError
mov ecx, ebx
shr ecx, 2
mov edi, eax
2410,6 → 2427,8
shr ecx, 9
call fs_write64_sys ; clear new records
stdcall kernel_free, ebx
pop eax
push ERROR_DEVICE
mov eax, esi
shr eax, 3+9
mov ebx, eax
2420,12 → 2439,12
xor edx, edx
call fs_write64_app ; partition bitmap
test eax, eax
jnz ntfsDevice
jnz ntfsError
mov eax, [ebp+NTFS.frs_buffer]
mov [ebp+NTFS.ntfs_cur_buf], eax
call writeRecord ; $MFT
test eax, eax
jnz ntfsDevice
jnz ntfsError
mov eax, [ebp+NTFS.mftmirr_cluster]
mul [ebp+NTFS.sectors_per_cluster]
mov ebx, [ebp+NTFS.frs_buffer]
2433,7 → 2452,8
dec ecx
call fs_write64_sys ; $MFTMirr
test eax, eax
jnz ntfsDevice
jnz ntfsError
pop eax
mov eax, [ebp+NTFS.ntfs_cur_offs]
add [ebp+NTFS.ntfsLastRead], eax
.mftRecord:
2473,7 → 2493,7
add ecx, 8
mov [edi+sizeWithHeader], ecx
mov byte [edi+attributeOffset], 18h
mov byte [edi+indexedFlag], 1
mov byte [edi+attributeFlags], 1
add edi, 18h
add esi, 16
sub ecx, 18h
2516,17 → 2536,19
mov byte [edi+attributeOffset], 20h
mov dword[edi+18h], 490024h ; unicode $I30
mov dword[edi+18h+4], 300033h
mov byte [edi+20h+attributeType], 30h
mov byte [edi+20h+collationRule], 1
add edi, 20h
mov byte [edi+attributeType], 30h
mov byte [edi+collationRule], 1
mov eax, [ebp+NTFS.sectors_per_cluster]
shl eax, 9
mov [edi+20h+indexRecordSize], eax
mov byte [edi+20h+indexRecordSizeClus], 1
mov byte [edi+30h+indexOffset], 16
mov byte [edi+30h+nodeRealSize], 32
mov byte [edi+30h+nodeAllocatedSize], 32
mov byte [edi+40h+indexAllocatedSize], 16
mov byte [edi+40h+indexFlags], 2
mov [edi+indexRecordSize], eax
mov byte [edi+indexRecordSizeClus], 1
mov byte [edi+16+indexOffset], 16
mov byte [edi+16+nodeRealSize], 32
mov byte [edi+16+nodeAllocatedSize], 32
mov byte [edi+32+indexAllocatedSize], 16
mov byte [edi+32+indexFlags], 2
sub edi, 20h
mov al, 3
.writeMftRecord:
mov byte [edi+sizeWithHeader], 50h
2537,7 → 2559,10
mov [ebp+NTFS.ntfs_cur_buf], edi
call writeRecord
test eax, eax
jnz ntfsDevice
jz @f
push ERROR_DEVICE
jmp ntfsError
@@:
mov esi, [ebp+PARTITION.Disk]
call disk_sync
; write MFT bitmap
2551,8 → 2576,10
xor edx, edx
call fs_write64_sys
test eax, eax
jnz ntfsDevice
; 5. Write partition bitmap
jz @f
push ERROR_DEVICE
jmp ntfsError
@@: ; 5. Write partition bitmap
cmp [ebp+NTFS.ntfsFolder], 0
jnz @f
cmp [ebp+NTFS.fileRealSize], 0
2571,7 → 2598,9
xor edx, edx
call fs_write64_app
test eax, eax
jnz ntfsDevice
jz @f
push ERROR_DEVICE
jmp ntfsError
@@:
mov esi, [ebp+PARTITION.Disk]
call disk_sync
2584,14 → 2613,12
mov eax, [ebp+NTFS.cur_index_buf]
mov [ebp+NTFS.ntfs_cur_buf], eax
call writeRecord
test eax, eax
jnz ntfsDevice
mov ebx, [ebp+NTFS.fileRealSize]
ntfsDone:
push eax
mov esi, [ebp+PARTITION.Disk]
call disk_sync
call ntfs_unlock
xor eax, eax
pop eax
mov ebx, [ebp+NTFS.fileRealSize]
ret
 
writeRecord:
2624,8 → 2651,6
bitmapBuffering:
; Extend BitmapBuffer and read next 32kb of bitmap
; Warning: $Bitmap fragmentation is not foreseen
; if edi -> position in bitmap buffer,
; then ecx = number of buffered dwords left
push ebx
mov eax, [ebp+NTFS.BitmapTotalSize]
cmp eax, [ebp+NTFS.BitmapSize]
2655,8 → 2680,9
mov [ebp+NTFS.BitmapSize], eax
@@:
mov ecx, [ebp+NTFS.BitmapSize]
add ecx, [ebp+NTFS.BitmapBuffer]
sub ecx, edi
mov eax, edi
sub eax, [ebp+NTFS.BitmapBuffer]
sub ecx, eax
shr ecx, 2
pop ebx
ret
2669,7 → 2695,7
.end:
add esp, 12 ; double ret
push ERROR_DISK_FULL
jmp ntfsOut
jmp ntfsError
 
;----------------------------------------------------------------
ntfs_WriteFile:
2681,24 → 2707,27
@@:
call ntfs_lock
stdcall ntfs_find_lfn, [esp+4]
jc ntfsNotFound
cmp [ebp+NTFS.ntfs_cur_iRecord], 16
jc ntfsDenied
jnc .found
push ERROR_FILE_NOT_FOUND
jmp ntfsError
.found:
mov [ebp+NTFS.ntfs_cur_attr], 0x80
mov [ebp+NTFS.ntfs_cur_offs], 0
mov [ebp+NTFS.ntfs_cur_size], 0
call ntfs_read_attr
jc ntfsDenied
jnc @f
push ERROR_ACCESS_DENIED
jmp ntfsError
@@:
push ERROR_UNSUPPORTED_FS
mov eax, [ebp+NTFS.frs_buffer]
cmp word [eax+baseRecordReuse], 0
jnz ntfsUnsupported ; auxiliary record
jnz ntfsError ; auxiliary record
cmp byte [eax+hardLinkCounter], 1
jnz ntfsUnsupported ; file copying required
jnz ntfsError ; file copying required
mov ecx, [ebp+NTFS.ntfs_attr_offs]
cmp byte [ecx+nonResidentFlag], 1
jnz ntfsUnsupported ; resident $DATA
cmp word [ecx+attributeFlags], 0
jnz ntfsUnsupported
jnz ntfsError ; resident $DATA
mov eax, [ebx+4]
mov edx, [ebx+8]
add eax, [ebx+12]
2705,10 → 2734,12
adc edx, 0
cmp edx, [ecx+attributeRealSize+4]
jc .write
jnz ntfsUnsupported ; end of file
jnz ntfsError ; end of file
cmp [ecx+attributeRealSize], eax
jc ntfsUnsupported
jc ntfsError
.write:
pop eax
push ERROR_DEVICE
mov eax, [ebx+4]
mov edx, [ebx+8]
mov ecx, [ebx+12]
2721,7 → 2752,7
lea edi, [ebp+NTFS.ntfs_bitmap_buf]
mov [ebp+NTFS.ntfs_cur_buf], edi
call ntfs_read_attr.continue
jc ntfsDevice
jc ntfsError
mov eax, [ebx+4]
and eax, 1FFh
add edi, eax
2743,7 → 2774,7
pop ebx
pop ecx
test eax, eax
jnz ntfsDevice
jnz ntfsError
test ecx, ecx
jz @f
mov eax, [ebx+4]
2763,7 → 2794,7
mov [ebp+NTFS.ntfsWriteAttr], 0
pop [ebp+NTFS.ntfs_cur_offs]
pop ecx
jc ntfsDevice
jc ntfsError
and ecx, 1FFh
jz @f
add esi, [ebp+NTFS.ntfs_cur_read]
2771,7 → 2802,7
lea edi, [ebp+NTFS.ntfs_bitmap_buf]
mov [ebp+NTFS.ntfs_cur_buf], edi
call ntfs_read_attr.continue
jc ntfsDevice
jc ntfsError
rep movsb
push ebx
mov eax, [ebp+NTFS.ntfsLastRead]
2780,216 → 2811,20
xor edx, edx
call fs_write64_app
pop ebx
test eax, eax
jnz ntfsDevice
@@:
mov esi, [ebp+PARTITION.Disk]
call disk_sync
call ntfs_unlock
pop eax
xor eax, eax
mov ebx, [ebx+12]
jmp ntfsDone
 
;----------------------------------------------------------------
ntfs_Delete:
cmp byte [esi], 0
jnz @f
xor ebx, ebx
movi eax, ERROR_ACCESS_DENIED
ret
@@:
call ntfs_lock
stdcall ntfs_find_lfn, [esp+4]
jc ntfsNotFound
cmp [ebp+NTFS.ntfs_cur_iRecord], 16
jc ntfsDenied
cmp [ebp+NTFS.ntfsFragmentCount], 1
jnz ntfsUnsupported ; record fragmented
test byte [eax+indexFlags], 1
jnz ntfsUnsupported ; index has a subnode
mov edx, [ebp+NTFS.ntfs_cur_iRecord]
shr edx, 3
cmp edx, [ebp+NTFS.mftBitmapSize]
jnc ntfsUnsupported
; delete index from the node
movzx edx, word [eax+indexAllocatedSize]
mov edi, [ebp+NTFS.cur_index_buf]
cmp dword [edi], 'INDX'
jz .indexRecord
mov esi, [ebp+NTFS.frs_buffer] ; indexRoot
mov ecx, [esi+recordRealSize]
shr ecx, 2
rep movsd
mov esi, [ebp+NTFS.cur_index_buf]
mov edi, [ebp+NTFS.ntfs_attr_offs]
sub edi, [ebp+NTFS.frs_buffer]
add edi, esi
sub [edi+sizeWithHeader], edx
sub [edi+sizeWithoutHeader], edx
mov cl, [edi+attributeOffset]
add edi, ecx
sub [edi+16+nodeRealSize], edx
sub [edi+16+nodeAllocatedSize], edx
sub eax, esi
add eax, edi
sub [esi+recordRealSize], edx
mov ecx, [esi+recordRealSize]
jmp @f
 
.indexRecord:
sub [edi+28], edx
mov ecx, [edi+28]
add ecx, 24
@@:
add ecx, [ebp+NTFS.cur_index_buf]
sub ecx, eax
shr ecx, 2
mov esi, eax
add esi, edx
mov edi, eax
rep movsd
mov eax, [ebp+NTFS.ntfsLastRead]
mov [ebp+NTFS.nodeLastRead], eax
; examine file record
mov [ebp+NTFS.ntfs_cur_attr], 0x80
mov [ebp+NTFS.ntfs_cur_offs], 0
mov [ebp+NTFS.ntfs_cur_size], 0
call ntfs_read_attr
jc .folder
mov esi, [ebp+NTFS.frs_buffer]
cmp word [esi+baseRecordReuse], 0
jnz ntfsUnsupported ; auxiliary record
cmp byte [esi+hardLinkCounter], 2
jnc .writeFileRecord ; delete hard link
mov esi, [ebp+NTFS.ntfs_attr_offs]
cmp byte [esi+nonResidentFlag], 0
jz .writeBitmapMFT
movzx eax, byte [esi+dataRunsOffset]
add esi, eax
xor edi, edi
sub esp, 16
.clearBitmap: ; "delete" file data
call ntfs_decode_mcb_entry
jnc .mcbEnd
cmp dword[esp+8], 0
jz .clearBitmap
add edi, [esp+8]
mov ebx, [esp]
mov eax, edi
add eax, ebx
shr eax, 3
inc eax
cmp eax, [ebp+NTFS.BitmapSize]
jc .buffered
add eax, [ebp+NTFS.BitmapBuffer]
add esp, 16
push edi
mov edi, eax
@@:
call bitmapBuffering
shl ecx, 2
js @b
pop edi
sub esp, 16
.buffered:
push edi
mov ecx, edi
shr edi, 5
shl edi, 2
add edi, [ebp+NTFS.BitmapBuffer]
and ecx, 31
xor eax, eax
dec eax
shr eax, cl
shl eax, cl
neg ecx
add ecx, 32
sub ecx, ebx
jc @f
shl eax, cl ; fits inside dword
shr eax, cl
not eax
and [edi], eax
jmp .writeBitmap
 
@@:
not eax
and [edi], eax
neg ecx
push ecx
shr ecx, 5
add edi, 4
xor eax, eax
rep stosd
pop ecx
and ecx, 31
dec eax
shr eax, cl
shl eax, cl
and [edi], eax
.writeBitmap:
pop edi
mov ecx, edi
add ecx, ebx
add ecx, 4095
shr ecx, 3+9
mov eax, edi
shr eax, 3+9
sub ecx, eax
mov ebx, eax
shl ebx, 9
add eax, [ebp+NTFS.BitmapLocation]
add ebx, [ebp+NTFS.BitmapBuffer]
xor edx, edx
call fs_write64_app
jmp .clearBitmap
 
.mcbEnd:
add esp, 16
jmp .writeBitmapMFT
 
.folder: ; empty?
lea esi, [ebp+NTFS.ntfs_bitmap_buf]
mov [ebp+NTFS.ntfs_cur_buf], esi
mov [ebp+NTFS.ntfs_cur_attr], 0x90
mov [ebp+NTFS.ntfs_cur_offs], 0
mov [ebp+NTFS.ntfs_cur_size], 1
call ntfs_read_attr
cmp [ebp+NTFS.ntfs_cur_read], 48
jnz ntfsDenied
test byte [esi+32+indexFlags], 1
jnz ntfsDenied
.writeBitmapMFT: ; "delete" file record
mov eax, [ebp+NTFS.ntfs_cur_iRecord]
mov ecx, eax
shr eax, 3
and ecx, 7
mov edi, [ebp+NTFS.mftBitmapBuffer]
btr [edi+eax], ecx
shr eax, 9
mov ebx, eax
shl ebx, 9
add eax, [ebp+NTFS.mftBitmapLocation]
add ebx, edi
mov ecx, 1
xor edx, edx
call fs_write64_sys
mov esi, [ebp+NTFS.frs_buffer]
mov byte [esi+recordFlags], 0
.writeFileRecord:
dec byte [esi+hardLinkCounter]
mov [ebp+NTFS.ntfs_cur_buf], esi
call writeRecord
; write directory node
mov eax, [ebp+NTFS.nodeLastRead]
mov [ebp+NTFS.ntfsLastRead], eax
mov eax, [ebp+NTFS.cur_index_buf]
mov [ebp+NTFS.ntfs_cur_buf], eax
call writeRecord
test eax, eax
jz ntfsDone
jmp ntfsDevice
 
;----------------------------------------------------------------
ntfs_SetFileEnd:
ntfs_SetFileInfo:
movi eax, ERROR_UNSUPPORTED_FS
ntfs_Delete:
mov eax, ERROR_UNSUPPORTED_FS
ret
 
;----------------------------------------------------------------
3002,9 → 2837,12
call ntfs_lock
stdcall ntfs_find_lfn, [esp+4]
jnc .found
push ERROR_FILE_NOT_FOUND
test eax, eax
jz ntfsFail
jmp ntfsNotFound
jnz ntfsError
pop eax
push ERROR_FS_FAIL
jmp ntfsError
.found:
push esi edi
mov esi, eax
3016,25 → 2854,8
xor eax, eax
ret
 
ntfsUnsupported:
push ERROR_UNSUPPORTED_FS
ntfsOut:
ntfsError:
call ntfs_unlock
xor ebx, ebx
pop eax
ret
ntfsDevice:
push ERROR_DEVICE
jmp ntfsOut
ntfsNotFound:
push ERROR_FILE_NOT_FOUND
jmp ntfsOut
ntfsDenied:
push ERROR_ACCESS_DENIED
jmp ntfsOut
ntfsFail:
push ERROR_FS_FAIL
jmp ntfsOut
ntfsNoMemory:
push ERROR_OUT_OF_MEMORY
jmp ntfsOut