Subversion Repositories SvarDOS

Rev

Rev 2053 | Rev 2055 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2053 Rev 2054
Line 535... Line 535...
535
 */
535
 */
536
static void GetVolumeAndSerial(char *volume, char *serial, char *path) {
536
static void GetVolumeAndSerial(char *volume, char *serial, char *path) {
537
  char rootPath[MAXBUF];
537
  char rootPath[MAXBUF];
538
  char dummy[MAXBUF];
538
  char dummy[MAXBUF];
539
  union serialNumber {
539
  union serialNumber {
540
    DWORD serialFull;
540
    unsigned long serialFull;
541
    struct {
541
    struct {
542
      WORD a;
542
      unsigned short a;
543
      WORD b;
543
      unsigned short b;
544
    } serialParts;
544
    } serialParts;
545
  } serialNum;
545
  } serialNum;
546
 
546
 
547
  /* get drive letter or share server\name */
547
  /* get drive letter or share server\name */
548
  splitpath(path, rootPath, dummy);
548
  splitpath(path, rootPath, dummy);
Line 550... Line 550...
550
 
550
 
551
  if (GetVolumeInformation(rootPath, volume, VOLLEN, &serialNum.serialFull) == 0) {
551
  if (GetVolumeInformation(rootPath, volume, VOLLEN, &serialNum.serialFull) == 0) {
552
    showInvalidDrive();
552
    showInvalidDrive();
553
  }
553
  }
554
 
554
 
555
  if (serialNum.serialFull == 0)
555
  if (serialNum.serialFull == 0) {
556
    serial[0] = '\0';
556
    serial[0] = '\0';
557
  else
557
  } else {
558
    sprintf(serial, "%04X:%04X",
-
 
559
      serialNum.serialParts.b, serialNum.serialParts.a);
558
    sprintf(serial, "%04X:%04X", serialNum.serialParts.b, serialNum.serialParts.a);
-
 
559
  }
560
}
560
}
561
 
561
 
562
 
562
 
563
/**
563
/**
564
 * Stores directory information obtained from FindFirst/Next that
564
 * Stores directory information obtained from FindFirst/Next that
565
 * we may wish to make use of when displaying directory entry.
565
 * we may wish to make use of when displaying directory entry.
566
 * e.g. attribute, dates, etc.
566
 * e.g. attribute, dates, etc.
567
 */
567
 */
568
typedef struct DIRDATA
568
typedef struct DIRDATA {
569
{
-
 
570
  DWORD subdirCnt;          /* how many subdirectories we have */
569
  unsigned long subdirCnt;  /* how many subdirectories we have */
571
  DWORD fileCnt;            /* how many [normal] files we have */
570
  unsigned long fileCnt;    /* how many [normal] files we have */
572
  unsigned short attrib;    /* Directory attributes            */
571
  unsigned short attrib;    /* Directory attributes            */
573
} DIRDATA;
572
} DIRDATA;
574
 
573
 
575
/**
574
/**
576
 * Contains the information stored in a Stack necessary to allow
575
 * Contains the information stored in a Stack necessary to allow