VirtualBox

Changeset 39027 in vbox


Ignore:
Timestamp:
Oct 19, 2011 9:58:41 AM (13 years ago)
Author:
vboxsync
Message:

RTFileGetSize/win: Made it grok volume & disks (some disks anyway).

Location:
trunk/src/VBox/Runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/fileio-win.cpp

    r39025 r39027  
    3030*******************************************************************************/
    3131#define LOG_GROUP RTLOGGROUP_DIR
     32#ifndef _WIN32_WINNT
     33# define _WIN32_WINNT 0x0500
     34#endif
    3235#include <Windows.h>
    3336
     
    632635     * GetFileSize works for most handles.
    633636     */
    634     int             rc;
    635637    ULARGE_INTEGER  Size;
    636638    Size.LowPart = GetFileSize((HANDLE)RTFileToNative(hFile), &Size.HighPart);
     
    638640    {
    639641        *pcbSize = Size.QuadPart;
    640         if (Size.QuadPart)
    641             return VINF_SUCCESS;
    642         rc = VINF_SUCCESS;
    643         /** @todo Check what GetFileSize returns on disks and volume
    644          *        handles! */
    645     }
    646     else
    647         rc = RTErrConvertFromWin32(GetLastError());
    648 #if 0
    649     /*
    650      * Could it be a volume?
     642        return VINF_SUCCESS;
     643    }
     644    int rc = RTErrConvertFromWin32(GetLastError());
     645
     646    /*
     647     * Could it be a volume or a disk?
    651648     */
    652649    DISK_GEOMETRY   DriveGeo;
     
    676673        }
    677674    }
    678 #endif
    679675
    680676    /*
  • trunk/src/VBox/Runtime/testcase/Makefile.kmk

    r38082 r39027  
    6161        tstRTFileAio \
    6262        tstRTFileAppend-1 \
     63        tstRTFileGetSize-1 \
    6364        tstFileLock \
    6465        tstFork \
     
    233234tstRTFileAppend-1_SOURCES = tstRTFileAppend-1.cpp
    234235
     236tstRTFileGetSize-1_TEMPLATE = VBOXR3TSTEXE
     237tstRTFileGetSize-1_SOURCES = tstRTFileGetSize-1.cpp
     238
    235239tstFileAppendWin-1_SOURCES = tstFileAppendWin-1.cpp
    236240
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette