forked from KolibriOS/kolibrios
ISO9660 bugfixes
git-svn-id: svn://kolibrios.org@364 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
0f0c0aabfa
commit
b000e7656d
@ -190,6 +190,7 @@ proc fs_execute
|
|||||||
mov [save_cr3], ebx
|
mov [save_cr3], ebx
|
||||||
|
|
||||||
stdcall create_app_space,[hdr_mem],[file_base],[file_size]
|
stdcall create_app_space,[hdr_mem],[file_base],[file_size]
|
||||||
|
mov ecx, -30 ; no memory
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jz .failed
|
jz .failed
|
||||||
|
|
||||||
|
@ -64,8 +64,10 @@ free_cd_channel:
|
|||||||
.IDE_Channel_2:
|
.IDE_Channel_2:
|
||||||
mov [IDE_Channel_2],0
|
mov [IDE_Channel_2],0
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
uglobal
|
||||||
cd_status dd 0
|
cd_status dd 0
|
||||||
|
endg
|
||||||
|
|
||||||
;----------------------------------------------------------------
|
;----------------------------------------------------------------
|
||||||
;
|
;
|
||||||
@ -210,14 +212,14 @@ fs_CdReadFolder:
|
|||||||
call cd_find_lfn
|
call cd_find_lfn
|
||||||
jnc .found
|
jnc .found
|
||||||
pop edi
|
pop edi
|
||||||
cmp [DevErrorCode],0
|
cmp [DevErrorCode], 0
|
||||||
jne .noaccess_1
|
jne .noaccess_1
|
||||||
or ebx, -1
|
or ebx, -1
|
||||||
mov eax, ERROR_FILE_NOT_FOUND
|
mov eax, ERROR_FILE_NOT_FOUND
|
||||||
ret
|
ret
|
||||||
.found:
|
.found:
|
||||||
mov edi,[cd_current_pointer_of_input]
|
mov edi, [cd_current_pointer_of_input]
|
||||||
test byte [edi+25],10b ; do not allow read directories
|
test byte [edi+25], 10b ; do not allow read directories
|
||||||
jnz .found_dir
|
jnz .found_dir
|
||||||
pop edi
|
pop edi
|
||||||
.noaccess_1:
|
.noaccess_1:
|
||||||
@ -225,9 +227,9 @@ fs_CdReadFolder:
|
|||||||
mov eax, ERROR_ACCESS_DENIED
|
mov eax, ERROR_ACCESS_DENIED
|
||||||
ret
|
ret
|
||||||
.found_dir:
|
.found_dir:
|
||||||
mov eax,[edi+2] ; eax=cluster
|
mov eax, [edi+2] ; eax=cluster
|
||||||
mov [CDSectorAddress],eax
|
mov [CDSectorAddress], eax
|
||||||
mov eax,[edi+10] ; ðàçìåð äèðåêòðîðèè
|
mov eax, [edi+10] ; ðàçìåð äèðåêòðîðèè
|
||||||
.doit:
|
.doit:
|
||||||
; init header
|
; init header
|
||||||
push eax ecx
|
push eax ecx
|
||||||
@ -237,33 +239,36 @@ fs_CdReadFolder:
|
|||||||
rep stosd
|
rep stosd
|
||||||
pop ecx eax
|
pop ecx eax
|
||||||
mov byte [edx], 1 ; version
|
mov byte [edx], 1 ; version
|
||||||
mov [cd_mem_location],edx
|
mov [cd_mem_location], edx
|
||||||
add [cd_mem_location],32
|
add [cd_mem_location], 32
|
||||||
; íà÷èíàåì ïåðåáðîñêó ÁÄÂÊ â ÓÑÂÊ
|
; íà÷èíàåì ïåðåáðîñêó ÁÄÂÊ â ÓÑÂÊ
|
||||||
;.mainloop:
|
;.mainloop:
|
||||||
mov [cd_counter_block],dword 0
|
mov [cd_counter_block], dword 0
|
||||||
dec dword [CDSectorAddress]
|
dec dword [CDSectorAddress]
|
||||||
push ecx
|
push ecx
|
||||||
.read_to_buffer:
|
.read_to_buffer:
|
||||||
inc dword [CDSectorAddress]
|
inc dword [CDSectorAddress]
|
||||||
mov [CDDataBuf_pointer],CDDataBuf
|
mov [CDDataBuf_pointer], CDDataBuf
|
||||||
call ReadCDWRetr ; ÷èòàåì ñåêòîð äèðåêòîðèè
|
call ReadCDWRetr ; ÷èòàåì ñåêòîð äèðåêòîðèè
|
||||||
cmp [DevErrorCode],0
|
cmp [DevErrorCode], 0
|
||||||
jne .noaccess_1
|
jne .noaccess_1
|
||||||
call .get_names_from_buffer
|
call .get_names_from_buffer
|
||||||
sub eax,2048
|
sub eax,2048
|
||||||
; äèðåêòîðèÿ çàêîí÷èëàñü?
|
; äèðåêòîðèÿ çàêîí÷èëàñü?
|
||||||
cmp eax,0
|
ja .read_to_buffer
|
||||||
ja .read_to_buffer
|
mov edi, [cd_counter_block]
|
||||||
mov edi,[cd_counter_block]
|
mov [edx+8], edi
|
||||||
mov [edx+8],edi
|
mov edi, [ebx]
|
||||||
mov edi,[ebx]
|
sub [edx+4], edi
|
||||||
sub [edx+4],edi
|
xor eax, eax
|
||||||
|
dec ecx
|
||||||
|
js @f
|
||||||
|
mov al, ERROR_END_OF_FILE
|
||||||
|
@@:
|
||||||
pop ecx edi
|
pop ecx edi
|
||||||
mov ebx, [edx+4]
|
mov ebx, [edx+4]
|
||||||
mov eax,ERROR_SUCCESS
|
ret
|
||||||
ret
|
|
||||||
|
|
||||||
.get_names_from_buffer:
|
.get_names_from_buffer:
|
||||||
mov [cd_current_pointer_of_input_2],CDDataBuf
|
mov [cd_current_pointer_of_input_2],CDDataBuf
|
||||||
push eax esi edi edx
|
push eax esi edi edx
|
||||||
@ -658,11 +663,9 @@ cd_find_lfn:
|
|||||||
cmp byte [esi-1], 0
|
cmp byte [esi-1], 0
|
||||||
jz .done
|
jz .done
|
||||||
mov eax,[cd_current_pointer_of_input]
|
mov eax,[cd_current_pointer_of_input]
|
||||||
add eax,2
|
push dword [eax+2]
|
||||||
mov eax,[eax]
|
pop dword [CDSectorAddress] ; íà÷àëî äèðåêòîðèè
|
||||||
mov [CDSectorAddress],eax ; íà÷àëî äèðåêòîðèè
|
mov eax,[eax+2+8] ; ðàçìåð äèðåêòîðèè
|
||||||
add eax,8
|
|
||||||
mov eax,[eax] ; ðàçìåð äèðåêòîðèè
|
|
||||||
jmp .mainloop
|
jmp .mainloop
|
||||||
; óêàçàòåëü ôàéëà íàéäåí
|
; óêàçàòåëü ôàéëà íàéäåí
|
||||||
.done:
|
.done:
|
||||||
|
Loading…
Reference in New Issue
Block a user