Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
10 KiB

  1. MEM.C: /*----------------------------------------------------------------------+
  2. MEM.C: | - Used to display DOS memory map summary. |
  3. MEM.C: | - Used to display DOS memory map. |
  4. MEM.C: | - Used to display a detailed DOS memory map. |
  5. MEM.C: | AN001 - PTM P2914 -> This PTM relates to MEM's ability to report|
  6. MEM.C: | AN002 - PTM P3477 -> MEM was displaying erroneous base memory |
  7. MEM.C: | AN003 - PTM P3912 -> MEM messages do not conform to spec. |
  8. MEM.C: | AN004 - PTM P4510 -> MEM does not give correct DOS size. |
  9. MEM.C: | AN005 - PTM P4957 -> MEM does not give correct DOS size for |
  10. MEM.C: | M000 SR 8/27/90 Added new Ctrl-C handler to delink UMBs |
  11. MEM.C: +----------------------------------------------------------------------*/
  12. MEM.C: char *MultipleDrives = "%c: - %c:" ;
  13. MEM.C: char *UnOwned = "----------" ;
  14. MEM.C: /*----------------------------------------------------------------------+
  15. MEM.C: +----------------------------------------------------------------------*/
  16. MEM.C: /* Store the current Ctrl-C handler and replace with our
  17. MEM.C: Ctrl-C handler :M000
  18. MEM.C: LinkedIn--;
  19. MEM.C: /* If user did not issue Ctrl-C till here, we just remove the handler */
  20. MEM.C: /*----------------------------------------------------------------------+
  21. MEM.C: +----------------------------------------------------------------------*/
  22. MEM.C: /* Parse_Message - This routine will print only those */
  23. MEM.C: /* Inputs : Msg_Num - number of applicable message */
  24. MEM.C: /* Handle - display type */
  25. MEM.C: /* Message_Type - type of message to display */
  26. MEM.C: /* Replace_Parm - pointer to parm to replace */
  27. MEMBASE.C: /* MEMBASE.C - MEM routines for determining and displaying memory usage
  28. MEMBASE.C: Out_Var2 = (long) (FP_SEG(SysVarsPtr) - 0x70)*16l;
  29. MEMBASE.C: for (ThisDeviceDriver = SysVarsPtr -> DeviceDriverChain;
  30. MEMBASE.C: ThisDeviceDriver = ThisDeviceDriver -> NextDeviceHeader)
  31. MEMBASE.C: FP_OFF(ArenaHeadPtr) = FP_OFF(SysVarsPtr) - 2; /* ;an004; */
  32. MEMBASE.C: Out_Var2 = (long) ((AddressOf((char far *)ThisArenaPtr)) - Out_Var1); /* ;ac004; */
  33. MEMBASE.C: /* 0008:000->------------------ ------------------- */
  34. MEMBASE.C: /* | BUFFERS | -------->|B (signature) | Block header */
  35. MEMBASE.C: /* ------------------ ------------------- */
  36. MEMBASE.C: /* | FCBs | -- | | */
  37. MEMBASE.C: /* ------------------ | | Buffers data | */
  38. MEMBASE.C: /* ------------------ | | | */
  39. MEMBASE.C: /* ------------------ | -------------------- */
  40. MEMBASE.C: /* ------------------ | ------------------- */
  41. MEMBASE.C: /* | EXTERN DRIVER 2| | -------->|X (signature) | Block header */
  42. MEMBASE.C: /* ------------------ ------------------- */
  43. MEMBASE.C: /* ------------------ | Buffers data | */
  44. MEMBASE.C: /* -------------------- */
  45. MEMBASE.C: /* 70:0 - BIOS data 70:0 - BIOS data
  46. MEMBASE.C: /* 70:0 - BIOS data
  47. MEMBASE.C: while (ThisArenaPtr -> Signature != (char) 'Z')
  48. MEMBASE.C: if (ThisArenaPtr -> Owner == 8 || ThisArenaPtr -> Owner == 9 ) /* MSKK02 */
  49. MEMBASE.C: FP_SEG(NextArenaPtr) = FP_SEG(ThisArenaPtr) + ThisArenaPtr -> Paragraphs + 1;
  50. MEMBASE.C: Out_Var2 = (long) (ThisArenaPtr -> Paragraphs) * 16l; /* MSKK02 */
  51. MEMBASE.C: if (ThisArenaPtr->OwnerName[0] == 'S' &&
  52. MEMBASE.C: ThisArenaPtr->OwnerName[1] == 'C')
  53. MEMBASE.C: (ThisArenaPtr -> Owner == 8) ? IbmbioMsg : AdddrvMsg, /* MSKK02 */
  54. MEMBASE.C: (ThisArenaPtr -> Owner == 8) ? SystemDataMsg : ProgramMsg ); /* MSKK02 */
  55. MEMBASE.C: switch(ThisConfigArenaPtr -> Signature) /* MSKK02 */
  56. MEMBASE.C: Out_Var1 = ((long) ThisConfigArenaPtr -> Paragraphs) * 16l; /* MSKK02 */
  57. MEMBASE.C: FP_SEG(NextConfigArenaPtr) += NextConfigArenaPtr -> Paragraphs + 1; /* MSKK02 */
  58. MEMBASE.C: if (ThisConfigArenaPtr -> Signature == (char) 'D') /* MSKK02 */
  59. MEMBASE.C: ThisDeviceDriver = ThisDeviceDriver -> NextDeviceHeader; /* MSKK02 */
  60. MEMBASE.C: FP_SEG(ThisConfigArenaPtr) += ThisConfigArenaPtr -> Paragraphs + 1; /* MSKK02 */
  61. MEMBASE.C: if (ThisArenaPtr -> Owner == 8)
  62. MEMBASE.C: FP_SEG(NextArenaPtr) = FP_SEG(ThisArenaPtr) + ThisArenaPtr -> Paragraphs + 1;
  63. MEMBASE.C: Out_Var2 = (long) (ThisArenaPtr -> Paragraphs) * 16l;
  64. MEMBASE.C: if (ThisArenaPtr->OwnerName[0] == 'S' &&
  65. MEMBASE.C: ThisArenaPtr->OwnerName[1] == 'C')
  66. MEMBASE.C: switch(ThisConfigArenaPtr -> Signature)
  67. MEMBASE.C: Out_Var1 = ((long) ThisConfigArenaPtr -> Paragraphs) * 16l;
  68. MEMBASE.C: FP_SEG(NextConfigArenaPtr) += NextConfigArenaPtr -> Paragraphs + 1;
  69. MEMBASE.C: if (ThisConfigArenaPtr -> Signature == (char) 'D')
  70. MEMBASE.C: ThisDeviceDriver = ThisDeviceDriver -> NextDeviceHeader; /* MSKK01 */
  71. MEMBASE.C: FP_SEG(ThisConfigArenaPtr) += ThisConfigArenaPtr -> Paragraphs + 1;
  72. MEMBASE.C: Out_Var2 = ((long) (ThisArenaPtr -> Paragraphs)) * 16l;
  73. MEMBASE.C: FP_SEG(ThisArenaPtr) += ThisArenaPtr -> Paragraphs + 1;
  74. MEMBASE.C: Out_Var2 = ((long) (ThisArenaPtr -> Paragraphs)) * 16l;
  75. MEMBASE.C: if ( ((ThisDeviceDriver -> Attributes) & 0x8000 ) != 0 )
  76. MEMBASE.C: { for (i = 0; i < 8; i++) LocalDeviceName[i] = ThisDeviceDriver -> Name[i];
  77. MEMBASE.C: if ((int) ThisDeviceDriver -> Name[0] == 1)
  78. MEMBASE.C: 'A'+BlockDeviceNumber + ((int) ThisDeviceDriver -> Name[0]) - 1);
  79. MEMBASE.C: BlockDeviceNumber += (int) (ThisDeviceDriver -> Name[0]);
  80. MEMBASE.C: free_mem = (DOS_TopOfMemory * 16l) - (FP_SEG(PSPptr)*16l); /* ;an000;ac005; */
  81. MEMBASE.C: PspSegment = ArenaPtr -> Owner;
  82. MEMBASE.C: FP_SEG(ArenaPtr) = PspSegment-1; /* -1 'cause Arena is 16 bytes before PSP */
  83. MEMBASE.C: StringPtr = (char far *) &(ArenaPtr -> OwnerName[0]);
  84. MEMBASE.C: * such names. - Nagara 11/20/90
  85. MEMBASE.C: StringPtr = (char far *) &(ArenaPtr -> OwnerName[0]);
  86. MEMBASE.C: OutputPtr--;
  87. MEMBASE.C: if (Header -> Owner == 8) Message_Number = StackMsg;
  88. MEMBASE.C: if (Header -> Owner == 0) Message_Number = FreeMsg;
  89. MEMBASE.C: PspSegment = Header -> Owner;
  90. MEMCTRLC.C: /* This module contains the Ctrl-C handler put in by Mem when */
  91. MEMCTRLC.C: /* it links in UMBs. On a Ctrl-C, UMBs are delinked if they were */
  92. MEMCTRLC.C: /* explicitly enabled by Mem. The old Ctrl-C handler is restored */
  93. MEMCTRLC.C: /* after a Ctrl-C and as a result lot of old programs dont run. */
  94. MEMEX.C: /* MEMEX.C - expanded and extended memory handling functions for MEM.C.
  95. MEMEX.C: if ((SysVarsPtr) -> ExtendedMemory != 0) /* extended memory? ;an001; dms;*/
  96. MEMEX.C: EXTMemoryTot = (long) (SysVarsPtr) -> ExtendedMemory; /* get total EM size ;an001; dms;*/
  97. MEMEX.C: EXTMemoryTot -= (unsigned long) (CheckVDisk() * 1024l);
  98. MEMEX.C: /* only want to try this if vector is non-zero */
  99. SUBMSG.C: /* SUBMSG.C - Message retriever interface functions for MEM command.
  100. SUBMSG.C: /* SUB0_MESSAGE - This routine will print only those */
  101. SUBMSG.C: /* Inputs : Msg_Num - number of applicable message */
  102. SUBMSG.C: /* Handle - display type */
  103. SUBMSG.C: /* Message_Type - type of message to display */
  104. SUBMSG.C: /* SUB1_MESSAGE - This routine will print only those */
  105. SUBMSG.C: /* Inputs : Msg_Num - number of applicable message */
  106. SUBMSG.C: /* Handle - display type */
  107. SUBMSG.C: /* Message_Type - type of message to display */
  108. SUBMSG.C: /* Replace_Parm - pointer to parm to replace */
  109. SUBMSG.C: /* SUB2_MESSAGE - This routine will print only those */
  110. SUBMSG.C: /* Inputs : Msg_Num - number of applicable message */
  111. SUBMSG.C: /* Handle - display type */
  112. SUBMSG.C: /* Message_Type - type of message to display */
  113. SUBMSG.C: /* Replace_Parm1 - pointer to parm to replace */
  114. SUBMSG.C: /* Replace_Parm2 - pointer to parm to replace */
  115. SUBMSG.C: /* Replace_Parm3 - pointer to parm to replace */
  116. SUBMSG.C: /* SUB3_MESSAGE - This routine will print only those */
  117. SUBMSG.C: /* Inputs : Msg_Num - number of applicable message */
  118. SUBMSG.C: /* Handle - display type */
  119. SUBMSG.C: /* Message_Type - type of message to display */
  120. SUBMSG.C: /* Replace_Parm1 - pointer to parm to replace */
  121. SUBMSG.C: /* Replace_Parm2 - pointer to parm to replace */
  122. SUBMSG.C: /* Replace_Parm3 - pointer to parm to replace */
  123. SUBMSG.C: /* SUB4_MESSAGE - This routine will print only those */
  124. SUBMSG.C: /* Inputs : Msg_Num - number of applicable message */
  125. SUBMSG.C: /* Handle - display type */
  126. SUBMSG.C: /* Message_Type - type of message to display */
  127. SUBMSG.C: /* Replace_Parm1 - pointer to parm to replace */
  128. SUBMSG.C: /* Replace_Parm2 - pointer to parm to replace */
  129. SUBMSG.C: /* Replace_Parm3 - pointer to parm to replace */
  130. SUBMSG.C: /* Dynamic_Parm - parm number to use as replaceable */
  131. SUBMSG.C: /* SUB4a_MESSAGE - This routine will print only those */
  132. SUBMSG.C: /* Inputs : Msg_Num - number of applicable message */
  133. SUBMSG.C: /* Handle - display type */
  134. SUBMSG.C: /* Message_Type - type of message to display */
  135. SUBMSG.C: /* Replace_Parm1 - pointer to parm to replace */
  136. SUBMSG.C: /* Replace_Parm2 - pointer to parm to replace */
  137. SUBMSG.C: /* Replace_Parm3 - pointer to parm to replace */
  138. SUBMSG.C: /* Dynamic_Parm - parm number to use as replaceable */
  139. SUBMSG.C: /* EMSPrint - This routine will print the message */