void encode_partitionInfo(PartitionInfo partInfo, unsigned char *result) { *result++ = partInfo.bootable; encode_chs(partInfo.C_start, partInfo.H_start, partInfo.S_start, result); result +=3; *result++ = partInfo.partitionId; encode_chs(partInfo.C_end, partInfo.H_end, partInfo.S_end, result); result += 3; memcpy(result, (unsigned char *)&(partInfo.block_start), 4); result += 4; memcpy(result, (unsigned char *)&(partInfo.block_count), 4); }
void encode_partitionInfo(PartitionInfo partInfo, unsigned char *result) { *result++ = partInfo.bootable; encode_chs(partInfo.C_start, partInfo.H_start, partInfo.S_start, result); result +=3; *result++ = partInfo.partitionId; encode_chs(partInfo.C_end, partInfo.H_end, partInfo.S_end, result); result += 3; *((int *)result) = partInfo.block_start; result += 4; *((int *)result) = partInfo.block_count; }