Changeset 37596 in vbox for trunk/src/VBox/Runtime/common/ldr
- Timestamp:
- Jun 22, 2011 7:30:06 PM (13 years ago)
- Location:
- trunk/src/VBox/Runtime/common/ldr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/ldr/ldr.cpp
r28800 r37596 39 39 #include <iprt/log.h> 40 40 #include "internal/ldr.h" 41 42 43 /*******************************************************************************44 * Structures and Typedefs *45 *******************************************************************************/46 typedef struct RTLDRREADERFILE47 {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 60 41 61 42 -
trunk/src/VBox/Runtime/common/ldr/ldrFile.cpp
r28800 r37596 55 55 RTLDRREADER Core; 56 56 /** The file. */ 57 RTFILE File;57 RTFILE hFile; 58 58 /** The file size. */ 59 59 RTFOFF cbFile; … … 79 79 if (pFileReader->off != off) 80 80 { 81 int rc = RTFileSeek(pFileReader-> File, off, RTFILE_SEEK_BEGIN, NULL);81 int rc = RTFileSeek(pFileReader->hFile, off, RTFILE_SEEK_BEGIN, NULL); 82 82 if (RT_FAILURE(rc)) 83 83 { … … 91 91 * Read. 92 92 */ 93 int rc = RTFileRead(pFileReader-> File, pvBuf, cb, NULL);93 int rc = RTFileRead(pFileReader->hFile, pvBuf, cb, NULL); 94 94 if (RT_SUCCESS(rc)) 95 95 pFileReader->off += cb; … … 185 185 int rc = VINF_SUCCESS; 186 186 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); 190 190 AssertRC(rc); 191 pFileReader-> File = NIL_RTFILE;191 pFileReader->hFile = NIL_RTFILE; 192 192 } 193 193 RTMemFree(pFileReader); … … 211 211 { 212 212 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); 214 214 if (RT_SUCCESS(rc)) 215 215 { 216 rc = RTFileGetSize(pFileReader-> File, (uint64_t *)&pFileReader->cbFile);216 rc = RTFileGetSize(pFileReader->hFile, (uint64_t *)&pFileReader->cbFile); 217 217 if (RT_SUCCESS(rc)) 218 218 { … … 230 230 return VINF_SUCCESS; 231 231 } 232 RTFileClose(pFileReader->File); 232 233 RTFileClose(pFileReader->hFile); 233 234 } 234 235 RTMemFree(pFileReader);
Note:
See TracChangeset
for help on using the changeset viewer.