virtual.h
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 3k
Category:

Windows Kernel

Development Platform:

Visual C++

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