MEM.C: /*----------------------------------------------------------------------+

MEM.C: |                       - Used to display DOS memory map summary.       |

MEM.C: |                       - Used to display DOS memory map.               |

MEM.C: |                       - Used to display a detailed DOS memory map.    |

MEM.C: |       AN001 - PTM P2914 -> This PTM relates to MEM's ability to report|

MEM.C: |       AN002 - PTM P3477 -> MEM was displaying erroneous base memory   |

MEM.C: |       AN003 - PTM P3912 -> MEM messages do not conform to spec.       |

MEM.C: |       AN004 - PTM P4510 -> MEM does not give correct DOS size.        |

MEM.C: |       AN005 - PTM P4957 -> MEM does not give correct DOS size for     |

MEM.C: |		M000	SR	8/27/90	Added new Ctrl-C handler to delink UMBs 		  |

MEM.C: +----------------------------------------------------------------------*/

MEM.C: 	char	*MultipleDrives = "%c: - %c:" ;

MEM.C: 	char	*UnOwned = "----------" ;

MEM.C: /*----------------------------------------------------------------------+

MEM.C: +----------------------------------------------------------------------*/

MEM.C: 	/* Store the current Ctrl-C handler and replace with our

MEM.C: 		Ctrl-C handler :M000

MEM.C: 			LinkedIn--;

MEM.C: 	/* If user did not issue Ctrl-C till here, we just remove the handler */

MEM.C: /*----------------------------------------------------------------------+

MEM.C: +----------------------------------------------------------------------*/

MEM.C: /* Parse_Message                - This routine will print only those    */

MEM.C: /*      Inputs  : Msg_Num       - number of applicable message          */

MEM.C: /*                Handle        - display type                          */

MEM.C: /*                Message_Type  - type of message to display            */

MEM.C: /*                Replace_Parm  - pointer to parm to replace            */

MEMBASE.C: /* MEMBASE.C - MEM routines for determining and displaying memory usage

MEMBASE.C: 	Out_Var2 = (long) (FP_SEG(SysVarsPtr) - 0x70)*16l;

MEMBASE.C: 	for (ThisDeviceDriver = SysVarsPtr -> DeviceDriverChain;

MEMBASE.C: 	       ThisDeviceDriver = ThisDeviceDriver -> NextDeviceHeader)

MEMBASE.C:         FP_OFF(ArenaHeadPtr) = FP_OFF(SysVarsPtr) - 2;                                                                           /* ;an004; */

MEMBASE.C:         Out_Var2 = (long) ((AddressOf((char far *)ThisArenaPtr)) - Out_Var1);                                                    /* ;ac004; */

MEMBASE.C: /* 0008:000->------------------          -------------------                                   */

MEMBASE.C: /*           | BUFFERS        | -------->|B (signature)    | Block header                      */

MEMBASE.C: /*           ------------------          -------------------                                   */

MEMBASE.C: /*           | FCBs           | --       |                 |                                   */

MEMBASE.C: /*           ------------------   |      | Buffers data    |                                   */

MEMBASE.C: /*           ------------------   |      |                 |                                   */

MEMBASE.C: /*           ------------------   |      --------------------                                  */

MEMBASE.C: /*           ------------------   |          -------------------                               */

MEMBASE.C: /*           | EXTERN DRIVER 2|   | -------->|X (signature)    | Block header                  */

MEMBASE.C: /*           ------------------              -------------------                               */

MEMBASE.C: /*           ------------------              | Buffers data    |                               */

MEMBASE.C: /*                                           --------------------                              */

MEMBASE.C: /*    70:0 - BIOS data			     70:0 - BIOS data

MEMBASE.C: /*    70:0 - BIOS data

MEMBASE.C: 	while (ThisArenaPtr -> Signature != (char) 'Z')

MEMBASE.C: 		if (ThisArenaPtr -> Owner == 8 || ThisArenaPtr -> Owner == 9 )							 /* MSKK02  */

MEMBASE.C: 			FP_SEG(NextArenaPtr) = FP_SEG(ThisArenaPtr) + ThisArenaPtr -> Paragraphs + 1;

MEMBASE.C: 			Out_Var2 = (long) (ThisArenaPtr -> Paragraphs) * 16l;							 /* MSKK02  */

MEMBASE.C: 			if (ThisArenaPtr->OwnerName[0] == 'S' &&

MEMBASE.C: 			    ThisArenaPtr->OwnerName[1] == 'C')

MEMBASE.C: 				     (ThisArenaPtr -> Owner == 8) ? IbmbioMsg : AdddrvMsg,					 /* MSKK02  */

MEMBASE.C: 				     (ThisArenaPtr -> Owner == 8) ? SystemDataMsg : ProgramMsg );				 /* MSKK02  */

MEMBASE.C: 				switch(ThisConfigArenaPtr -> Signature) 							 /* MSKK02  */

MEMBASE.C: 				Out_Var1 = ((long) ThisConfigArenaPtr -> Paragraphs) * 16l;					 /* MSKK02  */

MEMBASE.C: 				FP_SEG(NextConfigArenaPtr) += NextConfigArenaPtr -> Paragraphs + 1;				 /* MSKK02  */

MEMBASE.C: 				if (ThisConfigArenaPtr -> Signature == (char) 'D')						 /* MSKK02  */

MEMBASE.C: 						ThisDeviceDriver = ThisDeviceDriver -> NextDeviceHeader;			 /* MSKK02  */

MEMBASE.C: 				FP_SEG(ThisConfigArenaPtr) += ThisConfigArenaPtr -> Paragraphs + 1;				 /* MSKK02  */

MEMBASE.C: 		if (ThisArenaPtr -> Owner == 8)

MEMBASE.C: 			FP_SEG(NextArenaPtr) = FP_SEG(ThisArenaPtr) + ThisArenaPtr -> Paragraphs + 1;

MEMBASE.C: 			Out_Var2 = (long) (ThisArenaPtr -> Paragraphs) * 16l;

MEMBASE.C: 			if (ThisArenaPtr->OwnerName[0] == 'S' &&

MEMBASE.C: 			    ThisArenaPtr->OwnerName[1] == 'C')

MEMBASE.C: 				switch(ThisConfigArenaPtr -> Signature)

MEMBASE.C: 				Out_Var1 = ((long) ThisConfigArenaPtr -> Paragraphs) * 16l;

MEMBASE.C: 				FP_SEG(NextConfigArenaPtr) += NextConfigArenaPtr -> Paragraphs + 1;

MEMBASE.C: 				if (ThisConfigArenaPtr -> Signature == (char) 'D')

MEMBASE.C: 						ThisDeviceDriver = ThisDeviceDriver -> NextDeviceHeader;			 /* MSKK01  */

MEMBASE.C: 				FP_SEG(ThisConfigArenaPtr) += ThisConfigArenaPtr -> Paragraphs + 1;

MEMBASE.C: 		      Out_Var2 = ((long) (ThisArenaPtr -> Paragraphs)) * 16l;

MEMBASE.C: 		FP_SEG(ThisArenaPtr) += ThisArenaPtr -> Paragraphs + 1;

MEMBASE.C: 	Out_Var2 = ((long) (ThisArenaPtr -> Paragraphs)) * 16l;

MEMBASE.C: 	if ( ((ThisDeviceDriver -> Attributes) & 0x8000 ) != 0 )

MEMBASE.C: 	      { for (i = 0; i < 8; i++) LocalDeviceName[i] = ThisDeviceDriver -> Name[i];

MEMBASE.C: 		if ((int) ThisDeviceDriver -> Name[0] == 1)

MEMBASE.C: 				'A'+BlockDeviceNumber + ((int) ThisDeviceDriver -> Name[0]) - 1);

MEMBASE.C: 		BlockDeviceNumber += (int) (ThisDeviceDriver -> Name[0]);

MEMBASE.C: 	free_mem = (DOS_TopOfMemory * 16l) - (FP_SEG(PSPptr)*16l);								 /* ;an000;ac005; */

MEMBASE.C: 	PspSegment = ArenaPtr -> Owner;

MEMBASE.C: 		FP_SEG(ArenaPtr) = PspSegment-1;	/* -1 'cause Arena is 16 bytes before PSP */

MEMBASE.C: 		StringPtr = (char far *) &(ArenaPtr -> OwnerName[0]);

MEMBASE.C:  * such names.  - Nagara 11/20/90

MEMBASE.C: 			StringPtr = (char far *) &(ArenaPtr -> OwnerName[0]);

MEMBASE.C: 					OutputPtr--;

MEMBASE.C: 	if (Header -> Owner == 8) Message_Number = StackMsg;

MEMBASE.C: 	if (Header -> Owner == 0) Message_Number = FreeMsg;

MEMBASE.C: 	PspSegment = Header -> Owner;

MEMCTRLC.C: /*		This module contains the Ctrl-C handler put in by Mem when 	*/

MEMCTRLC.C: /*	it links in UMBs. On a Ctrl-C, UMBs are delinked if they were	*/

MEMCTRLC.C: /* 	explicitly enabled by Mem. The old Ctrl-C handler is restored 	*/

MEMCTRLC.C: /*	after a Ctrl-C and as a result lot of old programs dont run.	*/

MEMEX.C: /* MEMEX.C - expanded and extended memory handling functions for MEM.C.

MEMEX.C:   if ((SysVarsPtr) -> ExtendedMemory != 0)                                      /* extended memory?     ;an001; dms;*/

MEMEX.C:       EXTMemoryTot = (long) (SysVarsPtr) -> ExtendedMemory;                     /* get total EM size    ;an001; dms;*/

MEMEX.C: 	      EXTMemoryTot -= (unsigned long) (CheckVDisk() * 1024l);

MEMEX.C:     /* only want to try this if vector is non-zero */

SUBMSG.C: /* SUBMSG.C - Message retriever interface functions for MEM command.

SUBMSG.C: /* SUB0_MESSAGE 		- This routine will print only those	*/

SUBMSG.C: /*	Inputs	: Msg_Num	- number of applicable message		*/

SUBMSG.C: /*		  Handle	- display type				*/

SUBMSG.C: /*		  Message_Type	- type of message to display		*/

SUBMSG.C: /* SUB1_MESSAGE 		- This routine will print only those	*/

SUBMSG.C: /*	Inputs	: Msg_Num	- number of applicable message		*/

SUBMSG.C: /*		  Handle	- display type				*/

SUBMSG.C: /*		  Message_Type	- type of message to display		*/

SUBMSG.C: /*		  Replace_Parm	- pointer to parm to replace		*/

SUBMSG.C: /* SUB2_MESSAGE 		- This routine will print only those	*/

SUBMSG.C: /*	Inputs	: Msg_Num	- number of applicable message		*/

SUBMSG.C: /*		  Handle	- display type				*/

SUBMSG.C: /*		  Message_Type	- type of message to display		*/

SUBMSG.C: /*		  Replace_Parm1 - pointer to parm to replace		*/

SUBMSG.C: /*		  Replace_Parm2 - pointer to parm to replace		*/

SUBMSG.C: /*		  Replace_Parm3 - pointer to parm to replace		*/

SUBMSG.C: /* SUB3_MESSAGE 		- This routine will print only those	*/

SUBMSG.C: /*	Inputs	: Msg_Num	- number of applicable message		*/

SUBMSG.C: /*		  Handle	- display type				*/

SUBMSG.C: /*		  Message_Type	- type of message to display		*/

SUBMSG.C: /*		  Replace_Parm1 - pointer to parm to replace		*/

SUBMSG.C: /*		  Replace_Parm2 - pointer to parm to replace		*/

SUBMSG.C: /*		  Replace_Parm3 - pointer to parm to replace		*/

SUBMSG.C: /* SUB4_MESSAGE 		- This routine will print only those	*/

SUBMSG.C: /*	Inputs	: Msg_Num	- number of applicable message		*/

SUBMSG.C: /*		  Handle	- display type				*/

SUBMSG.C: /*		  Message_Type	- type of message to display		*/

SUBMSG.C: /*		  Replace_Parm1 - pointer to parm to replace		*/

SUBMSG.C: /*		  Replace_Parm2 - pointer to parm to replace		*/

SUBMSG.C: /*		  Replace_Parm3 - pointer to parm to replace		*/

SUBMSG.C: /*		  Dynamic_Parm	- parm number to use as replaceable	*/

SUBMSG.C: /* SUB4a_MESSAGE		- This routine will print only those	*/

SUBMSG.C: /*	Inputs	: Msg_Num	- number of applicable message		*/

SUBMSG.C: /*		  Handle	- display type				*/

SUBMSG.C: /*		  Message_Type	- type of message to display		*/

SUBMSG.C: /*		  Replace_Parm1 - pointer to parm to replace		*/

SUBMSG.C: /*		  Replace_Parm2 - pointer to parm to replace		*/

SUBMSG.C: /*		  Replace_Parm3 - pointer to parm to replace		*/

SUBMSG.C: /*		  Dynamic_Parm	- parm number to use as replaceable	*/

SUBMSG.C: /* EMSPrint			- This routine will print the message	*/

