     1                                  
     2                                  
     3                                  
     4                                  [list -]									  ;AN000;
     4          ******************       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
     6                                  
     7                                  [list +]
     8                                  section DOSCODECODE
     9                                  [list -]
     9          ******************       warning: out: ... for DOS Version 4.00 ... [-w+user]
     9          ******************       warning: out: BPB.INC... [-w+user]
     9          ******************       warning: out: ... CLONE version build switch on ... [-w+user]
     9          ******************       warning: out: DEVSYM.INC... [-w+user]
    17                                  StackSize   equ	180h			; gross but effective
    18                                  
    19                                  	i_need	VERFLG		       ; verify status flag		  ;AN000;
    20                                  	i_need	CNTCFLAG	       ; break status flag		  ;AN000;
    21                                  	i_need	CPSWFLAG	       ; CP switch logic ON/OFF 	  ;AN000;
    22                                  	I_need	CURRENTPDB,WORD        ; Current process identifier	  ;AN000;
    23                                  	I_need	HIGH_SECTOR,WORD					  ;AN000;
    24                                  	I_need	BUF_HASH_COUNT,WORD					  ;AN000;
    25                                  	I_need	FAILERR,WORD						  ;AN000;
    26                                  	I_need	USER_ID,WORD						  ;AN000;
    27                                  	I_need	CALLDEVAD,DWORD       ; 				  ;AN000;
    28                                  	I_need	SYSINITVAR,WORD 					  ;AN000;
    29                                  	I_need	MYNAME,16	      ; NetBIOS name			  ;AN000;
    30                                  	I_need	RETRYCOUNT,WORD       ; retry count			  ;AN000;
    31                                  	I_need	COUNTRY_CDPG,BYTE					  ;AN000;
    32                                  	i_need	DAY,BYTE	      ; date				  ;AN000;
    33                                  	i_need	MONTH,BYTE						  ;AN000;
    34                                  	i_need	YEAR,WORD						  ;AN000;
    35                                  	i_need	CURBUF,DWORD						  ;AN000;
    36                                  	i_need	IFS_DRIVER_ERR,WORD					  ;AN000;
    37                                  	i_need	DOS34_FLAG,WORD       ; IFS function Read/Write flag	  ;AN000;
    38                                  	i_need	Callback_SS,WORD      ; 				  ;AN000;
    39                                  	i_need	Callback_SP,WORD					  ;AN000;
    40                                  	i_need	SaveBX,WORD						  ;AN000;
    41                                  	i_need	Temp_Var,WORD						  ;AN000;
    42                                  	i_need	INDOS,BYTE						  ;AN000;
    43                                  	i_need	DskStack,BYTE						  ;AN000;
    44                                  	i_need	IOStack,BYTE						  ;AN000;
    45                                  	i_need	Callback_flag,BYTE					  ;AN000;
    46                                  
    47                                  DOSINFO     STRUC							  ;AN000;
    48 00000000 ????                    bsize	  dw	?							  ;AN000;
    49 00000002 ????                    files	  dw	?							  ;AN000;
    50 00000004 ????                    fcbs1	  dw	?							  ;AN000;
    51 00000006 ????                    fcbs2	  dw	?							  ;AN000;
    52 00000008 ????                    buffers   dw	?							  ;AN000;
    53 0000000A ????                    	  dw	?							  ;AN000;
    54 0000000C ????                    lastdrv   dw	?							  ;AN000;
    55 0000000E ????                    secsize   dw	?							  ;AN000;
    56                                  DOSINFO       ENDS							  ;AN000;
    57                                  
    58                                  
    59                                  
    60                                  	extrn	ABSDRD:NEAR		 ;AN000;
    61                                  	extrn	ABSDWRT:NEAR		 ;AN000;
    62                                  	extrn	READTIME:NEAR		 ;AN000;
    63                                  	extrn	CHECKFLUSH:NEAR 	 ;AN000;
    64                                  	extrn	GETCURHEAD:NEAR 	 ;AN000;
    65                                  
    66                                  
    67                                  ;******************************************************************************
    68                                  ; *
    69                                  ; *	 MODULE: IFS_DOSCALL
    70                                  ; *
    71                                  ; *	 FUNCTION: IFS to DOS function request dispatcher
    72                                  ; *
    73                                  ; *	 FUNCTION: This procedure dispatches the IFS DOS service requests
    74                                  ; *		   by calling various DOS service routines
    75                                  ; *
    76                                  ; *	 CALLING SEQUENCE:
    77                                  ; *
    78                                  ; *		   CALL  DWORD PTR IFS_DOSCALL@
    79                                  ; *
    80                                  ; *
    81                                  ; *	 RETURN SEQUENCE:
    82                                  ; *
    83                                  ; *		   If AX = 0	No error
    84                                  ; *
    85                                  ; *		   If AX <> 0	Error
    86                                  ; *		      AX = Error Code:
    87                                  ; *
    88                                  ; *
    89                                  ; *	 INTERNAL REFERENCES:	None
    90                                  ; *
    91                                  ; *
    92                                  ; *	 EXTERNAL REFERENCES:	STRATEGY, INTERRUPT, ABSDRD, ABSDWRT,
    93                                  ; *				FIND_SECTOR, MARK_SECTOR, WRITE_BUFFR,
    94                                  ; *				READ_BUFFR, WRITE_BUFFR, FREE_BUFFR,
    95                                  ; *				GET_DOS_INFO, FLUSH_BUFF
    96                                  ; *
    97                                  ; *	 NOTES:  None
    98                                  ; *
    99                                  ; *	 REVISION HISTORY:  New
   100                                  ; *
   101                                  ; *	 COPYRIGHT:  "MS DOS IFS Function"
   102                                  ; *		     "Version 1.00 (C) Copyright 1988 Microsoft Corporation"
   103                                  ; *		     "Licensed Material - Program Property of Microsoft"
   104                                  ; *
   105                                  ; *************************************************************************
   106                                  
   107                                  
   108                                  relocated ifsentry
   109                                  PROCEDURE   IFS_DOSCALL,FAR						  ;AN000;
   109          ******************       warning: proc IFS_DOSCALL... [-w+user]
   110                                   assume DS:NOTHING,ES:NOTHING, ss:nothing
   111                                  
   112 00000000 FA                      	 CLI			;					  ;AN000;
   113                                  
   114                                  extern doscode_getdosdata
   115                                  
   116 00000001 1E                      	push ds
   117 00000002 50                      	push ax
   118 00000003 E8(0000)                	call doscode_getdosdata
   119 00000006 8ED8                    	mov ds, ax
   120                                   assume ds:DOSGROUP
   121 00000008 58                      	pop ax
   122                                  
   123 00000009 80FC27                  	 CMP	 AH,39		;					  ;AN000;
   124 0000000C 7507                    	 JNZ	 others 	;					  ;AN000;
   125 0000000E FE06[0000]              	 INC	 byte [INDOS]	; in DOS				  ;AN000;
   126 00000012 E9AC00                  	 JMP	 Dosend_ds	;					  ;AN000;
   127                                  others:
   128 00000015 80FC28                  	 CMP	 AH,40		;					  ;AN000;
   129 00000018 7507                    	 JNZ	 others2	;					  ;AN000;
   130 0000001A FE0E[0000]              	 DEC	 byte [INDOS]	; out DOS				  ;AN000;
   131 0000001E E9A000                  	 JMP	 Dosend_ds	;					  ;AN000;
   132                                  others2:
   133 00000021 80FC26                  	 CMP	 AH,38		;					  ;AN000;
   134 00000024 750D                    	 JNZ	 not_stack	;					  ;AN000;
   135 00000026 83C402                  	add sp, 2
   136 00000029 1E                      	push ds
   137                                  IOSTACK equ IOStack	; NASM port label
   138 0000002A BE[0000]                	 MOV	 SI,OFFSET IOSTACK wrt DOSGROUP				  ;AN000;
   139                                  stacksize equ StackSize	; NASM port equate
   140 0000002D B98001                  	 MOV	 CX,stacksize						  ;AN000;
   141 00000030 E98E00                  	 JMP	 Dosend_ds	;					  ;AN000;
   142                                  				;					  ;AN000;
   143                                  not_stack:			;					  ;AN000;
   144 00000033 8F06[0000]              	pop word [Temp_Var]	; save ds for strcmp strcpy		  ;AN000;
   145                                   assume DS:DOSGROUP							  ;AN000;
   146 00000037 FE06[0000]              	 INC	 byte [INDOS]	; in DOS				  ;AN000;
   147 0000003B 51                      	 PUSH	 CX		; save cx				  ;AN000;
   148 0000003C 52                      	 PUSH	 DX		; save cx				  ;AN000;
   149 0000003D 8CD1                    	 MOV	 CX,SS		; cx=stack				  ;AN000;
   150 0000003F 8CDA                    	 MOV	 DX,ds		; cx=stack				  ;AN000;
   151 00000041 39D1                    	 CMP	 CX,DX		; dosgroup stack ?			  ;AN000;
   152 00000043 5A                      	 POP	 DX		; save cx				  ;AN000;
   153 00000044 59                      	 POP	 CX		; restore cx				  ;AN000;
   154 00000045 741C                    	 JZ	 withSS_SP	; yes					  ;AN000;
   155 00000047 8C16[0000]              	 MOV	 [Callback_SS],SS ;save SS:SP				  ;AN000;
   156 0000004B 8926[0000]              	 MOV	 [Callback_SP],SP					  ;AN000;
   157 0000004F 891E[0000]              	 MOV	 [SaveBX],BX	;					  ;AN000;
   158 00000053 8CDB                    	 MOV	 BX,ds		; prepare system stack			  ;AN000;
   159                                  DSKSTACK equ DskStack	; NASM port label
   160 00000055 8ED3                    	 MOV	 SS,BX		;					  ;AN000;
   161 00000057 BC[0000]                	 MOV	 SP,OFFSET DSKSTACK wrt DOSGROUP				  ;AN000;
   162                                   assume ss:DOSGROUP
   163 0000005A 8B1E[0000]              	 MOV	 BX,[SaveBX]	;					  ;AN000;
   164 0000005E C606[0000]01            	 MOV	 byte [Callback_flag],1  ;set flag				  ;AN000;
   165                                  withSS_SP:			;					  ;AN000;
   166 00000063 FB                      	 STI								  ;AN000;
   167                                   ASSUME DS:NOTHING							  ;AN000;
   168                                  ;	 OR	 [DOS34_FLAG],Force_I24_Fail				  ;AN000;
   169                                  ;									  ;AN000;
   170                                  ;	 cmp	 ah,0		 ; call Strategy routine ??		  ;AN000;
   171                                  ;	 jne	 dos_chk_ah1	 ; jump if not				  ;AN000;
   172                                  ;	 CALL	 STRATEGY	 ; else call strategy routine		  ;AN000;
   173                                  ;	 jmp	 dos_exit	 ; then exit				  ;AN000;
   174                                  									  ;AN000;
   175                                  ;Dos_Chk_Ah1:								   ;AN000;
   176                                  ;	 cmp	 ah,1		 ; call interrupt routine		  ;AN000;
   177                                  ;	 jne	 dos_chk_ah2	 ; jump if not				  ;AN000;
   178                                  ;	 CALL	 INTERRUPT	 ; else call interrupt routine		  ;AN000;
   179                                  ;	 jmp	 dos_exit	 ; then exit				  ;AN000;
   180                                  									  ;AN000;
   181                                  ;Dos_Chk_Ah2:								   ;AN000;
   182                                  ;	 cmp	 ah,4					  ;AN000;
   183                                  ;	 jae	 Dos_Chk_Ah8				  ;AN000;
   184                                  ;	 mov	 High_Sector,si  ; save HI sector word	  ;AN000;
   185                                  ;	 mov	 dx,di		 ; save low sector	  ;AN000;
   186                                  ;	 push	 es					  ;AN000;
   187                                  ;	 invoke  FIND_DPB	 ; ds:si -> DPB 	  ;AN000;
   188                                  ;	 mov	 bp,si					  ;AN000;
   189                                  ;	 push	 ds					  ;AN000;
   190                                  ;	 pop	 es		 ; es:bp -> DPB 	  ;AN000;
   191                                  ;	 pop	 ds		 ; DS:BX-->Input buffer   ;AN000;
   192                                  ;
   193                                  ;	 cmp	 ah,2		 ; absolute read ??			  ;AN000;
   194                                  ;	 jne	 dos_chk_ah3	 ; jump if not				  ;AN000;
   195                                  ;
   196                                  ;	 invoke  DSKREAD	 ; else do absolute read		  ;AN000;
   197                                  ;	 jmp	 dos_exit	 ; then return				  ;AN000;
   198                                  
   199                                  ;Dos_Chk_Ah3:								   ;AN000;
   200                                  ;	 invoke  DSKWRITE	 ; do absolute write			  ;AN000;
   201                                  ;	 jmp	 dos_exit	 ; then exit				  ;AN000;
   202                                  
   203                                  
   204                                  
   205                                  Dos_chk_ah32:								  ;AN000;
   206 00000064 80FC20                  	 cmp	 ah,32
   207 00000067 7505                    	 jne	 str_cmp				    ;AN000;
   208 00000069 E85B00                  	 CALL	 GET_DOS_INFO	 ; else get DOS information ;AN000;
   209                                  dos_exit equ Dos_Exit	; NASM port label
   210 0000006C EB1A                    	 jmp	 SHORT dos_exit 			    ;AN000;		 ;AN000;
   211                                  str_cmp:								  ;AN000;
   212 0000006E 368E1E[0000]            	 mov	 DS,[ss:Temp_Var]	  ; restore DS				  ;AN000;
   213                                   assume ds:nothing
   214 00000073 80FC24                  	 cmp	 ah,36					    ;AN000;
   215 00000076 7505                    	 jne	 str_cpy				    ;AN000;
   216 00000078 E8(0000)                	 invoke  strcmp 	 ; string compare	    ;AN000;
   217 0000007B EB0B                    	 jmp	 SHORT dos_exit 					  ;AN000;
   218                                  str_cpy:								  ;AN000;
   219 0000007D 80FC25                  	 cmp	 ah,37					    ;AN000;
   220                                  dos_error equ Dos_Error	; NASM port label
   221 00000080 7505                    	 jne	 dos_error				    ;AN000;
   222 00000082 E8(0000)                	 invoke  strcpy 	 ; string copy		    ;AN000;
   223 00000085 EB01                    	 jmp	 SHORT dos_exit 					  ;AN000;
   224                                  
   225                                  Dos_Error:								  ;AN000;
   226 00000087 F9                      	 stc
   227                                  							    ;AN000;
   228                                  Dos_Exit:								  ;AN000;
   229 00000088 FA                      	 CLI								  ;AN000;
   230 00000089 9C                      	 PUSHF								  ;AN000;
   231                                  No_Force_I24_Fail equ NO_Force_I24_Fail	; NASM port equate
   232 0000008A 368326[0000]DF          	 AND	 word [ss:DOS34_FLAG],No_Force_I24_Fail 			  ;AN000;
   233 00000090 36FE0E[0000]            	 DEC	 byte [ss:INDOS]	 ; exit DOS				  ;AN000;
   234 00000095 36803E[0000]00          	 CMP	 byte [ss:Callback_flag],0  ;from dosgroup
   235 0000009B 7427                    	 JZ	 noSS_SP	    ;yes				  ;AN000;
   236 0000009D 36C606[0000]00          	 MOV	 byte [ss:Callback_flag],0  ;					  ;AN000;
   237                                  					; fl on stack
   238 000000A3 56                      	 push si
   239 000000A4 1E                      	 push ds
   240 000000A5 368E1E[0000]            	 mov ds, [ss:Callback_SS]
   241                                   assume ds:nothing
   242 000000AA 368B36[0000]            	 mov si, [ss:Callback_SP]	; ds:si -> user stack
   243 000000AF 4E                      	 dec si
   244 000000B0 4E                      	 dec si				; make space for another word
   245 000000B1 8F04                    	 pop word [si]			; ds
   246 000000B3 4E                      	 dec si
   247 000000B4 4E                      	 dec si
   248 000000B5 8F04                    	 pop word [si]			; si
   249 000000B7 4E                      	 dec si
   250 000000B8 4E                      	 dec si
   251 000000B9 8F04                    	 pop word [si]			; fl
   252 000000BB 1E                      	 push ds
   253 000000BC 17                      	 pop ss				; switch stacks
   254 000000BD 89F4                    	 mov sp, si
   255                                   assume ss:nothing
   256 000000BF 9D                      	 popf				; fl
   257 000000C0 5E                      	 pop si				; si
   258                                  					; ds left on stack
   259                                  Dosend_ds:
   260 000000C1 1F                      	pop ds
   261                                   assume ds:nothing, ss:nothing
   262 000000C2 FB                      	 STI			 ;					  ;AN000;
   263 000000C3 CB                      	 retf			 ;return				  ;AN000;
   264                                  
   265                                  noSS_SP:						    ;AN000;
   266 000000C4 9D                      	 POPF
   267 000000C5 FB                      	sti
   268 000000C6 CB                      	retf
   269                                  
   270                                  
   271                                  ENDPROC   IFS_DOSCALL					    ;AN000;
   272                                  
   273                                  
   274                                  
   275                                  
   276                                  
   277                                  ; ****************************************************************************
   278                                  ; *
   279                                  ; *	 MODULE: STRATEGY
   280                                  ; *
   281                                  ; *	 FUNCTION: Call Strategy Routine
   282                                  ; *
   283                                  ; *	 FUNCTION: This procedure dispatches the IFS DOS service requests
   284                                  ; *		   by calling various DOS service functions
   285                                  ; *
   286                                  ; *	 INPUT:    ES:BX ---> Device Request Header
   287                                  ; *		   AL  = Drive #
   288                                  ; *
   289                                  ; *		   CALL STRATEGY
   290                                  ; *
   291                                  ; *	 OUTPUT:   output of driver
   292                                  ; *
   293                                  ; *	 INTERNAL REFERENCES:	None
   294                                  ; *
   295                                  ; *
   296                                  ; *	 EXTERNAL REFERENCES:	GETTHISDRV
   297                                  ; *
   298                                  ; *	 NOTES:  None
   299                                  ; *
   300                                  ; *	 REVISION HISTORY:  New
   301                                  ; *
   302                                  ; *************************************************************************
   303                                  
   304                                  ;PROCEDURE   STRATEGY,NEAR						   ;AN000;
   305                                  
   306                                  ;	 INVOKE  FIND_DPB		 ; get DPB from drive number	   ;AN000;
   307                                  ;					 ; DS:SI-->DPB for drive	   ;AN000;
   308                                  ;	 LDS	 DI,[DS:SI.DPB_Driver_Addr]   ; get driver addres from DPB ;AN000;
   309                                  ;	 MOV	 DX,WORD PTR [DI.SDEVSTRAT]    ;get strategy routine address;AN000;
   310                                  ;Driver_Call:								   ;AN000;
   311                                  ;	 MOV	 WORD PTR [CALLDEVAD],DX	; save it		   ;AN000;
   312                                  ;	 MOV	 WORD PTR [CALLDEVAD+2],DS	;			   ;AN000;
   313                                  ;	 CALL	 DWORD	PTR  [CALLDEVAD]	; call strategy routine    ;AN000;
   314                                  ;STRAT_Exit:								   ;AN000;
   315                                  ;	 RET					; return		   ;AN000;
   316                                  
   317                                  ;ENDPROC   STRATEGY							   ;AN000;
   318                                  
   319                                  
   320                                  
   321                                  
   322                                  
   323                                  
   324                                  
   325                                  
   326                                  ; ****************************************************************************
   327                                  ; *
   328                                  ; *	 MODULE: INTERRUPT
   329                                  ; *
   330                                  ; *	 FUNCTION: This procedure calls the interrupt routine of the drive
   331                                  ; *		   specified in the drive#.
   332                                  ; *
   333                                  ; *	 INPUT:    AL = Drive #
   334                                  ; *
   335                                  ; *
   336                                  ; *	 OUTPUT:   output of driver
   337                                  ; *
   338                                  ; *
   339                                  ; *	 INTERNAL REFERENCES:	None
   340                                  ; *
   341                                  ; *
   342                                  ; *	 EXTERNAL REFERENCES:	FIND_DPB
   343                                  ; *
   344                                  ; *	 NOTES:  None
   345                                  ; *
   346                                  ; *	 REVISION HISTORY:  New
   347                                  ; *
   348                                  ; *************************************************************************
   349                                  
   350                                  ;PROCEDURE    INTERRUPT,NEAR						   ;AN000;
   351                                  
   352                                  ;	 INVOKE  FIND_DPB		 ; get DPB from drive number	   ;AN000;
   353                                  ;	 LDS	 DI,[DS:SI.DPB_Driver_Addr]   ; get driver addres from DPB ;AN000;
   354                                  ;	 MOV	 DX,WORD PTR [DI.SDEVINT]     ; get interrupt routine addrs;AN000;
   355                                  ;	 JMP	 Driver_Call						   ;AN000;
   356                                  
   357                                  ;ENDPROC  INTERRUPT							   ;AN000;
   358                                  
   359                                  
   360                                  
   361                                  
   362                                  
   363                                  
   364                                  
   365                                  
   366                                  ; ************************************************************************* *
   367                                  ; *
   368                                  ; *	 MODULE: Get_Dos_Info
   369                                  ; *
   370                                  ; *	 FUNCTION: Get DOS information
   371                                  ; *
   372                                  ; *	 INPUT:    AL = Dos info code
   373                                  ; *
   374                                  ; *	 OUTPUT:   Dos Information  in registers
   375                                  ; *
   376                                  ; *	 INTERNAL REFERENCES:	None
   377                                  ; *
   378                                  ; *
   379                                  ; *	 EXTERNAL REFERENCES:	READTIME, $GETEXTCNTRY
   380                                  ; *
   381                                  ; *	 NOTES:  None
   382                                  ; *
   383                                  ; *	 REVISION HISTORY:  New
   384                                  ; *
   385                                  ; *************************************************************************
   386                                  
   387                                  PROCEDURE  GET_DOS_INFO,NEAR						   ;AN000;
   387          ******************       warning: proc GET_DOS_INFO... [-w+user]
   388                                   assume ss:DOSGROUP
   389                                  
   390 000000C7 3C00                    	cmp    al,0			; TIME and DATE ??		   ;AN000;
   391 000000C9 7518                    	jne    chk_al1							   ;AN000;
   392                                  
   393                                  ReadTime equ READTIME	; NASM port label
   394 000000CB E8(0000)                	Invoke	ReadTime		; get time in CX:DX		   ;AN000;
   395                                  
   396 000000CE 51                      	push	cx			; save time			   ;AN000;
   397 000000CF 52                      	push	dx							   ;AN000;
   398                                  
   399 000000D0 368B0E[0000]            	MOV	CX,[ss:YEAR]						   ;AN000;
   400 000000D5 81C1BC07                	ADD	CX,1980 						   ;AN000;
   401 000000D9 368B16[0000]            	MOV	DX,WORD PTR [ss:DAY]	; fetch both day and month	   ;AN000;
   402                                  
   403 000000DE 5B                      	pop	bx			; bh = seconds	bl = hundredths    ;AN000;
   404 000000DF 58                      	pop	ax			; ah = hour  al = minutes	   ;AN000;
   405                                  					; cx = year  dh = month 	   ;AN000;
   406                                  get_info_exit equ Get_Info_Exit	; NASM port label
   407 000000E0 EB6E                    	jmp	get_info_exit						   ;AN000;
   408 000000E2 90                      	nop	; identicalise
   409                                  
   410                                  
   411                                  chk_al1:				; Active process info ??	   ;AN000;
   412 000000E3 3C01                    	cmp    al,1							   ;AN000;
   413 000000E5 750D                    	jne    chk_al2			; no, try next			   ;AN000;
   414                                  CurrentPDB equ CURRENTPDB	; NASM port label
   415 000000E7 368B1E[0000]            	MOV	BX,[ss:CurrentPDB]        ; BX = active process ID 	   ;AN000;
   416                                  User_ID equ USER_ID	; NASM port label
   417 000000EC 368B16[0000]            	mov	DX,[ss:User_ID]	       ; User ID			   ;AN000;
   418 000000F1 EB5D                    	jmp	get_info_exit	       ; exit				   ;AN000;
   419 000000F3 90                      	nop	; identicalise
   420                                  
   421                                  
   422                                  chk_al2:								   ;AN000;
   423                                  ;	cmp    al,2		       ; get CPSW info ??		   ;AN000;
   424                                  ;	jne    chk_al3		       ; jump if not			   ;AN000;
   425                                  ;	MOV	SI,OFFSET COUNTRY_CDPG wrt DOSGROUP 			   ;AN000;
   426                                  ;	MOV	BX,[SI.ccDosCodePage]  ; get dos code page id in BX	   ;AN000;
   427                                  ;	MOV	DL,CPSWFLAG	       ; get CP Switch status		   ;AN000;
   428                                  ;	jmp	get_info_exit	       ; exit				   ;AN000;
   429                                  
   430                                  
   431                                  chk_al3:
   432                                  ;	cmp    al,3		       ; get CTRL BRK status ?? 	   ;AN000;
   433                                  ;	jne    chk_al4							   ;AN000;
   434                                  ;	mov    dl,CNTCFLAG	       ; DL = break status flag 	   ;AN000;
   435                                  ;	jmp    get_info_exit	       ; exit				   ;AN000;
   436                                  
   437                                  
   438                                  chk_al4:
   439                                  ;	cmp    al,4		       ; get Verify status ??		   ;AN000;
   440                                  ;	jne    chk_al5
   441                                  ;	mov    dl,VERFLG	       ; DL = verify status flag	   ;AN000;
   442                                  ;	jmp    get_info_exit	       ; exit				   ;AN000;
   443                                  
   444                                  
   445                                  chk_al5:
   446 000000F4 3C05                    	cmp    al,5		      ; Config.sys info ??		   ;AN000;
   447 000000F6 7536                    	jne    chk_al6							   ;AN000;
   448                                  
   449 000000F8 BE[0000]                	mov	si,OFFSET SYSINITVAR wrt DOSGROUP	 ; DS:SI-->SysInitVar	   ;AN000;
   450 000000FB 1E                      	push	ds							   ;AN000;
   451 000000FC 56                      	push	si							   ;AN000;
   452                                  Sysi_SFT equ SYSI_SFT	; NASM port equate
   453 000000FD C57404                  	lds	si,[si + Sysi_SFT]      ; get SFT address 		   ;AN000;
   454 00000100 8B4404                  	mov	ax,[si + SFCount]       ; get number of files		   ;AN000;
   455                                  SFlink equ SFLink	; NASM port equate
   456 00000103 C534                    	lds	si,[si + SFlink]	      ; get next SFT table		   ;AN000;
   457 00000105 83FEFF                  	cmp	si,-1		      ; end of table			   ;AN000;
   458 00000108 7403                    	jz	nomore		      ; 				   ;AN000;
   459 0000010A 034404                  	add	ax,[si + SFCount]       ; 				   ;AN000;
   460                                  nomore: 			      ; 				   ;AN000;
   461 0000010D 26894502                	mov	[es:di + files],ax	 ; save files= value		   ;AN000;
   462 00000111 5E                      	pop	si							   ;AN000;
   463 00000112 1F                      	pop	ds							   ;AN000;
   464                                   assume ds:DOSGROUP
   465                                  Sysi_MaxSec equ SYSI_MAXSEC	; NASM port equate
   466 00000113 8B4410                  	mov	ax,[si + Sysi_MaxSec]	 ; get maximum sector size	   ;AN000;
   467 00000116 2689450E                	mov	[es:di + secsize],ax	 ; save files= value		   ;AN000;
   468                                  Sysi_Keep equ SYSI_Keep	; NASM port equate
   469 0000011A 8B441E                  	mov	ax,[si + Sysi_Keep]	 ;				   ;AN000;
   470 0000011D 26894506                	mov	[es:di + fcbs2],ax	 ;				   ;AN000;
   471                                  Sysi_FCB equ SYSI_FCB	; NASM port equate
   472 00000121 C5741A                  	lds	si,[si + Sysi_FCB]      ; get FCB address 		   ;AN000;
   473 00000124 8B4404                  	mov	ax,[si + SFCount]       ; get number of fcbs		   ;AN000;
   474 00000127 26894504                	mov	[es:di + fcbs1],ax	 ; save fcbs=  value		   ;AN000;
   475 0000012B EB23                    	jmp	get_info_exit						   ;AN000;
   476 0000012D 90                      	nop	; identicalise
   477                                  
   478                                  
   479                                  
   480                                  chk_al6:								  ;AN000;
   481 0000012E 3C06                    	cmp    al,6			; get machine name ??		  ;AN000;
   482                                  chk_al7 equ Chk_Al7	; NASM port label
   483 00000130 7513                    	jne    chk_al7			; no, check next function	  ;AN000;
   484 00000132 161F                    	context  DS							  ;AN000;
   485                                  DOSGroup equ DOSGROUP	; NASM port equate
   486                                  MyName equ MYNAME	; NASM port label
   487 00000134 BE[0000]                	mov	si,offset MyName wrt DOSGroup   ; DS:SI-->name string	  ;AN000;
   488                                  					; ES:DI-->return buffer 	  ;AN000;
   489 00000137 83C702                  	add	di,2			; skip max return size		  ;AN000;
   490 0000013A B90F00                  	mov	cx,15			; name size			  ;AN000;
   491                                  Chk6_Loop:								  ;AN000;
   492 0000013D F3A4                    	rep	movsb			; copy machine name to return buffer;AN000;
   493 0000013F 30C0                    	xor	al,al			; set 16th byte is 0		   ;AN000;
   494 00000141 AA                      	stosb								   ;AN000;
   495 00000142 EB0C                    	jmp	get_info_exit		; return			   ;AN000;
   496 00000144 90                      	nop	; identicalise
   497                                  									   ;AN000;
   498                                  									   ;AN000;
   499                                  Chk_Al7:								   ;AN000;
   500                                  ;	cmp	al,7			; get country information ??	   ;AN000;
   501                                  ;	jne	chk_al8 		; no, try next function 	   ;AN000;
   502                                  ;	mov	al,dl			; AL = info ID			   ;AN000;
   503                                  ;	mov	bx,-1			; select active code page	   ;AN000;
   504                                  ;	mov	dx,-1			; select active country 	   ;AN000;
   505                                  ;	mov	cx,-1			; get all			   ;AN000;
   506                                  ;	INVOKE	$getExtCntry		; get country info		   ;AN000;
   507                                  ;	jmp	SHORT Get_Info_Exit	; exit				   ;AN000;
   508                                  
   509                                  
   510                                  Chk_Al8:								   ;AN000;
   511 00000145 3C08                    	cmp	al,8			; get share retry count ??	   ;AN000;
   512                                  bad_param equ Bad_Param	; NASM port label
   513 00000147 7506                    	jne	bad_param		; no, Bad parameter		   ;AN000;
   514                                  RetryCount equ RETRYCOUNT	; NASM port label
   515 00000149 8B1E[0000]              	mov	bx,[RetryCount]		; BX = Share retry count	   ;AN000;
   516 0000014D EB01                    	jmp	SHORT Get_Info_Exit	      ; exit			   ;AN000;
   517                                  
   518                                  Bad_Param:				; Bad parameter 		   ;AN000;
   519 0000014F F9                      	stc				;				   ;AN000;
   520                                  
   521                                  Get_Info_Exit:				; exit				   ;AN000;
   522                                  
   523 00000150 C3                      	ret								   ;AN000;
   524                                  
   525                                  
   526                                  ENDPROC   GET_DOS_INFO							   ;AN000;
   527                                  
   528                                  
   529                                  
   530                                  
   531                                  
   532                                  
   533                                  
   534                                  
   535                                  ; ************************************************************************* *
   536                                  ; *
   537                                  ; *	 MODULE: $IFS_IOCTL
   538                                  ; *
   539                                  ; *	 FUNCTION: Handle IFS Driver IOCTL calls
   540                                  ; *
   541                                  ; *	 INPUT:    AH = 6B  function code
   542                                  ; *		   AL = XX  00 = Drive IOCTL, 01 = Psudo device IOCTL
   543                                  ; *		   CX = 00  Reserved
   544                                  ; *		   BL = XX  Device Number
   545                                  ; *		   DS:DX    Pointer to Buffer
   546                                  ; *
   547                                  ; *	 OUTPUT:
   548                                  ; *		   IF CARRY = 0  No Error
   549                                  ; *		   IF CARRY = 1  Error
   550                                  ; *			 AX = ERROR CODE
   551                                  ; *
   552                                  ; *	 INTERNAL REFERENCES:	None
   553                                  ; *
   554                                  ; *
   555                                  ; *	 EXTERNAL REFERENCES:	INT 2F
   556                                  ; *
   557                                  ; *	 NOTES:  None
   558                                  ; *
   559                                  ; *	 REVISION HISTORY:  New
   560                                  ; *************************************************************************
   561                                  
   562                                  PROCEDURE  D_IFS_IOCTL,NEAR						   ;AN000;
   562          ******************       warning: proc D_IFS_IOCTL... [-w+user]
   563                                   assume ss:DOSGROUP
   564                                  
   565 00000151 50                      	PUSH	AX							   ;AN000;
   566                                  multnet equ MultNET	; NASM port equate
   567 00000152 B82F11                  	MOV	AX,(multnet << 8) | 47    ; pass control to IFS Func	   ;AN000;
   568 00000155 CD2F                    	INT	2FH							   ;AN000;
   569 00000157 5B                      	POP	BX							   ;AN000;
   570 00000158 7203                    	JC	ABB_ERR 						   ;AN000;
   571 0000015A E9(0000)                	TRANSFER   SYS_RET_OK		      ; return			   ;AN000;
   572                                  
   573                                  ABB_ERR:								   ;AN000;
   574 0000015D E9(0000)                	transfer SYS_RET_ERR		    ; error return		   ;AN000;
   575                                  
   576                                  ENDPROC  D_IFS_IOCTL							   ;AN000;
   577                                  
   578                                      END 								   ;AN000;
   579                                  
   580                                  
