blob: 17d6f15c61b6c3f6ee68faf2bc230d98f761c0a9 [file] [log] [blame]
srs5694a0eb11a2009-08-29 15:00:08 -04001//
2// C++ Implementation: gptpart
3//
4// Description: Class to implement a SINGLE GPT partition
5//
6//
Roderick W. Smithe3ee7332013-09-24 12:56:11 -04007// Author: Rod Smith <rodsmith@rodsbooks.com>, (C) 2009-2013
srs5694a0eb11a2009-08-29 15:00:08 -04008//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
srs5694978041c2009-09-21 20:51:47 -040012// This program is copyright (c) 2009 by Roderick W. Smith. It is distributed
13// under the terms of the GNU GPL version 2, as detailed in the COPYING file.
srs5694a0eb11a2009-08-29 15:00:08 -040014
15#define __STDC_LIMIT_MACROS
16#define __STDC_CONSTANT_MACROS
17
srs569400b6d7a2011-06-26 22:40:06 -040018#ifdef USE_UTF16
srs5694699941e2011-03-21 21:33:57 -040019#include <unicode/ustdio.h>
20#else
21#define UnicodeString string
22#endif
23
srs5694a0eb11a2009-08-29 15:00:08 -040024#include <string.h>
srs5694fed16d02010-01-27 23:03:40 -050025#include <stdio.h>
26#include <iostream>
srs5694a0eb11a2009-08-29 15:00:08 -040027#include "gptpart.h"
28#include "attributes.h"
29
30using namespace std;
31
srs5694a0eb11a2009-08-29 15:00:08 -040032GPTPart::GPTPart(void) {
srs569455d92612010-03-07 22:16:07 -050033 partitionType.Zero();
34 uniqueGUID.Zero();
35 firstLBA = 0;
36 lastLBA = 0;
37 attributes = 0;
Roderick W. Smith84aaff62014-02-17 16:17:11 -050038 memset(name, 0, NAME_SIZE * sizeof(name[0]) );
srs5694a0eb11a2009-08-29 15:00:08 -040039} // Default constructor
40
41GPTPart::~GPTPart(void) {
42} // destructor
43
srs5694a0eb11a2009-08-29 15:00:08 -040044// Return the gdisk-specific two-byte hex code for the partition
srs5694bf8950c2011-03-12 01:23:12 -050045uint16_t GPTPart::GetHexType(void) const {
srs56946699b012010-02-04 00:55:30 -050046 return partitionType.GetHexType();
srs5694a0eb11a2009-08-29 15:00:08 -040047} // GPTPart::GetHexType()
48
49// Return a plain-text description of the partition type (e.g., "Linux/Windows
50// data" or "Linux swap").
srs56946699b012010-02-04 00:55:30 -050051string GPTPart::GetTypeName(void) {
52 return partitionType.TypeName();
srs5694a0eb11a2009-08-29 15:00:08 -040053} // GPTPart::GetNameType()
54
Roderick W. Smith84aaff62014-02-17 16:17:11 -050055#ifdef USE_UTF16
srs56945a608532011-03-17 13:53:01 -040056// Return a Unicode description of the partition type (e.g., "Linux/Windows
57// data" or "Linux swap").
58UnicodeString GPTPart::GetUTypeName(void) {
59 return partitionType.UTypeName();
srs56945a608532011-03-17 13:53:01 -040060} // GPTPart::GetNameType()
Roderick W. Smith84aaff62014-02-17 16:17:11 -050061#endif
srs56945a608532011-03-17 13:53:01 -040062
srs5694a0eb11a2009-08-29 15:00:08 -040063// Compute and return the partition's length (or 0 if the end is incorrectly
64// set before the beginning).
srs5694bf8950c2011-03-12 01:23:12 -050065uint64_t GPTPart::GetLengthLBA(void) const {
srs5694a0eb11a2009-08-29 15:00:08 -040066 uint64_t length = 0;
srs569455d92612010-03-07 22:16:07 -050067
srs5694a0eb11a2009-08-29 15:00:08 -040068 if (firstLBA <= lastLBA)
69 length = lastLBA - firstLBA + UINT64_C(1);
70 return length;
71} // GPTPart::GetLengthLBA()
72
srs569400b6d7a2011-06-26 22:40:06 -040073#ifdef USE_UTF16
srs5694699941e2011-03-21 21:33:57 -040074// Return partition's name field, converted to a Unicode string
75UnicodeString GPTPart::GetDescription(void) {
76 return (UChar*) name;
77} // GPTPart::GetDescription()
78#else
Roderick W. Smith84aaff62014-02-17 16:17:11 -050079// Return partition's name field, converted to a C++ UTF-8 string
srs56946699b012010-02-04 00:55:30 -050080string GPTPart::GetDescription(void) {
Roderick W. Smith84aaff62014-02-17 16:17:11 -050081 // convert name to utf32 then to utf8
82 string utf8 ;
83 size_t pos = 0 ;
84 while ( ( pos < NAME_SIZE ) && ( name[ pos ] != 0 ) ) {
85 uint16_t cp = name[ pos ++ ] ;
86 if ( ! IsLittleEndian() ) ReverseBytes( & cp , 2 ) ;
87 // first to utf32
88 uint32_t uni ;
89 if ( cp < 0xd800 || cp > 0xdfff ) {
90 uni = cp ;
91 } // if
92 else if ( cp < 0xdc00 ) {
93 // lead surrogate
94 uni = ( (uint32_t)( cp & 0x3ff ) ) << 10 ;
95 if ( pos >= NAME_SIZE ) {
96 // missing trail surrogate, name[] is invalid
97 break ;
98 } // if
99 cp = name[ pos ++ ] ;
100 if ( cp < 0xdc00 || cp > 0xdfff ) {
101 // invalid trail surrogate, name[] is invalid
102 break ;
103 } // if
104 // trail surrogate
105 uni |= cp & 0x3ff ;
106 uni += 0x10000 ;
107 } // if
108 else {
109 // unexpected trail surrogate, name[] is invalid
110 break ;
111 } // if
112 // then to utf8
113 if ( uni < 0x80 ) {
114 utf8 += (char) uni ;
115 } // if
116 else if ( uni < 0x800 ) {
117 utf8 += (char) ( 0xc0 | ( uni >> 6 ) ) ;
118 utf8 += (char) ( 0x80 | ( uni & 0x3f ) ) ;
119 } // if
120 else if ( uni < 0x10000 ) {
121 utf8 += (char) ( 0xe0 | ( uni >> 12 ) ) ;
122 utf8 += (char) ( 0x80 | ( ( uni >> 6 ) & 0x3f ) ) ;
123 utf8 += (char) ( 0x80 | ( uni & 0x3f ) ) ;
124 } // if
125 else {
126 utf8 += (char) ( 0xf0 | ( uni >> 18 ) ) ;
127 utf8 += (char) ( 0xe0 | ( ( uni >> 12 ) & 0x3f ) ) ;
128 utf8 += (char) ( 0x80 | ( ( uni >> 6 ) & 0x3f ) ) ;
129 utf8 += (char) ( 0x80 | ( uni & 0x3f ) ) ;
130 } // if
131 }
132 return utf8 ;
133} // GPTPart::GetDescription(), UTF-8 version
srs5694699941e2011-03-21 21:33:57 -0400134#endif
srs56940a697312010-01-28 21:10:52 -0500135
srs569408bb0da2010-02-19 17:19:55 -0500136// Return 1 if the partition is in use
137int GPTPart::IsUsed(void) {
srs5694e69e6802012-01-20 22:37:12 -0500138 return (partitionType != GUIDData("0x00"));
srs569408bb0da2010-02-19 17:19:55 -0500139} // GPTPart::IsUsed()
140
Roderick W. Smitha345a922014-02-22 12:12:32 -0500141// Returns MBR_SIZED_GOOD, MBR_SIZED_IFFY, or MBR_SIZED_BAD; see comments
142// in header file for details.
Roderick W. Smith9b338c52014-02-20 11:13:36 -0500143int GPTPart::IsSizedForMBR(void) {
Roderick W. Smitha345a922014-02-22 12:12:32 -0500144 int retval = MBR_SIZED_GOOD;
145
146 if ((firstLBA > UINT32_MAX) || ((lastLBA - firstLBA) > UINT32_MAX) || (firstLBA > lastLBA))
147 retval = MBR_SIZED_BAD;
148 else if (lastLBA > UINT32_MAX)
149 retval = MBR_SIZED_IFFY;
150
151 return (retval);
Roderick W. Smith9b338c52014-02-20 11:13:36 -0500152} // GPTPart::IsSizedForMBR()
153
srs56940a697312010-01-28 21:10:52 -0500154// Set the type code to the specified one. Also changes the partition
155// name *IF* the current name is the generic one for the current partition
156// type.
srs56946699b012010-02-04 00:55:30 -0500157void GPTPart::SetType(PartType t) {
Roderick W. Smith84aaff62014-02-17 16:17:11 -0500158#ifdef USE_UTF16
srs56945a608532011-03-17 13:53:01 -0400159 if (GetDescription() == partitionType.UTypeName()) {
Roderick W. Smith84aaff62014-02-17 16:17:11 -0500160#else
161 if (GetDescription() == partitionType.TypeName()) {
162#endif
srs56946699b012010-02-04 00:55:30 -0500163 SetName(t.TypeName());
srs56940a697312010-01-28 21:10:52 -0500164 } // if
165 partitionType = t;
166} // GPTPart::SetType()
srs5694a0eb11a2009-08-29 15:00:08 -0400167
srs569400b6d7a2011-06-26 22:40:06 -0400168#ifdef USE_UTF16
srs5694699941e2011-03-21 21:33:57 -0400169// Set the name for a partition to theName, using a C++-style string as
170// input.
171void GPTPart::SetName(const string & theName) {
172 SetName((UnicodeString) theName.c_str());
srs56945a608532011-03-17 13:53:01 -0400173} // GPTPart::SetName()
174
srs5694699941e2011-03-21 21:33:57 -0400175// Set the name for a partition to theName, using a Unicode string as
176// input.
177void GPTPart::SetName(const UnicodeString & theName) {
178 if (theName.isBogus()) {
179 cerr << "Bogus UTF-16 name found in GPTPart::SetName()! Name not changed!\n";
180 } else {
Roderick W. Smith84aaff62014-02-17 16:17:11 -0500181 memset(name, 0, NAME_SIZE * sizeof(name[0]) );
182 theName.extractBetween(0, NAME_SIZE, (UChar*) name);
srs5694699941e2011-03-21 21:33:57 -0400183 } // if/else
srs5694a0eb11a2009-08-29 15:00:08 -0400184} // GPTPart::SetName()
srs569400b6d7a2011-06-26 22:40:06 -0400185
srs5694699941e2011-03-21 21:33:57 -0400186#else
srs569400b6d7a2011-06-26 22:40:06 -0400187
srs5694699941e2011-03-21 21:33:57 -0400188// Set the name for a partition to theName. Note that theName is a
189// standard C++-style ASCII string, although the GUID partition definition
190// requires a UTF-16LE string. This function creates a simple-minded copy
191// for this.
192void GPTPart::SetName(const string & theName) {
Roderick W. Smith84aaff62014-02-17 16:17:11 -0500193 // convert utf8 to utf32 then to utf16le
194 size_t len = theName.length() ;
195 size_t pos = 0 ;
196 for ( size_t i = 0 ; pos < NAME_SIZE && i < len ; ) {
197 uint32_t uni ;
198 uint8_t cp = theName[ i ++ ] ;
199 int todo ;
200 if ( cp < 0x80 ) {
201 uni = cp ;
202 todo = 0 ;
203 } // if
204 else if ( cp < 0xc0 || cp > 0xf7 ) {
205 // invalid byte, theName is broken
206 break ;
207 } // if
208 else if ( cp < 0xe0 ) {
209 uni = cp & 0x1f ;
210 todo = 1 ;
211 } // if
212 else if ( cp < 0xf0 ) {
213 uni = cp & 0x0f ;
214 todo = 2 ;
215 } // if
216 else {
217 uni = cp & 0x7 ;
218 todo = 3 ;
219 } // if
220 while ( todo > 0 ) {
221 if ( i >= len ) {
222 // missing continuation byte, theName is broken
223 goto break_converter ;
224 } // if
225 cp = theName[ i ++ ] ;
226 if ( cp > 0xbf || cp < 0x80 ) {
227 // invalid continuation byte, theName is broken
228 goto break_converter ;
229 } // if
230 uni <<= 6 ;
231 uni |= cp & 0x3f ;
232 todo -- ;
233 } // while
234 // then to utf16le
235 if ( uni < 0x10000 ) {
236 name[ pos ] = (uint16_t) uni ;
237 if ( ! IsLittleEndian() ) ReverseBytes( name + pos , 2 ) ;
238 pos ++ ;
239 } // if
240 else {
241 if ( pos > NAME_SIZE - 2 ) {
242 // not enough room for two surrogates, truncate
243 break ;
244 } // if
245 uni -= 0x10000 ;
246 name[ pos ] = (uint16_t)( uni >> 10 ) | 0xd800 ;
247 if ( ! IsLittleEndian() ) ReverseBytes( name + pos , 2 ) ;
248 pos ++ ;
249 name[ pos ] = (uint16_t)( uni & 0x3ff ) | 0xdc00 ;
250 if ( ! IsLittleEndian() ) ReverseBytes( name + pos , 2 ) ;
251 pos ++ ;
252 }
253 } // for
254 break_converter : ;
255 // finally fill with zeroes
256 while ( pos < NAME_SIZE ) {
257 name[ pos ++ ] = 0 ;
258 } // while
259} // GPTPart::SetName(), UTF-8 version
srs5694699941e2011-03-21 21:33:57 -0400260#endif
srs5694a0eb11a2009-08-29 15:00:08 -0400261
srs56946699b012010-02-04 00:55:30 -0500262// Set the name for the partition based on the current GUID partition type
263// code's associated name
264void GPTPart::SetDefaultDescription(void) {
265 SetName(partitionType.TypeName());
266} // GPTPart::SetDefaultDescription()
267
srs56940a697312010-01-28 21:10:52 -0500268GPTPart & GPTPart::operator=(const GPTPart & orig) {
srs56940a697312010-01-28 21:10:52 -0500269 partitionType = orig.partitionType;
270 uniqueGUID = orig.uniqueGUID;
271 firstLBA = orig.firstLBA;
272 lastLBA = orig.lastLBA;
273 attributes = orig.attributes;
Roderick W. Smith84aaff62014-02-17 16:17:11 -0500274 memcpy(name, orig.name, NAME_SIZE * sizeof( name[ 0 ] ) );
srs56940a697312010-01-28 21:10:52 -0500275 return *this;
276} // assignment operator
277
srs56949a46b042011-03-15 00:34:10 -0400278// Compare the values, and return a bool result.
279// Because this is intended for sorting and a firstLBA value of 0 denotes
280// a partition that's not in use and so that should be sorted upwards,
281// we return the opposite of the usual arithmetic result when either
282// firstLBA value is 0.
283bool GPTPart::operator<(const GPTPart &other) const {
srs56949a46b042011-03-15 00:34:10 -0400284 if (firstLBA && other.firstLBA)
285 return (firstLBA < other.firstLBA);
286 else
287 return (other.firstLBA < firstLBA);
288} // GPTPart::operator<()
289
srs56940a697312010-01-28 21:10:52 -0500290// Display summary information; does nothing if the partition is empty.
291void GPTPart::ShowSummary(int partNum, uint32_t blockSize) {
srs569401f7f082011-03-15 23:53:31 -0400292 string sizeInIeee;
srs56945a608532011-03-17 13:53:01 -0400293 UnicodeString description;
srs569464cbd172011-03-01 22:03:54 -0500294 size_t i;
srs56940a697312010-01-28 21:10:52 -0500295
296 if (firstLBA != 0) {
srs569401f7f082011-03-15 23:53:31 -0400297 sizeInIeee = BytesToIeee(lastLBA - firstLBA + 1, blockSize);
srs569408bb0da2010-02-19 17:19:55 -0500298 cout.fill(' ');
srs56940a697312010-01-28 21:10:52 -0500299 cout.width(4);
300 cout << partNum + 1 << " ";
301 cout.width(14);
302 cout << firstLBA << " ";
303 cout.width(14);
304 cout << lastLBA << " ";
Roderick W. Smithf6948032014-03-29 00:27:33 -0400305 cout << sizeInIeee << " ";
srs569401f7f082011-03-15 23:53:31 -0400306 if (sizeInIeee.length() < 10)
307 for (i = 0; i < 10 - sizeInIeee.length(); i++)
308 cout << " ";
srs56940a697312010-01-28 21:10:52 -0500309 cout.fill('0');
310 cout.width(4);
311 cout.setf(ios::uppercase);
srs56946699b012010-02-04 00:55:30 -0500312 cout << hex << partitionType.GetHexType() << " " << dec;
srs56940a697312010-01-28 21:10:52 -0500313 cout.fill(' ');
srs569400b6d7a2011-06-26 22:40:06 -0400314#ifdef USE_UTF16
srs5694699941e2011-03-21 21:33:57 -0400315 GetDescription().extractBetween(0, 23, description);
srs56945a608532011-03-17 13:53:01 -0400316 cout << description << "\n";
srs5694699941e2011-03-21 21:33:57 -0400317#else
Roderick W. Smith84aaff62014-02-17 16:17:11 -0500318 string desc = GetDescription() ;
319 size_t n = 0 ;
320 size_t i = 0 ;
321 size_t len = desc.length() ;
322 while ( n < 22 && i < len ) {
323 i ++ ;
324 if ( i >= len ) {
325 // short description
326 break ;
327 } // if
328 // skip continuation bytes
329 while ( i < len && ( ( desc[ i ] & 0xC0 ) == 0x80 ) ) {
330 // utf8 continuation byte
331 i ++ ;
332 } // while
333 n ++ ;
334 } // while
335 if ( i < len ) {
336 n = 0 ;
337 i = 0 ;
338 // description is long we will truncate it
339 while ( n < 19 && i < len ) {
340 i ++ ;
341 if ( i >= len ) {
342 // should not happen
343 break ;
344 } // if
345 // skip continuation bytes
346 while ( i < len && ( ( desc[ i ] & 0xC0 ) == 0x80 ) ) {
347 // utf8 continuation byte
348 i ++ ;
349 } // while
350 n ++ ;
351 } // while
352 } // for
353 cout << GetDescription().substr( 0 , i ) ;
354 if ( i < len ) cout << "..." ;
355 cout << "\n";
srs5694699941e2011-03-21 21:33:57 -0400356#endif
srs56940a697312010-01-28 21:10:52 -0500357 cout.fill(' ');
358 } // if
359} // GPTPart::ShowSummary()
360
361// Show detailed partition information. Does nothing if the partition is
362// empty (as determined by firstLBA being 0).
Jeff Sharkeyd761ff52015-02-28 19:18:39 -0800363void GPTPart::ShowDetails(uint32_t blockSize) {
srs56940a697312010-01-28 21:10:52 -0500364 uint64_t size;
365
366 if (firstLBA != 0) {
srs56945a081752010-09-24 20:39:41 -0400367 cout << "Partition GUID code: " << partitionType;
srs56946699b012010-02-04 00:55:30 -0500368 cout << " (" << partitionType.TypeName() << ")\n";
srs56945a081752010-09-24 20:39:41 -0400369 cout << "Partition unique GUID: " << uniqueGUID << "\n";
srs56940a697312010-01-28 21:10:52 -0500370
371 cout << "First sector: " << firstLBA << " (at "
Roderick W. Smithaf39cb42013-08-06 15:23:46 -0400372 << BytesToIeee(firstLBA, blockSize) << ")\n";
srs56940a697312010-01-28 21:10:52 -0500373 cout << "Last sector: " << lastLBA << " (at "
Roderick W. Smithaf39cb42013-08-06 15:23:46 -0400374 << BytesToIeee(lastLBA, blockSize) << ")\n";
srs56940a697312010-01-28 21:10:52 -0500375 size = (lastLBA - firstLBA + 1);
376 cout << "Partition size: " << size << " sectors ("
Roderick W. Smithaf39cb42013-08-06 15:23:46 -0400377 << BytesToIeee(size, blockSize) << ")\n";
srs56940a697312010-01-28 21:10:52 -0500378 cout << "Attribute flags: ";
379 cout.fill('0');
380 cout.width(16);
381 cout << hex;
382 cout << attributes << "\n";
383 cout << dec;
srs5694699941e2011-03-21 21:33:57 -0400384 cout << "Partition name: '" << GetDescription() << "'\n";
srs56940a697312010-01-28 21:10:52 -0500385 cout.fill(' ');
386 } // if
387} // GPTPart::ShowDetails()
388
389// Blank (delete) a single partition
390void GPTPart::BlankPartition(void) {
srs56946699b012010-02-04 00:55:30 -0500391 uniqueGUID.Zero();
392 partitionType.Zero();
srs56940a697312010-01-28 21:10:52 -0500393 firstLBA = 0;
394 lastLBA = 0;
395 attributes = 0;
Roderick W. Smith84aaff62014-02-17 16:17:11 -0500396 memset(name, 0, NAME_SIZE * sizeof( name[0]) );
srs56940a697312010-01-28 21:10:52 -0500397} // GPTPart::BlankPartition
398
399// Returns 1 if the two partitions overlap, 0 if they don't
400int GPTPart::DoTheyOverlap(const GPTPart & other) {
srs56940a697312010-01-28 21:10:52 -0500401 // Don't bother checking unless these are defined (both start and end points
402 // are 0 for undefined partitions, so just check the start points)
srs569464cbd172011-03-01 22:03:54 -0500403 return firstLBA && other.firstLBA &&
404 (firstLBA <= other.lastLBA) != (lastLBA < other.firstLBA);
srs56940a697312010-01-28 21:10:52 -0500405} // GPTPart::DoTheyOverlap()
406
srs56945a608532011-03-17 13:53:01 -0400407// Reverse the bytes of integral data types and of the UTF-16LE name;
408// used on big-endian systems.
srs56940a697312010-01-28 21:10:52 -0500409void GPTPart::ReversePartBytes(void) {
srs56945a608532011-03-17 13:53:01 -0400410 int i;
411
srs56940a697312010-01-28 21:10:52 -0500412 ReverseBytes(&firstLBA, 8);
413 ReverseBytes(&lastLBA, 8);
414 ReverseBytes(&attributes, 8);
Roderick W. Smith84aaff62014-02-17 16:17:11 -0500415 for (i = 0; i < NAME_SIZE; i ++ )
srs56945a608532011-03-17 13:53:01 -0400416 ReverseBytes(name + i, 2);
srs56940a697312010-01-28 21:10:52 -0500417} // GPTPart::ReverseBytes()
418
419/****************************************
420 * Functions requiring user interaction *
421 ****************************************/
422
srs56946699b012010-02-04 00:55:30 -0500423// Change the type code on the partition. Also changes the name if the original
424// name is the generic one for the partition type.
srs56940a697312010-01-28 21:10:52 -0500425void GPTPart::ChangeType(void) {
srs56945a608532011-03-17 13:53:01 -0400426 string line;
srs569464cbd172011-03-01 22:03:54 -0500427 int changeName;
srs569482f3f0b2010-09-22 10:50:24 -0400428 PartType tempType = (GUIDData) "00000000-0000-0000-0000-000000000000";
srs56940a697312010-01-28 21:10:52 -0500429
Roderick W. Smith84aaff62014-02-17 16:17:11 -0500430#ifdef USE_UTF16
srs56945a608532011-03-17 13:53:01 -0400431 changeName = (GetDescription() == GetUTypeName());
Roderick W. Smith84aaff62014-02-17 16:17:11 -0500432#else
433 changeName = (GetDescription() == GetTypeName());
434#endif
srs569455d92612010-03-07 22:16:07 -0500435
srs56946699b012010-02-04 00:55:30 -0500436 cout << "Current type is '" << GetTypeName() << "'\n";
srs569482f3f0b2010-09-22 10:50:24 -0400437 do {
srs56940741fa22013-01-09 12:55:40 -0500438 cout << "Hex code or GUID (L to show codes, Enter = " << hex << DEFAULT_GPT_TYPE << dec << "): ";
srs56945a608532011-03-17 13:53:01 -0400439 line = ReadString();
srs569482f3f0b2010-09-22 10:50:24 -0400440 if ((line[0] == 'L') || (line[0] == 'l')) {
srs56946699b012010-02-04 00:55:30 -0500441 partitionType.ShowAllTypes();
srs569482f3f0b2010-09-22 10:50:24 -0400442 } else {
srs56945a608532011-03-17 13:53:01 -0400443 if (line.length() == 0)
srs56940741fa22013-01-09 12:55:40 -0500444 tempType = DEFAULT_GPT_TYPE;
srs569482f3f0b2010-09-22 10:50:24 -0400445 else
446 tempType = line;
447 } // if/else
448 } while (tempType == (GUIDData) "00000000-0000-0000-0000-000000000000");
449 partitionType = tempType;
srs56946699b012010-02-04 00:55:30 -0500450 cout << "Changed type of partition to '" << partitionType.TypeName() << "'\n";
451 if (changeName) {
452 SetDefaultDescription();
453 } // if
srs56940a697312010-01-28 21:10:52 -0500454} // GPTPart::ChangeType()