1 PAGE
,132 ; \ f ;AN000;
2 ; SCCSID = @(#)ifsdir.asm 1.0 87/05/11 ;AN000;
3 TITLE IFSFUNC DIRECTORY ROUTINES
- Routines for IFS driver dispatch
;AN000;
5 ;************************************************************************************ ;AN000;
7 ; DIRECTORY related IFS driver calls ;AN000;
13 ; Programming notes: ;AN000;
14 ; Old redirector segmentation preserved. ;AN000;
15 ; Directory routines do not generate critical errors. ;AN000;
17 ; REVISION HISTORY: ;AN000;
18 ; A000 Original version 4.00 May 1987
19 ; A001 PTM 3671- check for null cds 3/88 RPS/RMG
24 ;************************************************************************************ ;AN000;
28 INCLUDE IFSSYM
.INC ;AN000;
29 INCLUDE IFSFSYM
.INC ;AN000;
30 INCLUDE DOSSYM
.INC ;AN000;
31 INCLUDE DEVSYM
.INC ;AN000;
35 AsmVars
<IBM
, Installed
, Debug
> ;AN000;
37 ; define the base code segment of the network support first ;AN000;
39 ifsseg
SEGMENT BYTE PUBLIC 'ifsseg' ;AN000;
42 ; include the rest of the segment definitions for normal MSDOS ;AN000;
44 include dosseg
.asm
;AN000;
46 DATA SEGMENT WORD PUBLIC 'DATA' ;AN000;
48 ; DOSGROUP data ;AN000;
49 Extrn WFP_START
:WORD ;AN000;
50 Extrn THISCDS
:DWORD ;AN000;
55 ; define our own code segment ;AN000;
57 ifsseg
SEGMENT BYTE PUBLIC 'ifsseg' ;AN000;
58 ASSUME
SS:DOSGROUP
,CS:ifsseg
;AN000;
61 Extrn IFSR
:WORD ;AN000;
62 Extrn DEVICE_CB@_OFFSET
:WORD ;AN000;
64 BREAK <IFS_RMDIR Remove an IFS Directory
> ;AN000;
65 ;************************************************************************************ ;AN000;
70 ; IFSFUNC Dispatcher ;AN000;
72 ; Routines called: ;AN000;
77 ; [WFP_START] Points to WFP string ;AN000;
78 ; [THISCDS] Points to CDS being used ;AN000;
81 ; Prep IFSRH as follows: (* indicate which fields set) ;AN000;
82 ; * IFSR_LENGTH DW 42 ; Request length ;AN000;
83 ; * IFSR_FUNCTION DB 4 ; Execute API function ;AN000;
84 ; IFSR_RETCODE DW ? ;AN000;
85 ; IFSR_RETCLASS DB ? ;AN000;
86 ; IFSR_RESV1 DB 16 DUP(0) ;AN000;
87 ; * IFSR_APIFUNC DB 4 ; Remove Directory ;AN000;
88 ; IFSR_ERROR_CLASS DB ? ;AN000;
89 ; IFSR_ERROR_ACTION DB ? ;AN000;
90 ; IFSR_ERROR_LOCUS DB ? ;AN000;
91 ; IFSR_ALLOWED DB ? ;AN000;
92 ; IFSR_I24_RETRY DB ? ;AN000;
93 ; IFSR_I24_RESP DB ? ;AN000;
94 ; IFSR_RESV2 DB ? ;AN000;
95 ; * IFSR_DEVICE_CB@ DD ? ; Call CDS_TO_CD to convert CDS to CD ;AN000;
96 ; ; and set this as pointer to it. ;AN000;
97 ; IFSR_OPEN_CB@ DD ? ;AN000;
98 ; * IFSR_NAME@ DD ? ; [WFP_START] ;AN000;
100 ; CALL routine, CALL_IFS, with pointer to CURDIR_IFSR_HDR ;AN000;
101 ; IF IFSR_RETCODE = 0 THEN ;AN000;
102 ; Call CD_TO_CDS ;AN000;
103 ; Clear carry ;AN000;
106 ; Put error code in AX ;AN000;
110 ; Carry clear: CDS FSDA updated ;AN000;
111 ; Carry set on error: error_path_not_found (bad path) ;AN000;
112 ; error_access_denied (file/device not empty) ;AN000;
114 ; Notes: DS preserved, others destroyed ;AN000;
116 ;************************************************************************************ ;AN000;
119 procedure IFS_RMDIR
,NEAR ;AN000;
121 entry IFS_SEQ_RMDIR
;AN000;
123 ifsr_fcn_def EXECAPI
; define ifsr fields for rmdir ;AN000;
124 ifsr_api_def RMDIR
;AN000;
126 PUSH DS ; preserve DS ;AN000;
128 invoke PREP_IFSR
; init ifsr, sets es:bx -> ifsr ;AN000;
130 MOV ES:[BX.IFSR_APIFUNC
],IFSRMDIR
;AN000;
131 JMP SHORT CHDIR_10
; go finish in ifs_chdir ;AN000;
133 EndProc IFS_RMDIR
;AN000;
135 BREAK <IFS_MKDIR Create an IFS Directory
> ;AN000;
137 ;************************************************************************************ ;AN000;
141 ; Called by: IFSFUNC Dispatcher ;AN000;
143 ; Routines called: CDS_TO_CD ;AN000;
147 ; [WFP_START] Points to WFP string ;AN000;
148 ; [THISCDS] Points to CDS being used. Not NULL. ;AN000;
151 ; Prep IFSRH as follows: (* indicate which fields set) ;AN000;
152 ; * IFSR_LENGTH DW 42 ; Request length ;AN000;
153 ; * IFSR_FUNCTION DB 4 ; Execute API function ;AN000;
154 ; IFSR_RETCODE DW ? ;AN000;
155 ; IFSR_RETCLASS DB ? ;AN000;
156 ; IFSR_RESV1 DB 16 DUP(0) ;AN000;
157 ; * IFSR_APIFUNC DB 3 ; Create Directory ;AN000;
158 ; IFSR_ERROR_CLASS DB ? ;AN000;
159 ; IFSR_ERROR_ACTION DB ? ;AN000;
160 ; IFSR_ERROR_LOCUS DB ? ;AN000;
161 ; IFSR_ALLOWED DB ? ;AN000;
162 ; IFSR_I24_RETRY DB ? ;AN000;
163 ; IFSR_I24_RESP DB ? ;AN000;
164 ; IFSR_RESV2 DB ? ;AN000;
165 ; * IFSR_DEVICE_CB@ DD ? ; Call CDS_TO_CD to convert CDS to CD ;AN000;
166 ; ; and set this as pointer to it. ;AN000;
167 ; IFSR_OPEN_CB@ DD ? ;AN000;
168 ; * IFSR_NAME@ DD ? ; [WFP_START] ;AN000;
170 ; CALL routine, CALL_IFS, with pointer to CURDIR_IFSR_HDR ;AN000;
172 ; IF IFSR_RETCODE = 0 THEN ;AN000;
173 ; Call CD_TO_CDS ;AN000;
174 ; Clear carry ;AN000;
177 ; Put error code in AX ;AN000;
181 ; Carry clear: CDS FSDA updated ;AN000;
182 ; Carry set on error: error_path_not_found (bad path) ;AN000;
183 ; error_access_denied ;AN000;
184 ; (Attempt to re-create read only file , or ;AN000;
185 ; create a second volume id or create a dir) ;AN000;
187 ; Notes: DS preserved, others destroyed ;AN000;
189 ;************************************************************************************ ;AN000;
191 procedure IFS_MKDIR
,NEAR ;AN000;
193 entry IFS_SEQ_MKDIR
;AN000;
195 ifsr_fcn_def EXECAPI
; define ifsr fields for mkdir ;AN000;
196 ifsr_api_def MKDIR
;AN000;
198 PUSH DS ; preserve DS ;AN000;
200 invoke PREP_IFSR
; init ifsr, sets es:bx -> ifsr ;AN000;
202 MOV ES:[BX.IFSR_APIFUNC
],IFSMKDIR
;AN000;
203 JMP SHORT CHDIR_10
; go finish in ifs_chdir ;AN000;
205 EndProc IFS_MKDIR
;AN000;
207 BREAK <IFS_CHDIR Check for validity
and change directory
> ;AN000;
210 ;************************************************************************************ ;AN000;
214 ; Called by: IFSFUNC Dispatcher ;AN000;
216 ; Routines called: CDS_TO_CD ;AN000;
221 ; [WFP_START] Points to WFP string ;AN000;
222 ; [THISCDS] Points to CDS being used. Not NUL. ;AN000;
225 ; Prep IFSRH as follows: (* indicate which fields set) ;AN000;
226 ; * IFSR_LENGTH DW 42 ; Request length ;AN000;
227 ; * IFSR_FUNCTION DB 4 ; Execute API function ;AN000;
228 ; IFSR_RETCODE DW ? ;AN000;
229 ; IFSR_RETCLASS DB ? ;AN000;
230 ; IFSR_RESV1 DB 16 DUP(0) ;AN000;
231 ; * IFSR_APIFUNC DB 5 ; Change Directory ;AN000;
232 ; IFSR_ERROR_CLASS DB ? ;AN000;
233 ; IFSR_ERROR_ACTION DB ? ;AN000;
234 ; IFSR_ERROR_LOCUS DB ? ;AN000;
235 ; IFSR_ALLOWED DB ? ;AN000;
236 ; IFSR_I24_RETRY DB ? ;AN000;
237 ; IFSR_I24_RESP DB ? ;AN000;
238 ; IFSR_RESV2 DB ? ;AN000;
239 ; * IFSR_DEVICE_CB@ DD ? ; Call CDS_TO_CD to convert CDS to CD ;AN000;
240 ; ; and set this as pointer to it. ;AN000;
241 ; IFSR_OPEN_CB@ DD ? ;AN000;
242 ; * IFSR_NAME@ DD ? ; [WFP_START] ;AN000;
244 ; CALL routine, CALL_IFS, with pointer to CURDIR_IFSR_HDR ;AN000;
246 ; IF IFSR_RETCODE = 0 THEN ;AN000;
247 ; Call CD_TO_CDS to update CDS ;AN000;
248 ; Clear carry ;AN000;
251 ; Put error code in AX ;AN000;
255 ; Carry clear: CDS updated. ;AN000;
256 ; Carry set on error: error_path_not_found (bad path) ;AN000;
257 ; error_access_denied ;AN000;
259 ; Notes: DS preserved, others destroyed ;AN000;
261 ;************************************************************************************ ;AN000;
263 procedure IFS_CHDIR
,NEAR ;AN000;
265 ifsr_fcn_def EXECAPI
; define ifsr fields for chdir ;AN000;
266 ifsr_api_def CHDIR
;AN000;
268 PUSH DS ; preserve DS ;AN000;
270 invoke PREP_IFSR
; init ifsr, sets es:bx -> ifsr ;AN000;
272 MOV ES:[BX.IFSR_APIFUNC
],IFSCHDIR
;AN000;
274 CHDIR_10: ; Welcome rmdir/mkdir code ;AN000;
275 MOV ES:[BX.IFSR_LENGTH
],LENGTH_CHDIR
;AN000;
276 MOV ES:[BX.IFSR_FUNCTION
],IFSEXECAPI
;AN000;
277 ; ds -> dosgroup ;AN000;
278 MOV SI,WORD PTR [WFP_START
] ; to access thiscds & wfp ;AN000;
279 invoke STRIP_WFP_START
; ditch leading d:\ ;AN000;
280 MOV WORD PTR ES:[BX.IFSR_NAME@
],SI ;AN000;
281 MOV WORD PTR ES:[BX.IFSR_NAME@
+2],DS ;AN000;
282 LDS SI,[THISCDS
] ;AN000;
283 SaveReg
<DS,SI> ;AN000;
284 MOV DEVICE_CB@_OFFSET
,IFSR_DEVICE_CB@
;AN000;
285 CMP SI,NULL_PTR
; skip cds work if cds null ;AN001;
287 invoke CDS_TO_CD
; CDS: sets [THISIFS] ;AN000;
288 ; IFSR_DEVICE_CB@ ;AN000;
289 ; ds - ifsseg ;AN000;
291 SaveReg
<CS> ; make sure ds = ifsseg ;AN001;
292 RestoreReg
<DS> ;AN001;
293 ;************************************************
294 invoke CALL_IFS
; call fs with dir request ;AN000;
295 ;************************************************
297 RestoreReg
<DI,ES> ; restore cds ptr into es:di ;AN000;
298 JC CHDIR_1000
;AN000;
299 CMP DI,NULL_PTR
; skip cds work if cds null ;AN001;
301 invoke CD_TO_CDS
; update cds ;AN000;
306 CHDIR_1000: ; finished ;AN000;
307 POP DS ; restore DS ;AN000;
310 EndProc IFS_CHDIR
;AN000;