Ignore:
Timestamp:
Feb 4, 2002, 6:32:38 PM (24 years ago)
Author:
umoeller
Message:

Buncha fixes, and fixes for fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/dosh.c

    r135 r137  
    42424242}
    42434243
    4244 /* ******************************************************************
    4245  *
    4246  *   Testcase
    4247  *
    4248  ********************************************************************/
    4249 
    4250 #ifdef BUILD_MAIN
    4251 
    4252 int main (int argc, char *argv[])
    4253 {
    4254     ULONG ul;
    4255 
    4256             printf("Drive checker ("__DATE__")\n");
    4257             printf("    type   fs      remot fixed parrm bootd       media audio eas   longn\n");
    4258 
    4259     for (ul = 1;
    4260          ul <= 26;
    4261          ul++)
    4262     {
    4263         XDISKINFO xdi;
    4264         APIRET arc = doshGetDriveInfo(ul,
    4265                                       0, // DRVFL_TOUCHFLOPPIES,
    4266                                       &xdi);
    4267 
    4268         printf(" %c: ", xdi.cDriveLetter, ul);
    4269 
    4270         if (!xdi.fPresent)
    4271             printf("not present\n");
    4272         else
    4273         {
    4274             if (arc)
    4275                 printf("error %d (IsFixedDisk: %d, QueryDiskParams %d, QueryMedia %d)\n",
    4276                         arc,
    4277                         xdi.arcIsFixedDisk,
    4278                         xdi.arcQueryDiskParams,
    4279                         xdi.arcQueryMedia);
    4280             else
    4281             {
    4282                 ULONG   aulFlags[] =
    4283                     {
    4284                         DFL_REMOTE,
    4285                         DFL_FIXED,
    4286                         DFL_PARTITIONABLEREMOVEABLE,
    4287                         DFL_BOOTDRIVE,
    4288                         0,
    4289                         DFL_MEDIA_PRESENT,
    4290                         DFL_AUDIO_CD,
    4291                         DFL_SUPPORTS_EAS,
    4292                         DFL_SUPPORTS_LONGNAMES
    4293                     };
    4294                 ULONG ul2;
    4295 
    4296                 PCSZ pcsz = NULL;
    4297 
    4298                 switch (xdi.bType)
    4299                 {
    4300                     case DRVTYPE_HARDDISK:  pcsz = "HDISK ";    break;
    4301                     case DRVTYPE_FLOPPY:    pcsz = "FLOPPY"; break;
    4302                     case DRVTYPE_TAPE:      pcsz = "TAPE  "; break;
    4303                     case DRVTYPE_VDISK:     pcsz = "VDISK "; break;
    4304                     case DRVTYPE_CDROM:     pcsz = "CDROM "; break;
    4305                     case DRVTYPE_LAN:       pcsz = "LAN   "; break;
    4306                     case DRVTYPE_PARTITIONABLEREMOVEABLE:
    4307                                             pcsz = "PRTREM"; break;
    4308                     default:
    4309                                             printf("bType=%d, BPB.bDevType=%d",
    4310                                                     xdi.bType,
    4311                                                     xdi.bpb.bDeviceType);
    4312                                             printf("\n           ");
    4313                 }
    4314 
    4315                 if (pcsz)
    4316                     printf("%s ", pcsz);
    4317 
    4318                 if (xdi.lFileSystem < 0)
    4319                     // negative means error
    4320                     printf("E%3d    ", xdi.lFileSystem); // , xdi.bFileSystem);
    4321                 else
    4322                     printf("%7s ", xdi.szFileSystem); // , xdi.bFileSystem);
    4323 
    4324                 for (ul2 = 0;
    4325                      ul2 < ARRAYITEMCOUNT(aulFlags);
    4326                      ul2++)
    4327                 {
    4328                     if (xdi.flDevice & aulFlags[ul2])
    4329                         printf("  X   ");
    4330                     else
    4331                         if (    (xdi.arcOpenLongnames)
    4332                              && (aulFlags[ul2] == DFL_SUPPORTS_LONGNAMES)
    4333                            )
    4334                             printf(" E%03d ", xdi.arcOpenLongnames);
    4335                         else
    4336                             printf("  -   ");
    4337                 }
    4338                 printf("\n");
    4339             }
    4340         }
    4341     }
    4342 }
    4343 
    4344 #endif
     4244
Note: See TracChangeset for help on using the changeset viewer.