VirtualBox

Ignore:
Timestamp:
Jun 22, 2011 7:30:06 PM (13 years ago)
Author:
vboxsync
Message:

*: RTFILE becomes a pointer, RTFileOpen++ expands it's flags paramter from uint32_t to uint64_t.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/ldr/ldr.cpp

    r28800 r37596  
    3939#include <iprt/log.h>
    4040#include "internal/ldr.h"
    41 
    42 
    43 /*******************************************************************************
    44 *   Structures and Typedefs                                                    *
    45 *******************************************************************************/
    46 typedef struct RTLDRREADERFILE
    47 {
    48     /** The core. */
    49     RTLDRREADER     Core;
    50     /** The file. */
    51     RTFILE          File;
    52     /** The file size. */
    53     RTFOFF          cbFile;
    54     /** The current offset. */
    55     RTFOFF          off;
    56     /** The filename (variable size). */
    57     char            szFilename[1];
    58 } RTLDRREADERFILE, *PRTLDRREADERFILE;
    59 
    6041
    6142
  • trunk/src/VBox/Runtime/common/ldr/ldrFile.cpp

    r28800 r37596  
    5555    RTLDRREADER     Core;
    5656    /** The file. */
    57     RTFILE          File;
     57    RTFILE          hFile;
    5858    /** The file size. */
    5959    RTFOFF          cbFile;
     
    7979    if (pFileReader->off != off)
    8080    {
    81         int rc = RTFileSeek(pFileReader->File, off, RTFILE_SEEK_BEGIN, NULL);
     81        int rc = RTFileSeek(pFileReader->hFile, off, RTFILE_SEEK_BEGIN, NULL);
    8282        if (RT_FAILURE(rc))
    8383        {
     
    9191     * Read.
    9292     */
    93     int rc = RTFileRead(pFileReader->File, pvBuf, cb, NULL);
     93    int rc = RTFileRead(pFileReader->hFile, pvBuf, cb, NULL);
    9494    if (RT_SUCCESS(rc))
    9595        pFileReader->off += cb;
     
    185185    int rc = VINF_SUCCESS;
    186186    PRTLDRREADERFILE pFileReader = (PRTLDRREADERFILE)pReader;
    187     if (pFileReader->File != NIL_RTFILE)
    188     {
    189         rc = RTFileClose(pFileReader->File);
     187    if (pFileReader->hFile != NIL_RTFILE)
     188    {
     189        rc = RTFileClose(pFileReader->hFile);
    190190        AssertRC(rc);
    191         pFileReader->File = NIL_RTFILE;
     191        pFileReader->hFile = NIL_RTFILE;
    192192    }
    193193    RTMemFree(pFileReader);
     
    211211    {
    212212        memcpy(pFileReader->szFilename, pszFilename, cchFilename + 1);
    213         rc = RTFileOpen(&pFileReader->File, pszFilename, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE);
     213        rc = RTFileOpen(&pFileReader->hFile, pszFilename, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE);
    214214        if (RT_SUCCESS(rc))
    215215        {
    216             rc = RTFileGetSize(pFileReader->File, (uint64_t *)&pFileReader->cbFile);
     216            rc = RTFileGetSize(pFileReader->hFile, (uint64_t *)&pFileReader->cbFile);
    217217            if (RT_SUCCESS(rc))
    218218            {
     
    230230                return VINF_SUCCESS;
    231231            }
    232             RTFileClose(pFileReader->File);
     232
     233            RTFileClose(pFileReader->hFile);
    233234        }
    234235        RTMemFree(pFileReader);
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