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.

145 lines
2.8 KiB

  1. /*++
  2. Microsoft Confidential
  3. Copyright (c) 1992-1997 Microsoft Corporation
  4. All rights reserved
  5. Module Name:
  6. virtual.h
  7. Abstract:
  8. Public declarations for the Change Virtual Memory dialog of the System
  9. Control Panel Applet
  10. Notes:
  11. The virtual memory settings and the crash dump (core dump) settings
  12. are tightly-coupled. Therefore, virtual.c and virtual.h have some
  13. heavy dependencies on crashdmp.c and startup.h (and vice versa).
  14. Author:
  15. Byron Dazey 06-Jun-1992
  16. Revision History:
  17. 15-Oct-1997 scotthal
  18. Split public declarations into separate header
  19. --*/
  20. #ifndef _SYSDM_VIRTUAL_H_
  21. #define _SYSDM_VIRTUAL_H_
  22. //
  23. // Some debugging macros shared by the virtual mem and crash dump stuff
  24. //
  25. #ifdef VM_DBG
  26. # pragma message(__FILE__"(19): warning !!!! : compiled for DEBUG ONLY!" )
  27. # define DPRINTF(p) DBGPRINTF(p)
  28. # define DOUT(S) DBGOUT(S)
  29. #else
  30. # define DPRINTF(p)
  31. # define DOUT(S)
  32. #endif
  33. //
  34. // Constants
  35. //
  36. #define MAX_DRIVES 26 // Max number of drives.
  37. //
  38. // Type Definitions
  39. //
  40. typedef struct
  41. {
  42. BOOL fCanHavePagefile; // TRUE if the drive can have a pagefile.
  43. BOOL fCreateFile; // TRUE if user hits [SET] and no pagefile
  44. DWORD nMinFileSize; // Minimum size of pagefile in MB.
  45. DWORD nMaxFileSize; // Max size of pagefile in MB.
  46. DWORD nMinFileSizePrev; // Previous minimum size of pagefile in MB.
  47. DWORD nMaxFileSizePrev; // Previous max size of pagefile in MB.
  48. LPTSTR pszPageFile; // Path to page file if it exists on that drv
  49. BOOL fRamBasedPagefile; // TRUE if the pagefile size should always match RAM
  50. BOOL fRamBasedPrev; // TRUE if the pagefile size should always match RAM
  51. } PAGING_FILE; // Swap file structure
  52. //
  53. // Global Variables
  54. //
  55. extern HKEY ghkeyMemMgt;
  56. extern PAGING_FILE apf[MAX_DRIVES];
  57. extern PAGING_FILE apfOriginal[MAX_DRIVES];
  58. //
  59. // Public function prototypes
  60. //
  61. INT_PTR
  62. APIENTRY
  63. VirtualMemDlg(
  64. IN HWND hDlg,
  65. IN UINT message,
  66. IN WPARAM wParam,
  67. IN LPARAM lParam
  68. );
  69. BOOL
  70. VirtualInitStructures(
  71. void
  72. );
  73. void
  74. VirtualFreeStructures(
  75. void
  76. );
  77. INT
  78. VirtualMemComputeAllocated(
  79. IN HWND hWnd,
  80. OUT BOOL *pfTempPf
  81. );
  82. VCREG_RET
  83. VirtualOpenKey(
  84. void
  85. );
  86. void
  87. VirtualCloseKey(
  88. void
  89. );
  90. BOOL
  91. VirtualGetPageFiles(
  92. OUT PAGING_FILE *apf
  93. );
  94. void
  95. VirtualFreePageFiles(
  96. IN PAGING_FILE *apf
  97. );
  98. BOOL
  99. VirtualMemUpdateRegistry(
  100. VOID
  101. );
  102. int
  103. VirtualMemPromptForReboot(
  104. IN HWND hDlg
  105. );
  106. DWORD
  107. GetFreeSpaceMB(
  108. IN INT iDrive
  109. );
  110. VOID
  111. SetDlgItemMB(
  112. IN HWND hDlg,
  113. IN INT idControl,
  114. IN DWORD dwMBValue
  115. );
  116. #endif // _SYSDM_VIRTUAL_H_