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.

169 lines
5.0 KiB

  1. #include "fdisk.h"
  2. HANDLE hModule;
  3. // IsDiskRemovable is an array of BOOLEANs each of which indicates
  4. // whether the corresponding physical disk is removable.
  5. PBOOLEAN IsDiskRemovable = NULL;
  6. // RemovableDiskReservedDriveLetters is an array of CHARs which
  7. // shows the reserved drive letter for each disk if that disk is
  8. // removable.
  9. PCHAR RemovableDiskReservedDriveLetters;
  10. // This will be an array of pointers to DISKSTATE structures, indexed
  11. // by disk number.
  12. PDISKSTATE *Disks;
  13. // BootDiskNumber is the number of the disk on which the boot partition
  14. // (ie. the disk with the WinNt files) resides. BootPartitionNumber is
  15. // the original partition number of this partition.
  16. ULONG BootDiskNumber;
  17. ULONG BootPartitionNumber;
  18. // window handles
  19. HANDLE hwndFrame,
  20. hwndList;
  21. // GDI objects
  22. HBITMAP hBitmapSmallDisk;
  23. HBITMAP hBitmapRemovableDisk;
  24. HDC hDC;
  25. HFONT hFontGraph,
  26. hFontGraphBold;
  27. HBRUSH Brushes[BRUSH_ARRAY_SIZE];
  28. HBRUSH hBrushFreeLogical,
  29. hBrushFreePrimary;
  30. HPEN hPenNull,
  31. hPenThinSolid;
  32. HCURSOR hcurWait,
  33. hcurNormal;
  34. // initial stuff for the disk graphs, used when there is
  35. // no info in win.ini.
  36. int BrushHatches[BRUSH_ARRAY_SIZE] = { DEFAULT_HATCH_USEDPRIMARY,
  37. DEFAULT_HATCH_USEDLOGICAL,
  38. DEFAULT_HATCH_STRIPESET,
  39. DEFAULT_HATCH_MIRROR,
  40. DEFAULT_HATCH_VOLUMESET
  41. };
  42. int BrushColors[BRUSH_ARRAY_SIZE] = { DEFAULT_COLOR_USEDPRIMARY,
  43. DEFAULT_COLOR_USEDLOGICAL,
  44. DEFAULT_COLOR_STRIPESET,
  45. DEFAULT_COLOR_MIRROR,
  46. DEFAULT_COLOR_VOLUMESET
  47. };
  48. // colors and patterns available for the disk graphs
  49. COLORREF AvailableColors[NUM_AVAILABLE_COLORS] = { RGB(0,0,0), // black
  50. RGB(128,128,128), // dark gray
  51. RGB(192,192,192), // light gray
  52. RGB(255,255,255), // white
  53. RGB(128,128,0), // dark yellow
  54. RGB(128,0,128), // violet
  55. RGB(128,0,0), // dark red
  56. RGB(0,128,128), // dark cyan
  57. RGB(0,128,0), // dark green
  58. RGB(0,0,128), // dark blue
  59. RGB(255,255,0), // yellow
  60. RGB(255,0,255), // light violet
  61. RGB(255,0,0), // red
  62. RGB(0,255,255), // cyan
  63. RGB(0,255,0), // green
  64. RGB(0,0,255) // blue
  65. };
  66. int AvailableHatches[NUM_AVAILABLE_HATCHES] = { 2,3,4,5,6 };
  67. // positions for various items in a disk graph
  68. DWORD GraphWidth,
  69. GraphHeight;
  70. DWORD BarTopYOffset,
  71. BarBottomYOffset,
  72. BarHeight;
  73. DWORD dxDriveLetterStatusArea;
  74. DWORD dxBarTextMargin,
  75. dyBarTextLine;
  76. DWORD dxSmallDisk,
  77. dySmallDisk,
  78. xSmallDisk,
  79. ySmallDisk;
  80. DWORD dxRemovableDisk,
  81. dyRemovableDisk,
  82. xRemovableDisk,
  83. yRemovableDisk;
  84. DWORD BarLeftX,
  85. BarWidth;
  86. // if a single disk region is selected, these vars describe the selection.
  87. PDISKSTATE SingleSel;
  88. DWORD SingleSelIndex;
  89. // name of help file
  90. PTCHAR HelpFile;
  91. TCHAR WinHelpFile[] = TEXT("windisk.hlp");
  92. TCHAR LanmanHelpFile[] = TEXT("windiska.hlp");
  93. // number of hard disks attached to the system
  94. unsigned DiskCount = 0;
  95. // class name for frame window
  96. TCHAR szFrame[] = TEXT("fdFrame");
  97. // "Disk %u"
  98. LPTSTR DiskN;
  99. PWSTR wszUnformatted,
  100. wszNewUnformatted,
  101. wszUnknown;
  102. // If the following is TRUE, the registry needs to be updated and the user will
  103. // be prompted to save changed just as if he had made changes to any partitions.
  104. BOOL RegistryChanged = FALSE;
  105. // Restart required to make changes work.
  106. BOOL RestartRequired = FALSE;
  107. // If the following is TRUE, the main window will pass WM_ENTERIDLE
  108. // messages on to the child dialog box; this will trigger the
  109. // configuration search.
  110. BOOL ConfigurationSearchIdleTrigger = FALSE;
  111. // This flag indicates whether this is a Server
  112. // or just regular Windows NT Workstation.
  113. BOOL IsLanmanNt = FALSE;
  114. // This flag indicates whether double space volume creation
  115. // and deletion is allowed.
  116. BOOL IsFullDoubleSpace = FALSE;
  117. // Cdrom is present in the system.
  118. ULONG AllowCdRom = FALSE;