Rev 3187 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3187 | Rev 3240 | ||
---|---|---|---|
Line 19... | Line 19... | ||
19 | ERROR_FAT_TABLE = 9 ;deprecated |
19 | ERROR_FAT_TABLE = 9 ;deprecated |
20 | ERROR_FS_FAIL = 9 |
20 | ERROR_FS_FAIL = 9 |
21 | ERROR_ACCESS_DENIED = 10 |
21 | ERROR_ACCESS_DENIED = 10 |
22 | ERROR_DEVICE = 11 |
22 | ERROR_DEVICE = 11 |
Line -... | Line 23... | ||
- | 23 | ||
- | 24 | ; Errors specific to fn.70.7 - program start |
|
- | 25 | ||
- | 26 | ERROR_MEMORY_NOT_ENOUGH = 30 |
|
- | 27 | ERROR_INVALID_HEADER = 31 |
|
- | 28 | ERROR_TOO_MANY_PROCESSES = 32 |
|
- | 29 | ERROR_WRONG_HEADER_VERSION = 33 ; the version of the header is lower than needed for specific feature. |
|
23 | 30 | ||
24 | image_of_eax EQU esp+32 |
31 | image_of_eax EQU esp+32 |
Line -... | Line 32... | ||
- | 32 | image_of_ebx EQU esp+20 |
|
- | 33 | ||
- | 34 | ||
- | 35 | struc FileInfoBlock { |
|
- | 36 | .sub_fn dd ? |
|
- | 37 | .offset dd ? |
|
- | 38 | .flags dd ? |
|
- | 39 | .size dd ? |
|
- | 40 | .ptr_buff dd ? |
|
- | 41 | .filename rb 1 |
|
- | 42 | .pFilename dd ? |
|
- | 43 | ||
- | 44 | ; variants |
|
- | 45 | ||
- | 46 | label .execFlags dword at .offset |
|
- | 47 | label .execPtrArg dword at .flags |
|
- | 48 | label .execStdIO dword at .size |
|
- | 49 | label .execStdErr dword at .ptr_buff |
|
- | 50 | } |
|
- | 51 | ||
- | 52 | virtual at 0 |
|
- | 53 | FileInfoBlock FileInfoBlock |
|
- | 54 | end virtual |
|
25 | image_of_ebx EQU esp+20 |
55 | |
26 | 56 | ||
Line 27... | Line 57... | ||
27 | ; System function 70 - files with long names (LFN) |
57 | ; System function 70 - files with long names (LFN) |
28 | ; diamond, 2006 |
58 | ; diamond, 2006 |
Line 101... | Line 131... | ||
101 | dd dyndisk_handler, dyndisk_enum_root |
131 | dd dyndisk_handler, dyndisk_enum_root |
102 | ; add new handlers here |
132 | ; add new handlers here |
103 | dd 0 |
133 | dd 0 |
Line 104... | Line 134... | ||
104 | 134 | ||
- | 135 | endg |
|
- | 136 | ||
105 | endg |
137 | |
106 | file_system_lfn: |
138 | file_system_lfn: |
107 | ; in: ebx->fileinfo block |
139 | ; in: ebx->fileinfo block |
108 | ; operation codes: |
140 | ; operation codes: |
109 | ; 0 : read file |
141 | ; 0 : read file |
Line 116... | Line 148... | ||
116 | ; 7 : start application |
148 | ; 7 : start application |
117 | ; 8 : delete file |
149 | ; 8 : delete file |
118 | ; 9 : create directory |
150 | ; 9 : create directory |
Line 119... | Line 151... | ||
119 | 151 | ||
120 | ; parse file name |
152 | ; parse file name |
121 | lea esi, [ebx+20] |
153 | lea esi, [ebx+FileInfoBlock.filename] |
122 | lodsb |
154 | lodsb |
123 | test al, al |
155 | test al, al |
124 | jnz @f |
156 | jnz @f |
125 | mov esi, [esi] |
157 | mov esi, [esi] ; FileInfoBlock.pFilename actually. |
126 | lodsb |
158 | lodsb |
127 | @@: |
159 | @@: |
128 | cmp al, '/' |
160 | cmp al, '/' |
129 | jz .notcurdir |
161 | jz .notcurdir |
Line 140... | Line 172... | ||
140 | cmp byte [esi], 0 |
172 | cmp byte [esi], 0 |
141 | jz .rootdir |
173 | jz .rootdir |
142 | call process_replace_file_name |
174 | call process_replace_file_name |
143 | .parse_normal: |
175 | .parse_normal: |
144 | cmp dword [ebx], 7 |
176 | cmp dword [ebx], 7 |
145 | jne @F |
177 | jne .not_execute |
- | 178 | ||
- | 179 | mov eax, [ebx+FileInfoBlock.execStdIO] ; or NULL if not needed. |
|
146 | mov edx, [ebx+4] |
180 | mov ecx, [ebx+FileInfoBlock.execStdErr] ; or NULL if not needed. |
147 | mov ebx, [ebx+8] |
181 | mov edx, [ebx+FileInfoBlock.execFlags] ; now only debug flag |
- | 182 | mov ebx, [ebx+FileInfoBlock.execPtrArg] ; pointer to string with command line arguments. |
|
- | 183 | ||
148 | call fs_execute; esi+ebp, ebx, edx |
184 | call fs_execute ; esi+ebp, ebx, edx |
149 | mov [image_of_eax], eax |
185 | mov [image_of_eax], eax |
150 | ret |
186 | ret |
151 | @@: |
187 | |
- | 188 | .not_execute: |
|
152 | mov edi, rootdirs-8 |
189 | mov edi, rootdirs-8 |
153 | xor ecx, ecx |
190 | xor ecx, ecx |
154 | push esi |
191 | push esi |
155 | .scan1: |
192 | .scan1: |
156 | pop esi |
193 | pop esi |
Line 179... | Line 216... | ||
179 | mov esi, [edi+4] |
216 | mov esi, [edi+4] |
180 | .maindir_noesi: |
217 | .maindir_noesi: |
181 | cmp dword [ebx], 1 |
218 | cmp dword [ebx], 1 |
182 | jnz .access_denied |
219 | jnz .access_denied |
183 | xor eax, eax |
220 | xor eax, eax |
184 | mov ebp, [ebx+12] ;количество блоков для считывания |
221 | mov ebp, [ebx+12] ; block count to be read. |
185 | mov edx, [ebx+16] ;куда записывать рузельтат |
222 | mov edx, [ebx+16] ; where to write the result. |
186 | ; add edx, std_application_base_address |
223 | ; add edx, std_application_base_address |
187 | push dword [ebx+4] ; first block |
224 | push dword [ebx+4] ; first block |
188 | mov ebx, [ebx+8] ; flags |
225 | mov ebx, [ebx+8] ; flags |
189 | ; ebx=flags, [esp]=first block, ebp=number of blocks, edx=return area, esi='Next' handler |
226 | ; ebx=flags, [esp]=first block, ebp=number of blocks, edx=return area, esi='Next' handler |
190 | mov edi, edx |
227 | mov edi, edx |