forked from KolibriOS/kolibrios
ntfs.inc: bugfixes
taskman.inc: IOPL reverted back to 1 git-svn-id: svn://kolibrios.org@273 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
0cb93396cf
commit
7cae037e85
@ -1080,7 +1080,7 @@ proc set_app_params stdcall,slot:dword, params:dword,\
|
|||||||
mov [edi+TSS._eip],eax ;set eip in TSS
|
mov [edi+TSS._eip],eax ;set eip in TSS
|
||||||
mov eax, [esi+0x0C] ;app_esp
|
mov eax, [esi+0x0C] ;app_esp
|
||||||
mov [edi+TSS._esp],eax ;set stack in TSS
|
mov [edi+TSS._esp],eax ;set stack in TSS
|
||||||
mov [edi+TSS._eflags],dword 0x3202
|
mov [edi+TSS._eflags],dword 0x1202
|
||||||
|
|
||||||
mov [edi+TSS._cs],app_code ;selector of code segment
|
mov [edi+TSS._cs],app_code ;selector of code segment
|
||||||
mov [edi+TSS._ss],app_data
|
mov [edi+TSS._ss],app_data
|
||||||
|
@ -288,6 +288,7 @@ ntfs_bCanContinue db ?
|
|||||||
rb 3
|
rb 3
|
||||||
|
|
||||||
ntfs_attrlist_buf rb 0x400
|
ntfs_attrlist_buf rb 0x400
|
||||||
|
ntfs_attrlist_mft_buf rb 0x400
|
||||||
ntfs_bitmap_buf rb 0x400
|
ntfs_bitmap_buf rb 0x400
|
||||||
|
|
||||||
ntfs_attr_iRecord dd ?
|
ntfs_attr_iRecord dd ?
|
||||||
@ -298,7 +299,6 @@ ntfs_attr_size dq ?
|
|||||||
ntfs_cur_tail dd ?
|
ntfs_cur_tail dd ?
|
||||||
endg
|
endg
|
||||||
|
|
||||||
|
|
||||||
ntfs_read_attr:
|
ntfs_read_attr:
|
||||||
; in: global variables
|
; in: global variables
|
||||||
; out: [ntfs_cur_read]
|
; out: [ntfs_cur_read]
|
||||||
@ -434,6 +434,12 @@ ntfs_read_attr:
|
|||||||
mov [ntfs_attr_list], eax
|
mov [ntfs_attr_list], eax
|
||||||
jmp .scancont
|
jmp .scancont
|
||||||
.okattr:
|
.okattr:
|
||||||
|
; ignore named $DATA attributes (aka NTFS streams)
|
||||||
|
cmp ecx, 0x80
|
||||||
|
jnz @f
|
||||||
|
cmp byte [eax+9], 0
|
||||||
|
jnz .scancont
|
||||||
|
@@:
|
||||||
mov [ntfs_attr_offs], eax
|
mov [ntfs_attr_offs], eax
|
||||||
.scancont:
|
.scancont:
|
||||||
add eax, [eax+4]
|
add eax, [eax+4]
|
||||||
@ -493,14 +499,19 @@ ntfs_read_attr:
|
|||||||
push dword [ntfs_attr_size+4]
|
push dword [ntfs_attr_size+4]
|
||||||
or dword [ntfs_attr_size], -1
|
or dword [ntfs_attr_size], -1
|
||||||
or dword [ntfs_attr_size+4], -1
|
or dword [ntfs_attr_size+4], -1
|
||||||
xor edx, edx
|
and [ntfs_cur_offs], 0
|
||||||
mov [ntfs_cur_offs], edx
|
|
||||||
mov [ntfs_cur_size], 2
|
mov [ntfs_cur_size], 2
|
||||||
and [ntfs_cur_read], 0
|
and [ntfs_cur_read], 0
|
||||||
mov [ntfs_cur_buf], ntfs_attrlist_buf
|
mov eax, ntfs_attrlist_buf
|
||||||
push edx
|
cmp [ntfs_cur_iRecord], 0
|
||||||
|
jnz @f
|
||||||
|
mov eax, ntfs_attrlist_mft_buf
|
||||||
|
@@:
|
||||||
|
mov [ntfs_cur_buf], eax
|
||||||
|
push eax
|
||||||
call .doreadattr
|
call .doreadattr
|
||||||
pop edx
|
pop esi
|
||||||
|
mov edx, 1
|
||||||
pop dword [ntfs_attr_size+4]
|
pop dword [ntfs_attr_size+4]
|
||||||
pop dword [ntfs_attr_size]
|
pop dword [ntfs_attr_size]
|
||||||
mov ebp, [ntfs_cur_read]
|
mov ebp, [ntfs_cur_read]
|
||||||
@ -509,10 +520,9 @@ ntfs_read_attr:
|
|||||||
pop [ntfs_cur_size]
|
pop [ntfs_cur_size]
|
||||||
pop [ntfs_cur_offs]
|
pop [ntfs_cur_offs]
|
||||||
jc .errret
|
jc .errret
|
||||||
mov esi, ntfs_attrlist_buf
|
|
||||||
or edi, -1
|
or edi, -1
|
||||||
.scanliststart:
|
|
||||||
lea ebp, [ebp+esi-1Ah]
|
lea ebp, [ebp+esi-1Ah]
|
||||||
|
.scanliststart:
|
||||||
mov eax, [ntfs_cur_attr]
|
mov eax, [ntfs_cur_attr]
|
||||||
.scanlist:
|
.scanlist:
|
||||||
cmp esi, ebp
|
cmp esi, ebp
|
||||||
@ -523,6 +533,12 @@ ntfs_read_attr:
|
|||||||
movzx ecx, word [esi+4]
|
movzx ecx, word [esi+4]
|
||||||
add esi, ecx
|
add esi, ecx
|
||||||
jmp .scanlist
|
jmp .scanlist
|
||||||
|
@@:
|
||||||
|
; ignore named $DATA attributes (aka NTFS streams)
|
||||||
|
cmp eax, 0x80
|
||||||
|
jnz @f
|
||||||
|
cmp byte [esi+6], 0
|
||||||
|
jnz .scanlistcont
|
||||||
@@:
|
@@:
|
||||||
push eax
|
push eax
|
||||||
mov eax, [esi+8]
|
mov eax, [esi+8]
|
||||||
@ -550,8 +566,14 @@ ntfs_read_attr:
|
|||||||
jz .errret_pop
|
jz .errret_pop
|
||||||
cmp dword [eax], ecx
|
cmp dword [eax], ecx
|
||||||
jz @f
|
jz @f
|
||||||
|
.l1:
|
||||||
add eax, [eax+4]
|
add eax, [eax+4]
|
||||||
jmp @b
|
jmp @b
|
||||||
|
@@:
|
||||||
|
cmp eax, 0x80
|
||||||
|
jnz @f
|
||||||
|
cmp byte [eax+9], 0
|
||||||
|
jnz .l1
|
||||||
@@:
|
@@:
|
||||||
cmp byte [eax+8], 0
|
cmp byte [eax+8], 0
|
||||||
jnz .sdnores
|
jnz .sdnores
|
||||||
@ -590,39 +612,54 @@ ntfs_read_attr:
|
|||||||
ret
|
ret
|
||||||
.scanlistdone:
|
.scanlistdone:
|
||||||
sub ebp, ntfs_attrlist_buf-1Ah
|
sub ebp, ntfs_attrlist_buf-1Ah
|
||||||
test ebp, 1FFh
|
cmp [ntfs_cur_iRecord], 0
|
||||||
jnz .scanlistfound
|
|
||||||
test edx, edx
|
|
||||||
jnz @f
|
jnz @f
|
||||||
inc edx
|
sub ebp, ntfs_attrlist_mft_buf-ntfs_attrlist_buf
|
||||||
|
@@:
|
||||||
cmp ebp, 0x400
|
cmp ebp, 0x400
|
||||||
jnz .scanlistfound
|
jnz .scanlistfound
|
||||||
@@:
|
|
||||||
inc edx
|
inc edx
|
||||||
push esi edi
|
push esi edi
|
||||||
mov esi, ntfs_attrlist_buf+0x200
|
mov esi, ntfs_attrlist_buf+0x200
|
||||||
mov edi, ntfs_attrlist_buf
|
mov edi, ntfs_attrlist_buf
|
||||||
|
cmp [ntfs_cur_iRecord], 0
|
||||||
|
jnz @f
|
||||||
|
mov esi, ntfs_attrlist_mft_buf+0x200
|
||||||
|
mov edi, ntfs_attrlist_mft_buf
|
||||||
|
@@:
|
||||||
mov ecx, 0x200/4
|
mov ecx, 0x200/4
|
||||||
rep movsd
|
rep movsd
|
||||||
|
mov eax, edi
|
||||||
pop edi esi
|
pop edi esi
|
||||||
sub esi, 0x200
|
sub esi, 0x200
|
||||||
push [ntfs_cur_offs]
|
push [ntfs_cur_offs]
|
||||||
push [ntfs_cur_size]
|
push [ntfs_cur_size]
|
||||||
push [ntfs_cur_read]
|
push [ntfs_cur_read]
|
||||||
push [ntfs_cur_buf]
|
push [ntfs_cur_buf]
|
||||||
|
push dword [ntfs_attr_size]
|
||||||
|
push dword [ntfs_attr_size+4]
|
||||||
|
or dword [ntfs_attr_size], -1
|
||||||
|
or dword [ntfs_attr_size+4], -1
|
||||||
mov [ntfs_cur_offs], edx
|
mov [ntfs_cur_offs], edx
|
||||||
mov [ntfs_cur_size], 1
|
mov [ntfs_cur_size], 1
|
||||||
and [ntfs_cur_read], 0
|
and [ntfs_cur_read], 0
|
||||||
mov [ntfs_cur_buf], ntfs_attrlist_buf+0x200
|
mov [ntfs_cur_buf], eax
|
||||||
|
mov ecx, [ntfs_attr_list]
|
||||||
push esi edx
|
push esi edx
|
||||||
call .doreadattr
|
call .doreadattr
|
||||||
pop edx esi
|
pop edx esi
|
||||||
mov ebp, [ntfs_cur_read]
|
mov ebp, [ntfs_cur_read]
|
||||||
|
pop dword [ntfs_attr_size+4]
|
||||||
|
pop dword [ntfs_attr_size]
|
||||||
pop [ntfs_cur_buf]
|
pop [ntfs_cur_buf]
|
||||||
pop [ntfs_cur_read]
|
pop [ntfs_cur_read]
|
||||||
pop [ntfs_cur_size]
|
pop [ntfs_cur_size]
|
||||||
pop [ntfs_cur_offs]
|
pop [ntfs_cur_offs]
|
||||||
jc .errret
|
jc .errret
|
||||||
|
add ebp, ntfs_attrlist_buf+0x200-0x1A
|
||||||
|
cmp [ntfs_cur_iRecord], 0
|
||||||
|
jnz .scanliststart
|
||||||
|
add ebp, ntfs_attrlist_mft_buf-ntfs_attrlist_buf
|
||||||
jmp .scanliststart
|
jmp .scanliststart
|
||||||
|
|
||||||
.doreadattr:
|
.doreadattr:
|
||||||
|
Loading…
Reference in New Issue
Block a user