Source code of Windows XP (NT5)
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.

144 lines
2.5 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. } PAGING_FILE; // Swap file structure
  51. //
  52. // Global Variables
  53. //
  54. extern HKEY ghkeyMemMgt;
  55. extern PAGING_FILE apf[MAX_DRIVES];
  56. extern PAGING_FILE apfOriginal[MAX_DRIVES];
  57. //
  58. // Public function prototypes
  59. //
  60. INT_PTR
  61. APIENTRY
  62. VirtualMemDlg(
  63. IN HWND hDlg,
  64. IN UINT message,
  65. IN WPARAM wParam,
  66. IN LPARAM lParam
  67. );
  68. BOOL
  69. VirtualInitStructures(
  70. void
  71. );
  72. void
  73. VirtualFreeStructures(
  74. void
  75. );
  76. INT
  77. VirtualMemComputeAllocated(
  78. IN HWND hWnd,
  79. OUT BOOL *pfTempPf
  80. );
  81. VCREG_RET
  82. VirtualOpenKey(
  83. void
  84. );
  85. void
  86. VirtualCloseKey(
  87. void
  88. );
  89. BOOL
  90. VirtualGetPageFiles(
  91. OUT PAGING_FILE *apf
  92. );
  93. void
  94. VirtualFreePageFiles(
  95. IN PAGING_FILE *apf
  96. );
  97. BOOL
  98. VirtualMemUpdateRegistry(
  99. VOID
  100. );
  101. int
  102. VirtualMemPromptForReboot(
  103. IN HWND hDlg
  104. );
  105. DWORD
  106. GetFreeSpaceMB(
  107. IN INT iDrive
  108. );
  109. VOID
  110. SetDlgItemMB(
  111. IN HWND hDlg,
  112. IN INT idControl,
  113. IN DWORD dwMBValue
  114. );
  115. #endif // _SYSDM_VIRTUAL_H_