     1                                  ;	SCCSID = @(#)dircall.asm	1.1 85/04/10
     2                                  ;	SCCSID = @(#)dircall.asm	1.1 85/04/10
     3                                  ;TITLE DIRCALL - Directory manipulation internal calls
     4                                  ;NAME  DIRCALL
     5                                  ; Low level directory manipulation routines for making removing and
     6                                  ;   verifying local or NET directories
     7                                  ;
     8                                  ;   DOS_MKDIR
     9                                  ;   DOS_CHDIR
    10                                  ;   DOS_RMDIR
    11                                  ;
    12                                  ;   Modification history:
    13                                  ;
    14                                  ;	Created: ARR 30 March 1983
    15                                  ;
    16                                  
    17                                  ;
    18                                  ; get the appropriate segment definitions
    19                                  ;
    20                                  [list -]
    20          ******************       warning: redefining multi-line macro `struc' [-w+pp-macro-redef-multi]
    14                              <4> [list -]
    14                              <3> [list -]
     3                              <2> 
     4                              <2> addsection DOSSTART, align=16 PUBLIC class=DOSSTART
     5                              <2> ; (no prior section) ; DOSSTART		ENDS
     6                              <2> 
     7                              <2> addsection DOSSTARTJUMP, align=1 PUBLIC class=START
     8                              <2> ; (no prior section) ; DOSSTARTJUMP		ENDS
     9                              <2> 
    10                              <2> addsection CONSTANTS, align=2 PUBLIC class=CONST
    11                              <2> ; (no prior section) ; CONSTANTS	ENDS
    12                              <2> 
    13                              <2> addsection DATA, align=2 PUBLIC class=DATA
    14                              <2> ; (no prior section) ; DATA		ENDS
    15                              <2> 
    16                              <2> addsection TABLE, align=2 PUBLIC class=TABLE
    17                              <2> ; (no prior section) ; TABLE		ENDS
    18                              <2> 
    19                              <2> addsection DOSDATATABLE, align=2 PUBLIC class=DOSDATACODE
    20                              <2> ; (no prior section) ; DOSDATATABLE		ENDS
    21                              <2> 
    22                              <2> addsection DOSDATACODE, align=1 PUBLIC class=DOSDATACODE
    23                              <2> ; (no prior section) ; DOSDATACODE		ENDS
    24                              <2> 
    25                              <2> addsection DOSBIODATA, align=2 PUBLIC class=DOSBIODATA
    26                              <2> 
    27                              <2> addsection LAST, align=16 PUBLIC class=LAST
    28                              <2> ; (no prior section) ; LAST		ENDS
    29                              <2> 
    30                              <2> group DOSGROUP DOSSTART DOSSTARTJUMP CONSTANTS DATA TABLE DOSDATATABLE DOSDATACODE DOSBIODATA LAST
     8                              <1> 
     9                              <1> %include "dcodeseg.nas"
     1                              <2> 
     2                              <2> %ifndef DCODESEGNAS
     3                              <2> %assign DCODESEGNAS 1
     4                              <2> 
     5                              <2> section DOSCODETABLE align=2 PUBLIC class=DOSCODE
     6                              <2> ; (no prior section) ; DOSCODETABLE		ENDS
     7                              <2> section DOSCODECODE align=1 PUBLIC class=DOSCODE
     8                              <2> ; (no prior section) ; DOSCODECODE		ENDS
     9                              <2> section DOSBIOCODE align=2 PUBLIC class=DOSCODE
    10                              <2> section BIOCODE	align=2 PUBLIC class=DOSCODE
    11                              <2> 
    12                              <2> %ifnidni DOSENTRYGROUP, DOSCODEGROUP
    13                              <2>  group DOSCODEGROUP DOSCODETABLE DOSCODECODE DOSBIOCODE BIOCODE
    14                              <2> %endif
    15                              <2> 
    16                              <2> %endif
    10                              <1> 
    11                              <1> section LAST
    12                              <1> ; (no prior section) ; LAST		ENDS
    22                                  
    23                                  [list +]
    24                                  section DOSCODECODE
    25                                  [list -]
    25          ******************       warning: out: ... for DOS Version 4.00 ... [-w+user]
    25          ******************       warning: out: BPB.INC... [-w+user]
    25          ******************       warning: out: ... CLONE version build switch on ... [-w+user]
    25          ******************       warning: out: DEVSYM.INC... [-w+user]
    34                                  
    35                                  %iassign Installed TRUE
    36                                  
    37                                  	i_need	THISSFT,DWORD
    38                                  	i_need	THISCDS,DWORD
    39                                  	i_need	NoSetDir,BYTE
    40                                  	i_need	CURBUF, DWORD
    41                                  	i_need	DIRSTART,WORD
    42                                  	i_need	THISDPB,DWORD
    43                                  	i_need	NAME1,BYTE
    44                                  	i_need	LASTENT,WORD
    45                                  	i_need	SATTRIB,BYTE
    46                                  	i_need	ATTRIB,BYTE
    47                                  	i_need	ALLOWED,BYTE
    48                                  	i_need	FAILERR,BYTE
    49                                  	i_need	RenBuf,BYTE
    50                                  	i_need	FastOpenFlg,BYTE		  ; DOS 3.3
    51                                  	i_need	FastOpenTable,BYTE		  ; DOS 3.3
    52                                  	i_need	WFP_START,WORD			  ; DOS 3.3
    53                                  	i_need	HIGH_SECTOR,WORD		  ; F.C. >32mb
    54                                  
    55                                   assume nocheck, ss:DOSGROUP
    56                                  
    57                                  BREAK <DOS_MkDir - Make a directory entry>
    58                                  
    59                                  ; Inputs:
    60                                  ;	[WFP_START] Points to WFP string ("d:/" must be first 3 chars, NUL
    61                                  ;		terminated)
    62                                  ;	[CURR_DIR_END] Points to end of Current dir part of string
    63                                  ;		( = -1 if current dir not involved, else
    64                                  ;		 Points to first char after last "/" of current dir part)
    65                                  ;	[THISCDS] Points to CDS being used
    66                                  ;		(Low word = -1 if NUL CDS (Net direct request))
    67                                  ; Function:
    68                                  ;	Make a new directory
    69                                  ; Returns:
    70                                  ;	Carry Clear
    71                                  ;		No error
    72                                  ;	Carry Set
    73                                  ;	    AX is error code
    74                                  ;		error_path_not_found
    75                                  ;			Bad path (not in curr dir part if present)
    76                                  ;		error_bad_curr_dir
    77                                  ;			Bad path in current directory part of path
    78                                  ;		error_access_denied
    79                                  ;			Already exists, device name
    80                                  ; DS preserved, Others destroyed
    81                                  
    82                                  	procedure   DOS_MKDIR,NEAR
    82          ******************       warning: proc DOS_MKDIR... [-w+user]
    83                                  	DOSAssume   CS,<DS>,"DOS_MkDir"
    84                                  	ASSUME	ES:NOTHING
    85                                  
    86 00000000 E8(0000)                	Invoke	TestNet
    87                                  local_mkdir equ LOCAL_MKDIR	; NASM port label
    88 00000003 7314                    	JNC	local_mkdir
    89                                  %IFN Installed
    90                                  	transfer NET_MKDIR
    91                                  %ELSE
    92                                  multNET equ MultNET	; NASM port equate
    93 00000005 B80311                  	MOV	AX,(multNET << 8) | 3
    94 00000008 CD2F                    	INT	2FH
    95 0000000A C3                      	return
    96                                  %ENDIF
    97                                  
    98                                  NODEACCERRJ:
    99 0000000B B80500                  	MOV	AX,error_access_denied
   100                                  BadRet:
   101 0000000E F9                      	STC
   102 0000000F E8(0000)                	LeaveCrit   critDisk
   103 00000012 C3                      	return
   104                                  
   105                                  PATHNFJ:
   106 00000013 E8(0000)                	LeaveCrit   critDisk
   107 00000016 E9(0000)                	transfer SET_MKND_ERR		; Map the MakeNode error and return
   108                                  
   109                                  LOCAL_MKDIR:
   110 00000019 E8(0000)                	EnterCrit   critDisk
   111                                  ;
   112                                  ; MakeNode requires an SFT to fiddle with.  We Use a temp spot (RENBUF)
   113                                  ;
   114 0000001C 8C16[0200]              	MOV	WORD PTR [THISSFT+2],SS
   115                                  DOSGroup equ DOSGROUP	; NASM port equate
   116 00000020 C706[0000][0000]        	MOV	WORD PTR [THISSFT],OFFSET RenBuf wrt DOSGroup
   117                                  ;
   118                                  ;  NOTE: Need WORD PTR because MASM takes type of
   119                                  ;   TempSFT (byte) instead of type of sf_mft (word).
   120                                  ;
   121                                  sf_mft equ sf_MFT	; NASM port equate
   122 00000026 C706[3300]0000          	MOV	WORD [RenBuf + sf_mft],0    ; make sure SHARER won't complain.
   123 0000002C B010                    	MOV	AL,attr_directory
   124 0000002E E8(0000)                	invoke	MAKENODE
   125                                  
   126 00000031 72E0                    	JC	PATHNFJ
   127 00000033 83F803                  	CMP	AX,3
   128 00000036 74D3                    	JZ	NODEACCERRJ	; Can't make a device into a directory
   129 00000038 C42E[0000]              	LES	BP,[THISDPB]	; Makenode zaps this
   130 0000003C C53E[0000]              	LDS	DI,[CURBUF]
   131                                  ASSUME	DS:NOTHING
   132 00000040 29FE                    	SUB	SI,DI
   133 00000042 56                      	PUSH	SI		; Pointer to dir_first
   134 00000043 FF750A                  	PUSH	WORD PTR [DI + buf_sector+2]	    ;F.C. >32mb
   135                                  
   136 00000046 FF7508                  	PUSH	WORD PTR [DI + buf_sector] ; Sector of new node
   137 00000049 161F                    	context DS
   138 0000004B FF36[0000]              	PUSH	word [DIRSTART]	; Parent for .. entry
   139 0000004F 31C0                    	XOR	AX,AX
   140 00000051 A3[0000]                	MOV	[DIRSTART],AX	; Null directory
   141 00000054 E8(0000)                	invoke	NEWDIR
   142 00000057 7277                    	JC	NODEEXISTSPOPDEL    ; No room
   143 00000059 E8(0000)                	invoke	GETENT		; First entry
   144 0000005C 7272                    	JC	NODEEXISTSPOPDEL    ; Screw up
   145 0000005E C43E[0000]              	LES	DI,[CURBUF]
   146                                  
   147 00000062 26F6450540              	TEST	byte [ES:DI + buf_flags],buf_dirty  ;LB. if already dirty		;AN000;
   148 00000067 7508                    	JNZ	yesdirty		  ;LB.	  don't increment dirty count   ;AN000;
   149 00000069 E8(0000)                	invoke	INC_DIRTY_COUNT 	  ;LB.					;AN000;
   150 0000006C 26804D0540              	OR	byte [ES:DI + buf_flags],buf_dirty
   151                                  yesdirty:
   152 00000071 83C710                  	ADD	DI,BUFINSIZ	; Point at buffer
   153 00000074 B82E20                  	MOV	AX,202EH	; ". "
   154 00000077 8B16[0000]              	MOV	DX,[DIRSTART]	; Point at itself
   155 0000007B E8(0000)                	invoke	SETDOTENT
   156 0000007E B82E2E                  	MOV	AX,2E2EH	; ".."
   157 00000081 5A                      	POP	DX		; Parent
   158 00000082 E8(0000)                	invoke	SETDOTENT
   159 00000085 C42E[0000]              	LES	BP,[THISDPB]
   160                                  allowed_FAIL equ Allowed_FAIL	; NASM port equate
   161                                  allowed_RETRY equ Allowed_RETRY	; NASM port equate
   162 00000089 C606[0000]18            	MOV	byte [ALLOWED],allowed_FAIL + allowed_RETRY
   163 0000008E 5A                      	POP	DX		; Entry sector
   164 0000008F 8F06[0000]              	POP	word [HIGH_SECTOR]	;F.C. >32mb
   165                                  
   166 00000093 30C0                    	XOR	AL,AL		; Pre read
   167 00000095 E8(0000)                	invoke	GETBUFFR
   168 00000098 7263                    	JC	NODEEXISTSP
   169 0000009A 8B16[0000]              	MOV	DX,[DIRSTART]
   170 0000009E C53E[0000]              	LDS	DI,[CURBUF]
   171                                  ASSUME	DS:NOTHING
   172 000000A2 804D0504                	OR	byte [DI + buf_flags],buf_isDIR
   173 000000A6 5E                      	POP	SI		; dir_first pointer
   174 000000A7 01FE                    	ADD	SI,DI
   175 000000A9 8914                    	MOV	[SI],DX
   176 000000AB 31D2                    	XOR	DX,DX
   177 000000AD 895402                  	MOV	[SI+2],DX	; Zero size
   178 000000B0 895404                  	MOV	[SI+4],DX
   179                                  DIRUP:
   180 000000B3 F6450540                	TEST	byte [DI + buf_flags],buf_dirty  ;LB. if already dirty 		;AN000;
   181 000000B7 7507                    	JNZ	yesdirty2		  ;LB.	  don't increment dirty count   ;AN000;
   182 000000B9 E8(0000)                	invoke	INC_DIRTY_COUNT 	  ;LB.					;AN000;
   183 000000BC 804D0540                	OR	byte [DI + buf_flags],buf_dirty	; Dirty buffer
   184                                  yesdirty2:
   185 000000C0 161F                    	context DS
   186 000000C2 268A4600                	MOV	AL,[ES:BP + dpb_drive]
   187 000000C6 E8(0000)                	invoke	FLUSHBUF
   188 000000C9 B80500                  	MOV	AX,error_access_denied
   189 000000CC E8(0000)                	LeaveCrit   critDisk
   190 000000CF C3                      	return
   191                                  
   192                                  NODEEXISTSPOPDEL:
   193 000000D0 5A                      	POP	DX		; Parent
   194 000000D1 5A                      	POP	DX		; Entry sector
   195 000000D2 8F06[0000]              	POP	word [HIGH_SECTOR]	; F.C. >32mb
   196                                  
   197 000000D6 C42E[0000]              	LES	BP,[THISDPB]
   198 000000DA C606[0000]18            	MOV	byte [ALLOWED],allowed_FAIL + allowed_RETRY
   199 000000DF 30C0                    	XOR	AL,AL		; Pre read
   200 000000E1 E8(0000)                	invoke	GETBUFFR
   201 000000E4 7217                    	JC	NODEEXISTSP
   202 000000E6 C53E[0000]              	LDS	DI,[CURBUF]
   203                                  ASSUME	DS:NOTHING
   204 000000EA 804D0504                	OR	byte [DI + buf_flags],buf_isDIR
   205 000000EE 5E                      	POP	SI		; dir_first pointer
   206 000000EF 01FE                    	ADD	SI,DI
   207 000000F1 83EE1A                  	SUB	SI,dir_first	;Point back to start of dir entry
   208 000000F4 C604E5                  	MOV	BYTE PTR [SI],0E5H    ; Free the entry
   209 000000F7 E8B9FF                  	CALL	DIRUP		; Error doesn't matter since erroring anyway
   210                                  NODEEXISTS:
   211 000000FA E90EFF                  	JMP	NODEACCERRJ
   212                                  
   213                                  NODEEXISTSP:
   214 000000FD 5E                      	POP	SI		; Clean stack
   215 000000FE EBFA                    	JMP	NODEEXISTS
   216                                  
   217                                  EndProc DOS_MKDIR
   218                                  
   219                                  BREAK <DOS_ChDir -- Verify a directory>
   220                                  
   221                                  ; Inputs:
   222                                  ;	[WFP_START] Points to WFP string ("d:/" must be first 3 chars, NUL
   223                                  ;		terminated)
   224                                  ;	[CURR_DIR_END] Points to end of Current dir part of string
   225                                  ;		( = -1 if current dir not involved, else
   226                                  ;		 Points to first char after last "/" of current dir part)
   227                                  ;	[THISCDS] Points to CDS being used May not be NUL
   228                                  ; Function:
   229                                  ;	Validate the path for potential new current directory
   230                                  ; Returns:
   231                                  ;	NOTE:
   232                                  ;	    [SATTRIB] is modified by this call
   233                                  ;	Carry Clear
   234                                  ;	    CX is cluster number of the DIR, LOCAL CDS ONLY
   235                                  ;		Caller must NOT set ID fields on a NET CDS.
   236                                  ;	Carry Set
   237                                  ;	    AX is error code
   238                                  ;		error_path_not_found
   239                                  ;			Bad path
   240                                  ;		error_access_denied
   241                                  ;			device or file name
   242                                  ; DS preserved, Others destroyed
   243                                  
   244                                  	procedure   DOS_CHDIR,NEAR
   244          ******************       warning: proc DOS_CHDIR... [-w+user]
   245                                  	DOSAssume   CS,<DS>,"DOS_Chdir"
   246                                  	ASSUME	ES:NOTHING
   247                                  
   248 00000100 E8(0000)                	Invoke	TestNet
   249 00000103 7306                    	JNC	LOCAL_CHDIR
   250                                  %IFN Installed
   251                                  	transfer NET_CHDIR
   252                                  %ELSE
   253 00000105 B80511                  	MOV	AX,(multNET << 8) | 5
   254 00000108 CD2F                    	INT	2FH
   255 0000010A C3                      	return
   256                                  %ENDIF
   257                                  
   258                                  LOCAL_CHDIR:
   259 0000010B E8(0000)                	EnterCrit   critDisk
   260 0000010E 26F745430020            	TEST	word [ES:DI + curdir_flags],curdir_splice ;PTM.
   261 00000114 7406                    	JZ	nojoin				   ;PTM.
   262 00000116 26C74549FFFF            	MOV	word [ES:DI + curdir_ID],0FFFFH	   ;PTM.
   263                                  nojoin:
   264 0000011C C606[0000]00            	MOV	byte [NoSetDir],FALSE
   265 00000121 C606[0000]16            	MOV	byte [SATTRIB],attr_directory+attr_system+attr_hidden
   266                                  				; Dir calls can find these
   267                                  ; DOS 3.3  6/24/86 FastOpen
   268                                  
   269 00000126 800E[0000]01            	OR	byte [FastOpenFlg],FastOpen_Set	   ; set fastopen flag
   270 0000012B E8(0000)                	invoke	GetPath
   271 0000012E 9C                      	PUSHF									;AN000;
   272 0000012F 8026[0000]80            	AND	byte [FastOpenFlg],Fast_yes		   ; clear it all		;AC000;
   273 00000134 9D                      	POPF									;AN000;
   274                                  ; DOS 3.3  6/24/86 FastOpen
   275 00000135 B80300                  	MOV	AX,error_path_not_found
   276 00000138 7207                    	JC	ChDirDone
   277 0000013A 753B                    	JNZ	NOTDIRPATH	; Path not a DIR
   278 0000013C 8B0E[0000]              	MOV	CX,[DIRSTART]	; Get cluster number
   279 00000140 F8                      	CLC
   280                                  ChDirDone:
   281 00000141 E8(0000)                	LeaveCrit   critDisk
   282 00000144 C3                      	return
   283                                  
   284                                  EndProc DOS_CHDIR
   285                                  
   286                                  BREAK <DOS_RmDir -- Remove a directory>
   287                                  
   288                                  ; Inputs:
   289                                  ;	[WFP_START] Points to WFP string ("d:/" must be first 3 chars, NUL
   290                                  ;		terminated)
   291                                  ;	[CURR_DIR_END] Points to end of Current dir part of string
   292                                  ;		( = -1 if current dir not involved, else
   293                                  ;		 Points to first char after last "/" of current dir part)
   294                                  ;	[THISCDS] Points to CDS being used
   295                                  ;		(Low word = -1 if NUL CDS (Net direct request))
   296                                  ; Function:
   297                                  ;	Remove a directory
   298                                  ;	NOTE: Attempt to remove current directory must be detected by caller
   299                                  ; Returns:
   300                                  ;	NOTE:
   301                                  ;	    [SATTRIB] is modified by this call
   302                                  ;	Carry Clear
   303                                  ;		No error
   304                                  ;	Carry Set
   305                                  ;	    AX is error code
   306                                  ;		error_path_not_found
   307                                  ;			Bad path (not in curr dir part if present)
   308                                  ;		error_bad_curr_dir
   309                                  ;			Bad path in current directory part of path
   310                                  ;		error_access_denied
   311                                  ;			device or file name, root directory
   312                                  ;			Bad directory ('.' '..' messed up)
   313                                  ; DS preserved, Others destroyed
   314                                  
   315                                  	procedure   DOS_RMDIR,NEAR
   315          ******************       warning: proc DOS_RMDIR... [-w+user]
   316                                  	DOSAssume   CS,<DS>,"DOS_RmDir"
   317                                  	ASSUME	ES:NOTHING
   318                                  
   319 00000145 E8(0000)                	Invoke	TestNet
   320                                  Local_RmDIR equ LOCAL_RMDIR	; NASM port label
   321 00000148 7306                    	JNC	Local_RmDIR
   322                                  %IFN Installed
   323                                  	transfer NET_RMDIR
   324                                  %ELSE
   325 0000014A B80111                  	MOV	AX,(multNET << 8) | 1
   326 0000014D CD2F                    	INT	2FH
   327 0000014F C3                      	return
   328                                  %ENDIF
   329                                  
   330                                  LOCAL_RMDIR:
   331 00000150 E8(0000)                	EnterCrit   critDisk
   332 00000153 C606[0000]00            	MOV	byte [NoSetDir],0
   333 00000158 C606[0000]16            	MOV	byte [SATTRIB],attr_directory+attr_system+attr_hidden
   334                                  				; Dir calls can find these
   335 0000015D E8(0000)                	invoke	GetPath
   336 00000160 720C                    	JC	NOPATH		; Path not found
   337 00000162 7513                    	JNZ	NOTDIRPATH	; Path not a DIR
   338 00000164 8B3E[0000]              	MOV	DI,[DIRSTART]
   339 00000168 09FF                    	OR	DI,DI		; Root ?
   340 0000016A 750E                    	JNZ	rmdir_get_buf	; No
   341 0000016C EB09                    	JMP	SHORT NOTDIRPATH
   342                                  
   343                                  NOPATH:
   344 0000016E B80300                  	MOV	AX,error_path_not_found
   345 00000171 E99AFE                  	JMP	BadRet
   346                                  
   347                                  NOTDIRPATHPOP:
   348 00000174 58                      	POP	AX			  ;F.C. >32mb
   349 00000175 58                      	POP	AX
   350                                  NOTDIRPATHPOP2:
   351 00000176 58                      	POP	AX
   352                                  NOTDIRPATH:
   353                                  NodeAccErrJ equ NODEACCERRJ	; NASM port label
   354 00000177 E991FE                  	JMP	NodeAccErrJ
   355                                  
   356                                  rmdir_get_buf:
   357 0000017A C53E[0000]              	LDS	DI,[CURBUF]
   358                                  ASSUME	DS:NOTHING
   359 0000017E 29FB                    	SUB	BX,DI		; Compute true offset
   360 00000180 53                      	PUSH	BX		; Save entry pointer
   361 00000181 FF750A                  	PUSH	WORD PTR [DI + buf_sector+2] ;F.C. >32mb
   362 00000184 FF7508                  	PUSH	WORD PTR [DI + buf_sector] ; Save sector number
   363 00000187 161F                    	context DS
   364 00000189 1607                    	context ES
   365 0000018B BF[0000]                	MOV	DI,OFFSET NAME1 wrt DOSGROUP
   366 0000018E B03F                    	MOV	AL,'?'
   367 00000190 B90B00                  	MOV	CX,11
   368 00000193 F3AA                    	REP	STOSB
   369 00000195 30C0                    	XOR	AL,AL
   370 00000197 AA                      	STOSB			; Nul terminate it
   371 00000198 E8(0000)                	invoke	STARTSRCH	; Set search
   372 0000019B E8(0000)                	invoke	GETENTRY	; Get start of directory
   373 0000019E 72D4                    	JC	NOTDIRPATHPOP	; Screw up
   374 000001A0 8E1E[0200]              	MOV	DS,WORD PTR [CURBUF+2]
   375                                  ASSUME	DS:NOTHING
   376 000001A4 89DE                    	MOV	SI,BX
   377 000001A6 AD                      	LODSW
   378 000001A7 3D2E20                  	CMP	AX,(' ' << 8) | '.'   ; First entry '.'?
   379 000001AA 75C8                    	JNZ	NOTDIRPATHPOP		; Nope
   380 000001AC 83C61E                  	ADD	SI,(dir_entry_struc_size) - 2 ; Next entry
   381 000001AF AD                      	LODSW
   382 000001B0 3D2E2E                  	CMP	AX,('.' << 8) | '.'   ; Second entry '..'?
   383 000001B3 75BF                    	JNZ	NOTDIRPATHPOP		; Nope
   384 000001B5 161F                    	context DS
   385 000001B7 C706[0000]0200          	MOV	word [LASTENT],2		; Skip . and ..
   386 000001BD E8(0000)                	invoke	GETENTRY		; Get next entry
   387 000001C0 72B2                    	JC	NOTDIRPATHPOP		; Screw up
   388 000001C2 C606[0000]16            	MOV	byte [ATTRIB],attr_directory+attr_hidden+attr_system
   389 000001C7 E8(0000)                	invoke	SRCH			; Do a search
   390 000001CA 73A8                    	JNC	NOTDIRPATHPOP		; Found another entry!
   391 000001CC 803E[0000]00            	CMP	byte [FAILERR],0
   392 000001D1 75A1                    	JNZ	NOTDIRPATHPOP		; Failure of search due to I 24 FAIL
   393 000001D3 C42E[0000]              	LES	BP,[THISDPB]
   394 000001D7 8B1E[0000]              	MOV	BX,[DIRSTART]
   395                                  ;; FastSeek 10/27/86
   396 000001DB E8(0000)                	invoke	Delete_FSeek		; delete the fastseek entry
   397                                  ;; FastSeek 10/27/86
   398 000001DE E8(0000)                	invoke	RELEASE 		; Release data in sub dir
   399 000001E1 7291                    	JC	NOTDIRPATHPOP		; Screw up
   400 000001E3 5A                      	POP	DX			; Sector # of entry
   401 000001E4 8F06[0000]              	POP	word [HIGH_SECTOR]		; F.C. >32mb
   402                                  
   403 000001E8 C606[0000]18            	MOV	byte [ALLOWED],allowed_FAIL + allowed_RETRY
   404 000001ED 30C0                    	XOR	AL,AL			; Pre read
   405 000001EF E8(0000)                	invoke	GETBUFFR		; Get sector back
   406 000001F2 7282                    	JC	NOTDIRPATHPOP2		; Screw up
   407 000001F4 C53E[0000]              	LDS	DI,[CURBUF]
   408                                  ASSUME	DS:NOTHING
   409 000001F8 804D0504                	OR	byte [DI + buf_flags],buf_isDIR
   410 000001FC 5B                      	POP	BX			; Pointer to start of entry
   411 000001FD 01FB                    	ADD	BX,DI			; Corrected
   412 000001FF C607E5                  	MOV	BYTE PTR [BX],0E5H	; Free the entry
   413                                  
   414                                  ;DOS 3.3 FastOpen  6/16/86  F.C.
   415 00000202 1E                      	PUSH	DS
   416 00000203 161F                    	context DS
   417 00000205 E8(0000)                	invoke	FastOpen_Delete 	; call fastopen to delete an entry
   418 00000208 1F                      	POP	DS
   419                                  ;DOS 3.3 FastOpen  6/16/86  F.C.
   420                                   assume ds:nothing
   421                                  
   422 00000209 E9A7FE                  	JMP	DIRUP			; In MKDIR, dirty buffer and flush
   423                                  
   424                                  EndProc DOS_RMDIR
   425                                  
   426                                      END
