Ignore:
Timestamp:
Apr 25, 2001, 8:55:35 PM (24 years ago)
Author:
umoeller
Message:

Misc. fixes.

File:
1 edited

Legend:

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

    r60 r63  
    346346                    BOOL fSkipRemoveables) // in: if TRUE, only non-removeable disks will be returned
    347347{
    348     CHAR szName[5] = "";
    349     ULONG ulLogicalDrive = 1, // start with drive A:
    350           ulFound = 0;        // found drives count
    351     APIRET arc            = NO_ERROR; // return code
     348    CHAR    szName[5] = "";
     349    ULONG   ulLogicalDrive = 1, // start with drive A:
     350            ulFound = 0;        // found drives count
     351    APIRET  arc = NO_ERROR; // return code
    352352
    353353    if (fSkipRemoveables)
     
    379379                          1,
    380380                          &dataLen);
    381 
    382         /* _Pmpf(("  ul = %d, Drive %c: arc = %d nonRemoveable = %d",
    383                     ulLogicalDrive,
    384                     G_acDriveLetters[ulLogicalDrive],
    385                     arc,
    386                     nonRemovable)); */
    387381
    388382        if (    // fixed disk and non-removeable
     
    471465 *@@changed V0.9.4 (2000-08-03) [umoeller]: more network fixes
    472466 *@@changed V0.9.9 (2001-03-19) [pr]: validate drive number
     467 *@@changed V0.9.11 (2001-04-23) [umoeller]: added an extra check for floppies
    473468 */
    474469
     
    517512            // sigh...
    518513        case ERROR_NOT_SUPPORTED: // 50
    519         {
    520514            // this is returned by file systems which don't
    521515            // support DASD DosOpen;
    522516            // use some other method then, this isn't likely
    523517            // to fail -- V0.9.1 (2000-02-09) [umoeller]
    524             FSALLOCATE  fsa;
    525             arc = DosQueryFSInfo(ulLogicalDrive,
    526                                  FSIL_ALLOC,
    527                                  &fsa,
    528                                  sizeof(fsa));
    529         break; }
     518
     519            // but don't do this for floppies
     520            // V0.9.11 (2001-04-23) [umoeller]
     521            if (ulLogicalDrive > 2)
     522            {
     523                FSALLOCATE  fsa;
     524                arc = DosQueryFSInfo(ulLogicalDrive,
     525                                     FSIL_ALLOC,
     526                                     &fsa,
     527                                     sizeof(fsa));
     528            }
     529        break;
    530530
    531531        case NO_ERROR:
     
    554554            paramsize = 0,
    555555            datasize = 0;
    556     APIRET    rc = NO_ERROR;
    557     USHORT    data,
    558               param;
     556    APIRET  rc = NO_ERROR;
     557    USHORT  data,
     558            param;
    559559
    560560    name[0] = doshQueryBootDrive();
     
    802802 *
    803803 *@@added V0.9.0 [umoeller]
     804 *@@changed V0.9.11 (2001-04-22) [umoeller]: this copied even with errors, fixed
    804805 */
    805806
     
    820821                         sizeof(FSInfoBuf)); // depends
    821822
    822     #ifdef __OS2V2X__
    823         strcpy(pszVolumeLabel, FSInfoBuf.szVolLabel);
    824     #else
    825         strcpy(pszVolumeLabel, FSInfoBuf.vol.szVolLabel);
    826     #endif
     823    if (!arc)       // V0.9.11 (2001-04-22) [umoeller]
     824    {
     825        #ifdef __OS2V2X__
     826            strcpy(pszVolumeLabel, FSInfoBuf.szVolLabel);
     827        #else
     828            strcpy(pszVolumeLabel, FSInfoBuf.vol.szVolLabel);
     829        #endif
     830    }
    827831
    828832    return (arc);
     
    10231027 *      --  FILE_HIDDEN
    10241028 *
    1025  *      This returns the APIRET of DosQueryPathAttr.
     1029 *      This returns the APIRET of DosQueryPathInfo.
    10261030 *      *pulAttr is only valid if NO_ERROR is
    10271031 *      returned.
Note: See TracChangeset for help on using the changeset viewer.