summaryrefslogtreecommitdiff
path: root/v4.0/src/DOS/DELETE.ASM
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/DOS/DELETE.ASM')
-rw-r--r--v4.0/src/DOS/DELETE.ASM777
1 files changed, 777 insertions, 0 deletions
diff --git a/v4.0/src/DOS/DELETE.ASM b/v4.0/src/DOS/DELETE.ASM
new file mode 100644
index 0000000..c5473c0
--- /dev/null
+++ b/v4.0/src/DOS/DELETE.ASM
@@ -0,0 +1,777 @@
1; SCCSID = @(#)delete.asm 1.3 85/10/18
2; SCCSID = @(#)delete.asm 1.3 85/10/18
3TITLE DOS_DELETE - Internal DELETE call for MS-DOS
4NAME DOS_DELETE
5; Low level routine for deleting files
6;
7; DOS_DELETE
8; REN_DEL_Check
9; FastOpen_Delete ; DOS 3.3
10; FastOpen_Update ; DOS 3.3
11; FastSeek_Open ; DOS 4.00
12; FSeek_dispatch ; DOS 4.00
13; FastSeek_Close ; DOS 4.00
14; FastSeek_Delete ; DOS 4.00
15; Delete_FSeek ; DOS 4.00
16; FastSeek_Lookup ; DOS 4.00
17; FastSeek_Insert ; DOS 4.00
18; FastSeek_Truncate ; DOS 4.00
19; FS_doit ; DOS 4.00
20;
21; Revision history:
22;
23; A000 version 4.00 Jan. 1988
24;
25
26;
27; get the appropriate segment definitions
28;
29.xlist
30include dosseg.asm
31
32CODE SEGMENT BYTE PUBLIC 'CODE'
33 ASSUME SS:DOSGROUP,CS:DOSGROUP
34
35.xcref
36INCLUDE DOSSYM.INC
37INCLUDE DEVSYM.INC
38INCLUDE FASTOPEN.INC
39INCLUDE fastseek.inc
40INCLUDE fastxxxx.inc
41.cref
42.list
43
44Installed = TRUE
45
46 i_need NoSetDir,BYTE
47 i_need Creating,BYTE
48 i_need DELALL,BYTE
49 i_need THISDPB,DWORD
50 i_need THISSFT,DWORD
51 i_need THISCDS,DWORD
52 i_need CURBUF,DWORD
53 i_need ATTRIB,BYTE
54 i_need SATTRIB,BYTE
55 i_need WFP_START,WORD
56 i_need FoundDel,BYTE
57 i_need AUXSTACK,BYTE
58 i_need VOLCHNG_FLAG,BYTE
59 i_need JShare,DWORD
60 i_need FastOpenTable,BYTE ; DOS 3.3
61 i_need FastTable,BYTE ; DOS 4.00
62 i_need FSeek_drive,BYTE ; DOS 4.00
63 i_need FSeek_firclus,WORD ; DOS 4.00
64 i_need FSeek_logclus,WORD ; DOS 4.00
65 i_need FSeek_logsave,WORD ; DOS 4.00
66 i_need FastSeekflg,BYTE ; DOS 4.00
67 i_need Del_ExtCluster,WORD ; DOS 4.00
68 i_need SAVE_BX,WORD ; DOS 4.00
69 i_need DMAADD,DWORD
70 i_need RENAMEDMA,BYTE
71
72; Inputs:
73; [WFP_START] Points to WFP string ("d:/" must be first 3 chars, NUL
74; terminated)
75; [CURR_DIR_END] Points to end of Current dir part of string
76; ( = -1 if current dir not involved, else
77; Points to first char after last "/" of current dir part)
78; [THISCDS] Points to CDS being used
79; (Low word = -1 if NUL CDS (Net direct request))
80; [SATTRIB] Is attribute of search, determines what files can be found
81; Function:
82; Delete the specified file(s)
83; Outputs:
84; CARRY CLEAR
85; OK
86; CARRY SET
87; AX is error code
88; error_file_not_found
89; Last element of path not found
90; error_path_not_found
91; Bad path (not in curr dir part if present)
92; error_bad_curr_dir
93; Bad path in current directory part of path
94; error_access_denied
95; Attempt to delete device or directory
96; ***error_sharing_violation***
97; Deny both access required, generates an INT 24.
98; This error is NOT returned. The INT 24H is generated,
99; and the file is ignored (not deleted). Delete will
100; simply continue on looking for more files.
101; Carry will NOT be set in this case.
102; DS preserved, others destroyed
103
104fileFound = 01h
105fileDeleted = 10h
106
107 procedure DOS_DELETE,NEAR
108 DOSAssume CS,<DS>,"DOS_Delete"
109 ASSUME ES:NOTHING
110
111 Invoke TestNet
112 JNC LOCAL_DELETE
113; invoke OWN_SHARE2 ;IFS. IFS owns share ? ;AN000;
114; JZ ifsshare ;IFS. yes ;AN000;
115; PUSH WORD PTR [DMAADD+2] ;IFS. save DMAADD ;AN000;
116; PUSH WORD PTR [DMAADD] ;IFS. ;AN000;
117; CALL IFS_SEARCH_FIRST ;IFS. do search first ;AN000;
118; JC nofiles ;IFS. file not existing ;AN000;
119delete_next_file: ;IFS. ;AN000;
120; CALL IFS_REN_DEL_CHECK ;IFS. do REN_DEL_CHECK ;AN000;
121; JNC share_okok ;IFS. share ok ;AN000;
122; MOV AX,error_sharing_violation ;IFS. share violation ;AN000;
123; JMP SHORT nofiles ;IFS. ;AN000;
124share_okok:
125; MOV AX,(multNET SHL 8) OR 19 ;IFS. delete it now ;AN000;
126;; INT 2FH ;IFS. ;AN000;
127; JC nofiles ;IFS. error ;AN000;
128; invoke DOS_SEARCH_NEXT ;IFS. get next entry ;AN000;
129; JNC delete_next_file ;IFS. ;AN000;
130; CLC ;IFS. no more files ;AN000;
131nofiles:
132; POP WORD PTR [DMAADD] ;IFS. retor DMAADD ;AN000;
133; POP WORD PTR [DMAADD+2] ;IFS. ;AN000;
134; ret ;IFS. return
135ifsshare:
136
137
138IF NOT Installed
139 transfer NET_DELETE
140ELSE
141 MOV AX,(multNET SHL 8) OR 19
142 INT 2FH
143 return
144ENDIF
145
146LOCAL_DELETE:
147 MOV [FoundDel],00 ; No files found and no files deleted
148 EnterCrit critDisk
149 MOV WORD PTR [CREATING],0E500H ; Assume not del *.*
150 MOV SI,[WFP_START]
151SKPNUL:
152 LODSB
153 OR AL,AL
154 JNZ SKPNUL ; go to end
155 SUB SI,4 ; Back over possible "*.*"
156 CMP WORD PTR [SI],("." SHL 8 OR "*")
157 JNZ TEST_QUEST
158 CMP BYTE PTR [SI+2],"*"
159 JZ CHECK_ATTS
160TEST_QUEST:
161 SUB SI,9 ; Back over possible "????????.???"
162 XCHG DI,SI
163 context ES
164 MOV AX,"??"
165 MOV CX,4 ; four sets of "??"
166 REPE SCASW
167 JNZ NOT_ALL
168 XCHG DI,SI
169 LODSW
170 CMP AX,("?" SHL 8) OR "."
171 JNZ NOT_ALL
172 LODSW
173 CMP AX,"??"
174 JNZ NOT_ALL
175CHECK_ATTS:
176 MOV AL,BYTE PTR [SATTRIB]
177 AND AL,attr_hidden+attr_system+attr_directory+attr_volume_id+attr_read_only
178 ; Look only at hidden bits
179 CMP AL,attr_hidden+attr_system+attr_directory+attr_volume_id+attr_read_only
180 ; All must be set
181 JNZ NOT_ALL
182
183; NOTE WARNING DANGER-----
184; This DELALL stuff is not safe. It allows directories to be deleted.
185; It should ONLY be used by FORMAT in the ROOT directory.
186;
187
188 MOV [DELALL],0 ; DEL *.* - flag deleting all
189NOT_ALL:
190 MOV [NoSetDir],1
191 invoke GetPathNoSet
192 ASSUME ES:NOTHING
193 JNC Del_found
194 JNZ bad_path
195 OR CL,CL
196 JZ bad_path
197No_file:
198 MOV AX,error_file_not_found
199ErrorReturn:
200 STC
201 LeaveCrit critDisk
202 return
203
204bad_path:
205 MOV AX,error_path_not_found
206 JMP ErrorReturn
207
208Del_found:
209 JNZ NOT_DIR ; Check for dir specified
210 CMP DelAll,0 ; DelAll = 0 allows delete of dir.
211 JZ Not_Dir
212Del_access_err:
213 MOV AX,error_access_denied
214 JMP ErrorReturn
215
216NOT_DIR:
217 OR AH,AH ; Check if device name
218 JS Del_access_err ; Can't delete I/O devices
219;
220; Main delete loop. CURBUF+2:BX points to a matching directory entry.
221;
222DELFILE:
223 OR [FoundDel],fileFound ; file found, not deleted yet
224;
225; If we are deleting the Volume ID, then we set VOLUME_CHNG flag to make
226; DOS issue a build BPB call the next time this drive is accessed.
227;
228 PUSH DS
229 MOV AH,[DELALL]
230 LDS DI,[CURBUF]
231ASSUME DS:NOTHING
232;; Extended Attributes
233; PUSH AX ;FT. save cluster of XA ;AN000;
234; MOV AX,DS:[BX.dir_ExtCluster];FT. ;AN000;
235; MOV [Del_ExtCluster],AX ;FT. ;AN000;
236; POP AX ;FT, ;AN000;
237
238;; Extended Attributes
239 TEST [Attrib],attr_read_only ; are we deleting RO files too?
240 JNZ DoDelete ; yes
241 TEST DS:[BX.dir_attr],attr_read_only
242 JZ DoDelete ; not read only
243 POP DS
244 JMP SHORT DelNxt ; Skip it (Note ES:BP not set)
245
246DoDelete:
247 call REN_DEL_Check ; Sets ES:BP = [THISDPB]
248 JNC DEL_SHARE_OK
249 POP DS
250 JMP SHORT DelNxt ; Skip it
251
252DEL_SHARE_OK:
253 Assert ISBUF,<DS,DI>,"Del_Share_OK"
254 TEST [DI.buf_flags],buf_dirty ;LB. if already dirty ;AN000;
255 JNZ yesdirty ;LB. don't increment dirty count ;AN000;
256 invoke INC_DIRTY_COUNT ;LB. ;AN000;
257 OR [DI.buf_flags],buf_dirty
258yesdirty:
259 MOV [BX],AH ; Put in E5H or 0
260 MOV BX,[SI] ; Get firclus pointer
261 POP DS
262 DOSAssume CS,<DS>,"Del_Share_OK"
263 OR [FoundDel],fileDeleted ; Deleted file
264 CMP BX,2
265 JB DELEXT ; File has invalid FIRCLUS (too small)
266 CMP BX,ES:[BP.dpb_max_cluster]
267 JA DELEXT ; File has invalid FIRCLUS (too big)
268;; FastSeek 10/27/86
269 CALL Delete_FSeek ; delete the fastseek entry
270;; FastSeek 10/27/86
271
272 invoke RELEASE ; Free file data
273 JC No_fileJ
274; DOS 3.3 FastOpen
275
276 CALL FastOpen_Delete ; delete the dir info in fastopen
277
278
279; DOS 3.3 FastOpen
280;; Extended Attributes
281DELEXT:
282
283; MOV BX,[Del_ExtCluster] ;FT. delete XA cluster chain ;AN000;
284; CMP BX,2 ;FT. ;AN000;
285; JB DELNXT ;FT. XA has invalid cluster (too small) ;AN000;
286; CMP BX,ES:[BP.dpb_max_cluster];FT. ;AN000;
287; JA DELNXT ;FT. XA has invalid cluster (too big) ;AN000;
288; invoke RELEASE ;FT. Free extended attrs cluster ;AN000;
289; JC No_fileJ ;FT. ;AN000;
290
291;; Extended Attributes
292DELNXT:
293 LES BP,[THISDPB] ; Possible to get here without this set
294 invoke GETENTRY ; Registers need to be reset
295 JC No_fileJ
296 invoke NEXTENT
297if DEBUG
298 JC Flsh
299 JMP DelFile
300flsh:
301ELSE
302 JNC DELFILE
303ENDIF
304 LES BP,[THISDPB] ; NEXTENT sets ES=DOSGROUP
305 MOV AL,ES:[BP.dpb_drive]
306 invoke FLUSHBUF
307 JC No_fileJ
308;
309; Now we need to test FoundDel for our flags. The cases to consider are:
310;
311; not found not deleted file not found
312; not found deleted *** impossible ***
313; found not deleted access denied (read-only)
314; found deleted no error
315;
316 TEST FoundDel,fileDeleted ; did we delete a file?
317 JZ DelError ; no, figure out what's wrong.
318; We set VOLCHNG_FLAG to indicate that we have changed the volume label
319; and to force the DOS to issue a media check.
320 TEST [Attrib],attr_volume_id
321 jz No_Set_Flag
322 PUSH AX
323 PUSH ES
324 PUSH DI
325 LES DI,[THISCDS]
326ASSUME ES:NOTHING
327 MOV AH,BYTE PTR ES:[DI] ; Get drive
328 SUB AH,'A' ; Convert to 0-based
329 mov byte ptr [VOLCHNG_FLAG],AH
330 XOR BH,BH ;>32mb delte volume id from boot record ;AN000;
331 invoke Set_Media_ID ;>32mb set voulme id to boot record ;AN000;
332 invoke FATRead_CDS ; force media check
333 POP DI
334 POP ES
335 POP AX
336No_Set_Flag:
337 LeaveCrit critDisk ; carry is clear
338 return
339DelError:
340 TEST FoundDel,fileFound ; not deleted. Did we find file?
341 JNZ Del_access_errJ ; yes. Access denied
342No_fileJ:
343 JMP No_file ; Nope
344Del_Access_errJ:
345 JMP Del_access_err
346
347EndProc DOS_DELETE
348
349Break <REN_DEL_Check - check for access for rename and delete>
350
351; Inputs:
352; [THISDPB] set
353; [CURBUF+2]:BX points to entry
354; [CURBUF+2]:SI points to firclus field of entry
355; [WFP_Start] points to name
356; Function:
357; Check for Exclusive access on given file.
358; Used by RENAME, SET_FILE_INFO, and DELETE.
359; Outputs:
360; ES:BP = [THISDPB]
361; NOTE: The WFP string pointed to by [WFP_Start] Will be Modified. The
362; last element will be loaded from the directory entry. This is
363; so the name given to the sharer doesn't have any meta chars in
364; it.
365; Carry set if sharing violation, INT 24H generated
366; NOTE THAT AX IS NOT error_sharing_violation.
367; This is because input AX is preserved.
368; Caller must set the error if needed.
369; Carry clear
370; OK
371; AX,DS,BX,SI,DI preserved
372
373 procedure REN_DEL_Check,NEAR
374ASSUME DS:NOTHING,ES:NOTHING
375
376 PUSH DS
377 PUSH DI
378 PUSH AX
379 PUSH BX
380 PUSH SI ; Save CURBUF pointers
381 context ES
382ASSUME ES:DOSGROUP
383 MOV DI,[WFP_START] ; ES:DI -> WFP
384 MOV SI,BX
385 MOV DS,WORD PTR [CURBUF+2] ; DS:SI -> entry (FCB style name)
386 MOV BX,DI ; Set backup limit for skipback
387 ADD BX,2 ; Skip over d: to point to leading '\'
388 invoke StrLen ; CX is length of ES:DI including NUL
389 DEC CX ; Don't include nul in count
390 ADD DI,CX ; Point to NUL at end of string
391 invoke SkipBack ; Back up one element
392 INC DI ; Point to start of last element
393 MOV [SAVE_BX],DI ;IFS. save for DOS_RENAME ;AN000;
394 invoke PackName ; Transfer name from entry to ASCIZ tail.
395 POP SI ; Get back entry pointers
396 POP BX
397 PUSH BX
398 PUSH SI ; Back on stack
399 context DS
400ASSUME DS:DOSGROUP
401;
402; Close the file if possible by us.
403;
404if installed
405 Call JShare + 13 * 4
406else
407 Call ShCloseFile
408endif
409 MOV WORD PTR [THISSFT+2],DS
410 MOV WORD PTR [THISSFT],OFFSET DOSGROUP:AUXSTACK - (SIZE sf_entry)
411 ; Scratch space
412 XOR AH,AH ; Indicate file to DOOPEN (high bit off)
413 invoke DOOPEN ; Fill in SFT for share check
414 LES DI,[THISSFT]
415 MOV ES:[DI.sf_mode],sharing_deny_both ; requires exclusive access
416 MOV ES:[DI.sf_ref_count],1 ; Pretend open
417 invoke ShareEnter
418 jc CheckDone
419 LES DI,[THISSFT]
420 MOV ES:[DI.sf_ref_count],0 ; Pretend closed and free
421 invoke SHAREEND ; Tell sharer we're done with THISSFT
422 CLC
423CheckDone:
424 LES BP,[THISDPB]
425 POP SI
426 POP BX
427 POP AX
428 POP DI
429 POP DS
430 return
431
432EndProc REN_DEL_Check
433
434Break <FastOpen_Delete - delete dir info in fastopen>
435
436; Inputs:
437; None
438; Function:
439; Call FastOpen to delete the dir info.
440; Outputs:
441; None
442;
443;
444
445 procedure FastOpen_Delete,NEAR
446ASSUME DS:NOTHING,ES:NOTHING
447 PUSHF ; save flag
448 PUSH SI ; save registers
449 PUSH BX
450 PUSH AX
451
452 MOV SI,[WFP_Start] ; ds:si points to path name
453 MOV AL,FONC_delete ; al = 3
454fastinvoke:
455 MOV BX,OFFSET DOSGROUP:FastTable + 2
456 CALL DWORD PTR [BX] ; call fastopen
457
458 POP AX ; restore registers
459 POP BX
460 POP SI
461 POPF ; restore flag
462 return
463EndProc FastOpen_Delete
464
465
466Break <FastOpen_Update - update dir info in fastopen>
467
468; Inputs:
469; DL drive number (A=0,B=1,,,)
470; CX first cluster #
471; AH 0 updates dir entry
472; 1 updates CLUSNUM , BP = new CLUSNUM
473; ES:DI directory entry
474; Function:
475; Call FastOpen to update the dir info.
476; Outputs:
477; None
478;
479;
480
481 procedure FastOpen_Update,NEAR
482ASSUME DS:NOTHING,ES:NOTHING
483 PUSHF ; save flag
484 PUSH SI
485 PUSH BX ; save regs
486 PUSH AX
487
488 MOV AL,FONC_update ; al = 4
489 JMP fastinvoke
490
491EndProc FastOpen_Update
492
493Break <FastSeek_Open - create a file extent cache entry>
494
495; Inputs:
496; DL drive number (0=A,1=B,,,)
497; CX first cluster #
498; Function:
499; Create a file extent cache entry
500; Outputs:
501; None
502;
503;
504
505 procedure FastSeek_Open,NEAR ;AN000;
506ASSUME DS:NOTHING,ES:NOTHING ;AN000;
507 ;AN000;
508 TEST [FastSeekflg],Fast_yes ; Fastseek installed ? ;AN000;
509 JZ fs_no11 ; no ;AN000;
510 PUSH SI ; save regs ;AN000;
511 PUSH AX ;AN000;
512 MOV AL,FSEC_open ; al = 11 ;AN000;
513fseek_disp: ;AN000;
514 CALL FSeek_dispatch ; call fastseek ;AN000;
515 POP AX ; restore regs ;AN000;
516 POP SI ;AN000;
517fs_no11: ;AN000;
518 return ; return ;AN000;
519EndProc FastSeek_Open ;AN000;
520
521; Inputs:
522; none
523; Function:
524; Call Fastseek
525; Outputs:
526; Output of Fastseek
527;
528
529 procedure FSeek_dispatch,NEAR
530ASSUME DS:NOTHING,ES:NOTHING ;AN000;
531 ;AN000;
532 MOV AH,FastSeek_ID ; fastseek ID = 1 ;AN000;
533 entry Fast_Dispatch ; future fastxxxx entry ;AN000;
534 PUSH AX ; save ax ;AN000;
535 MOV AL,AH ; al=fastseek ID ;AN000;
536 XOR AH,AH ; ;AN000;
537 DEC AX ; ;AN000;
538 SHL AX,1 ; times 4 to get entry offset ;AN000;
539 SHL AX,1 ;AN000;
540 ;AN000;
541 MOV SI,OFFSET DOSGROUP:FastTable + 2 ; index to the ;AN000;
542 ADD SI,AX ; fastxxxx entry ;AN000;
543 POP AX ; restore ax ;AN000;
544 CALL DWORD PTR CS:[SI] ; call fastseek ;AN000;
545 return
546EndProc FSeek_dispatch
547
548Break <FastSeek_Close - close a file extent entry>
549
550; Inputs:
551; DL drive number (0=A,1=B,,,)
552; CX first cluster #
553; Function:
554; Close a file extent entry
555; Outputs:
556; None
557;
558;
559
560 procedure FastSeek_Close,NEAR
561ASSUME DS:NOTHING,ES:NOTHING ;AN000;
562
563 TEST [FastSeekflg],Fast_yes ; Fastseek installed ? ;AN000;
564 JZ fs_no2 ; no ;AN000;
565 PUSH SI ; save regs ;AN000;
566 PUSH AX ; ;AN000;
567 MOV AL,FSEC_close ; al = 12 ;AN000;
568 JMP fseek_disp ; call fastseek ;AN000;
569EndProc FastSeek_Close ;AN000;
570
571Break <FastSeek_Delete - delete a file extent entry>
572
573; Inputs:
574; DL drive number (0=A,1=B,,,)
575; CX first cluster #
576; Function:
577; Delete a file extent entry
578; Outputs:
579; None
580;
581;
582
583 procedure FastSeek_Delete,NEAR
584ASSUME DS:NOTHING,ES:NOTHING ;AN000;
585 ;AN000;
586 TEST [FastSeekflg],Fast_yes ; Fastseek installed ? ;AN000;
587 JZ fs_no2 ; no ;AN000;
588 PUSH SI ; save regs ;AN000;
589 PUSH AX ;AN000;
590 MOV AL,FSEC_delete ; al=13 ;AN000;
591 JMP fseek_disp ; call fastseek ;AN000;
592EndProc FastSeek_Delete ;AN000;
593 ;AN000;
594; Inputs:
595; FastSeekflg= 0 , not installed
596; 1 , installed
597; BX= first cluster number
598; ES:BP = addr of DPB
599; Function:
600; Delete a file extent entry
601; Outputs:
602; None
603;
604
605 procedure Delete_FSeek,NEAR ;AN000;
606ASSUME DS:NOTHING,ES:NOTHING ;AN000;
607 TEST [FastSeekflg],Fast_yes ; Fastseek installed ? ;AN000;
608 JZ fs_no2 ; no ;AN000;
609 PUSH CX ; save regs ;AN000;
610 PUSH DX ;AN000;
611 MOV CX,BX ; first cluster # ;AN000;
612 MOV DL,ES:[BP.dpb_drive] ; drive # ;AN000;
613 CALL FastSeek_Delete ; call fastseek to delete an entry ;AN000;
614 POP DX ; restore regs ;AN000;
615 POP CX ;AN000;
616fs_no2: ;AN000;
617 return ; exit ;AN000;
618EndProc Delete_FSeek ;AN000;
619
620Break <FastSeek_Lookup - look up a cluster number>
621
622; Inputs:
623; FSeek_drive : drive number (0=A,1=B,,,)
624; FSeek_firclus: first cluster #
625; FSeek_logclus: logical cluster #
626; Function:
627; Look up a physical cluster #
628; Outputs:
629; carry clear, DI = physical cluster #, FSeek_logsave=DI-1
630; carry set,
631; partially found, DI=last physical cluster #
632; FSeek_logsave=last logical cluster #
633
634 procedure FastSeek_Lookup,NEAR ;AN000;
635ASSUME DS:NOTHING,ES:NOTHING ;AN000;
636
637 PUSH AX ; save ax ;AN000;
638 MOV AL,FSEC_lookup ; al = 14 ;AN000;
639 PUSH BX ; save bx ;AN000;
640 CALL FS_doit ; call fastseek ;AN000;
641 MOV [FSeek_logsave],BX ; save returned BX ;AN000;
642 POP BX ; restore bx ;AN000;
643 POP AX ; restore ax ;AN000;
644 return ;AN000;
645EndProc FastSeek_Lookup ;AN000;
646 ;AN000;
647
648Break <FastSeek_Insert - insert a cluster number>
649
650; Inputs:
651; FSeek_drive : drive number (0=A,1=B,,,)
652; FSeek_firclus: first cluster #
653; FSeek_logclus: logical cluster #
654; DI: physical cluster # to be inserted
655; Function:
656; insert a physical cluster #
657; Outputs:
658; none
659;
660
661 procedure FastSeek_Insert,NEAR
662ASSUME DS:NOTHING,ES:NOTHING
663
664 TEST [FastSeekflg],FS_insert ; insert mode set ? ;AN000;
665 JZ no_insert ; no ;AN000;
666 ;AN000;
667 PUSH AX ; save regs ;AN000;
668 PUSH BX ;AN000;
669 MOV AL,FSEC_insert ; al = 15 ;AN000;
670FSentry: ;AN000;
671 CALL FS_doit ; call fastseek ;AN000;
672 POP BX ; restore regs ;AN000;
673 POP AX ;AN000;
674no_insert:
675 return
676EndProc FastSeek_insert
677
678Break <FastSeek_Truncate - truncate cluster numbers>
679
680; Inputs:
681; FSeek_drive : drive number (0=A,1=B,,,)
682; FSeek_firclus: first cluster #
683; FSeek_logclus: logical cluster #
684; Function:
685; truncate physical cluster #s starting from FSeek_logclus
686; Outputs:
687; none
688;
689
690 procedure FastSeek_Truncate,NEAR
691ASSUME DS:NOTHING,ES:NOTHING
692 ;AN000;
693 TEST [FastSeekflg],Fast_yes ; Fastseek installed ? ;AN000;
694 JZ fs_no ; no ;AN000;
695 PUSH AX ; save regs ;AN000;
696 PUSH BX ;AN000;
697 MOV AL,FSEC_truncate ; al = 16 ;AN000;
698 JMP FSentry ; call fastseek ;AN000;
699fs_no: ;AN000;
700 return ;AN000;
701EndProc FastSeek_Truncate ;AN000;
702
703; Inputs:
704; FSeek_drive : drive number (0=A,1=B,,,)
705; FSeek_firclus: first cluster #
706; FSeek_logclus: logical cluster #
707; Function:
708; set up parameters and call fastseek
709; Outputs:
710; outputs of fastseek
711;
712 procedure FS_doit,NEAR
713ASSUME DS:NOTHING,ES:NOTHING
714 ;AN000;
715 PUSH CX ; save regs ;AN000;
716 PUSH DX ;AN000;
717 PUSH SI ;AN000;
718 MOV DL,[FSeek_drive] ; set drive # ;AN000;
719 MOV CX,[FSeek_firclus] ; set 1st cluster # ;AN000;
720 MOV BX,[FSeek_logclus] ; set logical cluster # ;AN000;
721 ;AN000;
722 CALL FSeek_dispatch ; call fastseek ;AN000;
723 ;AN000;
724 ; carry clear if found in DI ;AN000;
725 POP SI ; otherwise, carry set ;AN000;
726 ;AN000;
727 POP DX ; restore regs ;AN000;
728 POP CX ;AN000;
729 return ;AN000;
730EndProc FS_doit ;AN000;
731
732
733; Inputs:
734; same as DOS_SEARCH_FIRST
735; Function:
736; do a IFS search first
737; Outputs:
738; same as DOS_SEARCH_FIRST
739;
740 procedure IFS_SEARCH_FIRST,NEAR ;AN000;
741 DOSAssume CS,<DS>,"IFS_SEARCH_FIRST" ;AN000;
742 ASSUME ES:NOTHING ;AN000;
743
744; MOV WORD PTR [DMAADD+2],DS ;IFS. replace with scratch area ;AN000;;AN000;
745; MOV WORD PTR [DMAADD],OFFSET DOSGROUP:RENAMEDMA ;IFS. ;AN000;
746; invoke SET_THISDPB ;IFS. THISDPB set ;AN000;
747; invoke DOS_SEARCH_FIRST ;IFS. search first ;AN000;
748; return ;AN000;
749EndProc IFS_SEARCH_FIRST ;AN000;
750
751
752; Inputs:
753; THISDPB set
754; WFP_Start points to name
755; Function:
756; do a IFS REN_DEL_CHECK
757; Outputs:
758; same as REN_DEL_CHECK
759;
760 procedure IFS_REN_DEL_CHECK,NEAR ;AN000;
761 DOSAssume CS,<DS>,"IFS_REN_DEL_CHECK" ;AN000;
762 ASSUME ES:NOTHING ;AN000;
763
764; MOV AX,WORD PTR [DMAADD+2] ;IFS. set up ;AN000;;AN000;
765; MOV WORD PTR [CURBUF+2],AX ;IFS. curbuf+2 : bx -> dir entry ;AN000;
766; MOV BX,WORD PTR [DMAADD] ;IFS. ;AN000;
767; ADD BX,21 ;IFS. ;AN000;
768; MOV SI,BX ;IFS. curbuf+2:si -> dir_first ;AN000;
769; ADD SI,dir_first ;IFS. ;AN000;
770; EnterCrit critDisk ;IFS. enter critical section ;AN000;
771; CALL REN_DEL_Check ;IFS. share check ;AN000;
772; LeaveCrit critDisk ;IFS. leave critical section ;AN000;
773; return ;AN000;
774EndProc IFS_REN_DEL_CHECK ;AN000;
775
776CODE ENDS
777 END