File tree Expand file tree Collapse file tree 14 files changed +64
-27
lines changed
Expand file tree Collapse file tree 14 files changed +64
-27
lines changed Original file line number Diff line number Diff line change @@ -33,23 +33,30 @@ active_main(
3333 return TRUE;
3434 }
3535
36- if (CurrentPartition -> BootIndicator )
36+ if (CurrentDisk -> PartitionStyle == PARTITION_STYLE_MBR )
3737 {
38- ConResPuts (StdOut , IDS_ACTIVE_ALREADY );
39- return TRUE;
40- }
41-
42- CurrentPartition -> BootIndicator = TRUE;
43- CurrentDisk -> Dirty = TRUE;
44- UpdateDiskLayout (CurrentDisk );
45- Status = WritePartitions (CurrentDisk );
46- if (NT_SUCCESS (Status ))
47- {
48- ConResPuts (StdOut , IDS_ACTIVE_SUCCESS );
38+ if (CurrentPartition -> BootIndicator )
39+ {
40+ ConResPuts (StdOut , IDS_ACTIVE_ALREADY );
41+ return TRUE;
42+ }
43+
44+ CurrentPartition -> BootIndicator = TRUE;
45+ CurrentDisk -> Dirty = TRUE;
46+ UpdateDiskLayout (CurrentDisk );
47+ Status = WritePartitions (CurrentDisk );
48+ if (NT_SUCCESS (Status ))
49+ {
50+ ConResPuts (StdOut , IDS_ACTIVE_SUCCESS );
51+ }
52+ else
53+ {
54+ ConResPuts (StdOut , IDS_ACTIVE_FAIL );
55+ }
4956 }
5057 else
5158 {
52- ConResPuts (StdOut , IDS_ACTIVE_FAIL );
59+ ConResPuts (StdOut , IDS_ACTIVE_NO_MBR );
5360 }
5461
5562 return TRUE;
Original file line number Diff line number Diff line change @@ -33,23 +33,30 @@ inactive_main(
3333 return TRUE;
3434 }
3535
36- if (! CurrentPartition -> BootIndicator )
36+ if (CurrentDisk -> PartitionStyle == PARTITION_STYLE_MBR )
3737 {
38- ConResPuts (StdOut , IDS_INACTIVE_ALREADY );
39- return TRUE;
40- }
41-
42- CurrentPartition -> BootIndicator = FALSE;
43- CurrentDisk -> Dirty = TRUE;
44- UpdateDiskLayout (CurrentDisk );
45- Status = WritePartitions (CurrentDisk );
46- if (NT_SUCCESS (Status ))
47- {
48- ConResPuts (StdOut , IDS_INACTIVE_SUCCESS );
38+ if (!CurrentPartition -> BootIndicator )
39+ {
40+ ConResPuts (StdOut , IDS_INACTIVE_ALREADY );
41+ return TRUE;
42+ }
43+
44+ CurrentPartition -> BootIndicator = FALSE;
45+ CurrentDisk -> Dirty = TRUE;
46+ UpdateDiskLayout (CurrentDisk );
47+ Status = WritePartitions (CurrentDisk );
48+ if (NT_SUCCESS (Status ))
49+ {
50+ ConResPuts (StdOut , IDS_INACTIVE_SUCCESS );
51+ }
52+ else
53+ {
54+ ConResPuts (StdOut , IDS_INACTIVE_FAIL );
55+ }
4956 }
5057 else
5158 {
52- ConResPuts (StdOut , IDS_INACTIVE_FAIL );
59+ ConResPuts (StdOut , IDS_INACTIVE_NO_MBR );
5360 }
5461
5562 return TRUE;
Original file line number Diff line number Diff line change 2020 IDS_ACTIVE_FAIL "\nDie Partition konnte nicht als aktiv markiert werden.\nVergewissern Sie sich, dass diese Partition gültig ist.\n"
2121 IDS_ACTIVE_SUCCESS "\nDie aktuelle Partition wurde als aktiv markiert.\n"
2222 IDS_ACTIVE_ALREADY "\nDie aktuelle Partition wurde bereits als aktiv markiert.\n"
23+ IDS_ACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe ACTIVE command can only be used on an MBR disk.\n"
2324END
2425
2526STRINGTABLE
9697 IDS_INACTIVE_FAIL "\nDie Partition konnte nicht als inaktiv markiert werden.\nVergewissern Sie sich, dass diese Partition gültig ist.\n"
9798 IDS_INACTIVE_SUCCESS "\nDie aktuelle Partition wurde als inaktiv markiert.\n"
9899 IDS_INACTIVE_ALREADY "\nDie aktuelle Partition wurde bereits als inaktiv markiert.\n"
100+ IDS_INACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe INACTIVE command can only be used on an MBR disk.\n"
99101END
100102
101103/* Detail header titles */
Original file line number Diff line number Diff line change 2020 IDS_ACTIVE_FAIL "\nDiskPart was unable to mark the partition active.\nMake sure the partition is valid.\n"
2121 IDS_ACTIVE_SUCCESS "\nDiskPart marked the current partition as active.\n"
2222 IDS_ACTIVE_ALREADY "\nThe current partition is already marked as active.\n"
23+ IDS_ACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe ACTIVE command can only be used on an MBR disk.\n"
2324END
2425
2526STRINGTABLE
9697 IDS_INACTIVE_FAIL "\nDiskPart was unable to mark the partition inactive.\nMake sure the partition is valid.\n"
9798 IDS_INACTIVE_SUCCESS "\nDiskPart marked the current partition as inactive.\n"
9899 IDS_INACTIVE_ALREADY "\nThe current partition is already marked as inactive.\n"
100+ IDS_INACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe INACTIVE command can only be used on an MBR disk.\n"
99101END
100102
101103/* Detail header titles */
Original file line number Diff line number Diff line change 2727 IDS_ACTIVE_FAIL "\nDiskPart non ha potuto segnare la partizione come attiva.\nAssicurarsi che la partizione sia valida.\n"
2828 IDS_ACTIVE_SUCCESS "\nDiskPart ha segnato la partizione corrente come attiva.\n"
2929 IDS_ACTIVE_ALREADY "\nLa partizione corrente è già segnata come attiva.\n"
30+ IDS_ACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe ACTIVE command can only be used on an MBR disk.\n"
3031END
3132
3233STRINGTABLE
@@ -103,6 +104,7 @@ BEGIN
103104 IDS_INACTIVE_FAIL "\nDiskPart non è stato in grado di segnare la partizione inattiva.\nAssicurarsi che la partizione sia valida.\n"
104105 IDS_INACTIVE_SUCCESS "\nDiskPart ha segnato la partizione corrente come inattiva.\n"
105106 IDS_INACTIVE_ALREADY "\nLa partizione corrente è già segnata come attiva.\n"
107+ IDS_INACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe INACTIVE command can only be used on an MBR disk.\n"
106108END
107109
108110/* Detail header titles */
Original file line number Diff line number Diff line change 2020 IDS_ACTIVE_FAIL "\nDiskPart nie mógł oznaczyć partycji jako aktywnej.\nUpewnij się, że partycja jest prawidłowa.\n"
2121 IDS_ACTIVE_SUCCESS "\nDiskPart oznaczył bieżącą partycję jako aktywną.\n"
2222 IDS_ACTIVE_ALREADY "\nBieżąca partycja jest już oznaczona jako aktywna.\n"
23+ IDS_ACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe ACTIVE command can only be used on an MBR disk.\n"
2324END
2425
2526STRINGTABLE
9697 IDS_INACTIVE_FAIL "\nDiskPart nie może oznaczyć partycji jako nieaktywnej.\nUpewnij się, że partycja jest prawidłowa.\n"
9798 IDS_INACTIVE_SUCCESS "\nDiskPart oznaczył bieżącą partycję jako nieaktywną.\n"
9899 IDS_INACTIVE_ALREADY "\nBieżąca partycja jest już oznaczona jako nieaktywna.\n"
100+ IDS_INACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe INACTIVE command can only be used on an MBR disk.\n"
99101END
100102
101103/* Detail header titles */
Original file line number Diff line number Diff line change 2222 IDS_ACTIVE_FAIL "\nDiskPart was unable to mark the partition active.\nMake sure the partition is valid.\n"
2323 IDS_ACTIVE_SUCCESS "\nDiskPart marked the current partition as active.\n"
2424 IDS_ACTIVE_ALREADY "\nThe current partition is already marked as active.\n"
25+ IDS_ACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe ACTIVE command can only be used on an MBR disk.\n"
2526END
2627
2728STRINGTABLE
9899 IDS_INACTIVE_FAIL "\nDiskPart was unable to mark the partition inactive.\nMake sure the partition is valid.\n"
99100 IDS_INACTIVE_SUCCESS "\nDiskPart marked the current partition as inactive.\n"
100101 IDS_INACTIVE_ALREADY "\nThe current partition is already marked as inactive.\n"
102+ IDS_INACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe INACTIVE command can only be used on an MBR disk.\n"
101103END
102104
103105/* Detail header titles */
Original file line number Diff line number Diff line change 2828 IDS_ACTIVE_FAIL "\nDiskpart nu a reușit să marcheze partiția activă.\nAsigurați-vă că partiția este validă.\n"
2929 IDS_ACTIVE_SUCCESS "\nDiskPart a marcat partiția curentă ca activă.\n"
3030 IDS_ACTIVE_ALREADY "\nPartiția curentă este deja marcată ca activă.\n"
31+ IDS_ACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe ACTIVE command can only be used on an MBR disk.\n"
3132END
3233
3334STRINGTABLE
@@ -104,6 +105,7 @@ BEGIN
104105 IDS_INACTIVE_FAIL "\nDiskpart nu a reușit să marcheze partiția inactivă.\nAsigurați-vă că partiția este validă.\n"
105106 IDS_INACTIVE_SUCCESS "\nDiskPart a marcat partiția curentă ca inactivă.\n"
106107 IDS_INACTIVE_ALREADY "\nPartiția curentă este deja marcată ca inactivă.\n"
108+ IDS_INACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe INACTIVE command can only be used on an MBR disk.\n"
107109END
108110
109111/* Detail header titles */
Original file line number Diff line number Diff line change 2222 IDS_ACTIVE_FAIL "\nDiskPart was unable to mark the partition active.\nMake sure the partition is valid.\n"
2323 IDS_ACTIVE_SUCCESS "\nDiskPart marked the current partition as active.\n"
2424 IDS_ACTIVE_ALREADY "\nThe current partition is already marked as active.\n"
25+ IDS_ACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe ACTIVE command can only be used on an MBR disk.\n"
2526END
2627
2728STRINGTABLE
9899 IDS_INACTIVE_FAIL "\nDiskPart was unable to mark the partition inactive.\nMake sure the partition is valid.\n"
99100 IDS_INACTIVE_SUCCESS "\nDiskPart marked the current partition as inactive.\n"
100101 IDS_INACTIVE_ALREADY "\nThe current partition is already marked as inactive.\n"
102+ IDS_INACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe INACTIVE command can only be used on an MBR disk.\n"
101103END
102104
103105/* Detail header titles */
Original file line number Diff line number Diff line change 2424 IDS_ACTIVE_FAIL "\nDiskPart was unable to mark the partition active.\nMake sure the partition is valid.\n"
2525 IDS_ACTIVE_SUCCESS "\nDiskPart marked the current partition as active.\n"
2626 IDS_ACTIVE_ALREADY "\nThe current partition is already marked as active.\n"
27+ IDS_ACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe ACTIVE command can only be used on an MBR disk.\n"
2728END
2829
2930STRINGTABLE
@@ -100,6 +101,7 @@ BEGIN
100101 IDS_INACTIVE_FAIL "\nDiskPart was unable to mark the partition inactive.\nMake sure the partition is valid.\n"
101102 IDS_INACTIVE_SUCCESS "\nDiskPart marked the current partition as inactive.\n"
102103 IDS_INACTIVE_ALREADY "\nThe current partition is already marked as inactive.\n"
104+ IDS_INACTIVE_NO_MBR "\nThe selected disk is not an MBR disk.\nThe INACTIVE command can only be used on an MBR disk.\n"
103105END
104106
105107/* Detail header titles */
You can’t perform that action at this time.
0 commit comments