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.

97 lines
1.6 KiB

  1. typedef ULONG HPARTITION;
  2. UINT
  3. _far
  4. InitializePartitionList(
  5. VOID
  6. );
  7. HPARTITION
  8. _far
  9. OpenPartition(
  10. IN UINT PartitionId
  11. );
  12. VOID
  13. _far
  14. ClosePartition(
  15. IN HPARTITION PartitionHandle
  16. );
  17. BOOL
  18. _far
  19. GetPartitionInfoById(
  20. IN UINT PartitionId,
  21. IN UINT Reserved,
  22. OUT FPUINT DiskId,
  23. OUT FPBYTE SystemId,
  24. OUT FPULONG StartSector,
  25. OUT FPULONG SectorCount
  26. );
  27. BOOL
  28. _far
  29. GetPartitionInfoByHandle(
  30. IN HPARTITION PartitionHandle,
  31. OUT FPUINT DiskId,
  32. OUT FPBYTE SystemId,
  33. OUT FPULONG StartSector,
  34. OUT FPULONG SectorCount
  35. );
  36. BOOL
  37. _far
  38. ReadPartition(
  39. IN HPARTITION PartitionHandle,
  40. IN ULONG StartSector,
  41. IN BYTE SectorCount,
  42. OUT FPVOID Buffer
  43. );
  44. BOOL
  45. _far
  46. WritePartition(
  47. IN HPARTITION PartitionHandle,
  48. IN ULONG StartSector,
  49. IN BYTE SectorCount,
  50. IN FPVOID Buffer
  51. );
  52. //
  53. // Structure for partition table entry
  54. //
  55. typedef struct _PARTITION_TABLE_ENTRY{
  56. BYTE Active;
  57. BYTE StartH;
  58. BYTE StartS;
  59. BYTE StartC;
  60. BYTE SysId;
  61. BYTE EndH;
  62. BYTE EndS;
  63. BYTE EndC;
  64. ULONG Start;
  65. ULONG Count;
  66. } PARTITION_TABLE_ENTRY, _far * FPPARTITION_TABLE_ENTRY;
  67. //
  68. // Define structure for an on-disk master boot record.
  69. //
  70. #define NUM_PARTITION_TABLE_ENTRIES 4
  71. #define BOOT_RECORD_SIGNATURE (0xaa55)
  72. typedef struct _MBR {
  73. UCHAR BootCode[440];
  74. UCHAR NTFTSignature[4];
  75. UCHAR Filler[2];
  76. PARTITION_TABLE_ENTRY PartitionTable[NUM_PARTITION_TABLE_ENTRIES];
  77. UINT AA55Signature;
  78. } MBR, _far *FPMBR;