Ignore:
Timestamp:
Mar 28, 2000, 7:24:27 PM (25 years ago)
Author:
sandervl
Message:

MM: GetFreeDiskSpaceA fix

File:
1 edited

Legend:

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

    r2802 r3264  
    1 /* $Id: disk.cpp,v 1.9 2000-02-16 14:25:39 sandervl Exp $ */
     1/* $Id: disk.cpp,v 1.10 2000-03-28 17:24:27 sandervl Exp $ */
    22
    33/*
     
    2121#include "unicode.h"
    2222
    23 #define DBG_LOCALLOG    DBG_disk
     23#define DBG_LOCALLOG  DBG_disk
    2424#include "dbglocal.h"
    2525
     
    5555BOOL WIN32API GetDiskFreeSpaceA( LPCSTR arg1, PDWORD arg2, PDWORD arg3, PDWORD arg4, PDWORD  arg5)
    5656{
    57     dprintf(("KERNEL32:  OS2GetDiskFreeSpaceA\n"));
    58     return O32_GetDiskFreeSpace(arg1, arg2, arg3, arg4, arg5);
     57    BOOL rc;
     58    DWORD dwSectorsPerCluster;  // address of sectors per cluster ter
     59    DWORD dwBytesPerSector;     // address of bytes per sector
     60    DWORD dwNumberOfFreeClusters;       // address of number of free clusters
     61    DWORD dwTotalNumberOfClusters;      // address of total number of clusters
     62    dprintf(("KERNEL32:  OS2GetDiskFreeSpaceA %s, 0x%08X, 0x%08X, 0x%08X, 0x%08X,\n",
     63             arg1!=NULL?arg1:"NULL", arg2,arg3,arg4,arg5));
     64    rc = O32_GetDiskFreeSpace(arg1, &dwSectorsPerCluster, &dwBytesPerSector,
     65                              &dwNumberOfFreeClusters, &dwTotalNumberOfClusters);
     66    if(rc)
     67    {
     68      if (arg2!=NULL)
     69        *arg2 = dwSectorsPerCluster;
     70      if (arg3!=NULL)
     71        *arg3 = dwBytesPerSector;
     72      if (arg4!=NULL)
     73        *arg4 = dwNumberOfFreeClusters;
     74      if (arg5!=NULL)
     75        *arg5 = dwTotalNumberOfClusters;
     76    }
     77    dprintf((" returned %d\n",rc));
     78    return rc;
    5979}
    6080//******************************************************************************
     
    7696 * Name      : GetDiskFreeSpaceEx
    7797 * Purpose   :
    78  * Parameters: lpDirectoryName [in] Pointer to a null-terminated string that 
     98 * Parameters: lpDirectoryName [in] Pointer to a null-terminated string that
    7999 *                             specifies a directory on the disk of interest.
    80  *                             This string can be a UNC name. If this 
    81  *                             parameter is a UNC name, you must follow it 
    82  *                             with an additional backslash. For example, you 
    83  *                             would specify \\MyServer\MyShare as 
     100 *                             This string can be a UNC name. If this
     101 *                             parameter is a UNC name, you must follow it
     102 *                             with an additional backslash. For example, you
     103 *                             would specify \\MyServer\MyShare as
    84104 *                             \\MyServer\MyShare\.
    85  *                             If lpDirectoryName is NULL, the 
    86  *                             GetDiskFreeSpaceEx function obtains 
     105 *                             If lpDirectoryName is NULL, the
     106 *                             GetDiskFreeSpaceEx function obtains
    87107 *                             information about the object store.
    88  *                             Note that lpDirectoryName does not have to 
    89  *                             specify the root directory on a disk. The 
     108 *                             Note that lpDirectoryName does not have to
     109 *                             specify the root directory on a disk. The
    90110 *                             function accepts any directory on the disk.
    91111 *
    92112 *             lpFreeBytesAvailableToCaller
    93  *                             [out] Pointer to a variable to receive the 
    94  *                             total number of free bytes on the disk that 
    95  *                             are available to the user associated with the 
     113 *                             [out] Pointer to a variable to receive the
     114 *                             total number of free bytes on the disk that
     115 *                             are available to the user associated with the
    96116 *                             calling thread.
    97117 *             lpTotalNumberOfBytes
    98  *                             [out] Pointer to a variable to receive the 
    99  *                             total number of bytes on the disk that are 
    100  *                             available to the user associated with the 
     118 *                             [out] Pointer to a variable to receive the
     119 *                             total number of bytes on the disk that are
     120 *                             available to the user associated with the
    101121 *                             calling thread.
    102122 *             lpTotalNumberOfFreeBytes
    103  *                             [out] Pointer to a variable to receive the 
     123 *                             [out] Pointer to a variable to receive the
    104124 *                             total number of free bytes on the disk.
    105125 *                             This parameter can be NULL.
    106126 * Variables :
    107  * Result    : Nonzero indicates success. Zero indicates failure. To get 
     127 * Result    : Nonzero indicates success. Zero indicates failure. To get
    108128 *             extended error information, call GetLastError.
    109  * Remark    : Note that the values obtained by this function are of type 
    110  *             ULARGE_INTEGER. Be careful not to truncate these values to 
     129 * Remark    : Note that the values obtained by this function are of type
     130 *             ULARGE_INTEGER. Be careful not to truncate these values to
    111131 *             32 bits.
    112132 * Status    :
     
    122142{
    123143  dprintf(("not yet implemented"));
    124  
     144
    125145  return TRUE;
    126146}
     
    134154{
    135155  dprintf(("not yet implemented"));
    136  
     156
    137157  return TRUE;
    138158}
     
    143163UINT WIN32API GetDriveTypeA( LPCSTR arg1)
    144164{
    145     dprintf(("KERNEL32:  GetDriveType %s\n", arg1));
    146     return O32_GetDriveType(arg1);
     165    UINT rc;
     166    rc = O32_GetDriveType(arg1);
     167    dprintf(("KERNEL32:  GetDriveType %s = %d\n", arg1,rc));
     168    return rc;
    147169}
    148170//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.