Ignore:
Timestamp:
Jan 8, 2002, 7:20:45 PM (24 years ago)
Author:
sandervl
Message:

minor update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/disk.cpp

    r7738 r7742  
    1 /* $Id: disk.cpp,v 1.30 2002-01-07 14:44:03 sandervl Exp $ */
     1/* $Id: disk.cpp,v 1.31 2002-01-08 18:20:45 sandervl Exp $ */
    22
    33/*
     
    5454
    5555//******************************************************************************
    56 //SvL: 24-6-'97 - Added
    5756//******************************************************************************
    5857ODINFUNCTION5(BOOL, GetDiskFreeSpaceA,
    59               LPCSTR, arg1,
    60               PDWORD, arg2,
    61               PDWORD, arg3,
    62               PDWORD, arg4,
    63               PDWORD, arg5)
     58              LPCSTR, lpszRootPathName,
     59              PDWORD, lpSectorsPerCluster,
     60              PDWORD, lpBytesPerSector,
     61              PDWORD, lpFreeClusters,
     62              PDWORD, lpClusters)
    6463{
    6564  BOOL rc;
     
    6968  DWORD dwTotalNumberOfClusters;    // address of total number of clusters
    7069
    71   dprintf(("KERNEL32:  GetDiskFreeSpaceA %s, 0x%08X, 0x%08X, 0x%08X, 0x%08X,\n",
    72              arg1!=NULL?arg1:"NULL", arg2,arg3,arg4,arg5));
    73 
    74   rc = OSLibGetDiskFreeSpace((LPSTR)arg1, &dwSectorsPerCluster, &dwBytesPerSector,
     70  rc = OSLibGetDiskFreeSpace((LPSTR)lpszRootPathName, &dwSectorsPerCluster, &dwBytesPerSector,
    7571                             &dwNumberOfFreeClusters, &dwTotalNumberOfClusters);
    7672  if(rc)
    7773  {
    78     if (arg2!=NULL)
    79       *arg2 = dwSectorsPerCluster;
    80     if (arg3!=NULL)
    81       *arg3 = dwBytesPerSector;
    82     if (arg4!=NULL)
    83       *arg4 = dwNumberOfFreeClusters;
    84     if (arg5!=NULL)
    85       *arg5 = dwTotalNumberOfClusters;
     74    if (lpSectorsPerCluster!=NULL)
     75      *lpSectorsPerCluster = dwSectorsPerCluster;
     76    if (lpBytesPerSector!=NULL)
     77      *lpBytesPerSector = dwBytesPerSector;
     78    if (lpFreeClusters!=NULL)
     79      *lpFreeClusters = dwNumberOfFreeClusters;
     80    if (lpClusters!=NULL)
     81      *lpClusters = dwTotalNumberOfClusters;
    8682
    8783    /* CW: Windows Media Player setup complains about wrong clustersize when odin is installed on
     
    9288       TVFSTOHPFS = 1
    9389       */
    94     if(arg2!=NULL) {
    95       if(*arg2==1024 && PROFILE_GetOdinIniBool("DRIVESPACE","CLUSTERTO32",0)) {/* TVFS returns 1024 sectors per cluster */
     90    if(lpSectorsPerCluster!=NULL)
     91    {
     92      if(*lpSectorsPerCluster==1024 && PROFILE_GetOdinIniBool("DRIVESPACE","CLUSTERTO32",0))
     93      {/* TVFS returns 1024 sectors per cluster */
    9694        dprintf(("KERNEL32:  GetDiskFreeSpaceA, TVFS-Drive detected. Faking clustersize to 32.\n"));
    97         *arg2=32;
    98         if (arg4!=NULL)
    99           *arg4 = dwNumberOfFreeClusters<<0x5;
    100         if (arg5!=NULL)
    101           *arg5 = dwTotalNumberOfClusters<<0x5;
     95        *lpSectorsPerCluster=32;
     96        if (lpFreeClusters!=NULL)
     97          *lpFreeClusters = dwNumberOfFreeClusters<<0x5;
     98        if (lpClusters!=NULL)
     99          *lpClusters = dwTotalNumberOfClusters<<0x5;
    102100      }
    103101    }
    104 
    105102  }
    106 
    107103  return rc;
    108104}
     
    110106//******************************************************************************
    111107ODINFUNCTION5(BOOL, GetDiskFreeSpaceW,
    112               LPCWSTR, arg1,
    113               PDWORD, arg2,
    114               PDWORD, arg3,
    115               PDWORD, arg4,
    116               PDWORD, arg5)
     108              LPCWSTR, lpszRootPathName,
     109              PDWORD, lpSectorsPerCluster,
     110              PDWORD, lpBytesPerSector,
     111              PDWORD, lpFreeClusters,
     112              PDWORD, lpClusters)
    117113{
    118114  BOOL  rc;
    119115  char *astring;
    120116
    121   astring = UnicodeToAsciiString((LPWSTR)arg1);
    122   rc = CALL_ODINFUNC(GetDiskFreeSpaceA)(astring, arg2, arg3, arg4, arg5);
     117  astring = UnicodeToAsciiString((LPWSTR)lpszRootPathName);
     118  rc = CALL_ODINFUNC(GetDiskFreeSpaceA)(astring, lpSectorsPerCluster, lpBytesPerSector, lpFreeClusters, lpClusters);
    123119  FreeAsciiString(astring);
    124120  return(rc);
     
    254250    }
    255251    astring = UnicodeToAsciiString((LPWSTR)lpszDrive);
    256     dprintf(("KERNEL32:  OS2GetDriveTypeW %s", astring));
     252    dprintf(("KERNEL32: GetDriveTypeW %s", astring));
    257253    rc = GetDriveTypeA(astring);
    258254    FreeAsciiString(astring);
Note: See TracChangeset for help on using the changeset viewer.