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. **------------------------------------------------------------------------------
  3. ** Module: Disk Space Cleanup Property Sheets
  4. ** File: diskutil.h
  5. **
  6. ** Purpose: General Disk utility functions
  7. ** Notes:
  8. ** Mod Log: Created by Jason Cobb (2/97)
  9. **
  10. ** Copyright (c)1997 Microsoft Corporation, All Rights Reserved
  11. **------------------------------------------------------------------------------
  12. */
  13. #ifndef DISKUTIL_H
  14. #define DISKUTIL_H
  15. /*
  16. **------------------------------------------------------------------------------
  17. ** Project include files
  18. **------------------------------------------------------------------------------
  19. */
  20. #ifndef COMMON_H
  21. #include "common.h"
  22. #endif
  23. /*
  24. **------------------------------------------------------------------------------
  25. ** Defines
  26. **------------------------------------------------------------------------------
  27. */
  28. #ifndef cb1MEG
  29. #define cb1MEG ((ULONG)1048576L)
  30. #define cb2MEG (cb1MEG * 2L)
  31. #define cb5MEG (cb1MEG * 5L)
  32. #define cb10MEG (cb1MEG * 10L)
  33. #define cb50MEG (cb1MEG * 50L)
  34. #define cb100MEG (cb1MEG * 100L)
  35. #endif
  36. #ifndef DRENUM
  37. #define DRENUM
  38. typedef enum
  39. {
  40. Drive_A = 0,
  41. Drive_B, Drive_C, Drive_D, Drive_E, Drive_F,
  42. Drive_G, Drive_H, Drive_I, Drive_J, Drive_K,
  43. Drive_L, Drive_M, Drive_N, Drive_O, Drive_P,
  44. Drive_Q, Drive_R, Drive_S, Drive_T, Drive_U,
  45. Drive_V, Drive_W, Drive_X, Drive_Y, Drive_Z,
  46. Drive_INV,
  47. Drive_ALL
  48. } drenum;
  49. #endif // DRENUM
  50. typedef enum
  51. {
  52. hwUnknown,
  53. hwINVALID,
  54. hwRemoveable,
  55. hwFixed,
  56. hwNetwork,
  57. hwCDROM,
  58. hwRamDrive,
  59. hwFloppy
  60. } hardware;
  61. typedef enum
  62. {
  63. vtINVALID,
  64. vtDoubleSpace,
  65. vtDriveSpace,
  66. vtFrosting,
  67. vtMixed,
  68. vtFuture
  69. } volumetype;
  70. typedef struct _DEVIOCTL_REGISTERS {
  71. DWORD reg_EBX;
  72. DWORD reg_EDX;
  73. DWORD reg_ECX;
  74. DWORD reg_EAX;
  75. DWORD reg_EDI;
  76. DWORD reg_ESI;
  77. DWORD reg_Flags;
  78. } DEVIOCTL_REGISTERS, *PDEVIOCTL_REGISTERS;
  79. /*
  80. **------------------------------------------------------------------------------
  81. ** Global function prototypes
  82. **------------------------------------------------------------------------------
  83. */
  84. BOOL fIsSingleDrive(
  85. LPTSTR lpDrive
  86. );
  87. BOOL
  88. fIsValidDriveString(
  89. const TCHAR * szDrive
  90. );
  91. BOOL
  92. GetDriveFromString(
  93. const TCHAR * szDrive,
  94. drenum & dre
  95. );
  96. BOOL
  97. CreateStringFromDrive(
  98. drenum dre,
  99. TCHAR * szDrive,
  100. ULONG cLen
  101. );
  102. HICON
  103. GetDriveIcon(
  104. drenum dre,
  105. BOOL bSmallIcon
  106. );
  107. BOOL
  108. GetDriveDescription(
  109. drenum dre,
  110. TCHAR *psz,
  111. size_t cch
  112. );
  113. BOOL
  114. GetHardwareType(
  115. drenum dre,
  116. hardware &hwType
  117. );
  118. ULARGE_INTEGER
  119. GetFreeSpaceRatio(
  120. WORD dwDrive,
  121. ULARGE_INTEGER cbTotal
  122. );
  123. #endif