Home |
Function RTFCheckDiskBufferSize Function RTFCreateMasterBootRecord Function RTFCreateGPTPartition |
Function RTFCreateGPTPartitionRTFCreateGPTPartition creates a GPT partition table for a hard disk: int RTFCreateGPTPartition(void * GPT, UINT GPTBufferSize, RTFSector Sectors, UINT SectorSize, UINT PartitionAlignment, const BYTE * Unique, const wchar_t * Name, DWORD Flags); RTFCreateGPTPartition does not access any physical disk. ParametersGPTA pointer to a buffer to hold the GPT to be created. Its size must be at least 2 sectors plus 16384 bytes. GPTBufferSizeThe size of the buffer pointed to by parameter GPT. SectorsTotal number of sectors of the disk. SectorSizeBytes per sector of the disk. This value must be at least 512 and a power of two. PartitionAlignmentMinimum alignment of the first partition. This value must be at least 1 and a power of two. UniqueA pointer to an array of 6 bytes which uniquely identify the computer on which this function is called. This value is required to build a GUID for the new partition table. If this computer has an Ethernet interface, a pointer to the Ethernet address (MAC address) of that interface should be used. Other possibilities would be the serial number of the BIOS. NameA pointer to a NUL-terminated Unicode name of the first partition. The maximum length is 35 characters. If this parameter is NULL, a default name will be applied. FlagsCan be 0 or a combination of the following flags:
return valueIf the function succeeds, the return value is >= RTF_NO_ERROR. If the function fails, the return value is a negative error code. RTFCreateGPTPartition fills the supplied buffer with an MBR, a GPT header, and 128 partition table entries. The first entry contains one partition spanning the complete disk. When a GPT partition table is written to disk (starrting at sector 0), a backup GPT must also be written. Please see function RTFCreateBackupGPT for details. Demo program PartDemo uses this function.
|