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.

1301 lines
20 KiB

  1. /*++
  2. Copyright (c) 1990-1994 Microsoft Corporation
  3. Module Name:
  4. fdproto.h
  5. Abstract:
  6. Function prototypes.
  7. Author:
  8. Ted Miller (tedm) 7-Jan-1992
  9. Revision:
  10. Bob Rinne (bobri) 2-Feb-1994
  11. Moved definitions from ArcInst here to get rid of dependency with
  12. that source project.
  13. --*/
  14. // stuff in fdengine.c
  15. BOOLEAN
  16. SignatureIsUniqueToSystem(
  17. IN ULONG Disk,
  18. IN ULONG Signature
  19. );
  20. VOID
  21. FdSetDiskSignature(
  22. IN ULONG Disk,
  23. IN ULONG Signature
  24. );
  25. ULONG
  26. FdGetDiskSignature(
  27. IN ULONG Disk
  28. );
  29. BOOLEAN
  30. IsDiskOffLine(
  31. IN ULONG Disk
  32. );
  33. BOOLEAN
  34. IsRegionCommitted(
  35. PREGION_DESCRIPTOR RegionDescriptor
  36. );
  37. BOOLEAN
  38. ChangeCommittedOnDisk(
  39. IN ULONG Disk
  40. );
  41. VOID
  42. ClearCommittedDiskInformation(
  43. );
  44. // stuff in fdisk.c
  45. LONG
  46. MyFrameWndProc(
  47. IN HWND hwnd,
  48. IN UINT msg,
  49. IN UINT wParam,
  50. IN LONG lParam
  51. );
  52. VOID
  53. DeterminePartitioningState(
  54. IN OUT PDISKSTATE DiskState
  55. );
  56. VOID
  57. DrawDiskBar(
  58. IN PDISKSTATE DiskState
  59. );
  60. VOID
  61. AdjustMenuAndStatus(
  62. VOID
  63. );
  64. // stuff in fdinit.c
  65. BOOL
  66. InitializeApp(
  67. VOID
  68. );
  69. VOID
  70. CreateDiskState(
  71. OUT PDISKSTATE *DiskState,
  72. IN DWORD Disk,
  73. OUT PBOOL SignatureCreated
  74. );
  75. #if DBG && DEVL
  76. VOID
  77. StartThread2(
  78. VOID
  79. );
  80. #endif
  81. VOID
  82. DisplayInitializationMessage(
  83. VOID
  84. );
  85. // stuff in fdlistbx.c
  86. VOID
  87. Selection(
  88. IN BOOL MultipleSel,
  89. IN PDISKSTATE DiskState,
  90. IN DWORD region
  91. );
  92. VOID
  93. MouseSelection(
  94. IN BOOL MultipleSel,
  95. IN OUT PPOINT point
  96. );
  97. VOID
  98. SubclassListBox(
  99. IN HWND hwnd
  100. );
  101. DWORD
  102. InitializeListBox(
  103. IN HWND hwndListBox
  104. );
  105. VOID
  106. ResetLBCursorRegion(
  107. VOID
  108. );
  109. VOID
  110. WMDrawItem(
  111. IN PDRAWITEMSTRUCT pDrawItem
  112. );
  113. VOID
  114. ForceLBRedraw(
  115. VOID
  116. );
  117. // stuff in fdmisc.c
  118. BOOL
  119. AllDisksOffLine(
  120. VOID
  121. );
  122. VOID
  123. FdShutdownTheSystem(
  124. VOID
  125. );
  126. LPTSTR
  127. LoadAString(
  128. IN DWORD StringID
  129. );
  130. PWSTR
  131. LoadWString(
  132. IN DWORD StringID
  133. );
  134. int
  135. GetHeightFromPoints(
  136. IN int Points
  137. );
  138. VOID
  139. UnicodeHack(
  140. IN PCHAR Source,
  141. OUT LPTSTR Dest
  142. );
  143. VOID
  144. TotalRedrawAndRepaint(
  145. VOID
  146. );
  147. DWORD
  148. CommonDialog(
  149. IN DWORD MsgCode,
  150. IN LPTSTR Caption,
  151. IN DWORD Flags,
  152. IN va_list arglist
  153. );
  154. VOID
  155. ErrorDialog(
  156. IN DWORD ErrorCode,
  157. ...
  158. );
  159. VOID
  160. WarningDialog(
  161. IN DWORD MsgCode,
  162. ...
  163. );
  164. DWORD
  165. ConfirmationDialog(
  166. IN DWORD MsgCode,
  167. IN DWORD Flags,
  168. ...
  169. );
  170. VOID
  171. InfoDialog(
  172. IN DWORD MsgCode,
  173. ...
  174. );
  175. VOID
  176. InitVolumeLabelsAndTypeNames(
  177. VOID
  178. );
  179. VOID
  180. DetermineRegionInfo(
  181. IN PREGION_DESCRIPTOR Region,
  182. OUT PWSTR *TypeName,
  183. OUT PWSTR *VolumeLabel,
  184. OUT PWCH DriveLetter
  185. );
  186. VOID
  187. InitializeDriveLetterInfo(
  188. VOID
  189. );
  190. CHAR
  191. GetAvailableDriveLetter(
  192. VOID
  193. );
  194. VOID
  195. MarkDriveLetterUsed(
  196. IN CHAR DriveLetter
  197. );
  198. VOID
  199. MarkDriveLetterFree(
  200. IN CHAR DriveLetter
  201. );
  202. BOOL
  203. DriveLetterIsAvailable(
  204. IN CHAR DriveLetter
  205. );
  206. BOOL
  207. AllDriveLettersAreUsed(
  208. VOID
  209. );
  210. ULONG
  211. GetDiskNumberFromDriveLetter(
  212. IN CHAR DriveLetter
  213. );
  214. ULONG
  215. GetPartitionNumberFromDriveLetter(
  216. IN CHAR DriveLetter
  217. );
  218. PREGION_DESCRIPTOR
  219. LocateRegionForFtObject(
  220. IN PFT_OBJECT FtObject
  221. );
  222. #if DBG
  223. VOID
  224. FdiskAssertFailedRoutine(
  225. IN char *Expression,
  226. IN char *FileName,
  227. IN int LineNumber
  228. );
  229. #endif
  230. // stuff in fddlgs.c
  231. VOID
  232. CenterDialog(
  233. HWND hwnd
  234. );
  235. VOID
  236. SubclassListBox(
  237. IN HWND hwnd
  238. );
  239. INT_PTR CALLBACK
  240. MinMaxDlgProc(
  241. IN HWND hwnd,
  242. IN UINT msg,
  243. IN WPARAM wParam,
  244. IN LPARAM lParam
  245. );
  246. INT_PTR CALLBACK
  247. DriveLetterDlgProc(
  248. IN HWND hdlg,
  249. IN UINT msg,
  250. IN WPARAM wParam,
  251. IN LPARAM lParam
  252. );
  253. INT_PTR CALLBACK
  254. ColorDlgProc(
  255. IN HWND hdlg,
  256. IN UINT msg,
  257. IN WPARAM wParam,
  258. IN LPARAM lParam
  259. );
  260. INT_PTR CALLBACK
  261. DisplayOptionsDlgProc(
  262. IN HWND hdlg,
  263. IN UINT msg,
  264. IN WPARAM wParam,
  265. IN LPARAM lParam
  266. );
  267. VOID
  268. InitRectControl(
  269. VOID
  270. );
  271. // Format and label support routines - dmfmifs.c
  272. VOID
  273. FormatPartition(
  274. PREGION_DESCRIPTOR RegionDescriptor
  275. );
  276. VOID
  277. LabelPartition(
  278. PREGION_DESCRIPTOR RegionDescriptor
  279. );
  280. INT_PTR CALLBACK
  281. FormatDlgProc(
  282. IN HWND hDlg,
  283. IN UINT wMsg,
  284. IN WPARAM wParam,
  285. IN LPARAM lParam
  286. );
  287. INT_PTR CALLBACK
  288. LabelDlgProc(
  289. IN HWND hDlg,
  290. IN UINT wMsg,
  291. IN WPARAM wParam,
  292. IN LPARAM lParam
  293. );
  294. INT_PTR CALLBACK
  295. CancelDlgProc(
  296. IN HWND hDlg,
  297. IN UINT wMsg,
  298. IN WPARAM wParam,
  299. IN LPARAM lParam
  300. );
  301. VOID
  302. UnloadIfsDll(
  303. VOID
  304. );
  305. // stuff in fdmem.c
  306. PVOID
  307. Malloc(
  308. IN ULONG Size
  309. );
  310. PVOID
  311. Realloc(
  312. IN PVOID Block,
  313. IN ULONG NewSize
  314. );
  315. VOID
  316. Free(
  317. IN PVOID Block
  318. );
  319. VOID
  320. ConfirmOutOfMemory(
  321. VOID
  322. );
  323. // stuff in fdstleg.c
  324. VOID
  325. UpdateStatusBarDisplay(
  326. VOID
  327. );
  328. VOID
  329. ClearStatusArea(
  330. VOID
  331. );
  332. VOID
  333. DrawLegend(
  334. IN HDC hdc,
  335. IN PRECT rc
  336. );
  337. VOID
  338. DrawStatusAreaItem(
  339. IN PRECT rc,
  340. IN HDC hdc,
  341. IN LPTSTR Text,
  342. IN BOOL Unicode
  343. );
  344. // stuff in fdprof.c
  345. VOID
  346. WriteProfile(
  347. VOID
  348. );
  349. VOID
  350. ReadProfile(
  351. VOID
  352. );
  353. // stuff in fdft.c
  354. ULONG
  355. InitializeFt(
  356. IN BOOL DiskSignaturesCreated
  357. );
  358. ULONG
  359. SaveFt(
  360. VOID
  361. );
  362. VOID
  363. FdftCreateFtObjectSet(
  364. IN FT_TYPE FtType,
  365. IN PREGION_DESCRIPTOR *Regions,
  366. IN DWORD RegionCount,
  367. IN FT_SET_STATUS Status
  368. );
  369. BOOL
  370. FdftUpdateFtObjectSet(
  371. IN PFT_OBJECT_SET FtSet,
  372. IN FT_SET_STATUS SetState
  373. );
  374. VOID
  375. FdftDeleteFtObjectSet(
  376. IN PFT_OBJECT_SET FtSet,
  377. IN BOOL OffLineDisksOnly
  378. );
  379. BOOLEAN
  380. NewConfigurationRequiresFt(
  381. VOID
  382. );
  383. VOID
  384. FdftExtendFtObjectSet(
  385. IN OUT PFT_OBJECT_SET FtSet,
  386. IN OUT PREGION_DESCRIPTOR* Regions,
  387. IN DWORD RegionCount
  388. );
  389. DWORD
  390. FdftNextOrdinal(
  391. IN FT_TYPE FtType
  392. );
  393. // commit.c
  394. VOID
  395. FtConfigure(
  396. VOID
  397. );
  398. VOID
  399. CommitAssignLetterList(
  400. VOID
  401. );
  402. VOID
  403. CommitToAssignLetterList(
  404. IN PREGION_DESCRIPTOR RegionDescriptor,
  405. IN BOOL MoveLetter
  406. );
  407. VOID
  408. CommitAllChanges(
  409. IN PVOID Param
  410. );
  411. VOID
  412. CommitDeleteLockLetter(
  413. IN CHAR DriveLetter
  414. );
  415. BOOL
  416. CommitAllowed(
  417. VOID
  418. );
  419. VOID
  420. RescanDevices(
  421. VOID
  422. );
  423. // Commit interface routines.
  424. LETTER_ASSIGNMENT_RESULT
  425. CommitDriveLetter(
  426. IN PREGION_DESCRIPTOR RegionDescriptor,
  427. IN CHAR OldDrive,
  428. IN CHAR NewDrive
  429. );
  430. LONG
  431. CommitToLockList(
  432. IN PREGION_DESCRIPTOR RegionDescriptor,
  433. IN BOOL RemoveDriveLetter,
  434. IN BOOL LockNow,
  435. IN BOOL FailOk
  436. );
  437. LONG
  438. CommitLockVolumes(
  439. IN ULONG Disk
  440. );
  441. LONG
  442. CommitUnlockVolumes(
  443. IN ULONG Disk,
  444. IN BOOLEAN FreeList
  445. );
  446. VOID
  447. CommitUpdateRegionStructures(
  448. VOID
  449. );
  450. // windisk.c
  451. INT_PTR CALLBACK
  452. SizeDlgProc(
  453. IN HWND hDlg,
  454. IN UINT wMsg,
  455. IN WPARAM wParam,
  456. IN LPARAM lParam
  457. );
  458. extern WNDPROC OldSizeDlgProc;
  459. DWORD
  460. CommitChanges(
  461. VOID
  462. );
  463. BOOLEAN
  464. BootPartitionNumberChanged(
  465. PULONG OldNumber,
  466. PULONG NewNumber
  467. );
  468. DWORD
  469. DeletionIsAllowed(
  470. IN PREGION_DESCRIPTOR Region
  471. );
  472. BOOL
  473. RegisterFileSystemExtend(
  474. VOID
  475. );
  476. // stuff in fd_nt.c
  477. BOOLEAN
  478. IsPagefileOnDrive(
  479. CHAR DriveLetter
  480. );
  481. VOID
  482. LoadExistingPageFileInfo(
  483. IN VOID
  484. );
  485. BOOLEAN
  486. GetVolumeSizeMB(
  487. IN ULONG Disk,
  488. IN ULONG Partition,
  489. OUT PULONG Size
  490. );
  491. ULONG
  492. GetVolumeTypeAndSize(
  493. IN ULONG Disk,
  494. IN ULONG Partition,
  495. OUT PWSTR *Label,
  496. OUT PWSTR *Type,
  497. OUT PULONG Size
  498. );
  499. PWSTR
  500. GetWideSysIDName(
  501. IN UCHAR SysID
  502. );
  503. ULONG
  504. MyDiskRegistryGet(
  505. OUT PDISK_REGISTRY *DiskRegistry
  506. );
  507. ULONG
  508. MasterBootCode(
  509. IN ULONG Disk,
  510. IN ULONG Signature,
  511. IN BOOLEAN SetBootCode,
  512. IN BOOLEAN SetSignature
  513. );
  514. ULONG
  515. UpdateMasterBootCode(
  516. IN ULONG Disk
  517. );
  518. ULONG
  519. FormDiskSignature(
  520. VOID
  521. );
  522. ULONG
  523. GetVolumeLabel(
  524. IN ULONG Disk,
  525. IN ULONG Partition,
  526. OUT PWSTR *Label
  527. );
  528. ULONG
  529. GetTypeName(
  530. IN ULONG Disk,
  531. IN ULONG Partition,
  532. OUT PWSTR *Name
  533. );
  534. BOOLEAN
  535. IsRemovable(
  536. IN ULONG DiskNumber
  537. );
  538. ULONG
  539. GetDriveLetterLinkTarget(
  540. IN PWSTR SourceNameStr,
  541. OUT PWSTR *LinkTarget
  542. );
  543. #if i386
  544. VOID
  545. MakePartitionActive(
  546. IN PREGION_DESCRIPTOR DiskRegionArray,
  547. IN ULONG RegionCount,
  548. IN ULONG RegionIndex
  549. );
  550. #endif
  551. // stuff in arrowin.c
  552. BOOL
  553. RegisterArrowClass(
  554. IN HANDLE hModule
  555. );
  556. // stuff in fdhelp.c
  557. VOID
  558. InitHelp(
  559. VOID
  560. );
  561. VOID
  562. TermHelp(
  563. VOID
  564. );
  565. VOID
  566. Help(
  567. IN LONG Code
  568. );
  569. VOID
  570. DialogHelp(
  571. IN DWORD HelpId
  572. );
  573. VOID
  574. SetMenuItemHelpContext(
  575. IN LONG wParam,
  576. IN DWORD lParam
  577. );
  578. // stuff in ftreg.c
  579. BOOL
  580. DoMigratePreviousFtConfig(
  581. VOID
  582. );
  583. BOOL
  584. DoRestoreFtConfig(
  585. VOID
  586. );
  587. VOID
  588. DoSaveFtConfig(
  589. VOID
  590. );
  591. // Double Space support routines.
  592. BOOL
  593. DblSpaceVolumeExists(
  594. IN PREGION_DESCRIPTOR RegionDescriptor
  595. );
  596. BOOL
  597. DblSpaceDismountedVolumeExists(
  598. IN PREGION_DESCRIPTOR RegionDescriptor
  599. );
  600. BOOLEAN
  601. DblSpaceCreate(
  602. IN HWND Dialog,
  603. IN PVOID Param
  604. );
  605. VOID
  606. DblSpaceDelete(
  607. IN PVOID Param
  608. );
  609. VOID
  610. DblSpaceMount(
  611. IN PVOID Param
  612. );
  613. VOID
  614. DblSpaceDismount(
  615. IN PVOID Param
  616. );
  617. VOID
  618. DblSpaceInitialize(
  619. VOID
  620. );
  621. VOID
  622. DblSpace(
  623. IN HWND Dialog,
  624. IN PVOID Param
  625. );
  626. PDBLSPACE_DESCRIPTOR
  627. DblSpaceGetNextVolume(
  628. IN PREGION_DESCRIPTOR RegionDescriptor,
  629. IN PDBLSPACE_DESCRIPTOR DblSpace
  630. );
  631. // FmIfs interface routines
  632. BOOL
  633. LoadIfsDll(
  634. VOID
  635. );
  636. BOOL
  637. FmIfsDismountDblspace(
  638. IN CHAR DriveLetter
  639. );
  640. BOOL
  641. FmIfsMountDblspace(
  642. IN PCHAR FileName,
  643. IN CHAR HostDrive,
  644. IN CHAR NewDrive
  645. );
  646. BOOLEAN
  647. FmIfsQueryInformation(
  648. IN PWSTR DosDriveName,
  649. OUT PBOOLEAN IsRemovable,
  650. OUT PBOOLEAN IsFloppy,
  651. OUT PBOOLEAN IsCompressed,
  652. OUT PBOOLEAN Error,
  653. OUT PWSTR NtDriveName,
  654. IN ULONG MaxNtDriveNameLength,
  655. OUT PWSTR CvfFileName,
  656. IN ULONG MaxCvfFileNameLength,
  657. OUT PWSTR HostDriveName,
  658. IN ULONG MaxHostDriveNameLength
  659. );
  660. // Cdrom interface routines.
  661. VOID
  662. CdRom(
  663. IN HWND Dialog,
  664. IN PVOID Param
  665. );
  666. VOID
  667. CdRomAddDevice(
  668. IN PWSTR NtName,
  669. IN WCHAR DriveLetter
  670. );
  671. //
  672. // Macros
  673. //
  674. //
  675. // BOOLEAN
  676. // DmSignificantRegion(
  677. // IN PREGION_DESCRIPTOR Region
  678. // );
  679. //
  680. #define DmSignificantRegion(Region) (((Region)->SysID != SYSID_UNUSED) \
  681. && (!IsExtended((Region)->SysID)) \
  682. && (IsRecognizedPartition((Region)->SysID)))
  683. //
  684. // VOID
  685. // DmSetPersistentRegionData(
  686. // IN PPERSISTENT_REGION_DATA RegionData
  687. // );
  688. //
  689. #define DmSetPersistentRegionData(Region,RegionData) \
  690. FdSetPersistentData((Region),(ULONG)RegionData); \
  691. (Region)->PersistentData = RegionData
  692. //
  693. // VOID
  694. // DmInitPersistentRegionData(
  695. // OUT PPERSISTENT_REGION_DATA RegionData,
  696. // IN PFT_OBJECT ftObject,
  697. // IN PWSTR volumeLabel,
  698. // IN PWSTR typeName,
  699. // IN CHAR driveLetter,
  700. // );
  701. //
  702. #define DmInitPersistentRegionData(RegionData,ftObject,volumeLabel,typeName,driveLetter) \
  703. RegionData->DblSpace = NULL; \
  704. RegionData->FtObject = ftObject; \
  705. RegionData->VolumeLabel = volumeLabel; \
  706. RegionData->TypeName = typeName; \
  707. RegionData->VolumeExists = FALSE; \
  708. RegionData->DriveLetter = driveLetter
  709. // ntlow definitions
  710. STATUS_CODE
  711. LowOpenNtName(
  712. IN PCHAR Name,
  713. IN HANDLE_PT Handle
  714. );
  715. STATUS_CODE
  716. LowOpenDisk(
  717. IN PCHAR DevicePath,
  718. OUT HANDLE_PT DiskId
  719. );
  720. STATUS_CODE
  721. LowOpenPartition(
  722. IN PCHAR DevicePath,
  723. IN ULONG Partition,
  724. OUT HANDLE_PT Handle
  725. );
  726. STATUS_CODE
  727. LowOpenDriveLetter(
  728. IN CHAR DriveLetter,
  729. IN HANDLE_PT Handle
  730. );
  731. STATUS_CODE
  732. LowCloseDisk(
  733. IN HANDLE_T DiskId
  734. );
  735. STATUS_CODE
  736. LowGetDriveGeometry(
  737. IN PCHAR DevicePath,
  738. OUT PULONG TotalSectorCount,
  739. OUT PULONG SectorSize,
  740. OUT PULONG SectorsPerTrack,
  741. OUT PULONG Heads
  742. );
  743. STATUS_CODE
  744. LowGetPartitionGeometry(
  745. IN PCHAR PartitionPath,
  746. OUT PULONG TotalSectorCount,
  747. OUT PULONG SectorSize,
  748. OUT PULONG SectorsPerTrack,
  749. OUT PULONG Heads
  750. );
  751. STATUS_CODE
  752. LowReadSectors(
  753. IN HANDLE_T VolumeId,
  754. IN ULONG SectorSize,
  755. IN ULONG StartingSector,
  756. IN ULONG NumberOfSectors,
  757. OUT PVOID Buffer
  758. );
  759. STATUS_CODE
  760. LowWriteSectors(
  761. IN HANDLE_T VolumeId,
  762. IN ULONG SectorSize,
  763. IN ULONG StartingSector,
  764. IN ULONG NumberOfSectors,
  765. IN PVOID Buffer
  766. );
  767. STATUS_CODE
  768. LowLockDrive(
  769. IN HANDLE_T DiskId
  770. );
  771. STATUS_CODE
  772. LowUnlockDrive(
  773. IN HANDLE_T DiskId
  774. );
  775. STATUS_CODE
  776. LowFtVolumeStatus(
  777. IN ULONG Disk,
  778. IN ULONG Partition,
  779. IN PFT_SET_STATUS FtStatus,
  780. IN PULONG NumberOfMembers
  781. );
  782. STATUS_CODE
  783. LowFtVolumeStatusByLetter(
  784. IN CHAR DriveLetter,
  785. IN PFT_SET_STATUS FtStatus,
  786. IN PULONG NumberOfMembers
  787. );
  788. STATUS_CODE
  789. LowSetDiskLayout(
  790. IN PCHAR Path,
  791. IN PDRIVE_LAYOUT_INFORMATION DriveLayout
  792. );
  793. STATUS_CODE
  794. LowGetDiskLayout(
  795. IN PCHAR Path,
  796. OUT PDRIVE_LAYOUT_INFORMATION *DriveLayout
  797. );
  798. // Partition engine definitions
  799. ULONG
  800. GetDiskCount(
  801. VOID
  802. );
  803. PCHAR
  804. GetDiskName(
  805. ULONG Disk
  806. );
  807. ULONG
  808. DiskSizeMB(
  809. IN ULONG Disk
  810. );
  811. STATUS_CODE
  812. GetDiskRegions(
  813. IN ULONG Disk,
  814. IN BOOLEAN WantUsedRegions,
  815. IN BOOLEAN WantFreeRegions,
  816. IN BOOLEAN WantPrimaryRegions,
  817. IN BOOLEAN WantLogicalRegions,
  818. OUT PREGION_DESCRIPTOR *Region,
  819. OUT ULONG *RegionCount
  820. );
  821. #define GetAllDiskRegions(disk,regions,count) \
  822. GetDiskRegions(disk,TRUE,TRUE,TRUE,TRUE,regions,count)
  823. #define GetFreeDiskRegions(disk,regions,count) \
  824. GetDiskRegions(disk,FALSE,TRUE,TRUE,TRUE,regions,count)
  825. #define GetUsedDiskRegions(disk,regions,count) \
  826. GetDiskRegions(disk,TRUE,FALSE,TRUE,TRUE,regions,count)
  827. #define GetPrimaryDiskRegions(disk,regions,count) \
  828. GetDiskRegions(disk,TRUE,TRUE,TRUE,FALSE,regions,count)
  829. #define GetLogicalDiskRegions(disk,regions,count) \
  830. GetDiskRegions(disk,TRUE,TRUE,FALSE,TRUE,regions,count)
  831. #define GetUsedPrimaryDiskRegions(disk,regions,count) \
  832. GetDiskRegions(disk,TRUE,FALSE,TRUE,FALSE,regions,count)
  833. #define GetUsedLogicalDiskRegions(disk,regions,count) \
  834. GetDiskRegions(disk,TRUE,FALSE,FALSE,TRUE,regions,count)
  835. #define GetFreePrimaryDiskRegions(disk,regions,count) \
  836. GetDiskRegions(disk,FALSE,TRUE,TRUE,FALSE,regions,count)
  837. #define GetFreeLogicalDiskRegions(disk,regions,count) \
  838. GetDiskRegions(disk,FALSE,TRUE,FALSE,TRUE,regions,count)
  839. VOID
  840. FreeRegionArray(
  841. IN PREGION_DESCRIPTOR Region,
  842. IN ULONG RegionCount
  843. );
  844. STATUS_CODE
  845. IsAnyCreationAllowed(
  846. IN ULONG Disk,
  847. IN BOOLEAN AllowMultiplePrimaries,
  848. OUT PBOOLEAN AnyAllowed,
  849. OUT PBOOLEAN PrimaryAllowed,
  850. OUT PBOOLEAN ExtendedAllowed,
  851. OUT PBOOLEAN LogicalAllowed
  852. );
  853. STATUS_CODE
  854. IsCreationOfPrimaryAllowed(
  855. IN ULONG Disk,
  856. IN BOOLEAN AllowMultiplePrimaries,
  857. OUT PBOOLEAN Allowed
  858. );
  859. STATUS_CODE
  860. IsCreationOfExtendedAllowed(
  861. IN ULONG Disk,
  862. OUT PBOOLEAN Allowed
  863. );
  864. STATUS_CODE
  865. IsCreationOfLogicalAllowed(
  866. IN ULONG Disk,
  867. OUT PBOOLEAN Allowed
  868. );
  869. STATUS_CODE
  870. DoesAnyPartitionExist(
  871. IN ULONG Disk,
  872. OUT PBOOLEAN AnyExists,
  873. OUT PBOOLEAN PrimaryExists,
  874. OUT PBOOLEAN ExtendedExists,
  875. OUT PBOOLEAN LogicalExists
  876. );
  877. STATUS_CODE
  878. DoesAnyPrimaryExist(
  879. IN ULONG Disk,
  880. OUT PBOOLEAN Exists
  881. );
  882. STATUS_CODE
  883. DoesExtendedExist(
  884. IN ULONG Disk,
  885. OUT PBOOLEAN Exists
  886. );
  887. STATUS_CODE
  888. DoesAnyLogicalExist(
  889. IN ULONG Disk,
  890. OUT PBOOLEAN Exists
  891. );
  892. BOOLEAN
  893. IsExtended(
  894. IN UCHAR SysID
  895. );
  896. VOID
  897. SetPartitionActiveFlag(
  898. IN PREGION_DESCRIPTOR Region,
  899. IN UCHAR value
  900. );
  901. STATUS_CODE
  902. CreatePartition(
  903. IN PREGION_DESCRIPTOR Region,
  904. IN ULONG CreationSizeMB,
  905. IN REGION_TYPE Type
  906. );
  907. STATUS_CODE
  908. CreatePartitionEx(
  909. IN PREGION_DESCRIPTOR Region,
  910. IN LARGE_INTEGER MinimumSize,
  911. IN ULONG CreationSizeMB,
  912. IN REGION_TYPE Type,
  913. IN UCHAR SysId
  914. );
  915. STATUS_CODE
  916. DeletePartition(
  917. IN PREGION_DESCRIPTOR Region
  918. );
  919. ULONG
  920. GetHiddenSectorCount(
  921. ULONG Disk,
  922. ULONG Partition
  923. );
  924. VOID
  925. SetSysID(
  926. IN ULONG Disk,
  927. IN ULONG Partition,
  928. IN UCHAR SysID
  929. );
  930. VOID
  931. SetSysID2(
  932. IN PREGION_DESCRIPTOR Region,
  933. IN UCHAR SysID
  934. );
  935. PCHAR
  936. GetSysIDName(
  937. UCHAR SysID
  938. );
  939. STATUS_CODE
  940. CommitPartitionChanges(
  941. IN ULONG Disk
  942. );
  943. BOOLEAN
  944. HavePartitionsBeenChanged(
  945. IN ULONG Disk
  946. );
  947. VOID
  948. FdMarkDiskDirty(
  949. IN ULONG Disk
  950. );
  951. VOID
  952. FdSetPersistentData(
  953. IN PREGION_DESCRIPTOR Region,
  954. IN ULONG Data
  955. );
  956. ULONG
  957. FdGetMinimumSizeMB(
  958. IN ULONG Disk
  959. );
  960. ULONG
  961. FdGetMaximumSizeMB(
  962. IN PREGION_DESCRIPTOR Region,
  963. IN REGION_TYPE CreationType
  964. );
  965. LARGE_INTEGER
  966. FdGetExactSize(
  967. IN PREGION_DESCRIPTOR Region,
  968. IN BOOLEAN ForExtended
  969. );
  970. LARGE_INTEGER
  971. FdGetExactOffset(
  972. IN PREGION_DESCRIPTOR Region
  973. );
  974. BOOLEAN
  975. FdCrosses1024Cylinder(
  976. IN PREGION_DESCRIPTOR Region,
  977. IN ULONG CreationSizeMB,
  978. IN REGION_TYPE RegionType
  979. );
  980. ULONG
  981. FdGetDiskSignature(
  982. IN ULONG Disk
  983. );
  984. VOID
  985. FdSetDiskSignature(
  986. IN ULONG Disk,
  987. IN ULONG Signature
  988. );
  989. BOOLEAN
  990. IsDiskOffLine(
  991. IN ULONG Disk
  992. );
  993. STATUS_CODE
  994. FdiskInitialize(
  995. VOID
  996. );
  997. VOID
  998. FdiskCleanUp(
  999. VOID
  1000. );
  1001. VOID
  1002. ConfigureSystemPartitions(
  1003. VOID
  1004. );
  1005. VOID
  1006. ConfigureOSPartitions(
  1007. VOID
  1008. );
  1009. // Network support function definitions. stuff from network.c
  1010. VOID
  1011. NetworkRemoveShare(
  1012. IN LPCTSTR DriveLetter
  1013. );
  1014. VOID
  1015. NetworkShare(
  1016. IN LPCTSTR DriveLetter
  1017. );
  1018. VOID
  1019. NetworkInitialize(
  1020. );
  1021. // Debugging support for opens
  1022. #ifdef DBG
  1023. NTSTATUS
  1024. DmOpenFile(
  1025. OUT PHANDLE FileHandle,
  1026. IN ACCESS_MASK DesiredAccess,
  1027. IN POBJECT_ATTRIBUTES ObjectAttributes,
  1028. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1029. IN ULONG ShareAccess,
  1030. IN ULONG OpenOptions
  1031. );
  1032. NTSTATUS
  1033. DmClose(
  1034. IN HANDLE Handle
  1035. );
  1036. #else
  1037. #define DmOpenFile NtOpenFile
  1038. #define DmClose NtClose
  1039. #endif