/*++ Copyright (c) 1997 Microsoft Corporation Module Name: partsel.c Abstract: Routine to allow the user to select a partition from a list of partitions. The UI is a simple character-based deal. Author: Ted Miller (tedm) 29-May-1997 Revision History: --*/ #include #include #include #include #include #include #include INT _far SelectPartition( IN UINT PartitionCount, IN CHAR *Prompt, OUT CHAR *AlternateResponse, OPTIONAL IN FPCHAR textDisk, IN FPCHAR textPaddedMbCount, IN FPCHAR textInvalidSelection ) { UINT i,l; UINT DiskId; BYTE SysId; ULONG StartSector; ULONG SectorCount; BYTE Int13Unit; BYTE SectorsPerTrack; USHORT Heads; USHORT Cylinders; ULONG ExtendedSectorCount; UINT Selection; CHAR line[256]; select: printf("\n\n"); for(i=0; i PartitionCount)) { if(AlternateResponse) { Selection = 0; strcpy(AlternateResponse,line); } else { printf("\n%s\n\n",textInvalidSelection); goto select; } } return(Selection-1); }