Changeset 551 for trunk/dll/valid.c


Ignore:
Timestamp:
Feb 28, 2007, 2:33:51 AM (19 years ago)
Author:
Gregg Young
Message:

Indentation cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/valid.c

    r530 r551  
    2525#define INCL_DOS
    2626#define INCL_WIN
    27 #define INCL_DOSDEVICES         // DosDevIOCtl
    28 #define INCL_DOSDEVIOCTL        // DosDevIOCtl
     27#define INCL_DOSDEVICES                 // DosDevIOCtl
     28#define INCL_DOSDEVIOCTL                // DosDevIOCtl
    2929#include <os2.h>
    3030
     
    4747#pragma alloc_text(FINDDESK,GetDesktopName)
    4848
    49 
    50 APIRET MakeFullName (char *pszFileName)
     49APIRET MakeFullName(char *pszFileName)
    5150{
    5251  /* pszFileName must be CCHMAXPATH long minimum! */
    5352
    54   char   szPathName[CCHMAXPATH];
     53  char szPathName[CCHMAXPATH];
    5554  APIRET rc;
    5655
    5756  DosError(FERR_DISABLEHARDERR);
    5857  rc = DosQueryPathInfo(pszFileName,
    59                         FIL_QUERYFULLNAME,
    60                         szPathName,
    61                         sizeof(szPathName));
    62   if(!rc)
     58                        FIL_QUERYFULLNAME, szPathName, sizeof(szPathName));
     59  if (!rc)
    6360    strcpy(pszFileName, szPathName);    // Pass back actual name
    6461  return rc;
    6562}
    6663
    67 
    68 char *RootName (char *filename)
    69 {
    70   char *p = NULL,*pp;
     64char *RootName(char *filename)
     65{
     66  char *p = NULL, *pp;
    7167
    7268  // Return filename, strip path parts
    7369  // Return empty string when filename ends with \
    7470
    75   if(filename) {
    76     p = strrchr(filename,'\\');
    77     pp = strrchr(filename,'/');
    78     p = (p) ?
    79          (pp) ?
    80           (p > pp) ?
    81            p :
    82            pp :
    83           p :
    84          pp;
    85   }
    86   if(!p)                  /* name is itself a root */
     71  if (filename) {
     72    p = strrchr(filename, '\\');
     73    pp = strrchr(filename, '/');
     74    p = (p) ? (pp) ? (p > pp) ? p : pp : p : pp;
     75  }
     76  if (!p)                               /* name is itself a root */
    8777    p = filename;
    88   else                    /* skip past backslash */
     78  else                                  /* skip past backslash */
    8979    p++;
    9080  return p;
    9181}
    9282
    93 
    94 int TestDates (char *file1,char *file2)
     83int TestDates(char *file1, char *file2)
    9584{
    9685  /*
     
    10089   */
    10190
    102   int         comp = 0;
    103   FILESTATUS3 fs3o,fs3n;
     91  int comp = 0;
     92  FILESTATUS3 fs3o, fs3n;
    10493
    10594  DosError(FERR_DISABLEHARDERR);
    106   if(!DosQueryPathInfo(file1,
    107                        FIL_STANDARD,
    108                        &fs3o,
    109                        sizeof(fs3o))) {
    110     DosError(FERR_DISABLEHARDERR);
    111     if(!DosQueryPathInfo(file2,
    112                          FIL_STANDARD,
    113                          &fs3n,
    114                          sizeof(fs3n))) {
     95  if (!DosQueryPathInfo(file1, FIL_STANDARD, &fs3o, sizeof(fs3o))) {
     96    DosError(FERR_DISABLEHARDERR);
     97    if (!DosQueryPathInfo(file2, FIL_STANDARD, &fs3n, sizeof(fs3n))) {
    11598      comp = (fs3n.fdateLastWrite.year >
    11699              fs3o.fdateLastWrite.year) ? 1 :
    117              (fs3n.fdateLastWrite.year <
    118               fs3o.fdateLastWrite.year) ? -1 :
    119              (fs3n.fdateLastWrite.month >
    120               fs3o.fdateLastWrite.month) ? 1 :
    121              (fs3n.fdateLastWrite.month <
    122               fs3o.fdateLastWrite.month) ? -1 :
    123              (fs3n.fdateLastWrite.day >
    124               fs3o.fdateLastWrite.day) ? 1 :
    125              (fs3n.fdateLastWrite.day <
    126               fs3o.fdateLastWrite.day) ? -1 :
    127              (fs3n.ftimeLastWrite.hours >
    128               fs3o.ftimeLastWrite.hours) ? 1 :
    129              (fs3n.ftimeLastWrite.hours <
    130               fs3o.ftimeLastWrite.hours) ? -1 :
    131              (fs3n.ftimeLastWrite.minutes >
    132               fs3o.ftimeLastWrite.minutes) ? 1 :
    133              (fs3n.ftimeLastWrite.minutes <
    134               fs3o.ftimeLastWrite.minutes) ? -1 :
    135              (fs3n.ftimeLastWrite.twosecs >
    136               fs3o.ftimeLastWrite.twosecs) ? 1 :
    137              (fs3n.ftimeLastWrite.twosecs <
    138               fs3o.ftimeLastWrite.twosecs) ? -1 :
    139              0;
     100        (fs3n.fdateLastWrite.year <
     101         fs3o.fdateLastWrite.year) ? -1 :
     102        (fs3n.fdateLastWrite.month >
     103         fs3o.fdateLastWrite.month) ? 1 :
     104        (fs3n.fdateLastWrite.month <
     105         fs3o.fdateLastWrite.month) ? -1 :
     106        (fs3n.fdateLastWrite.day >
     107         fs3o.fdateLastWrite.day) ? 1 :
     108        (fs3n.fdateLastWrite.day <
     109         fs3o.fdateLastWrite.day) ? -1 :
     110        (fs3n.ftimeLastWrite.hours >
     111         fs3o.ftimeLastWrite.hours) ? 1 :
     112        (fs3n.ftimeLastWrite.hours <
     113         fs3o.ftimeLastWrite.hours) ? -1 :
     114        (fs3n.ftimeLastWrite.minutes >
     115         fs3o.ftimeLastWrite.minutes) ? 1 :
     116        (fs3n.ftimeLastWrite.minutes <
     117         fs3o.ftimeLastWrite.minutes) ? -1 :
     118        (fs3n.ftimeLastWrite.twosecs >
     119         fs3o.ftimeLastWrite.twosecs) ? 1 :
     120        (fs3n.ftimeLastWrite.twosecs < fs3o.ftimeLastWrite.twosecs) ? -1 : 0;
    140121    }
    141122  }
     
    143124}
    144125
    145 
    146 BOOL IsNewer (char *file1,char *file2)
     126BOOL IsNewer(char *file1, char *file2)
    147127{
    148128  /* return TRUE if file2 is newer than file1 */
    149129
    150   return (TestDates(file1,file2) > 0);
    151 }
    152 
    153 
    154 BOOL IsDesktop (HAB hab,HWND hwnd)
     130  return (TestDates(file1, file2) > 0);
     131}
     132
     133BOOL IsDesktop(HAB hab, HWND hwnd)
    155134{
    156135  HWND hwndDesktop;
    157136
    158   if(hwnd == HWND_DESKTOP)
     137  if (hwnd == HWND_DESKTOP)
    159138    return TRUE;
    160   hwndDesktop = WinQueryDesktopWindow(hab,NULLHANDLE);
    161   if(hwnd == hwndDesktop)
     139  hwndDesktop = WinQueryDesktopWindow(hab, NULLHANDLE);
     140  if (hwnd == hwndDesktop)
    162141    return TRUE;
    163142  return FALSE;
    164143}
    165144
    166 BOOL ParentIsDesktop (HWND hwnd,HWND hwndParent)
     145BOOL ParentIsDesktop(HWND hwnd, HWND hwndParent)
    167146{
    168147  HWND hwndDesktop;
    169148  BOOL ret = FALSE;
    170149
    171   if(!hwndParent)
    172     hwndParent = WinQueryWindow(hwnd,QW_PARENT);
    173   if(hwndParent == HWND_DESKTOP)
     150  if (!hwndParent)
     151    hwndParent = WinQueryWindow(hwnd, QW_PARENT);
     152  if (hwndParent == HWND_DESKTOP)
    174153    ret = TRUE;
    175154  else {
    176     hwndDesktop = WinQueryDesktopWindow(WinQueryAnchorBlock(hwnd),(HWND)0);
    177     if(hwndDesktop == hwndParent)
     155    hwndDesktop = WinQueryDesktopWindow(WinQueryAnchorBlock(hwnd), (HWND) 0);
     156    if (hwndDesktop == hwndParent)
    178157      ret = TRUE;
    179158  }
     
    188167 */
    189168
    190 INT CheckDrive (CHAR chDrive, CHAR *pszFileSystem, ULONG *pulType)
    191 {
    192   CHAR          szPath[3];
    193   VOID          *pvBuffer = NULL;
    194   CHAR          *pfsn;
    195   CHAR          *pfsd;
    196   ULONG         clBufferSize;
    197   APIRET        rc;
    198   ULONG         ulAction;
    199   ULONG         clParmBytes;
    200   ULONG         clDataBytes;
    201   HFILE         hDev;
     169INT CheckDrive(CHAR chDrive, CHAR * pszFileSystem, ULONG * pulType)
     170{
     171  CHAR szPath[3];
     172  VOID *pvBuffer = NULL;
     173  CHAR *pfsn;
     174  CHAR *pfsd;
     175  ULONG clBufferSize;
     176  APIRET rc;
     177  ULONG ulAction;
     178  ULONG clParmBytes;
     179  ULONG clDataBytes;
     180  HFILE hDev;
     181
    202182# pragma pack(1)
    203   struct {
    204     BYTE        Cmd;
    205     BYTE        Unit;
    206   } parmPkt = {0, 0};
     183  struct
     184  {
     185    BYTE Cmd;
     186    BYTE Unit;
     187  }
     188  parmPkt =
     189  {
     190  0, 0};
    207191# define BPB_REMOVABLE_MEDIA    0x08    // 3 - Media is removable
    208192  struct
    209193  {
    210194    BIOSPARAMETERBLOCK bpb;
    211     USHORT cCylinders;                  // Documented but not implemented
    212     BYTE bDeviceType;                   // Documented but not implemented
    213     USHORT fsDeviceAttr;                // Documented but not implemented
    214   } dataPkt;
     195    USHORT cCylinders;          // Documented but not implemented
     196    BYTE bDeviceType;           // Documented but not implemented
     197    USHORT fsDeviceAttr;        // Documented but not implemented
     198  }
     199  dataPkt;
     200
    215201# pragma pack()
    216   BYTE          NonRemovable;
     202  BYTE NonRemovable;
    217203  PFSQBUFFER2 pfsq;
    218204
     
    224210
    225211# define BUFFER_BYTES 8192
    226   rc = DosAllocMem(&pvBuffer,BUFFER_BYTES,PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);
     212  rc =
     213    DosAllocMem(&pvBuffer, BUFFER_BYTES,
     214                PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);
    227215  if (rc) {
    228     Dos_Error(MB_CANCEL,rc,HWND_DESKTOP,pszSrcFile,__LINE__,GetPString(IDS_OUTOFMEMORY));
     216    Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
     217              GetPString(IDS_OUTOFMEMORY));
    229218    return -1;                          // Say failed
    230219  }
     
    236225  DosError(FERR_DISABLEHARDERR);
    237226  rc = DosQueryFSAttach(szPath, 0, FSAIL_QUERYNAME,
    238                           (PFSQBUFFER2)pvBuffer, &clBufferSize);
    239   if (rc)
    240   {
     227                        (PFSQBUFFER2) pvBuffer, &clBufferSize);
     228  if (rc) {
    241229    /* can't get any info at all */
    242230    DosFreeMem(pvBuffer);
     
    245233  }
    246234
    247   pfsq = (PFSQBUFFER2)pvBuffer;
     235  pfsq = (PFSQBUFFER2) pvBuffer;
    248236  pfsn = pfsq->szName + pfsq->cbName + 1;
    249237  pfsd = pfsn + pfsq->cbFSDName + 1;
    250238
    251   if (pszFileSystem)
    252   {
     239  if (pszFileSystem) {
    253240    strncpy(pszFileSystem, pfsn, CCHMAXPATH);
    254241    pszFileSystem[CCHMAXPATH - 1] = 0;
    255242  }
    256243
    257   if (pulType && !strcmp(pfsn,CDFS))
     244  if (pulType && !strcmp(pfsn, CDFS))
    258245    *pulType |= DRIVE_NOTWRITEABLE | DRIVE_CDROM | DRIVE_REMOVABLE;
    259246
    260   if (((PFSQBUFFER2)pvBuffer)->iType == FSAT_REMOTEDRV)
    261   {
     247  if (((PFSQBUFFER2) pvBuffer)->iType == FSAT_REMOTEDRV) {
    262248    if (pulType)
    263249      *pulType |= DRIVE_REMOTE;
    264     if (pulType && !strcmp(pfsn,CBSIFS))
    265     {
     250    if (pulType && !strcmp(pfsn, CBSIFS)) {
    266251      *pulType |= DRIVE_ZIPSTREAM;
    267252      *pulType &= ~DRIVE_REMOTE;
    268253      *pulType |= DRIVE_NOLONGNAMES;
    269       if (pfsq->cbFSAData)
    270       {
     254      if (pfsq->cbFSAData) {
    271255        ULONG FType;
    272256
    273         if (CheckDrive(*pfsd,NULL,&FType) != -1)
    274         {
     257        if (CheckDrive(*pfsd, NULL, &FType) != -1) {
    275258          if (FType & DRIVE_REMOVABLE)
    276259            *pulType |= DRIVE_REMOVABLE;
     
    281264    }
    282265    if (pulType &&
    283         (!strcmp(pfsn,HPFS) ||
    284          !strcmp(pfsn,JFS) ||
    285          !strcmp(pfsn,FAT32) ||
    286          !strcmp(pfsn,NDFS32) ||
    287          !strcmp(pfsn,HPFS386)))
    288     {
     266        (!strcmp(pfsn, HPFS) ||
     267         !strcmp(pfsn, JFS) ||
     268         !strcmp(pfsn, FAT32) ||
     269         !strcmp(pfsn, NDFS32) || !strcmp(pfsn, HPFS386))) {
    289270      *pulType &= ~DRIVE_NOLONGNAMES;
    290271    }
     
    294275
    295276  // Local drive
    296   if (strcmp(pfsn,HPFS) &&
    297       strcmp(pfsn,JFS) &&
    298       strcmp(pfsn,CDFS) &&
    299       strcmp(pfsn,FAT32) &&
    300       strcmp(pfsn,NDFS32) &&
    301       strcmp(pfsn,HPFS386))
    302   {
    303     if(pulType)
     277  if (strcmp(pfsn, HPFS) &&
     278      strcmp(pfsn, JFS) &&
     279      strcmp(pfsn, CDFS) &&
     280      strcmp(pfsn, FAT32) && strcmp(pfsn, NDFS32) && strcmp(pfsn, HPFS386)) {
     281    if (pulType)
    304282      (*pulType) |= DRIVE_NOLONGNAMES;  // Others can not have long names
    305283  }
     
    307285  DosError(FERR_DISABLEHARDERR);
    308286  rc = DosOpen(szPath, &hDev, &ulAction, 0, 0, FILE_OPEN,
    309                  OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE |
    310                  OPEN_FLAGS_DASD | OPEN_FLAGS_FAIL_ON_ERROR, 0);
    311   if(rc)
    312   {
     287               OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE |
     288               OPEN_FLAGS_DASD | OPEN_FLAGS_FAIL_ON_ERROR, 0);
     289  if (rc) {
    313290    DosError(FERR_DISABLEHARDERR);
    314291    if (pulType)
     
    322299  NonRemovable = 1;                     // Preset as non removable
    323300  DosError(FERR_DISABLEHARDERR);
    324   rc = DosDevIOCtl(hDev, IOCTL_DISK, DSK_BLOCKREMOVABLE,
    325                      &parmPkt.Cmd,              /*  Address of the command-specific argument list. */
    326                      sizeof(parmPkt.Cmd),       /*  Length, in bytes, of pParams. */
    327                      &clParmBytes,              /*  Pointer to the length of parameters. */
    328                      &NonRemovable,             /*  Address of the data area. */
    329                      sizeof(NonRemovable),      /*  Length, in bytes, of pData. */
    330                      &clDataBytes);             /*  Pointer to the length of data. */
     301  rc = DosDevIOCtl(hDev, IOCTL_DISK, DSK_BLOCKREMOVABLE, &parmPkt.Cmd,  /*  Address of the command-specific argument list. */
     302                   sizeof(parmPkt.Cmd), /*  Length, in bytes, of pParams. */
     303                   &clParmBytes,        /*  Pointer to the length of parameters. */
     304                   &NonRemovable,       /*  Address of the data area. */
     305                   sizeof(NonRemovable),        /*  Length, in bytes, of pData. */
     306                   &clDataBytes);       /*  Pointer to the length of data. */
    331307
    332308  if (!rc && NonRemovable) {
     
    336312    memset(&dataPkt, 0xff, sizeof(dataPkt));
    337313    DosError(FERR_DISABLEHARDERR);
    338     rc = DosDevIOCtl(hDev, IOCTL_DISK, DSK_GETDEVICEPARAMS,
    339                        &parmPkt.Cmd,            /*  Address of the command-specific argument list. */
    340                        sizeof(parmPkt.Cmd),     /*  Length, in bytes, of pParams. */
    341                        &clParmBytes,            /*  Pointer to the length of parameters. */
    342                        &dataPkt,                /*  Address of the data area. */
    343                        sizeof(dataPkt),         /*  Length, in bytes, of pData. */
    344                        &clDataBytes);           /*  Pointer to the length of data. */
     314    rc = DosDevIOCtl(hDev, IOCTL_DISK, DSK_GETDEVICEPARAMS, &parmPkt.Cmd,       /*  Address of the command-specific argument list. */
     315                     sizeof(parmPkt.Cmd),       /*  Length, in bytes, of pParams. */
     316                     &clParmBytes,      /*  Pointer to the length of parameters. */
     317                     &dataPkt,          /*  Address of the data area. */
     318                     sizeof(dataPkt),   /*  Length, in bytes, of pData. */
     319                     &clDataBytes);     /*  Pointer to the length of data. */
    345320
    346321    if (!rc && (dataPkt.bpb.fsDeviceAttr & BPB_REMOVABLE_MEDIA))
     
    358333}
    359334
    360 
    361 BOOL IsFileSame (CHAR *filename1,CHAR *filename2)
     335BOOL IsFileSame(CHAR * filename1, CHAR * filename2)
    362336{
    363337  /* returns:  -1 (error), 0 (is a directory), or 1 (is a file) */
    364338
    365   FILESTATUS3 fsa1,fsa2;
    366   APIRET      ret;
    367 
    368   if(filename1 && filename2) {
    369     DosError(FERR_DISABLEHARDERR);
    370     ret = DosQueryPathInfo(filename1,FIL_STANDARD,&fsa1,
    371                         (ULONG)sizeof(fsa1));
    372     if(!ret) {
     339  FILESTATUS3 fsa1, fsa2;
     340  APIRET ret;
     341
     342  if (filename1 && filename2) {
     343    DosError(FERR_DISABLEHARDERR);
     344    ret = DosQueryPathInfo(filename1, FIL_STANDARD, &fsa1,
     345                           (ULONG) sizeof(fsa1));
     346    if (!ret) {
    373347      DosError(FERR_DISABLEHARDERR);
    374       ret = DosQueryPathInfo(filename2,FIL_STANDARD,&fsa2,
    375                              (ULONG)sizeof(fsa2));
    376       if(!ret) {
    377         if(fsa1.cbFile == fsa2.cbFile &&
    378            (fsa1.attrFile & (~FILE_ARCHIVED)) ==
    379            (fsa2.attrFile & (~FILE_ARCHIVED)))
     348      ret = DosQueryPathInfo(filename2, FIL_STANDARD, &fsa2,
     349                             (ULONG) sizeof(fsa2));
     350      if (!ret) {
     351        if (fsa1.cbFile == fsa2.cbFile &&
     352            (fsa1.attrFile & (~FILE_ARCHIVED)) ==
     353            (fsa2.attrFile & (~FILE_ARCHIVED)))
    380354          return TRUE;
    381355      }
     
    385359}
    386360
    387 
    388 INT IsFile (CHAR *filename)
     361INT IsFile(CHAR * filename)
    389362{
    390363  /* returns:  -1 (error), 0 (is a directory), or 1 (is a file) */
    391364
    392365  FILESTATUS3 fsa;
    393   APIRET      ret;
    394 
    395   if(filename && *filename) {
    396     DosError(FERR_DISABLEHARDERR);
    397     ret = DosQueryPathInfo(filename,
    398                            FIL_STANDARD,
    399                            &fsa,
    400                            (ULONG)sizeof(fsa));
    401     if(!ret)
     366  APIRET ret;
     367
     368  if (filename && *filename) {
     369    DosError(FERR_DISABLEHARDERR);
     370    ret = DosQueryPathInfo(filename, FIL_STANDARD, &fsa, (ULONG) sizeof(fsa));
     371    if (!ret)
    402372      return ((fsa.attrFile & FILE_DIRECTORY) == 0);
    403     else if(IsValidDrive(*filename) && IsRoot(filename))
     373    else if (IsValidDrive(*filename) && IsRoot(filename))
    404374      return 0;
    405375  }
    406   return -1;  /* error; doesn't exist or can't read or null filename */
    407 }
    408 
    409 
    410 BOOL IsFullName (CHAR *filename)
     376  return -1;                            /* error; doesn't exist or can't read or null filename */
     377}
     378
     379BOOL IsFullName(CHAR * filename)
    411380{
    412381  return (filename) ?
    413           (isalpha(*filename) && filename[1] == ':' && filename[2] == '\\') :
    414           0;
    415 }
    416 
    417 
    418 BOOL IsRoot (CHAR *filename)
     382    (isalpha(*filename) && filename[1] == ':' && filename[2] == '\\') : 0;
     383}
     384
     385BOOL IsRoot(CHAR * filename)
    419386{
    420387  return (filename && isalpha(*filename) && filename[1] == ':' &&
     
    422389}
    423390
    424 
    425 BOOL IsValidDir (CHAR *path)
    426 {
    427   CHAR        fullname[CCHMAXPATH];
     391BOOL IsValidDir(CHAR * path)
     392{
     393  CHAR fullname[CCHMAXPATH];
    428394  FILESTATUS3 fs;
    429395
    430   if(path) {
    431     DosError(FERR_DISABLEHARDERR);
    432     if(!DosQueryPathInfo(path,
    433                          FIL_QUERYFULLNAME,
    434                          fullname,
    435                          sizeof(fullname))) {
    436       if(IsValidDrive(*fullname)) {
    437         if(!IsRoot(fullname)) {
     396  if (path) {
     397    DosError(FERR_DISABLEHARDERR);
     398    if (!DosQueryPathInfo(path,
     399                          FIL_QUERYFULLNAME, fullname, sizeof(fullname))) {
     400      if (IsValidDrive(*fullname)) {
     401        if (!IsRoot(fullname)) {
    438402          DosError(FERR_DISABLEHARDERR);
    439           if(!DosQueryPathInfo(fullname,
    440                                FIL_STANDARD,
    441                                &fs,
    442                                sizeof(fs)) &&
    443              (fs.attrFile & FILE_DIRECTORY))
     403          if (!DosQueryPathInfo(fullname,
     404                                FIL_STANDARD,
     405                                &fs,
     406                                sizeof(fs)) && (fs.attrFile & FILE_DIRECTORY))
    444407            return TRUE;
    445408        }
     
    452415}
    453416
    454 
    455 BOOL IsValidDrive (CHAR drive)
    456 {
    457   CHAR   Path[] = " :",Buffer[256];
     417BOOL IsValidDrive(CHAR drive)
     418{
     419  CHAR Path[] = " :", Buffer[256];
    458420  APIRET Status;
    459   ULONG  Size;
    460   ULONG  ulDriveNum,ulDriveMap;
    461 
    462   if(!isalpha(drive) ||
    463      (driveflags[toupper(drive) - 'A'] & (DRIVE_IGNORE | DRIVE_INVALID)))
     421  ULONG Size;
     422  ULONG ulDriveNum, ulDriveMap;
     423
     424  if (!isalpha(drive) ||
     425      (driveflags[toupper(drive) - 'A'] & (DRIVE_IGNORE | DRIVE_INVALID)))
    464426    return FALSE;
    465427  DosError(FERR_DISABLEHARDERR);
    466   Status = DosQCurDisk(&ulDriveNum,&ulDriveMap);
    467   if(!Status) {
    468     if(!(ulDriveMap & (1L << (ULONG)(toupper(drive) - 'A'))))
     428  Status = DosQCurDisk(&ulDriveNum, &ulDriveMap);
     429  if (!Status) {
     430    if (!(ulDriveMap & (1L << (ULONG) (toupper(drive) - 'A'))))
    469431      return FALSE;
    470432    Path[0] = toupper(drive);
     
    473435    Status = DosQueryFSAttach(Path,
    474436                              0,
    475                               FSAIL_QUERYNAME,
    476                               (PFSQBUFFER2)Buffer,
    477                               &Size);
     437                              FSAIL_QUERYNAME, (PFSQBUFFER2) Buffer, &Size);
    478438  }
    479439  return (Status == 0);
     
    482442//=== MakeValidDir() build valid directory name ===
    483443
    484 CHAR *MakeValidDir(CHAR *path)
    485 {
    486   ULONG         ulDrv;
    487   CHAR          *p;
    488   FILESTATUS3   fs;
    489   APIRET        rc;
     444CHAR *MakeValidDir(CHAR * path)
     445{
     446  ULONG ulDrv;
     447  CHAR *p;
     448  FILESTATUS3 fs;
     449  APIRET rc;
    490450
    491451  if (!MakeFullName(path)) {
     
    496456          return path;
    497457        DosError(FERR_DISABLEHARDERR);
    498         rc = DosQueryPathInfo(path,
    499                               FIL_STANDARD,
    500                               &fs,
    501                               sizeof(fs));
     458        rc = DosQueryPathInfo(path, FIL_STANDARD, &fs, sizeof(fs));
    502459        if (!rc && (fs.attrFile & FILE_DIRECTORY))
    503460          return path;
    504         p = strrchr(path,'\\');
     461        p = strrchr(path, '\\');
    505462        if (p) {
    506463          if (p < path + 3)
     
    515472  // Fall back to boot drive
    516473  DosError(FERR_DISABLEHARDERR);
    517   if (!DosQuerySysInfo(QSV_BOOT_DRIVE,
    518                        QSV_BOOT_DRIVE,
    519                        &ulDrv,
    520                        sizeof(ulDrv))) {
     474  if (!DosQuerySysInfo(QSV_BOOT_DRIVE, QSV_BOOT_DRIVE, &ulDrv, sizeof(ulDrv))) {
    521475    ulDrv += '@';
    522476    if (ulDrv < 'C')
    523477      ulDrv = 'C';
    524     strcpy(path," :\\");
    525     *path = (CHAR)ulDrv;
     478    strcpy(path, " :\\");
     479    *path = (CHAR) ulDrv;
    526480  }
    527481  else
    528     save_dir2(path);    // Fall back to fm3.ini drive or current dir - should never occur
     482    save_dir2(path);                    // Fall back to fm3.ini drive or current dir - should never occur
    529483  return path;
    530484}
    531485
    532 
    533 BOOL IsExecutable (CHAR *filename)
     486BOOL IsExecutable(CHAR * filename)
    534487{
    535488  register CHAR *p;
    536   APIRET         ret;
    537   ULONG          apptype;
    538 
    539   if(filename) {
    540     DosError(FERR_DISABLEHARDERR);
    541     p = strrchr(filename,'.');
    542     if(p)
    543       ret = DosQAppType(filename,
    544                         &apptype);
     489  APIRET ret;
     490  ULONG apptype;
     491
     492  if (filename) {
     493    DosError(FERR_DISABLEHARDERR);
     494    p = strrchr(filename, '.');
     495    if (p)
     496      ret = DosQAppType(filename, &apptype);
    545497    else {
    546498
    547499      char fname[CCHMAXPATH + 2];
    548500
    549       strcpy(fname,filename);
    550       strcat(fname,".");
    551       ret = DosQAppType(fname,
    552                         &apptype);
    553     }
    554     if((!ret && (!apptype ||
    555                  (apptype &
    556                   (FAPPTYP_NOTWINDOWCOMPAT |
    557                    FAPPTYP_WINDOWCOMPAT |
    558                    FAPPTYP_WINDOWAPI |
    559                    FAPPTYP_BOUND |
    560                    FAPPTYP_DOS |
    561                    FAPPTYP_WINDOWSREAL |
    562                    FAPPTYP_WINDOWSPROT |
    563                    FAPPTYP_32BIT |
    564                    0x1000)))) ||
    565        (p &&
    566         (!stricmp(p,".CMD") ||
    567         !stricmp(p,".BAT"))))
     501      strcpy(fname, filename);
     502      strcat(fname, ".");
     503      ret = DosQAppType(fname, &apptype);
     504    }
     505    if ((!ret && (!apptype ||
     506                  (apptype &
     507                   (FAPPTYP_NOTWINDOWCOMPAT |
     508                    FAPPTYP_WINDOWCOMPAT |
     509                    FAPPTYP_WINDOWAPI |
     510                    FAPPTYP_BOUND |
     511                    FAPPTYP_DOS |
     512                    FAPPTYP_WINDOWSREAL |
     513                    FAPPTYP_WINDOWSPROT |
     514                    FAPPTYP_32BIT |
     515                    0x1000)))) ||
     516        (p && (!stricmp(p, ".CMD") || !stricmp(p, ".BAT"))))
    568517      return TRUE;
    569518  }
     
    571520}
    572521
    573 
    574 VOID ArgDriveFlags (INT argc,CHAR **argv)
     522VOID ArgDriveFlags(INT argc, CHAR ** argv)
    575523{
    576524  INT x;
    577525
    578   for(x = 1;x < argc;x++) {
    579     if(*argv[x] == '/' && isalpha(argv[x][1])) {
     526  for (x = 1; x < argc; x++) {
     527    if (*argv[x] == '/' && isalpha(argv[x][1])) {
    580528
    581529      CHAR *p = &argv[x][1];
    582530
    583       while(isalpha(*p)) {
     531      while (isalpha(*p)) {
    584532        driveflags[toupper(*p) - 'A'] |= DRIVE_IGNORE;
    585533        p++;
    586534      }
    587535    }
    588     else if(*argv[x] == ';' && isalpha(argv[x][1])) {
     536    else if (*argv[x] == ';' && isalpha(argv[x][1])) {
    589537
    590538      CHAR *p = &argv[x][1];
    591539
    592       while(isalpha(*p)) {
     540      while (isalpha(*p)) {
    593541        driveflags[toupper(*p) - 'A'] |= DRIVE_NOPRESCAN;
    594542        p++;
    595543      }
    596544    }
    597     else if(*argv[x] == ',' && isalpha(argv[x][1])) {
     545    else if (*argv[x] == ',' && isalpha(argv[x][1])) {
    598546
    599547      CHAR *p = &argv[x][1];
    600548
    601       while(isalpha(*p)) {
     549      while (isalpha(*p)) {
    602550        driveflags[toupper(*p) - 'A'] |= DRIVE_NOLOADICONS;
    603551        p++;
    604552      }
    605553    }
    606     else if(*argv[x] == '`' && isalpha(argv[x][1])) {
     554    else if (*argv[x] == '`' && isalpha(argv[x][1])) {
    607555
    608556      CHAR *p = &argv[x][1];
    609557
    610       while(isalpha(*p)) {
     558      while (isalpha(*p)) {
    611559        driveflags[toupper(*p) - 'A'] |= DRIVE_NOLOADSUBJS;
    612560        p++;
    613561      }
    614562    }
    615     else if(*argv[x] == '\'' && isalpha(argv[x][1])) {
     563    else if (*argv[x] == '\'' && isalpha(argv[x][1])) {
    616564
    617565      CHAR *p = &argv[x][1];
    618566
    619       while(isalpha(*p)) {
     567      while (isalpha(*p)) {
    620568        driveflags[toupper(*p) - 'A'] |= DRIVE_NOLOADLONGS;
    621569        p++;
     
    625573}
    626574
    627 
    628 VOID DriveFlagsOne (INT x)
    629 {
    630   INT         removable;
    631   CHAR        szDrive[] = " :\\",FileSystem[CCHMAXPATH];
    632   ULONG       drvtype;
    633 
    634   *szDrive = (CHAR)(x + 'A');
     575VOID DriveFlagsOne(INT x)
     576{
     577  INT removable;
     578  CHAR szDrive[] = " :\\", FileSystem[CCHMAXPATH];
     579  ULONG drvtype;
     580
     581  *szDrive = (CHAR) (x + 'A');
    635582  *FileSystem = 0;
    636583  drvtype = 0;
    637   removable = CheckDrive(*szDrive,FileSystem,&drvtype);
     584  removable = CheckDrive(*szDrive, FileSystem, &drvtype);
    638585  driveserial[x] = -1;
    639586  driveflags[x] &= (DRIVE_IGNORE | DRIVE_NOPRESCAN | DRIVE_NOLOADICONS |
    640587                    DRIVE_NOLOADSUBJS | DRIVE_NOLOADLONGS |
    641588                    DRIVE_INCLUDEFILES | DRIVE_SLOW);
    642   if(removable != -1)
    643   {
     589  if (removable != -1) {
    644590    struct
    645591    {
    646592      ULONG serial;
    647       CHAR  volumelength;
    648       CHAR  volumelabel[CCHMAXPATH];
    649     }      volser;
    650 
    651     DosError(FERR_DISABLEHARDERR);
    652     if(!DosQueryFSInfo((ULONG)x + 1,FSIL_VOLSER,&volser,sizeof(volser)))
     593      CHAR volumelength;
     594      CHAR volumelabel[CCHMAXPATH];
     595    }
     596    volser;
     597
     598    DosError(FERR_DISABLEHARDERR);
     599    if (!DosQueryFSInfo((ULONG) x + 1, FSIL_VOLSER, &volser, sizeof(volser)))
    653600      driveserial[x] = volser.serial;
    654601    else
     
    658605    driveflags[x] |= DRIVE_INVALID;
    659606  driveflags[x] |= ((removable == -1 || removable == 1) ?
    660                                         DRIVE_REMOVABLE : 0);
    661   if(drvtype & DRIVE_REMOTE)
     607                    DRIVE_REMOVABLE : 0);
     608  if (drvtype & DRIVE_REMOTE)
    662609    driveflags[x] |= DRIVE_REMOTE;
    663   if (strcmp(FileSystem,HPFS) &&
    664       strcmp(FileSystem,JFS) &&
    665       strcmp(FileSystem,CDFS) &&
    666       strcmp(FileSystem,FAT32) &&
    667       strcmp(FileSystem,HPFS386))
    668   {
     610  if (strcmp(FileSystem, HPFS) &&
     611      strcmp(FileSystem, JFS) &&
     612      strcmp(FileSystem, CDFS) &&
     613      strcmp(FileSystem, FAT32) && strcmp(FileSystem, HPFS386)) {
    669614    driveflags[x] |= DRIVE_NOLONGNAMES;
    670615  }
    671   if(!strcmp(FileSystem,CDFS)) {
     616  if (!strcmp(FileSystem, CDFS)) {
    672617    removable = 1;
    673     driveflags[x] |= (DRIVE_REMOVABLE | DRIVE_NOTWRITEABLE |
    674                       DRIVE_CDROM);
    675   }
    676   else if(!stricmp(FileSystem,CBSIFS)) {
     618    driveflags[x] |= (DRIVE_REMOVABLE | DRIVE_NOTWRITEABLE | DRIVE_CDROM);
     619  }
     620  else if (!stricmp(FileSystem, CBSIFS)) {
    677621    driveflags[x] |= DRIVE_ZIPSTREAM;
    678622    driveflags[x] &= (~DRIVE_REMOTE);
    679     if(drvtype & DRIVE_REMOVABLE)
     623    if (drvtype & DRIVE_REMOVABLE)
    680624      driveflags[x] |= DRIVE_REMOVABLE;
    681     if(!(drvtype & DRIVE_NOLONGNAMES))
     625    if (!(drvtype & DRIVE_NOLONGNAMES))
    682626      driveflags[x] &= (~DRIVE_NOLONGNAMES);
    683627  }
    684628}
    685629
    686 
    687 VOID FillInDriveFlags (VOID *dummy)
    688 {
    689   ULONG        ulDriveNum,ulDriveMap;
     630VOID FillInDriveFlags(VOID * dummy)
     631{
     632  ULONG ulDriveNum, ulDriveMap;
    690633  register INT x;
    691634
    692   for(x = 0;x < 26;x++)
     635  for (x = 0; x < 26; x++)
    693636    driveflags[x] &= (DRIVE_IGNORE | DRIVE_NOPRESCAN | DRIVE_NOLOADICONS |
    694637                      DRIVE_NOLOADSUBJS | DRIVE_NOLOADLONGS |
    695638                      DRIVE_INCLUDEFILES | DRIVE_SLOW);
    696   memset(driveserial,-1,sizeof(driveserial));
     639  memset(driveserial, -1, sizeof(driveserial));
    697640  DosError(FERR_DISABLEHARDERR);
    698   DosQCurDisk(&ulDriveNum,&ulDriveMap);
    699   for(x = 0;x < 26;x++) {
    700     if(ulDriveMap & (1L << x) && !(driveflags[x] & DRIVE_IGNORE)) {
     641  DosQCurDisk(&ulDriveNum, &ulDriveMap);
     642  for (x = 0; x < 26; x++) {
     643    if (ulDriveMap & (1L << x) && !(driveflags[x] & DRIVE_IGNORE)) {
    701644      {
    702         CHAR  s[80];
    703         ULONG flags = 0,size = sizeof(ULONG);
    704 
    705         sprintf(s,"%c.DriveFlags",(CHAR)(x + 'A'));
    706         if(PrfQueryProfileData(fmprof,appname,s,&flags,&size) &&
    707            size == sizeof(ULONG))
     645        CHAR s[80];
     646        ULONG flags = 0, size = sizeof(ULONG);
     647
     648        sprintf(s, "%c.DriveFlags", (CHAR) (x + 'A'));
     649        if (PrfQueryProfileData(fmprof, appname, s, &flags, &size) &&
     650            size == sizeof(ULONG))
    708651          driveflags[x] |= flags;
    709652      }
    710653
    711       if(x > 1) {
    712         if(!(driveflags[x] & DRIVE_NOPRESCAN))
     654      if (x > 1) {
     655        if (!(driveflags[x] & DRIVE_NOPRESCAN))
    713656          DriveFlagsOne(x);
    714657        else
     
    720663      }
    721664    }
    722     else if(!(ulDriveMap & (1L << x)))
     665    else if (!(ulDriveMap & (1L << x)))
    723666      driveflags[x] |= DRIVE_INVALID;
    724667  }
    725668  {
    726     ULONG  startdrive = 3L;
    727 
    728     DosError(FERR_DISABLEHARDERR);
    729     DosQuerySysInfo(QSV_BOOT_DRIVE,QSV_BOOT_DRIVE,
    730                     (PVOID)&startdrive,(ULONG)sizeof(ULONG));
    731     if(startdrive)
     669    ULONG startdrive = 3L;
     670
     671    DosError(FERR_DISABLEHARDERR);
     672    DosQuerySysInfo(QSV_BOOT_DRIVE, QSV_BOOT_DRIVE,
     673                    (PVOID) & startdrive, (ULONG) sizeof(ULONG));
     674    if (startdrive)
    732675      driveflags[startdrive - 1] |= DRIVE_BOOT;
    733676  }
    734677}
    735678
    736 
    737 CHAR * assign_ignores (CHAR *s)
    738 {
    739   register INT   x;
    740   register CHAR *p,*pp;
     679CHAR *assign_ignores(CHAR * s)
     680{
     681  register INT x;
     682  register CHAR *p, *pp;
    741683
    742684  *s = '/';
    743685  s[1] = 0;
    744686  p = s + 1;
    745   if(s) {
    746     for(x = 0;x < 26;x++) {
    747       if((driveflags[x] & DRIVE_IGNORE) != 0) {
    748         *p = (CHAR)x + 'A';
     687  if (s) {
     688    for (x = 0; x < 26; x++) {
     689      if ((driveflags[x] & DRIVE_IGNORE) != 0) {
     690        *p = (CHAR) x + 'A';
    749691        p++;
    750692        *p = 0;
     
    752694    }
    753695  }
    754   if(!s[1]) {
     696  if (!s[1]) {
    755697    *s = 0;
    756698    pp = s;
     
    764706  pp[1] = 0;
    765707  p = pp + 1;
    766   if(pp) {
    767     for(x = 0;x < 26;x++) {
    768       if((driveflags[x] & DRIVE_NOPRESCAN) != 0) {
    769         *p = (CHAR)x + 'A';
     708  if (pp) {
     709    for (x = 0; x < 26; x++) {
     710      if ((driveflags[x] & DRIVE_NOPRESCAN) != 0) {
     711        *p = (CHAR) x + 'A';
    770712        p++;
    771713        *p = 0;
     
    773715    }
    774716  }
    775   if(!pp[1])
     717  if (!pp[1])
    776718    *pp = 0;
    777719  pp = &s[strlen(s)];
     
    781723  pp[1] = 0;
    782724  p = pp + 1;
    783   if(pp) {
    784     for(x = 0;x < 26;x++) {
    785       if((driveflags[x] & DRIVE_NOLOADICONS) != 0) {
    786         *p = (CHAR)x + 'A';
     725  if (pp) {
     726    for (x = 0; x < 26; x++) {
     727      if ((driveflags[x] & DRIVE_NOLOADICONS) != 0) {
     728        *p = (CHAR) x + 'A';
    787729        p++;
    788730        *p = 0;
     
    790732    }
    791733  }
    792   if(!pp[1])
     734  if (!pp[1])
    793735    *pp = 0;
    794736  pp = &s[strlen(s)];
     
    798740  pp[1] = 0;
    799741  p = pp + 1;
    800   if(pp) {
    801     for(x = 0;x < 26;x++) {
    802       if((driveflags[x] & DRIVE_NOLOADSUBJS) != 0) {
    803         *p = (CHAR)x + 'A';
     742  if (pp) {
     743    for (x = 0; x < 26; x++) {
     744      if ((driveflags[x] & DRIVE_NOLOADSUBJS) != 0) {
     745        *p = (CHAR) x + 'A';
    804746        p++;
    805747        *p = 0;
     
    807749    }
    808750  }
    809   if(!pp[1])
     751  if (!pp[1])
    810752    *pp = 0;
    811753  pp = &s[strlen(s)];
     
    815757  pp[1] = 0;
    816758  p = pp + 1;
    817   if(pp) {
    818     for(x = 0;x < 26;x++) {
    819       if((driveflags[x] & DRIVE_NOLOADLONGS) != 0) {
    820         *p = (CHAR)x + 'A';
     759  if (pp) {
     760    for (x = 0; x < 26; x++) {
     761      if ((driveflags[x] & DRIVE_NOLOADLONGS) != 0) {
     762        *p = (CHAR) x + 'A';
    821763        p++;
    822764        *p = 0;
     
    824766    }
    825767  }
    826   if(!pp[1])
     768  if (!pp[1])
    827769    *pp = 0;
    828770  bstrip(s);
     
    830772}
    831773
    832 
    833 BOOL needs_quoting (register CHAR *f)
     774BOOL needs_quoting(register CHAR * f)
    834775{
    835776  register CHAR *p = " &|<>";
    836777
    837   while(*p) {
    838     if(strchr(f,*p))
     778  while (*p) {
     779    if (strchr(f, *p))
    839780      return TRUE;
    840781    p++;
     
    843784}
    844785
    845 
    846 BOOL IsBinary (register CHAR *str,ULONG len)
     786BOOL IsBinary(register CHAR * str, ULONG len)
    847787{
    848788  register ULONG x = 0L;
    849789
    850   if(str) {
    851     while(x < len) {
    852       if(str[x] < ' ' && str[x] != '\r' && str[x] != '\n' && str[x] != '\t' &&
    853          str[x] != '\x1b' && str[x] != '\x1a' && str[x] != '\07' &&
    854          str[x] != '\x0c')
     790  if (str) {
     791    while (x < len) {
     792      if (str[x] < ' ' && str[x] != '\r' && str[x] != '\n' && str[x] != '\t'
     793          && str[x] != '\x1b' && str[x] != '\x1a' && str[x] != '\07'
     794          && str[x] != '\x0c')
    855795        return TRUE;
    856796      x++;
     
    860800}
    861801
    862 
    863 BOOL TestBinary (CHAR *filename)
    864 {
    865   HFILE   handle;
    866   ULONG   ulAction;
    867   ULONG   len;
    868   APIRET  rc;
    869   CHAR    buff[512];
    870 
    871   if(filename) {
    872     if(!DosOpen(filename,&handle,&ulAction,0L,0L,
    873                 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
    874                 OPEN_FLAGS_FAIL_ON_ERROR | OPEN_FLAGS_NOINHERIT |
    875                 OPEN_FLAGS_SEQUENTIAL | OPEN_SHARE_DENYNONE |
    876                 OPEN_ACCESS_READONLY,0L)) {
     802BOOL TestBinary(CHAR * filename)
     803{
     804  HFILE handle;
     805  ULONG ulAction;
     806  ULONG len;
     807  APIRET rc;
     808  CHAR buff[512];
     809
     810  if (filename) {
     811    if (!DosOpen(filename, &handle, &ulAction, 0L, 0L,
     812                 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
     813                 OPEN_FLAGS_FAIL_ON_ERROR | OPEN_FLAGS_NOINHERIT |
     814                 OPEN_FLAGS_SEQUENTIAL | OPEN_SHARE_DENYNONE |
     815                 OPEN_ACCESS_READONLY, 0L)) {
    877816      len = 512;
    878       rc = DosRead(handle,buff,len,&len);
     817      rc = DosRead(handle, buff, len, &len);
    879818      DosClose(handle);
    880       if(!rc && len)
    881         return IsBinary(buff,len);
     819      if (!rc && len)
     820        return IsBinary(buff, len);
    882821    }
    883822  }
     
    885824}
    886825
    887 
    888 char *IsVowel (char a)
    889 {
    890   return (strchr("aeiouAEIOU",a) != NULL) ? "n" : NullStr;
    891 }
    892 
    893 
    894 VOID GetDesktopName (CHAR *objectpath,ULONG size)
    895 {
    896   PFN     WQDPath;
     826char *IsVowel(char a)
     827{
     828  return (strchr("aeiouAEIOU", a) != NULL) ? "n" : NullStr;
     829}
     830
     831VOID GetDesktopName(CHAR * objectpath, ULONG size)
     832{
     833  PFN WQDPath;
    897834  HMODULE hmod = 0;
    898   APIRET  rc;
    899   ULONG   startdrive = 3L;
    900   CHAR    objerr[CCHMAXPATH];
     835  APIRET rc;
     836  ULONG startdrive = 3L;
     837  CHAR objerr[CCHMAXPATH];
    901838
    902839  if (!objectpath) {
     
    910847     * this way...
    911848     */
    912     rc = DosLoadModule(objerr,
    913                          sizeof(objerr),
    914                          "PMWP",
    915                          &hmod);
    916     if(!rc) {
    917       rc = DosQueryProcAddr(hmod,
    918                               262,
    919                               NULL,
    920                               &WQDPath);
    921       if(!rc)
    922         WQDPath(objectpath,size);
     849    rc = DosLoadModule(objerr, sizeof(objerr), "PMWP", &hmod);
     850    if (!rc) {
     851      rc = DosQueryProcAddr(hmod, 262, NULL, &WQDPath);
     852      if (!rc)
     853        WQDPath(objectpath, size);
    923854      DosFreeModule(hmod);
    924855    }
     
    930861                               NULL,
    931862                               "\0",
    932                                (PVOID)objectpath,
    933                                sizeof(objectpath))) {
    934       Win_Error(HWND_DESKTOP,HWND_DESKTOP,pszSrcFile,__LINE__,"PrfQueryProfileString");
     863                               (PVOID) objectpath, sizeof(objectpath))) {
     864      Win_Error(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__,
     865                "PrfQueryProfileString");
    935866      *objectpath = 0;
    936867    }
     
    942873      // Fall back - fixme to work for NLS
    943874      DosError(FERR_DISABLEHARDERR);
    944       DosQuerySysInfo(QSV_BOOT_DRIVE,QSV_BOOT_DRIVE,
    945                       (PVOID)&startdrive,(ULONG)sizeof(ULONG));
    946       sprintf(objectpath,
    947               "%c:\\DESKTOP",
    948               ((CHAR)startdrive) + '@');
    949     }
    950   }
    951 }
     875      DosQuerySysInfo(QSV_BOOT_DRIVE, QSV_BOOT_DRIVE,
     876                      (PVOID) & startdrive, (ULONG) sizeof(ULONG));
     877      sprintf(objectpath, "%c:\\DESKTOP", ((CHAR) startdrive) + '@');
     878    }
     879  }
     880}
Note: See TracChangeset for help on using the changeset viewer.