Rev 9047 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9047 | Rev 9048 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2021. 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: 9038 $ |
8 | $Revision: 9048 $ |
9 | 9 | ||
10 | 10 | ||
Line 438... | Line 438... | ||
438 | ends |
438 | ends |
Line 439... | Line 439... | ||
439 | 439 | ||
440 | struct PROC |
440 | struct PROC |
441 | list LHEAD |
441 | list LHEAD |
- | 442 | thr_list LHEAD |
|
442 | thr_list LHEAD |
443 | smap_list LHEAD |
443 | heap_lock MUTEX |
444 | heap_lock MUTEX |
444 | heap_base rd 1 |
445 | heap_base rd 1 |
445 | heap_top rd 1 |
446 | heap_top rd 1 |
446 | mem_used rd 1 |
- | |
447 | dlls_list_ptr rd 1 |
447 | mem_used rd 1 |
448 | pdt_0_phys rd 1 |
448 | pdt_0_phys rd 1 |
449 | pdt_1_phys rd 1 |
449 | pdt_1_phys rd 1 |
450 | io_map_0 rd 1 |
450 | io_map_0 rd 1 |
Line 649... | Line 649... | ||
649 | access dd ? ;+16 |
649 | access dd ? ;+16 |
650 | refcount dd ? ;+20 |
650 | refcount dd ? ;+20 |
651 | name rb 32 ;+24 |
651 | name rb 32 ;+24 |
652 | ends |
652 | ends |
Line 653... | Line -... | ||
653 | - | ||
654 | struct SMAP APPOBJ |
- | |
655 | base dd ? ;mapped base |
- | |
656 | parent dd ? ;SMEM |
- | |
657 | ends |
- | |
658 | - | ||
659 | struct DLLDESCR |
- | |
660 | bk dd ? |
- | |
661 | fd dd ? ;+4 |
- | |
662 | data dd ? ;+8 |
- | |
663 | size dd ? ;+12 |
- | |
664 | timestamp dq ? |
- | |
665 | refcount dd ? |
- | |
666 | defaultbase dd ? |
- | |
667 | coff_hdr dd ? |
- | |
668 | symbols_ptr dd ? |
- | |
669 | symbols_num dd ? |
- | |
670 | symbols_lim dd ? |
- | |
671 | exports dd ? ;export table |
- | |
672 | name rb 260 |
- | |
673 | ends |
- | |
674 | 653 | ||
675 | struct HDLL |
654 | struct SMAP |
676 | fd dd ? ;next object in list |
655 | fd dd ? ;next in mmapped list |
677 | bk dd ? ;prev object in list |
- | |
678 | pid dd ? ;owner id |
- | |
679 | 656 | bk dd ? ;prev in mmapped list |
|
680 | base dd ? ;mapped base |
657 | base dd ? ;mapped base |
681 | size dd ? ;mapped size |
658 | size dd ? ;mapped size |
682 | refcount dd ? ;reference counter for this process and this lib |
659 | type dd ? ;SMAP_TYPE_SMEM or SMAP_TYPE_PE |
683 | parent dd ? ;DLLDESCR |
660 | parent dd ? ;SMEM or PEDESCR |
- | 661 | ends |
|
- | 662 | SMAP_TYPE_SMEM = 1 |
|
Line 684... | Line 663... | ||
684 | ends |
663 | SMAP_TYPE_PE = 2 |
685 | 664 | ||
686 | struct DQ |
665 | struct DQ |
687 | lo dd ? |
666 | lo dd ? |
Line 808... | Line 787... | ||
808 | bus db ? |
787 | bus db ? |
809 | rb 2 |
788 | rb 2 |
810 | owner dd ? ; pointer to SRV or 0 |
789 | owner dd ? ; pointer to SRV or 0 |
811 | ends |
790 | ends |
Line -... | Line 791... | ||
- | 791 | ||
- | 792 | struct PEDESCR |
|
- | 793 | bk dd ? |
|
- | 794 | fd dd ? |
|
- | 795 | size dd ? ; in pages |
|
- | 796 | timestamp dq ? |
|
- | 797 | refcount dd ? |
|
- | 798 | defaultbase dd ? |
|
- | 799 | name dd ? |
|
- | 800 | entry dd ? |
|
- | 801 | stacksize dd ? |
|
- | 802 | page_array_lock MUTEX |
|
- | 803 | ; After those fields the array follows, one dword per every of [size] pages. |
|
- | 804 | ; The value of every field has 3 parts: |
|
- | 805 | ; - upper 20 bits are page number or zero; |
|
- | 806 | ; - next 4 bits are access rights shareable/executable/readable/writable |
|
- | 807 | ; in the same order as IMAGE_SCN_MEM_xxx shifted appropriately; |
|
- | 808 | ; - lower 8 bits are reference counter. |
|
- | 809 | ; The exact meaning depends on page type. |
|
- | 810 | ; * For a page with data in non-shareable section |
|
- | 811 | ; which has at least one unmodified copy: |
|
- | 812 | ; - upper 20 bits are page number for unmodified copy, |
|
- | 813 | ; - reference counter = number of unmodified copies is nonzero up to 0xFF. |
|
- | 814 | ; If reference counter reaches 0xFF, it becomes locked at this value. |
|
- | 815 | ; If reference counter reaches zero, the last copy changes ownership |
|
- | 816 | ; to the last process, |
|
- | 817 | ; and the page is converted to the following state. |
|
- | 818 | ; * For a page with data in non-shareable section |
|
- | 819 | ; with no unmodified copies: |
|
- | 820 | ; - all fields are reset to zero. |
|
- | 821 | ; The original content is lost; map_pe_usermode would reload from file. |
|
- | 822 | ; * For a page with zeroes in non-shareable section: |
|
- | 823 | ; - upper 20 bits are zero, |
|
- | 824 | ; - lower 8 bits are 0xFF. |
|
- | 825 | ; * For a page in shareable section with data or with zeroes: |
|
- | 826 | ; - upper 20 bits are page number for all copies, |
|
- | 827 | ; - lower 8 bits are reference counter from 1 to 0xFF. |
|
- | 828 | ; Reference counter does not actually matter here, |
|
- | 829 | ; it equals [refcount] unless 0xFF was once reached, |
|
- | 830 | ; but is kept for consistency. |
|
- | 831 | ends |
|
- | 832 | ||
- | 833 | struct SHARED_LOCKED_PAGE |
|
- | 834 | fd dd ? |
|
- | 835 | bk dd ? |
|
- | 836 | address dd ? |
|
- | 837 | parent dd ? |
|
- | 838 | offs dd ? |
|
- | 839 | ends |
|
812 | 840 | ||
813 | struct IDE_DATA |
841 | struct IDE_DATA |
814 | ProgrammingInterface dd ? |
842 | ProgrammingInterface dd ? |
815 | Interrupt dw ? |
843 | Interrupt dw ? |
816 | RegsBaseAddres dw ? |
844 | RegsBaseAddres dw ? |
Line 931... | Line 959... | ||
931 | PtrLinenumbers dd ? |
959 | PtrLinenumbers dd ? |
932 | NumReloc dw ? |
960 | NumReloc dw ? |
933 | NumLinenum dw ? |
961 | NumLinenum dw ? |
934 | Characteristics dd ? |
962 | Characteristics dd ? |
935 | ends |
963 | ends |
- | 964 | IMAGE_SCN_MEM_SHARED = 10000000h |
|
- | 965 | IMAGE_SCN_MEM_EXECUTE = 20000000h |
|
- | 966 | IMAGE_SCN_MEM_READ = 40000000h |
|
- | 967 | IMAGE_SCN_MEM_WRITE = 80000000h |
|
- | 968 | ||
- | 969 | struct STRIPPED_PE_SECTION |
|
- | 970 | Name rb 8 |
|
- | 971 | VirtualSize dd ? |
|
- | 972 | VirtualAddress dd ? |
|
- | 973 | SizeOfRawData dd ? |
|
- | 974 | PtrRawData dd ? |
|
- | 975 | Characteristics dd ? |
|
- | 976 | ends |
|
Line 936... | Line 977... | ||
936 | 977 | ||
937 | struct COFF_RELOC |
978 | struct COFF_RELOC |
938 | VirtualAddress dd ? |
979 | VirtualAddress dd ? |
939 | SymIndex dd ? |
980 | SymIndex dd ? |
Line 969... | Line 1010... | ||
969 | STRIPPED_PE_SIGNATURE = 0x4503 ; 'PE' xor 'S' |
1010 | STRIPPED_PE_SIGNATURE = 0x4503 ; 'PE' xor 'S' |
970 | SPE_DIRECTORY_IMPORT = 0 |
1011 | SPE_DIRECTORY_IMPORT = 0 |
971 | SPE_DIRECTORY_EXPORT = 1 |
1012 | SPE_DIRECTORY_EXPORT = 1 |
972 | SPE_DIRECTORY_BASERELOC = 2 |
1013 | SPE_DIRECTORY_BASERELOC = 2 |
Line -... | Line 1014... | ||
- | 1014 | ||
- | 1015 | struct IMAGE_DATA_DIRECTORY |
|
- | 1016 | VirtualAddress dd ? |
|
- | 1017 | isize dd ? |
|
- | 1018 | ends |
|
- | 1019 | ||
- | 1020 | struct IMAGE_OPTIONAL_HEADER32 |
|
- | 1021 | Magic dw ? |
|
- | 1022 | MajorLinkerVersion db ? |
|
- | 1023 | MinorLinkerVersion db ? |
|
- | 1024 | SizeOfCode dd ? |
|
- | 1025 | SizeOfInitializedData dd ? |
|
- | 1026 | SizeOfUninitializedData dd ? |
|
- | 1027 | AddressOfEntryPoint dd ? |
|
- | 1028 | BaseOfCode dd ? |
|
- | 1029 | BaseOfData dd ? |
|
- | 1030 | ImageBase dd ? |
|
- | 1031 | SectionAlignment dd ? |
|
- | 1032 | FileAlignment dd ? |
|
- | 1033 | MajorOperatingSystemVersion dw ? |
|
- | 1034 | MinorOperatingSystemVersion dw ? |
|
- | 1035 | MajorImageVersion dw ? |
|
- | 1036 | MinorImageVersion dw ? |
|
- | 1037 | MajorSubsystemVersion dw ? |
|
- | 1038 | MinorSubsystemVersion dw ? |
|
- | 1039 | Win32VersionValue dd ? |
|
- | 1040 | SizeOfImage dd ? |
|
- | 1041 | SizeOfHeaders dd ? |
|
- | 1042 | CheckSum dd ? |
|
- | 1043 | Subsystem dw ? |
|
- | 1044 | DllCharacteristics dw ? |
|
- | 1045 | SizeOfStackReserve dd ? |
|
- | 1046 | SizeOfStackCommit dd ? |
|
- | 1047 | SizeOfHeapReserve dd ? |
|
- | 1048 | SizeOfHeapCommit dd ? |
|
- | 1049 | LoaderFlags dd ? |
|
- | 1050 | NumberOfDirectories dd ? |
|
- | 1051 | DataDirectory IMAGE_DATA_DIRECTORY ? |
|
- | 1052 | Directories rb sizeof.IMAGE_DATA_DIRECTORY*15 |
|
- | 1053 | ends |
|
- | 1054 | ||
- | 1055 | struct IMAGE_FILE_HEADER |
|
- | 1056 | Machine dw ? |
|
- | 1057 | NumberOfSections dw ? |
|
- | 1058 | TimeDateStamp dd ? |
|
- | 1059 | PointerToSymbolTable dd ? |
|
- | 1060 | NumberOfSymbols dd ? |
|
- | 1061 | SizeOfOptionalHeader dw ? |
|
- | 1062 | Characteristics dw ? |
|
- | 1063 | ends |
|
- | 1064 | ||
- | 1065 | struct IMAGE_NT_HEADERS |
|
- | 1066 | Signature dd ? |
|
- | 1067 | FileHeader IMAGE_FILE_HEADER |
|
- | 1068 | OptionalHeader IMAGE_OPTIONAL_HEADER32 |
|
- | 1069 | ends |
|
973 | 1070 | ||
974 | struct IOCTL |
1071 | struct IOCTL |
975 | handle dd ? |
1072 | handle dd ? |
976 | io_code dd ? |
1073 | io_code dd ? |
977 | input dd ? |
1074 | input dd ? |