Changeset 14062 in vbox for trunk/src/VBox/Runtime/r3
- Timestamp:
- Nov 10, 2008 11:23:05 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 39118
- Location:
- trunk/src/VBox/Runtime/r3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp
r9355 r14062 274 274 275 275 276 RTDECL(int) RTDirRead(PRTDIR pDir, PRTDIRENTRY pDirEntry, unsigned*pcbDirEntry)276 RTDECL(int) RTDirRead(PRTDIR pDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry) 277 277 { 278 278 /* … … 283 283 AssertMsgReturn(VALID_PTR(pDirEntry), ("%p\n", pDirEntry), VERR_INVALID_POINTER); 284 284 285 unsignedcbDirEntry = sizeof(*pDirEntry);285 size_t cbDirEntry = sizeof(*pDirEntry); 286 286 if (pcbDirEntry) 287 287 { 288 288 AssertMsgReturn(VALID_PTR(pcbDirEntry), ("%p\n", pcbDirEntry), VERR_INVALID_POINTER); 289 289 cbDirEntry = *pcbDirEntry; 290 AssertMsgReturn(cbDirEntry >= (unsigned)RT_OFFSETOF(RTDIRENTRY, szName[2]),290 AssertMsgReturn(cbDirEntry >= RT_UOFFSETOF(RTDIRENTRY, szName[2]), 291 291 ("Invalid *pcbDirEntry=%d (min %d)\n", *pcbDirEntry, RT_OFFSETOF(RTDIRENTRYEX, szName[2])), 292 292 VERR_INVALID_PARAMETER); … … 378 378 379 379 380 RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, unsigned*pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs)380 RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs) 381 381 { 382 382 /* … … 390 390 ("Invalid enmAdditionalAttribs=%p\n", enmAdditionalAttribs), 391 391 VERR_INVALID_PARAMETER); 392 unsignedcbDirEntry = sizeof(*pDirEntry);392 size_t cbDirEntry = sizeof(*pDirEntry); 393 393 if (pcbDirEntry) 394 394 { -
trunk/src/VBox/Runtime/r3/win/dir-win.cpp
r13104 r14062 240 240 241 241 242 RTDECL(int) RTDirRead(PRTDIR pDir, PRTDIRENTRY pDirEntry, unsigned*pcbDirEntry)242 RTDECL(int) RTDirRead(PRTDIR pDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry) 243 243 { 244 244 /* … … 255 255 return VERR_INVALID_PARAMETER; 256 256 } 257 unsignedcbDirEntry = sizeof(*pDirEntry);257 size_t cbDirEntry = sizeof(*pDirEntry); 258 258 if (pcbDirEntry) 259 259 { 260 260 cbDirEntry = *pcbDirEntry; 261 if (cbDirEntry < (unsigned)RT_OFFSETOF(RTDIRENTRY, szName[2]))261 if (cbDirEntry < RT_UOFFSETOF(RTDIRENTRY, szName[2])) 262 262 { 263 263 AssertMsgFailed(("Invalid *pcbDirEntry=%d (min %d)\n", *pcbDirEntry, RT_OFFSETOF(RTDIRENTRY, szName[2]))); … … 336 336 337 337 338 RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, unsigned*pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs)338 RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs) 339 339 { 340 340 /* … … 357 357 return VERR_INVALID_PARAMETER; 358 358 } 359 unsignedcbDirEntry = sizeof(*pDirEntry);359 size_t cbDirEntry = sizeof(*pDirEntry); 360 360 if (pcbDirEntry) 361 361 { 362 362 cbDirEntry = *pcbDirEntry; 363 if (cbDirEntry < (unsigned)RT_OFFSETOF(RTDIRENTRYEX, szName[2]))363 if (cbDirEntry < RT_UOFFSETOF(RTDIRENTRYEX, szName[2])) 364 364 { 365 365 AssertMsgFailed(("Invalid *pcbDirEntry=%d (min %d)\n", *pcbDirEntry, RT_OFFSETOF(RTDIRENTRYEX, szName[2])));
Note:
See TracChangeset
for help on using the changeset viewer.