2011-09-24 10:33:33 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS DiskPart
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
|
|
* FILE: base/system/diskpart/inactive.c
|
2016-10-01 22:58:21 +00:00
|
|
|
* PURPOSE: Manages all the partitions of the OS in an interactive way.
|
2011-09-24 10:33:33 +00:00
|
|
|
* PROGRAMMERS: Lee Schroeder
|
|
|
|
*/
|
2014-01-13 13:07:50 +00:00
|
|
|
|
2011-09-24 10:33:33 +00:00
|
|
|
#include "diskpart.h"
|
|
|
|
|
2022-06-06 09:22:48 +00:00
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
inactive_main(
|
|
|
|
_In_ INT argc,
|
|
|
|
_In_ PWSTR *argv)
|
2011-09-24 10:33:33 +00:00
|
|
|
{
|
2022-06-06 09:22:48 +00:00
|
|
|
NTSTATUS Status;
|
|
|
|
|
|
|
|
DPRINT("Inactive()\n");
|
|
|
|
|
|
|
|
if (CurrentDisk == NULL)
|
|
|
|
{
|
|
|
|
ConResPuts(StdOut, IDS_SELECT_NO_DISK);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (CurrentPartition == NULL)
|
|
|
|
{
|
|
|
|
ConResPuts(StdOut, IDS_SELECT_NO_PARTITION);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!CurrentPartition->BootIndicator)
|
|
|
|
{
|
|
|
|
ConResPuts(StdOut, IDS_INACTIVE_ALREADY);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
CurrentPartition->BootIndicator = FALSE;
|
|
|
|
CurrentDisk->Dirty = TRUE;
|
|
|
|
UpdateDiskLayout(CurrentDisk);
|
|
|
|
Status = WritePartitions(CurrentDisk);
|
|
|
|
if (NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
ConResPuts(StdOut, IDS_INACTIVE_SUCCESS);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ConResPuts(StdOut, IDS_INACTIVE_FAIL);
|
|
|
|
}
|
|
|
|
|
2011-09-24 10:33:33 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|