Rev 1276 | Rev 1300 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1276 | Rev 1289 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 1276 $ |
8 | $Revision: 1289 $ |
9 | 9 | ||
Line 612... | Line 612... | ||
612 | .alloc: |
612 | .alloc: |
613 | call alloc_page |
613 | call alloc_page |
614 | test eax, eax |
614 | test eax, eax |
615 | jz .fail |
615 | jz .fail |
Line 616... | Line 616... | ||
616 | 616 | ||
Line 617... | Line 617... | ||
617 | stdcall map_page,[.err_addr],eax,dword PG_UW |
617 | stdcall map_page,[.err_addr],eax,PG_UW |
618 | 618 | ||
619 | mov edi, [.err_addr] |
619 | mov edi, [.err_addr] |
620 | and edi, 0xFFFFF000 |
620 | and edi, 0xFFFFF000 |
Line 625... | Line 625... | ||
625 | .exit: ;iret with repeat fault instruction |
625 | .exit: ;iret with repeat fault instruction |
626 | add esp,12 ;clear in stack: locals(.err_addr) + #PF + ret_to_caller |
626 | add esp,12 ;clear in stack: locals(.err_addr) + #PF + ret_to_caller |
627 | restore_ring3_context |
627 | restore_ring3_context |
628 | iretd |
628 | iretd |
Line -... | Line 629... | ||
- | 629 | ||
- | 630 | .err_access: |
|
- | 631 | ; access denied? this may be a result of copy-on-write protection for DLL |
|
- | 632 | ; check list of HDLLs |
|
- | 633 | and ebx, not 0xFFF |
|
- | 634 | mov eax, [CURRENT_TASK] |
|
- | 635 | shl eax, 8 |
|
- | 636 | lea eax, [SLOT_BASE+eax+APP_OBJ_OFFSET] |
|
- | 637 | mov esi, [eax+APPOBJ.fd] |
|
- | 638 | .scan_hdll: |
|
629 | 639 | cmp esi, eax |
|
630 | .err_access = .fail |
640 | jz .fail |
- | 641 | cmp [esi+APPOBJ.magic], 'HDLL' |
|
- | 642 | jnz .scan_hdll.next |
|
- | 643 | mov edx, ebx |
|
- | 644 | sub edx, [esi+HDLL.base] |
|
- | 645 | cmp edx, [esi+HDLL.size] |
|
- | 646 | jb .fault_in_hdll |
|
- | 647 | .scan_hdll.next: |
|
- | 648 | mov esi, [esi+APPOBJ.fd] |
|
- | 649 | jmp .scan_hdll |
|
- | 650 | .fault_in_hdll: |
|
- | 651 | ; allocate new page, map it as rw and copy data |
|
- | 652 | call alloc_page |
|
631 | ;íèêîãäà íå ïðîèñõîäèò |
653 | test eax, eax |
- | 654 | jz .fail |
|
- | 655 | stdcall map_page,ebx,eax,PG_UW |
|
- | 656 | mov edi, ebx |
|
- | 657 | mov ecx, 1024 |
|
- | 658 | sub ebx, [esi+HDLL.base] |
|
- | 659 | mov esi, [esi+HDLL.parent] |
|
- | 660 | mov esi, [esi+DLLDESCR.data] |
|
- | 661 | add esi, ebx |
|
- | 662 | rep movsd |
|
Line 632... | Line 663... | ||
632 | ;jmp .fail |
663 | jmp .exit |
633 | 664 | ||
634 | .kernel_space: |
665 | .kernel_space: |