Changeset 37024 in vbox
- Timestamp:
- May 10, 2011 11:23:44 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/dvm.h
r36816 r37024 71 71 /** Volume hosts a Solaris volume. */ 72 72 RTDVMVOLTYPE_SOLARIS, 73 /** End of the valid values. */ 74 RTDVMVOLTYPE_END, 73 75 /** Usual 32bit hack. */ 74 76 RTDVMVOLTYPE_32BIT_HACK = 0x7fffffff -
trunk/src/VBox/Runtime/Makefile.kmk
r36817 r37024 2296 2296 -e '/^g_enmProcessPriority/d'\ 2297 2297 -e '/^g_hDbgModStrCache/d'\ 2298 -e '/^g_DvmFmtGpt/d'\2299 -e '/^g_DvmFmtMbr/d'\2300 2298 \ 2301 2299 -e '/^RTDBusLoadLib/d' \ -
trunk/src/VBox/Runtime/common/dvm/dvm.cpp
r36868 r37024 25 25 */ 26 26 27 28 /******************************************************************************* 29 * Header Files * 30 *******************************************************************************/ 27 31 #include <iprt/types.h> 28 32 #include <iprt/assert.h> … … 77 81 * Global variables * 78 82 *******************************************************************************/ 79 extern RTDVMFMTOPS g_ DvmFmtMbr;80 extern RTDVMFMTOPS g_ DvmFmtGpt;83 extern RTDVMFMTOPS g_rtDvmFmtMbr; 84 extern RTDVMFMTOPS g_rtDvmFmtGpt; 81 85 82 86 /** … … 85 89 static PCRTDVMFMTOPS g_aDvmFmts[] = 86 90 { 87 &g_ DvmFmtMbr,88 &g_ DvmFmtGpt91 &g_rtDvmFmtMbr, 92 &g_rtDvmFmtGpt 89 93 }; 90 94 91 95 /** 92 96 * Descriptions of the volume types. 97 * 98 * This is indexed by RTDVMVOLTYPE. 93 99 */ 94 100 static const char * g_apcszDvmVolTypes[] = … … 468 474 RTDECL(const char *) RTDvmVolumeTypeGetDescr(RTDVMVOLTYPE enmVolType) 469 475 { 470 AssertReturn(enmVolType >= RTDVMVOLTYPE_INVALID && enmVolType < RTDVMVOLTYPE_ 32BIT_HACK, NULL);476 AssertReturn(enmVolType >= RTDVMVOLTYPE_INVALID && enmVolType < RTDVMVOLTYPE_END, NULL); 471 477 472 478 return g_apcszDvmVolTypes[enmVolType]; -
trunk/src/VBox/Runtime/common/dvm/dvmgpt.cpp
r36868 r37024 25 25 */ 26 26 27 28 /******************************************************************************* 29 * Header Files * 30 *******************************************************************************/ 27 31 #include <iprt/types.h> 28 32 #include <iprt/assert.h> … … 33 37 #include "internal/dvm.h" 34 38 39 40 /******************************************************************************* 41 * Structures and Typedefs * 42 *******************************************************************************/ 35 43 /** The GPT signature. */ 36 44 #define RTDVM_GPT_SIGNATURE "EFI PART" … … 178 186 #define RTDVM_GPT_BYTE2LBA(lba, disk) ((lba) / (disk)->cbSector) 179 187 188 189 /******************************************************************************* 190 * Global Variables * 191 *******************************************************************************/ 180 192 /** 181 193 * Mapping of partition types to DVM volume types. … … 216 228 }; 217 229 218 DECLCALLBACK(int) dvmFmtGptProbe(PCRTDVMDISK pDisk, uint32_t *puScore)230 static DECLCALLBACK(int) rtDvmFmtGptProbe(PCRTDVMDISK pDisk, uint32_t *puScore) 219 231 { 220 232 int rc = VINF_SUCCESS; … … 223 235 *puScore = RTDVM_MATCH_SCORE_UNSUPPORTED; 224 236 225 if ( dvmDiskGetSectors(pDisk) >= 2)237 if (rtDvmDiskGetSectors(pDisk) >= 2) 226 238 { 227 239 /* Read from the disk and check for the signature. */ 228 rc = dvmDiskRead(pDisk, RTDVM_GPT_LBA2BYTE(1, pDisk), &Hdr, sizeof(GptHdr));240 rc = rtDvmDiskRead(pDisk, RTDVM_GPT_LBA2BYTE(1, pDisk), &Hdr, sizeof(GptHdr)); 229 241 if ( RT_SUCCESS(rc) 230 242 && !strncmp(&Hdr.abSignature[0], RTDVM_GPT_SIGNATURE, RT_ELEMENTS(Hdr.abSignature)) … … 237 249 } 238 250 239 DECLCALLBACK(int) dvmFmtGptOpen(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)251 static DECLCALLBACK(int) rtDvmFmtGptOpen(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt) 240 252 { 241 253 int rc = VINF_SUCCESS; … … 249 261 250 262 /* Read the complete GPT header and convert to host endianess. */ 251 rc = dvmDiskRead(pDisk, RTDVM_GPT_LBA2BYTE(1, pDisk), &pThis->HdrRev1, sizeof(pThis->HdrRev1));263 rc = rtDvmDiskRead(pDisk, RTDVM_GPT_LBA2BYTE(1, pDisk), &pThis->HdrRev1, sizeof(pThis->HdrRev1)); 252 264 if (RT_SUCCESS(rc)) 253 265 { … … 270 282 if (VALID_PTR(pThis->paGptEntries)) 271 283 { 272 rc = dvmDiskRead(pDisk, RTDVM_GPT_LBA2BYTE(pThis->HdrRev1.u64LbaPartitionEntries, pDisk),284 rc = rtDvmDiskRead(pDisk, RTDVM_GPT_LBA2BYTE(pThis->HdrRev1.u64LbaPartitionEntries, pDisk), 273 285 pThis->paGptEntries, pThis->HdrRev1.cPartitionEntries * pThis->HdrRev1.cbPartitionEntry); 274 286 if (RT_SUCCESS(rc)) … … 311 323 } 312 324 313 DECLCALLBACK(int) dvmFmtGptInitialize(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)325 static DECLCALLBACK(int) rtDvmFmtGptInitialize(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt) 314 326 { 315 327 return VERR_NOT_IMPLEMENTED; 316 328 } 317 329 318 DECLCALLBACK(void) dvmFmtGptClose(RTDVMFMT hVolMgrFmt)330 static DECLCALLBACK(void) rtDvmFmtGptClose(RTDVMFMT hVolMgrFmt) 319 331 { 320 332 PRTDVMFMTINTERNAL pThis = hVolMgrFmt; … … 328 340 } 329 341 330 DECLCALLBACK(uint32_t) dvmFmtGptGetValidVolumes(RTDVMFMT hVolMgrFmt)342 static DECLCALLBACK(uint32_t) rtDvmFmtGptGetValidVolumes(RTDVMFMT hVolMgrFmt) 331 343 { 332 344 PRTDVMFMTINTERNAL pThis = hVolMgrFmt; … … 335 347 } 336 348 337 DECLCALLBACK(uint32_t) dvmFmtGptGetMaxVolumes(RTDVMFMT hVolMgrFmt)349 static DECLCALLBACK(uint32_t) rtDvmFmtGptGetMaxVolumes(RTDVMFMT hVolMgrFmt) 338 350 { 339 351 PRTDVMFMTINTERNAL pThis = hVolMgrFmt; … … 351 363 * @param phVolFmt Where to store the volume data on success. 352 364 */ 353 static int dvmFmtMbrVolumeCreate(PRTDVMFMTINTERNAL pThis, PGptEntry pGptEntry,365 static int rtDvmFmtMbrVolumeCreate(PRTDVMFMTINTERNAL pThis, PGptEntry pGptEntry, 354 366 uint32_t idx, PRTDVMVOLUMEFMT phVolFmt) 355 367 { … … 373 385 } 374 386 375 DECLCALLBACK(int) dvmFmtGptQueryFirstVolume(RTDVMFMT hVolMgrFmt, PRTDVMVOLUMEFMT phVolFmt)387 static DECLCALLBACK(int) rtDvmFmtGptQueryFirstVolume(RTDVMFMT hVolMgrFmt, PRTDVMVOLUMEFMT phVolFmt) 376 388 { 377 389 int rc = VINF_SUCCESS; … … 387 399 if (!RTUuidIsNull(&pGptEntry->UuidType)) 388 400 { 389 rc = dvmFmtMbrVolumeCreate(pThis, pGptEntry, i, phVolFmt);401 rc = rtDvmFmtMbrVolumeCreate(pThis, pGptEntry, i, phVolFmt); 390 402 break; 391 403 } … … 399 411 } 400 412 401 DECLCALLBACK(int) dvmFmtGptQueryNextVolume(RTDVMFMT hVolMgrFmt, RTDVMVOLUMEFMT hVolFmt, PRTDVMVOLUMEFMT phVolFmtNext)413 static DECLCALLBACK(int) rtDvmFmtGptQueryNextVolume(RTDVMFMT hVolMgrFmt, RTDVMVOLUMEFMT hVolFmt, PRTDVMVOLUMEFMT phVolFmtNext) 402 414 { 403 415 int rc = VERR_DVM_MAP_NO_VOLUME; … … 410 422 if (!RTUuidIsNull(&pGptEntry->UuidType)) 411 423 { 412 rc = dvmFmtMbrVolumeCreate(pThis, pGptEntry, i, phVolFmtNext);424 rc = rtDvmFmtMbrVolumeCreate(pThis, pGptEntry, i, phVolFmtNext); 413 425 break; 414 426 } … … 419 431 } 420 432 421 DECLCALLBACK(void) dvmFmtGptVolumeClose(RTDVMVOLUMEFMT hVolFmt)433 static DECLCALLBACK(void) rtDvmFmtGptVolumeClose(RTDVMVOLUMEFMT hVolFmt) 422 434 { 423 435 PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt; … … 431 443 } 432 444 433 DECLCALLBACK(uint64_t) dvmFmtGptVolumeGetSize(RTDVMVOLUMEFMT hVolFmt)445 static DECLCALLBACK(uint64_t) rtDvmFmtGptVolumeGetSize(RTDVMVOLUMEFMT hVolFmt) 434 446 { 435 447 PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt; … … 438 450 } 439 451 440 DECLCALLBACK(int) dvmFmtGptVolumeQueryName(RTDVMVOLUMEFMT hVolFmt, char **ppszVolName)452 static DECLCALLBACK(int) rtDvmFmtGptVolumeQueryName(RTDVMVOLUMEFMT hVolFmt, char **ppszVolName) 441 453 { 442 454 PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt; … … 450 462 } 451 463 452 DECLCALLBACK(RTDVMVOLTYPE) dvmFmtGptVolumeGetType(RTDVMVOLUMEFMT hVolFmt)464 static DECLCALLBACK(RTDVMVOLTYPE) rtDvmFmtGptVolumeGetType(RTDVMVOLUMEFMT hVolFmt) 453 465 { 454 466 RTDVMVOLTYPE enmVolType = RTDVMVOLTYPE_UNKNOWN; … … 465 477 } 466 478 467 DECLCALLBACK(uint64_t) dvmFmtGptVolumeGetFlags(RTDVMVOLUMEFMT hVolFmt)479 static DECLCALLBACK(uint64_t) rtDvmFmtGptVolumeGetFlags(RTDVMVOLUMEFMT hVolFmt) 468 480 { 469 481 NOREF(hVolFmt); /* No supported flags for now. */ … … 471 483 } 472 484 473 DECLCALLBACK(int) dvmFmtGptVolumeRead(RTDVMVOLUMEFMT hVolFmt, uint64_t off, void *pvBuf, size_t cbRead)485 static DECLCALLBACK(int) rtDvmFmtGptVolumeRead(RTDVMVOLUMEFMT hVolFmt, uint64_t off, void *pvBuf, size_t cbRead) 474 486 { 475 487 PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt; 476 488 AssertReturn(off + cbRead <= pVol->cbVolume, VERR_INVALID_PARAMETER); 477 489 478 return dvmDiskRead(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbRead);479 } 480 481 DECLCALLBACK(int) dvmFmtGptVolumeWrite(RTDVMVOLUMEFMT hVolFmt, uint64_t off, const void *pvBuf, size_t cbWrite)490 return rtDvmDiskRead(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbRead); 491 } 492 493 static DECLCALLBACK(int) rtDvmFmtGptVolumeWrite(RTDVMVOLUMEFMT hVolFmt, uint64_t off, const void *pvBuf, size_t cbWrite) 482 494 { 483 495 PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt; 484 496 AssertReturn(off + cbWrite <= pVol->cbVolume, VERR_INVALID_PARAMETER); 485 497 486 return dvmDiskWrite(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbWrite);487 } 488 489 RTDVMFMTOPS g_ DvmFmtGpt =498 return rtDvmDiskWrite(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbWrite); 499 } 500 501 RTDVMFMTOPS g_rtDvmFmtGpt = 490 502 { 491 503 /* pcszFmt */ 492 504 "GPT", 493 505 /* pfnProbe */ 494 dvmFmtGptProbe,506 rtDvmFmtGptProbe, 495 507 /* pfnOpen */ 496 dvmFmtGptOpen,508 rtDvmFmtGptOpen, 497 509 /* pfnInitialize */ 498 dvmFmtGptInitialize,510 rtDvmFmtGptInitialize, 499 511 /* pfnClose */ 500 dvmFmtGptClose,512 rtDvmFmtGptClose, 501 513 /* pfnGetValidVolumes */ 502 dvmFmtGptGetValidVolumes,514 rtDvmFmtGptGetValidVolumes, 503 515 /* pfnGetMaxVolumes */ 504 dvmFmtGptGetMaxVolumes,516 rtDvmFmtGptGetMaxVolumes, 505 517 /* pfnQueryFirstVolume */ 506 dvmFmtGptQueryFirstVolume,518 rtDvmFmtGptQueryFirstVolume, 507 519 /* pfnQueryNextVolume */ 508 dvmFmtGptQueryNextVolume,520 rtDvmFmtGptQueryNextVolume, 509 521 /* pfnVolumeClose */ 510 dvmFmtGptVolumeClose,522 rtDvmFmtGptVolumeClose, 511 523 /* pfnVolumeGetSize */ 512 dvmFmtGptVolumeGetSize,524 rtDvmFmtGptVolumeGetSize, 513 525 /* pfnVolumeQueryName */ 514 dvmFmtGptVolumeQueryName,526 rtDvmFmtGptVolumeQueryName, 515 527 /* pfnVolumeGetType */ 516 dvmFmtGptVolumeGetType,528 rtDvmFmtGptVolumeGetType, 517 529 /* pfnVolumeGetFlags */ 518 dvmFmtGptVolumeGetFlags,530 rtDvmFmtGptVolumeGetFlags, 519 531 /* pfnVolumeRead */ 520 dvmFmtGptVolumeRead,532 rtDvmFmtGptVolumeRead, 521 533 /* pfnVolumeWrite */ 522 dvmFmtGptVolumeWrite534 rtDvmFmtGptVolumeWrite 523 535 }; 524 536 -
trunk/src/VBox/Runtime/common/dvm/dvmmbr.cpp
r37023 r37024 89 89 typedef RTDVMMBRFS2VOLTYPE *PRTDVMMBRFS2VOLTYPE; 90 90 91 92 /******************************************************************************* 93 * Global Variables * 94 *******************************************************************************/ 91 95 /** 92 96 * Mapping of FS types to DVM volume types. … … 111 115 }; 112 116 113 DECLCALLBACK(int) dvmFmtMbrProbe(PCRTDVMDISK pDisk, uint32_t *puScore)117 static DECLCALLBACK(int) rtDvmFmtMbrProbe(PCRTDVMDISK pDisk, uint32_t *puScore) 114 118 { 115 119 int rc = VINF_SUCCESS; … … 121 125 { 122 126 /* Read from the disk and check for the 0x55aa signature at the end. */ 123 rc = dvmDiskRead(pDisk, 0, &abMbr[0], sizeof(abMbr));127 rc = rtDvmDiskRead(pDisk, 0, &abMbr[0], sizeof(abMbr)); 124 128 if ( RT_SUCCESS(rc) 125 129 && abMbr[510] == 0x55 … … 131 135 } 132 136 133 DECLCALLBACK(int) dvmFmtMbrOpen(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)137 static DECLCALLBACK(int) rtDvmFmtMbrOpen(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt) 134 138 { 135 139 int rc = VINF_SUCCESS; … … 143 147 144 148 /* Read the MBR and count the valid partition entries. */ 145 rc = dvmDiskRead(pDisk, 0, &pThis->abMbr[0], sizeof(pThis->abMbr));149 rc = rtDvmDiskRead(pDisk, 0, &pThis->abMbr[0], sizeof(pThis->abMbr)); 146 150 if (RT_SUCCESS(rc)) 147 151 { … … 168 172 } 169 173 170 DECLCALLBACK(int) dvmFmtMbrInitialize(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)174 static DECLCALLBACK(int) rtDvmFmtMbrInitialize(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt) 171 175 { 172 176 int rc = VINF_SUCCESS; … … 181 185 pThis->abMbr[511] = 0xaa; 182 186 183 rc = dvmDiskWrite(pDisk, 0, &pThis->abMbr[0], sizeof(pThis->abMbr));187 rc = rtDvmDiskWrite(pDisk, 0, &pThis->abMbr[0], sizeof(pThis->abMbr)); 184 188 185 189 if (RT_SUCCESS(rc)) … … 198 202 } 199 203 200 DECLCALLBACK(void) dvmFmtMbrClose(RTDVMFMT hVolMgrFmt)204 static DECLCALLBACK(void) rtDvmFmtMbrClose(RTDVMFMT hVolMgrFmt) 201 205 { 202 206 PRTDVMFMTINTERNAL pThis = hVolMgrFmt; … … 208 212 } 209 213 210 DECLCALLBACK(uint32_t) dvmFmtMbrGetValidVolumes(RTDVMFMT hVolMgrFmt)214 static DECLCALLBACK(uint32_t) rtDvmFmtMbrGetValidVolumes(RTDVMFMT hVolMgrFmt) 211 215 { 212 216 PRTDVMFMTINTERNAL pThis = hVolMgrFmt; … … 215 219 } 216 220 217 DECLCALLBACK(uint32_t) dvmFmtMbrGetMaxVolumes(RTDVMFMT hVolMgrFmt)221 static DECLCALLBACK(uint32_t) rtDvmFmtMbrGetMaxVolumes(RTDVMFMT hVolMgrFmt) 218 222 { 219 223 NOREF(hVolMgrFmt); … … 230 234 * @param phVolFmt Where to store the volume data on success. 231 235 */ 232 static int dvmFmtMbrVolumeCreate(PRTDVMFMTINTERNAL pThis, uint8_t *pbMbrEntry,236 static int rtDvmFmtMbrVolumeCreate(PRTDVMFMTINTERNAL pThis, uint8_t *pbMbrEntry, 233 237 uint32_t idx, PRTDVMVOLUMEFMT phVolFmt) 234 238 { … … 252 256 } 253 257 254 DECLCALLBACK(int) dvmFmtMbrQueryFirstVolume(RTDVMFMT hVolMgrFmt, PRTDVMVOLUMEFMT phVolFmt)258 static DECLCALLBACK(int) rtDvmFmtMbrQueryFirstVolume(RTDVMFMT hVolMgrFmt, PRTDVMVOLUMEFMT phVolFmt) 255 259 { 256 260 int rc = VINF_SUCCESS; … … 266 270 if (pbMbrEntry[0x04] != 0x00) 267 271 { 268 rc = dvmFmtMbrVolumeCreate(pThis, pbMbrEntry, i, phVolFmt);272 rc = rtDvmFmtMbrVolumeCreate(pThis, pbMbrEntry, i, phVolFmt); 269 273 break; 270 274 } … … 278 282 } 279 283 280 DECLCALLBACK(int) dvmFmtMbrQueryNextVolume(RTDVMFMT hVolMgrFmt, RTDVMVOLUMEFMT hVolFmt, PRTDVMVOLUMEFMT phVolFmtNext)284 static DECLCALLBACK(int) rtDvmFmtMbrQueryNextVolume(RTDVMFMT hVolMgrFmt, RTDVMVOLUMEFMT hVolFmt, PRTDVMVOLUMEFMT phVolFmtNext) 281 285 { 282 286 int rc = VERR_DVM_MAP_NO_VOLUME; … … 289 293 if (pbMbrEntry[0x04] != 0x00) 290 294 { 291 rc = dvmFmtMbrVolumeCreate(pThis, pbMbrEntry, i, phVolFmtNext);295 rc = rtDvmFmtMbrVolumeCreate(pThis, pbMbrEntry, i, phVolFmtNext); 292 296 break; 293 297 } … … 298 302 } 299 303 300 DECLCALLBACK(void) dvmFmtMbrVolumeClose(RTDVMVOLUMEFMT hVolFmt)304 static DECLCALLBACK(void) rtDvmFmtMbrVolumeClose(RTDVMVOLUMEFMT hVolFmt) 301 305 { 302 306 PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt; … … 310 314 } 311 315 312 DECLCALLBACK(uint64_t) dvmFmtMbrVolumeGetSize(RTDVMVOLUMEFMT hVolFmt)316 static DECLCALLBACK(uint64_t) rtDvmFmtMbrVolumeGetSize(RTDVMVOLUMEFMT hVolFmt) 313 317 { 314 318 PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt; … … 317 321 } 318 322 319 DECLCALLBACK(int) dvmFmtMbrVolumeQueryName(RTDVMVOLUMEFMT hVolFmt, char **ppszVolName)323 static DECLCALLBACK(int) rtDvmFmtMbrVolumeQueryName(RTDVMVOLUMEFMT hVolFmt, char **ppszVolName) 320 324 { 321 325 NOREF(hVolFmt); … … 323 327 } 324 328 325 DECLCALLBACK(RTDVMVOLTYPE) dvmFmtMbrVolumeGetType(RTDVMVOLUMEFMT hVolFmt)329 static DECLCALLBACK(RTDVMVOLTYPE) rtDvmFmtMbrVolumeGetType(RTDVMVOLUMEFMT hVolFmt) 326 330 { 327 331 RTDVMVOLTYPE enmVolType = RTDVMVOLTYPE_UNKNOWN; … … 338 342 } 339 343 340 DECLCALLBACK(uint64_t) dvmFmtMbrVolumeGetFlags(RTDVMVOLUMEFMT hVolFmt)344 static DECLCALLBACK(uint64_t) rtDvmFmtMbrVolumeGetFlags(RTDVMVOLUMEFMT hVolFmt) 341 345 { 342 346 uint64_t fFlags = 0; … … 349 353 } 350 354 351 DECLCALLBACK(int) dvmFmtMbrVolumeRead(RTDVMVOLUMEFMT hVolFmt, uint64_t off, void *pvBuf, size_t cbRead)355 static DECLCALLBACK(int) rtDvmFmtMbrVolumeRead(RTDVMVOLUMEFMT hVolFmt, uint64_t off, void *pvBuf, size_t cbRead) 352 356 { 353 357 PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt; 354 358 AssertReturn(off + cbRead <= pVol->cbVolume, VERR_INVALID_PARAMETER); 355 359 356 return dvmDiskRead(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbRead);357 } 358 359 DECLCALLBACK(int) dvmFmtMbrVolumeWrite(RTDVMVOLUMEFMT hVolFmt, uint64_t off, const void *pvBuf, size_t cbWrite)360 return rtDvmDiskRead(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbRead); 361 } 362 363 static DECLCALLBACK(int) rtDvmFmtMbrVolumeWrite(RTDVMVOLUMEFMT hVolFmt, uint64_t off, const void *pvBuf, size_t cbWrite) 360 364 { 361 365 PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt; 362 366 AssertReturn(off + cbWrite <= pVol->cbVolume, VERR_INVALID_PARAMETER); 363 367 364 return dvmDiskWrite(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbWrite);365 } 366 367 RTDVMFMTOPS g_ DvmFmtMbr =368 return rtDvmDiskWrite(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbWrite); 369 } 370 371 RTDVMFMTOPS g_rtDvmFmtMbr = 368 372 { 369 373 /* pcszFmt */ 370 374 "MBR", 371 375 /* pfnProbe */ 372 dvmFmtMbrProbe,376 rtDvmFmtMbrProbe, 373 377 /* pfnOpen */ 374 dvmFmtMbrOpen,378 rtDvmFmtMbrOpen, 375 379 /* pfnInitialize */ 376 dvmFmtMbrInitialize,380 rtDvmFmtMbrInitialize, 377 381 /* pfnClose */ 378 dvmFmtMbrClose,382 rtDvmFmtMbrClose, 379 383 /* pfnGetValidVolumes */ 380 dvmFmtMbrGetValidVolumes,384 rtDvmFmtMbrGetValidVolumes, 381 385 /* pfnGetMaxVolumes */ 382 dvmFmtMbrGetMaxVolumes,386 rtDvmFmtMbrGetMaxVolumes, 383 387 /* pfnQueryFirstVolume */ 384 dvmFmtMbrQueryFirstVolume,388 rtDvmFmtMbrQueryFirstVolume, 385 389 /* pfnQueryNextVolume */ 386 dvmFmtMbrQueryNextVolume,390 rtDvmFmtMbrQueryNextVolume, 387 391 /* pfnVolumeClose */ 388 dvmFmtMbrVolumeClose,392 rtDvmFmtMbrVolumeClose, 389 393 /* pfnVolumeGetSize */ 390 dvmFmtMbrVolumeGetSize,394 rtDvmFmtMbrVolumeGetSize, 391 395 /* pfnVolumeQueryName */ 392 dvmFmtMbrVolumeQueryName,396 rtDvmFmtMbrVolumeQueryName, 393 397 /* pfnVolumeGetType */ 394 dvmFmtMbrVolumeGetType,398 rtDvmFmtMbrVolumeGetType, 395 399 /* pfnVolumeGetFlags */ 396 dvmFmtMbrVolumeGetFlags,400 rtDvmFmtMbrVolumeGetFlags, 397 401 /* pfnVolumeRead */ 398 dvmFmtMbrVolumeRead,402 rtDvmFmtMbrVolumeRead, 399 403 /* pfnVolumeWrite */ 400 dvmFmtMbrVolumeWrite404 rtDvmFmtMbrVolumeWrite 401 405 }; 402 406 -
trunk/src/VBox/Runtime/include/internal/dvm.h
r36816 r37024 233 233 * @param pDisk The disk descriptor. 234 234 */ 235 DECLINLINE(uint64_t) dvmDiskGetSectors(PCRTDVMDISK pDisk)235 DECLINLINE(uint64_t) rtDvmDiskGetSectors(PCRTDVMDISK pDisk) 236 236 { 237 237 return pDisk->cbDisk / pDisk->cbSector; … … 247 247 * @param cbRead How much to read. 248 248 */ 249 DECLINLINE(int) dvmDiskRead(PCRTDVMDISK pDisk, uint64_t off, void *pvBuf, size_t cbRead)249 DECLINLINE(int) rtDvmDiskRead(PCRTDVMDISK pDisk, uint64_t off, void *pvBuf, size_t cbRead) 250 250 { 251 251 AssertPtrReturn(pDisk, VERR_INVALID_POINTER); … … 266 266 * @param cbWrite How much to write. 267 267 */ 268 DECLINLINE(int) dvmDiskWrite(PCRTDVMDISK pDisk, uint64_t off, const void *pvBuf, size_t cbWrite)268 DECLINLINE(int) rtDvmDiskWrite(PCRTDVMDISK pDisk, uint64_t off, const void *pvBuf, size_t cbWrite) 269 269 { 270 270 AssertPtrReturn(pDisk, VERR_INVALID_POINTER);
Note:
See TracChangeset
for help on using the changeset viewer.