1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
|
PAGE ,132 ; ;AN000;
; SCCSID = @(#)ifsdir.asm 1.0 87/05/11 ;AN000;
TITLE IFSFUNC DIRECTORY ROUTINES - Routines for IFS driver dispatch ;AN000;
NAME NETDIR ;AN000;
;************************************************************************************ ;AN000;
; ;AN000;
; DIRECTORY related IFS driver calls ;AN000;
; ;AN000;
; IFS_RMDIR ;AN000;
; IFS_MKDIR ;AN000;
; IFS_CHDIR ;AN000;
; ;AN000;
; Programming notes: ;AN000;
; Old redirector segmentation preserved. ;AN000;
; Directory routines do not generate critical errors. ;AN000;
; ;AN000;
; REVISION HISTORY: ;AN000;
; A000 Original version 4.00 May 1987
; A001 PTM 3671- check for null cds 3/88 RPS/RMG
; ;AN000;
; LOC - 67 ;AN000;
; LOD - 4 ;AN000;
; ;AN000;
;************************************************************************************ ;AN000;
;AN000;
.xlist ;AN000;
.xcref ;AN000;
INCLUDE IFSSYM.INC ;AN000;
INCLUDE IFSFSYM.INC ;AN000;
INCLUDE DOSSYM.INC ;AN000;
INCLUDE DEVSYM.INC ;AN000;
.cref ;AN000;
.list ;AN000;
;AN000;
AsmVars <IBM, Installed, Debug> ;AN000;
;AN000;
; define the base code segment of the network support first ;AN000;
;AN000;
ifsseg SEGMENT BYTE PUBLIC 'ifsseg' ;AN000;
ifsseg ENDS ;AN000;
;AN000;
; include the rest of the segment definitions for normal MSDOS ;AN000;
;AN000;
include dosseg.asm ;AN000;
;AN000;
DATA SEGMENT WORD PUBLIC 'DATA' ;AN000;
;AN000;
; DOSGROUP data ;AN000;
Extrn WFP_START:WORD ;AN000;
Extrn THISCDS:DWORD ;AN000;
;AN000;
DATA ENDS ;AN000;
;AN000;
;AN000;
; define our own code segment ;AN000;
;AN000;
ifsseg SEGMENT BYTE PUBLIC 'ifsseg' ;AN000;
ASSUME SS:DOSGROUP,CS:ifsseg ;AN000;
;AN000;
;IFS Data ;AN000;
Extrn IFSR:WORD ;AN000;
Extrn DEVICE_CB@_OFFSET:WORD ;AN000;
;AN000;
BREAK <IFS_RMDIR Remove an IFS Directory> ;AN000;
;************************************************************************************ ;AN000;
; ;AN000;
; IFS_RMDIR ;AN000;
; ;AN000;
;Called by: ;AN000;
; IFSFUNC Dispatcher ;AN000;
; ;AN000;
; Routines called: ;AN000;
; CDS_TO_CD ;AN000;
; CALL_IFS ;AN000;
; ;AN000;
; Inputs: ;AN000;
; [WFP_START] Points to WFP string ;AN000;
; [THISCDS] Points to CDS being used ;AN000;
; ;AN000;
; Function: ;AN000;
; Prep IFSRH as follows: (* indicate which fields set) ;AN000;
; * IFSR_LENGTH DW 42 ; Request length ;AN000;
; * IFSR_FUNCTION DB 4 ; Execute API function ;AN000;
; IFSR_RETCODE DW ? ;AN000;
; IFSR_RETCLASS DB ? ;AN000;
; IFSR_RESV1 DB 16 DUP(0) ;AN000;
; * IFSR_APIFUNC DB 4 ; Remove Directory ;AN000;
; IFSR_ERROR_CLASS DB ? ;AN000;
; IFSR_ERROR_ACTION DB ? ;AN000;
; IFSR_ERROR_LOCUS DB ? ;AN000;
; IFSR_ALLOWED DB ? ;AN000;
; IFSR_I24_RETRY DB ? ;AN000;
; IFSR_I24_RESP DB ? ;AN000;
; IFSR_RESV2 DB ? ;AN000;
; * IFSR_DEVICE_CB@ DD ? ; Call CDS_TO_CD to convert CDS to CD ;AN000;
; ; and set this as pointer to it. ;AN000;
; IFSR_OPEN_CB@ DD ? ;AN000;
; * IFSR_NAME@ DD ? ; [WFP_START] ;AN000;
; ;AN000;
; CALL routine, CALL_IFS, with pointer to CURDIR_IFSR_HDR ;AN000;
; IF IFSR_RETCODE = 0 THEN ;AN000;
; Call CD_TO_CDS ;AN000;
; Clear carry ;AN000;
; ELSE ;AN000;
; Set carry ;AN000;
; Put error code in AX ;AN000;
; ENDIF ;AN000;
; ;AN000;
; Outputs: ;AN000;
; Carry clear: CDS FSDA updated ;AN000;
; Carry set on error: error_path_not_found (bad path) ;AN000;
; error_access_denied (file/device not empty) ;AN000;
; ;AN000;
; Notes: DS preserved, others destroyed ;AN000;
; ;AN000;
;************************************************************************************ ;AN000;
;AN000;
;AN000;
procedure IFS_RMDIR,NEAR ;AN000;
;AN000;
entry IFS_SEQ_RMDIR ;AN000;
;AN000;
ifsr_fcn_def EXECAPI ; define ifsr fields for rmdir ;AN000;
ifsr_api_def RMDIR ;AN000;
;AN000;
PUSH DS ; preserve DS ;AN000;
;AN000;
invoke PREP_IFSR ; init ifsr, sets es:bx -> ifsr ;AN000;
;AN000;
MOV ES:[BX.IFSR_APIFUNC],IFSRMDIR ;AN000;
JMP SHORT CHDIR_10 ; go finish in ifs_chdir ;AN000;
;AN000;
EndProc IFS_RMDIR ;AN000;
;AN000;
BREAK <IFS_MKDIR Create an IFS Directory> ;AN000;
;AN000;
;************************************************************************************ ;AN000;
; ;AN000;
; IFS_MKDIR ;AN000;
; ;AN000;
; Called by: IFSFUNC Dispatcher ;AN000;
; ;AN000;
; Routines called: CDS_TO_CD ;AN000;
; CALL_IFS ;AN000;
; ;AN000;
; Inputs: ;AN000;
; [WFP_START] Points to WFP string ;AN000;
; [THISCDS] Points to CDS being used. Not NULL. ;AN000;
; ;AN000;
; Function: ;AN000;
; Prep IFSRH as follows: (* indicate which fields set) ;AN000;
; * IFSR_LENGTH DW 42 ; Request length ;AN000;
; * IFSR_FUNCTION DB 4 ; Execute API function ;AN000;
; IFSR_RETCODE DW ? ;AN000;
; IFSR_RETCLASS DB ? ;AN000;
; IFSR_RESV1 DB 16 DUP(0) ;AN000;
; * IFSR_APIFUNC DB 3 ; Create Directory ;AN000;
; IFSR_ERROR_CLASS DB ? ;AN000;
; IFSR_ERROR_ACTION DB ? ;AN000;
; IFSR_ERROR_LOCUS DB ? ;AN000;
; IFSR_ALLOWED DB ? ;AN000;
; IFSR_I24_RETRY DB ? ;AN000;
; IFSR_I24_RESP DB ? ;AN000;
; IFSR_RESV2 DB ? ;AN000;
; * IFSR_DEVICE_CB@ DD ? ; Call CDS_TO_CD to convert CDS to CD ;AN000;
; ; and set this as pointer to it. ;AN000;
; IFSR_OPEN_CB@ DD ? ;AN000;
; * IFSR_NAME@ DD ? ; [WFP_START] ;AN000;
; ;AN000;
; CALL routine, CALL_IFS, with pointer to CURDIR_IFSR_HDR ;AN000;
; ;AN000;
; IF IFSR_RETCODE = 0 THEN ;AN000;
; Call CD_TO_CDS ;AN000;
; Clear carry ;AN000;
; ELSE ;AN000;
; Set carry ;AN000;
; Put error code in AX ;AN000;
; ENDIF ;AN000;
; ;AN000;
; Outputs: ;AN000;
; Carry clear: CDS FSDA updated ;AN000;
; Carry set on error: error_path_not_found (bad path) ;AN000;
; error_access_denied ;AN000;
; (Attempt to re-create read only file , or ;AN000;
; create a second volume id or create a dir) ;AN000;
; ;AN000;
; Notes: DS preserved, others destroyed ;AN000;
; ;AN000;
;************************************************************************************ ;AN000;
;AN000;
procedure IFS_MKDIR,NEAR ;AN000;
;AN000;
entry IFS_SEQ_MKDIR ;AN000;
;AN000;
ifsr_fcn_def EXECAPI ; define ifsr fields for mkdir ;AN000;
ifsr_api_def MKDIR ;AN000;
;AN000;
PUSH DS ; preserve DS ;AN000;
;AN000;
invoke PREP_IFSR ; init ifsr, sets es:bx -> ifsr ;AN000;
;AN000;
MOV ES:[BX.IFSR_APIFUNC],IFSMKDIR ;AN000;
JMP SHORT CHDIR_10 ; go finish in ifs_chdir ;AN000;
;AN000;
EndProc IFS_MKDIR ;AN000;
;AN000;
BREAK <IFS_CHDIR Check for validity and change directory> ;AN000;
;AN000;
;AN000;
;************************************************************************************ ;AN000;
; ;AN000;
; IFS_CHDIR ;AN000;
; ;AN000;
; Called by: IFSFUNC Dispatcher ;AN000;
; ;AN000;
; Routines called: CDS_TO_CD ;AN000;
; CD_TO_CDS ;AN000;
; CALL_IFS ;AN000;
; ;AN000;
; Inputs: ;AN000;
; [WFP_START] Points to WFP string ;AN000;
; [THISCDS] Points to CDS being used. Not NUL. ;AN000;
; ;AN000;
; Function: ;AN000;
; Prep IFSRH as follows: (* indicate which fields set) ;AN000;
; * IFSR_LENGTH DW 42 ; Request length ;AN000;
; * IFSR_FUNCTION DB 4 ; Execute API function ;AN000;
; IFSR_RETCODE DW ? ;AN000;
; IFSR_RETCLASS DB ? ;AN000;
; IFSR_RESV1 DB 16 DUP(0) ;AN000;
; * IFSR_APIFUNC DB 5 ; Change Directory ;AN000;
; IFSR_ERROR_CLASS DB ? ;AN000;
; IFSR_ERROR_ACTION DB ? ;AN000;
; IFSR_ERROR_LOCUS DB ? ;AN000;
; IFSR_ALLOWED DB ? ;AN000;
; IFSR_I24_RETRY DB ? ;AN000;
; IFSR_I24_RESP DB ? ;AN000;
; IFSR_RESV2 DB ? ;AN000;
; * IFSR_DEVICE_CB@ DD ? ; Call CDS_TO_CD to convert CDS to CD ;AN000;
; ; and set this as pointer to it. ;AN000;
; IFSR_OPEN_CB@ DD ? ;AN000;
; * IFSR_NAME@ DD ? ; [WFP_START] ;AN000;
; ;AN000;
; CALL routine, CALL_IFS, with pointer to CURDIR_IFSR_HDR ;AN000;
; ;AN000;
; IF IFSR_RETCODE = 0 THEN ;AN000;
; Call CD_TO_CDS to update CDS ;AN000;
; Clear carry ;AN000;
; ELSE ;AN000;
; Set carry ;AN000;
; Put error code in AX ;AN000;
; ENDIF ;AN000;
; ;AN000;
; Outputs: ;AN000;
; Carry clear: CDS updated. ;AN000;
; Carry set on error: error_path_not_found (bad path) ;AN000;
; error_access_denied ;AN000;
; ;AN000;
; Notes: DS preserved, others destroyed ;AN000;
; ;AN000;
;************************************************************************************ ;AN000;
;AN000;
procedure IFS_CHDIR,NEAR ;AN000;
;AN000;
ifsr_fcn_def EXECAPI ; define ifsr fields for chdir ;AN000;
ifsr_api_def CHDIR ;AN000;
;AN000;
PUSH DS ; preserve DS ;AN000;
;AN000;
invoke PREP_IFSR ; init ifsr, sets es:bx -> ifsr ;AN000;
;AN000;
MOV ES:[BX.IFSR_APIFUNC],IFSCHDIR ;AN000;
;AN000;
CHDIR_10: ; Welcome rmdir/mkdir code ;AN000;
MOV ES:[BX.IFSR_LENGTH],LENGTH_CHDIR ;AN000;
MOV ES:[BX.IFSR_FUNCTION],IFSEXECAPI ;AN000;
; ds -> dosgroup ;AN000;
MOV SI,WORD PTR [WFP_START] ; to access thiscds & wfp ;AN000;
invoke STRIP_WFP_START ; ditch leading d:\ ;AN000;
MOV WORD PTR ES:[BX.IFSR_NAME@],SI ;AN000;
MOV WORD PTR ES:[BX.IFSR_NAME@+2],DS ;AN000;
LDS SI,[THISCDS] ;AN000;
SaveReg <DS,SI> ;AN000;
MOV DEVICE_CB@_OFFSET,IFSR_DEVICE_CB@ ;AN000;
CMP SI,NULL_PTR ; skip cds work if cds null ;AN001;
JE CHDIR_20 ;AN001;
invoke CDS_TO_CD ; CDS: sets [THISIFS] ;AN000;
; IFSR_DEVICE_CB@ ;AN000;
; ds - ifsseg ;AN000;
CHDIR_20: ;AN001;
SaveReg <CS> ; make sure ds = ifsseg ;AN001;
RestoreReg <DS> ;AN001;
;************************************************
invoke CALL_IFS ; call fs with dir request ;AN000;
;************************************************
;AN000;
RestoreReg <DI,ES> ; restore cds ptr into es:di ;AN000;
JC CHDIR_1000 ;AN000;
CMP DI,NULL_PTR ; skip cds work if cds null ;AN001;
JE CHDIR_40 ;AN001;
invoke CD_TO_CDS ; update cds ;AN000;
CHDIR_40: ;AN001;
CLC ;AN000;
;AN000;
CHDIR_1000: ; finished ;AN000;
POP DS ; restore DS ;AN000;
return ;AN000;
;AN000;
EndProc IFS_CHDIR ;AN000;
;AN000;
ifsseg ENDS ;AN000;
END ;AN000;
|