dvmmbr.cpp revision 68fb2428898c55a7172e6a75a0a8d7ce259919bd
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * IPRT Disk Volume Management API (DVM) - MBR format backend.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Copyright (C) 2011 Oracle Corporation
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * available from http://www.virtualbox.org. This file is free software;
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * you can redistribute it and/or modify it under the terms of the GNU
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * General Public License (GPL) as published by the Free Software
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * The contents of this file may alternatively be used under the terms
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * of the Common Development and Distribution License Version 1.0
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * VirtualBox OSE distribution, in which case the provisions of the
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * CDDL are applicable instead of those of the GPL.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * You may elect to license modified versions of this file under the
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * terms and conditions of either the GPL or the CDDL or both.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/*******************************************************************************
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync* Header Files *
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync*******************************************************************************/
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/*******************************************************************************
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync* Structures and Typedefs *
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync*******************************************************************************/
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync * MBR volume manager data.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** Pointer to the underlying disk. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** Number of initialized partitions. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** The raw MBR data. */
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync/** Pointer to the MBR volume manager. */
eb2d4958f7faf812c3bdb2d7587d815022f0bd55vboxsync * MBR volume data.
9055f61bb57d2a625c6434d55beac7565c3b3c0dvboxsync /** Pointer to the volume manager. */
typedef struct RTDVMMBRFS2VOLTYPE
{ 0x07, RTDVMVOLTYPE_NTFS }, /* Simplification: Used for HPFS, exFAT, ++, too but NTFS is the more common one. */
return rc;
return rc;
return rc;
PRTDVMVOLUMEFMTINTERNAL pVol = (PRTDVMVOLUMEFMTINTERNAL)RTMemAllocZ(sizeof(RTDVMVOLUMEFMTINTERNAL));
return rc;
return rc;
static DECLCALLBACK(int) rtDvmFmtMbrQueryNextVolume(RTDVMFMT hVolMgrFmt, RTDVMVOLUMEFMT hVolFmt, PRTDVMVOLUMEFMT phVolFmtNext)
return rc;
return VERR_NOT_SUPPORTED;
return enmVolType;
return fFlags;
static DECLCALLBACK(int) rtDvmFmtMbrVolumeRead(RTDVMVOLUMEFMT hVolFmt, uint64_t off, void *pvBuf, size_t cbRead)
static DECLCALLBACK(int) rtDvmFmtMbrVolumeWrite(RTDVMVOLUMEFMT hVolFmt, uint64_t off, const void *pvBuf, size_t cbWrite)