dvm.h revision e52b0dfe3d9ead70e24f2ce4ed3faa6c79c00618
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/** @file
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * IPRT Disk Volume Management API (DVM).
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/*
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * Copyright (C) 2011 Oracle Corporation
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end *
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * This file is part of VirtualBox Open Source Edition (OSE), as
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * available from http://www.virtualbox.org. This file is free software;
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * you can redistribute it and/or modify it under the terms of the GNU
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * General Public License (GPL) as published by the Free Software
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * Foundation, in version 2 as it comes in the "COPYING" file of the
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end *
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * The contents of this file may alternatively be used under the terms
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * of the Common Development and Distribution License Version 1.0
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * VirtualBox OSE distribution, in which case the provisions of the
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * CDDL are applicable instead of those of the GPL.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end *
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * You may elect to license modified versions of this file under the
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * terms and conditions of either the GPL or the CDDL or both.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end#ifndef ___iprt_dvm_h
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end#define ___iprt_dvm_h
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end#include <iprt/types.h>
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1endRT_C_DECLS_BEGIN
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/** @defgroup grp_dvm IPRT Disk Volume Management
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @{
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/**
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * Volume type.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * Comparable to the FS type in MBR partition maps
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * or the partition type GUIDs in GPT tables.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1endtypedef enum RTDVMVOLTYPE
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end{
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashi /** Invalid. */
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashi RTDVMVOLTYPE_INVALID = 0,
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony /** Unknown. */
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony RTDVMVOLTYPE_UNKNOWN,
80eed96ee3d8cfa0b66d9fb1cfe63fd83254d38bnilgun /** Volume hosts a NTFS filesystem. */
80eed96ee3d8cfa0b66d9fb1cfe63fd83254d38bnilgun RTDVMVOLTYPE_NTFS,
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end /** Volume hosts a FAT16 filesystem. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end RTDVMVOLTYPE_FAT16,
e1e8390280254f7f0580d701e583f670643d4f3fnilgun /** Volume hosts a FAT32 filesystem. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end RTDVMVOLTYPE_FAT32,
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end /** Volume hosts a Linux swap. */
e1e8390280254f7f0580d701e583f670643d4f3fnilgun RTDVMVOLTYPE_LINUX_SWAP,
e1e8390280254f7f0580d701e583f670643d4f3fnilgun /** Volume hosts a Linux filesystem. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end RTDVMVOLTYPE_LINUX_NATIVE,
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end /** Volume hosts a Linux LVM. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end RTDVMVOLTYPE_LINUX_LVM,
08cf4a15275e4cb65a424b3a1db5410bfb51085cjim /** Volume hosts a Linux SoftRaid. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end RTDVMVOLTYPE_LINUX_SOFTRAID,
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end /** Volume hosts a FreeBSD disklabel. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end RTDVMVOLTYPE_FREEBSD,
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end /** Volume hosts a NetBSD disklabel. */
1ac39787115a288f5e848344b1b1e8dccb1c58f1nd RTDVMVOLTYPE_NETBSD,
1ac39787115a288f5e848344b1b1e8dccb1c58f1nd /** Volume hosts a OpenBSD disklabel. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end RTDVMVOLTYPE_OPENBSD,
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end /** Volume hosts a Mac OS X HFS or HFS+ filesystem. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end RTDVMVOLTYPE_MAC_OSX_HFS,
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end /** Volume hosts a Solaris volume. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end RTDVMVOLTYPE_SOLARIS,
623eebe956d9c2d6d073ed3eae855b56030b40e9noodl /** Usual 32bit hack. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end RTDVMVOLTYPE_32BIT_HACK = 0x7fffffff
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end} RTDVMVOLTYPE;
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/** @defgroup grp_dvm_vol_flags Volume flags used by DVMVolumeGetFlags.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @{ */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/** Volume flags - Volume is bootable. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end#define DVMVOLUME_FLAGS_BOOTABLE RT_BIT_64(0)
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/** Volume flags - Volume is active. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end#define DVMVOLUME_FLAGS_ACTIVE RT_BIT_64(1)
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/** @} */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/** A handle to a volume manager. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1endtypedef struct RTDVMINTERNAL *RTDVM;
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/** A pointer to a volume manager handle. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1endtypedef RTDVM *PRTDVM;
f3ec420152ca921e4c1ce77782f51b53f659018dnd/** NIL volume manager handle. */
f3ec420152ca921e4c1ce77782f51b53f659018dnd#define NIL_RTDVM ((RTDVM)~0)
08cf4a15275e4cb65a424b3a1db5410bfb51085cjim
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/** A handle to a volume in a volume map. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1endtypedef struct RTDVMVOLUMEINTERNAL *RTDVMVOLUME;
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/** A pointer to a volume handle. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1endtypedef RTDVMVOLUME *PRTDVMVOLUME;
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/** NIL volume handle. */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end#define NIL_RTDVMVOLUME ((RTDVMVOLUME)~0)
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/**
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * Callback to read data from the underlying medium.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end *
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @returns IPRT status code.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param pvUser Opaque user data passed on creation.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param off Offset to start reading from.
1ac39787115a288f5e848344b1b1e8dccb1c58f1nd * @param pvBuf Where to store the read data.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param cbRead How many bytes to read.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1endtypedef DECLCALLBACK(int) FNDVMREAD(void *pvUser, uint64_t off, void *pvBuf, size_t cbRead);
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/** Pointer to a read callback. */
f3ec420152ca921e4c1ce77782f51b53f659018dndtypedef FNDVMREAD *PFNDVMREAD;
f3ec420152ca921e4c1ce77782f51b53f659018dnd
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/**
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * Callback to write data to the underlying medium.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end *
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @returns IPRT status code.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param pvUser Opaque user data passed on creation.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param off Offset to start writing to.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param pvBuf The data to write.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param cbRead How many bytes to write.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1endtypedef DECLCALLBACK(int) FNDVMWRITE(void *pvUser, uint64_t off, const void *pvBuf, size_t cbWrite);
d0828c8a321dc5e9ea60550f052294669c08cf93jim/** Pointer to a read callback. */
d0828c8a321dc5e9ea60550f052294669c08cf93jimtypedef FNDVMWRITE *PFNDVMWRITE;
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/**
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * Create a new volume manager.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end *
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @returns IPRT status.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param phVolMgr Where to store the handle to the volume manager on
2704de98885368683621b01c8f8f4e4b01557611takashi * success.
2704de98885368683621b01c8f8f4e4b01557611takashi * @param pfnRead Read callback for the underlying
2704de98885368683621b01c8f8f4e4b01557611takashi * disk/container/whatever.
d0828c8a321dc5e9ea60550f052294669c08cf93jim * @param pfnWrite Write callback for the underlying
2704de98885368683621b01c8f8f4e4b01557611takashi * disk/container/whatever.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param cbDisk Size of the underlying disk in bytes.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi * @param cbSector Size of one sector in bytes.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi * @param pvUser Opaque user data passed to the callbacks.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi */
1d980e5489836e977ba59b419e27b0ec875c4bd3takashiRTDECL(int) RTDvmCreate(PRTDVM phVolMgr, PFNDVMREAD pfnRead,
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi PFNDVMWRITE pfnWrite, uint64_t cbDisk,
cd6c8de3bedcc401ee230159b0439fa20f44488etakashi uint64_t cbSector, void *pvUser);
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/**
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * Retain a given volume manager.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end *
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @returns New reference count on success, UINT32_MAX on failure.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param hVolMgr The volume manager to retain.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end */
d87bca6b7382e9f3648aec4fb3419b225c39ee41jimRTDECL(uint32_t) RTDvmRetain(RTDVM hVolMgr);
d87bca6b7382e9f3648aec4fb3419b225c39ee41jim
27d778df0b517e1578f907d2e51eb961cd8ee5fbjim/**
27d778df0b517e1578f907d2e51eb961cd8ee5fbjim * Releases a given volume manager.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end *
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @returns New reference count on success (0 if closed), UINT32_MAX on failure.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param hVolMgr The volume manager to release.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1endRTDECL(uint32_t) RTDvmRelease(RTDVM hVolMgr);
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi/**
604c89126c27104f659d7a51b0113e3bd435faf8fielding * Probes the underyling disk for the best volume manager format handler
50cb7e2b30597f481fee57bac945190f06ebcc58jorton * and opens it.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end *
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @returns IPRT status code.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @retval VERR_NOT_FOUND if no backend can handle the volume map on the disk.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param hVolMgr The volume manager handle.
0a69d9bb491d9810892a9949c01403a1de3c7ac2nd */
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashiRTDECL(int) RTDvmMapOpen(RTDVM hVolMgr);
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashi
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/**
50cb7e2b30597f481fee57bac945190f06ebcc58jorton * Initializes a new volume map using the given format handler.
79b024b81f6bb3c44dce77a7552191daf8b522d2jim *
f772e8f448c223e5ea306f1bf92d97d968f972d5jim * @returns IPRT status code.
f772e8f448c223e5ea306f1bf92d97d968f972d5jim * @param hVolMgr The volume manager handle.
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony * @param pszFmt The format to use for the new map.
f3ec420152ca921e4c1ce77782f51b53f659018dnd */
d87bca6b7382e9f3648aec4fb3419b225c39ee41jimRTDECL(int) RTDvmMapInitialize(RTDVM hVolMgr, const char *pszFmt);
d87bca6b7382e9f3648aec4fb3419b225c39ee41jim
f3ec420152ca921e4c1ce77782f51b53f659018dnd/**
f3ec420152ca921e4c1ce77782f51b53f659018dnd * Gets the currently used format of the disk map.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end *
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @returns Name of the format.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param hVolMgr The volume manager handle.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1endRTDECL(const char *) RTDvmMapGetFormat(RTDVM hVolMgr);
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/**
e1e8390280254f7f0580d701e583f670643d4f3fnilgun * Gets the number of valid partitions in the map.
e1e8390280254f7f0580d701e583f670643d4f3fnilgun *
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @returns The number of valid volumes in the map or UINT32_MAX on failure.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param hVolMgr The volume manager handle.
987153b0772b889900365647b5afb962b80b4439nilgun */
e1e8390280254f7f0580d701e583f670643d4f3fnilgunRTDECL(uint32_t) RTDvmMapGetValidVolumes(RTDVM hVolMgr);
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/**
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * Gets the maximum number of partitions the map can hold.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end *
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi * @returns The maximum number of volumes in the map or UINT32_MAX on failure.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param hVolMgr The volume manager handle.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end */
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1endRTDECL(uint32_t) RTDvmMapGetMaxVolumes(RTDVM hVolMgr);
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end/**
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * Get the first valid volume from a map.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end *
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @returns IPRT status code.
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * @param hVolMgr The volume manager handle.
b036ef2952fb6924b308f954b39786443460ddc6rpluem * @param phVol Where to store the handle to the first volume on
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end * success. Release with RTDvmVolumeRelease().
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end */
RTDECL(int) RTDvmMapQueryFirstVolume(RTDVM hVolMgr, PRTDVMVOLUME phVol);
/**
* Get the first valid volume from a map.
*
* @returns IPRT status code.
* @param hVolMgr The volume manager handle.
* @param hVol Handle of the current volume.
* @param phVolNext Where to store the handle to the next volume on
* success. Release with RTDvmVolumeRelease().
*/
RTDECL(int) RTDvmMapQueryNextVolume(RTDVM hVolMgr, RTDVMVOLUME hVol, PRTDVMVOLUME phVolNext);
/**
* Retains a valid volume handle.
*
* @returns New reference count on success, UINT32_MAX on failure.
* @param hVol The volume to retain.
*/
RTDECL(uint32_t) RTDvmVolumeRetain(RTDVMVOLUME hVol);
/**
* Releases a valid volume handle.
*
* @returns New reference count on success (0 if closed), UINT32_MAX on failure.
* @param hVol The volume to release.
*/
RTDECL(uint32_t) RTDvmVolumeRelease(RTDVMVOLUME hVol);
/**
* Get the size of a volume in bytes.
*
* @returns Size of the volume in bytes or 0 on failure.
* @param hVol The volume handle.
*/
RTDECL(uint64_t) RTDvmVolumeGetSize(RTDVMVOLUME hVol);
/**
* Gets the name of the volume if supported.
*
* @returns VBox status code.
* @param hVol The volume handle.
* @param ppszVolName Where to store the name of the volume on success.
* The string must be freed with RTStrFree().
*/
RTDECL(int) RTDvmVolumeQueryName(RTDVMVOLUME hVol, char **ppszVolName);
/**
* Get the volume type of the volume if supported.
*
* @returns The volume type on success, DVMVOLTYPE_INVALID if hVol is invalid.
* @param hVol The volume handle.
*/
RTDECL(RTDVMVOLTYPE) RTDvmVolumeGetType(RTDVMVOLUME hVol);
/**
* Get the volume flags of the volume if supported.
*
* @returns The volume flags or UINT64_MAX on failure.
* @param hVol The volume handle.
*/
RTDECL(uint64_t) RTDvmVolumeGetFlags(RTDVMVOLUME hVol);
/**
* Reads data from the given volume.
*
* @returns VBox status code.
* @param hVol The volume handle.
* @param off Where to start reading from - 0 is the beginning of
* the volume.
* @param pvBuf Where to store the read data.
* @param cbRead How many bytes to read.
*/
RTDECL(int) RTDvmVolumeRead(RTDVMVOLUME hVol, uint64_t off, void *pvBuf, size_t cbRead);
/**
* Writes data to the given volume.
*
* @returns VBox status code.
* @param hVol The volume handle.
* @param off Where to start writing to - 0 is the beginning of
* the volume.
* @param pvBuf The data to write.
* @param cbWrite How many bytes to write.
*/
RTDECL(int) RTDvmVolumeWrite(RTDVMVOLUME hVol, uint64_t off, const void *pvBuf, size_t cbWrite);
/**
* Returns the description of a given volume type.
*
* @returns The description of the type.
* @param enmVolType The volume type.
*/
RTDECL(const char *) RTDvmVolumeTypeGetDescr(RTDVMVOLTYPE enmVolType);
RT_C_DECLS_END
/** @} */
#endif