DrvHostBase.cpp revision 44a5e7ac7dc670e0a1746082682109fb17e7b54b
46f059bea92bedbd395793702c73946ead235586vboxsync * VBox storage devices:
46f059bea92bedbd395793702c73946ead235586vboxsync * Host base drive access driver
46f059bea92bedbd395793702c73946ead235586vboxsync * Copyright (C) 2006-2007 innotek GmbH
46f059bea92bedbd395793702c73946ead235586vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
46f059bea92bedbd395793702c73946ead235586vboxsync * available from http://www.virtualbox.org. This file is free software;
46f059bea92bedbd395793702c73946ead235586vboxsync * you can redistribute it and/or modify it under the terms of the GNU
46f059bea92bedbd395793702c73946ead235586vboxsync * General Public License as published by the Free Software Foundation,
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * distribution. VirtualBox OSE is distributed in the hope that it will
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * be useful, but WITHOUT ANY WARRANTY of any kind.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync/*******************************************************************************
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync* Header Files *
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync*******************************************************************************/
46f059bea92bedbd395793702c73946ead235586vboxsync# include <IOKit/storage/IOStorageDeviceCharacteristics.h>
46f059bea92bedbd395793702c73946ead235586vboxsync# include <IOKit/scsi-commands/SCSICommandOperationCodes.h>
46f059bea92bedbd395793702c73946ead235586vboxsync /* Nothing special requires... yeah, right. */
46f059bea92bedbd395793702c73946ead235586vboxsynctypedef struct _IO_STATUS_BLOCK {
46f059bea92bedbd395793702c73946ead235586vboxsync} FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION;
46f059bea92bedbd395793702c73946ead235586vboxsync /*IN*/ FS_INFORMATION_CLASS FileSystemInformationClass );
46f059bea92bedbd395793702c73946ead235586vboxsync/* -=-=-=-=- IBlock -=-=-=-=- */
46f059bea92bedbd395793702c73946ead235586vboxsync/** @copydoc PDMIBLOCK::pfnRead */
46f059bea92bedbd395793702c73946ead235586vboxsyncstatic DECLCALLBACK(int) drvHostBaseRead(PPDMIBLOCK pInterface, uint64_t off, void *pvBuf, size_t cbRead)
46f059bea92bedbd395793702c73946ead235586vboxsync PDRVHOSTBASE pThis = PDMIBLOCK_2_DRVHOSTBASE(pInterface);
46f059bea92bedbd395793702c73946ead235586vboxsync LogFlow(("%s-%d: drvHostBaseRead: off=%#llx pvBuf=%p cbRead=%#x (%s)\n",
46f059bea92bedbd395793702c73946ead235586vboxsync pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, off, pvBuf, cbRead, pThis->pszDevice));
46f059bea92bedbd395793702c73946ead235586vboxsync * Check the state.
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync * Issue a READ(12) request.
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync AssertReturn(!(off % pThis->cbBlock), VERR_INVALID_PARAMETER);
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync AssertReturn(!(cbRead % pThis->cbBlock), VERR_INVALID_PARAMETER);
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync RT_BYTE4(LBA), RT_BYTE3(LBA), RT_BYTE2(LBA), RT_BYTE1(LBA),
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync RT_BYTE4(cBlocks), RT_BYTE3(cBlocks), RT_BYTE2(cBlocks), RT_BYTE1(cBlocks),
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync 0, 0, 0, 0, 0
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync rc = DRVHostBaseScsiCmd(pThis, abCmd, 12, PDMBLOCKTXDIR_FROM_DEVICE, pvBuf, &cbRead, NULL, 0, 0);
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync * Seek and read.
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync rc = RTFileSeek(pThis->FileDevice, off, RTFILE_SEEK_BEGIN, NULL);
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync rc = RTFileRead(pThis->FileDevice, pvBuf, cbRead, NULL);
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync Log2(("%s-%d: drvHostBaseRead: off=%#llx cbRead=%#x\n"
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync "%16.*Vhxd\n",
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, off, cbRead, cbRead, pvBuf));
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync Log(("%s-%d: drvHostBaseRead: RTFileRead(%d, %p, %#x) -> %Vrc (off=%#llx '%s')\n",
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, pThis->FileDevice,
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync Log(("%s-%d: drvHostBaseRead: RTFileSeek(%d,%#llx,) -> %Vrc\n", pThis->pDrvIns->pDrvReg->szDriverName,
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync pThis->pDrvIns->iInstance, pThis->FileDevice, off, rc));
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync LogFlow(("%s-%d: drvHostBaseRead: returns %Vrc\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, rc));
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync/** @copydoc PDMIBLOCK::pfnWrite */
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsyncstatic DECLCALLBACK(int) drvHostBaseWrite(PPDMIBLOCK pInterface, uint64_t off, const void *pvBuf, size_t cbWrite)
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync PDRVHOSTBASE pThis = PDMIBLOCK_2_DRVHOSTBASE(pInterface);
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync LogFlow(("%s-%d: drvHostBaseWrite: off=%#llx pvBuf=%p cbWrite=%#x (%s)\n",
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, off, pvBuf, cbWrite, pThis->pszDevice));
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync Log2(("%s-%d: drvHostBaseWrite: off=%#llx cbWrite=%#x\n"
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync "%16.*Vhxd\n",
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, off, cbWrite, cbWrite, pvBuf));
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync * Check the state.
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync /** @todo write support... */
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync * Seek and write.
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync rc = RTFileSeek(pThis->FileDevice, off, RTFILE_SEEK_BEGIN, NULL);
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync rc = RTFileWrite(pThis->FileDevice, pvBuf, cbWrite, NULL);
57134cc31d26d91192e87a4541b4f82fbdb2c297vboxsync Log(("%s-%d: drvHostBaseWrite: RTFileWrite(%d, %p, %#x) -> %Vrc (off=%#llx '%s')\n",
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, pThis->FileDevice,
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync Log(("%s-%d: drvHostBaseWrite: RTFileSeek(%d,%#llx,) -> %Vrc\n",
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, pThis->FileDevice, off, rc));
57134cc31d26d91192e87a4541b4f82fbdb2c297vboxsync LogFlow(("%s-%d: drvHostBaseWrite: returns %Vrc\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, rc));
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync/** @copydoc PDMIBLOCK::pfnFlush */
57134cc31d26d91192e87a4541b4f82fbdb2c297vboxsyncstatic DECLCALLBACK(int) drvHostBaseFlush(PPDMIBLOCK pInterface)
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync PDRVHOSTBASE pThis = PDMIBLOCK_2_DRVHOSTBASE(pInterface);
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, pThis->pszDevice));
46f059bea92bedbd395793702c73946ead235586vboxsync /** @todo scsi device buffer flush... */
46f059bea92bedbd395793702c73946ead235586vboxsync LogFlow(("%s-%d: drvHostBaseFlush: returns %Vrc\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, rc));
46f059bea92bedbd395793702c73946ead235586vboxsync/** @copydoc PDMIBLOCK::pfnIsReadOnly */
46f059bea92bedbd395793702c73946ead235586vboxsyncstatic DECLCALLBACK(bool) drvHostBaseIsReadOnly(PPDMIBLOCK pInterface)
46f059bea92bedbd395793702c73946ead235586vboxsync PDRVHOSTBASE pThis = PDMIBLOCK_2_DRVHOSTBASE(pInterface);
46f059bea92bedbd395793702c73946ead235586vboxsync/** @copydoc PDMIBLOCK::pfnGetSize */
46f059bea92bedbd395793702c73946ead235586vboxsyncstatic DECLCALLBACK(uint64_t) drvHostBaseGetSize(PPDMIBLOCK pInterface)
46f059bea92bedbd395793702c73946ead235586vboxsync PDRVHOSTBASE pThis = PDMIBLOCK_2_DRVHOSTBASE(pInterface);
df2e37f58f19997178bb9be53867a17509a3a2f9vboxsync LogFlow(("%s-%d: drvHostBaseGetSize: returns %llu\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, cb));
46f059bea92bedbd395793702c73946ead235586vboxsync/** @copydoc PDMIBLOCK::pfnGetType */
46f059bea92bedbd395793702c73946ead235586vboxsyncstatic DECLCALLBACK(PDMBLOCKTYPE) drvHostBaseGetType(PPDMIBLOCK pInterface)
46f059bea92bedbd395793702c73946ead235586vboxsync PDRVHOSTBASE pThis = PDMIBLOCK_2_DRVHOSTBASE(pInterface);
46f059bea92bedbd395793702c73946ead235586vboxsync LogFlow(("%s-%d: drvHostBaseGetType: returns %d\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, pThis->enmType));
LogFlow(("%s-%d: drvHostBaseGetUuid: returns VINF_SUCCESS *pUuid=%Vuuid\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, pUuid));
return VINF_SUCCESS;
#define PDMIBLOCKBIOS_2_DRVHOSTBASE(pInterface) ( (PDRVHOSTBASE((uintptr_t)pInterface - RT_OFFSETOF(DRVHOSTBASE, IBlockBios))) )
static DECLCALLBACK(int) drvHostBaseGetGeometry(PPDMIBLOCKBIOS pInterface, uint32_t *pcCylinders, uint32_t *pcHeads, uint32_t *pcSectors)
pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, rc, *pcCylinders, *pcHeads, *pcSectors));
return rc;
static DECLCALLBACK(int) drvHostBaseSetGeometry(PPDMIBLOCKBIOS pInterface, uint32_t cCylinders, uint32_t cHeads, uint32_t cSectors)
return rc;
static DECLCALLBACK(int) drvHostBaseGetTranslation(PPDMIBLOCKBIOS pInterface, PPDMBIOSTRANSLATION penmTranslation)
return rc;
static DECLCALLBACK(int) drvHostBaseSetTranslation(PPDMIBLOCKBIOS pInterface, PDMBIOSTRANSLATION enmTranslation)
return rc;
static DECLCALLBACK(int) drvHostBaseMount(PPDMIMOUNT pInterface, const char *pszFilename, const char *pszCoreDriver)
return VERR_PDM_MEDIA_MOUNTED;
return VERR_NOT_SUPPORTED;
return fRc;
LogFlow(("%s-%d: drvHostBaseLock: already locked\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance));
LogFlow(("%s-%d: drvHostBaseLock: returns %Vrc\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, rc));
return rc;
LogFlow(("%s-%d: drvHostBaseUnlock: not locked\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance));
LogFlow(("%s-%d: drvHostBaseUnlock: returns %Vrc\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, rc));
return rc;
return fRc;
static DECLCALLBACK(void *) drvHostBaseQueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface)
switch (enmInterface)
case PDMINTERFACE_BASE:
case PDMINTERFACE_BLOCK:
case PDMINTERFACE_BLOCK_BIOS:
case PDMINTERFACE_MOUNT:
return NULL;
#ifdef RT_OS_DARWIN
CFStringRef BSDNameStrRef = (CFStringRef)IORegistryEntryCreateCFProperty(Child, CFSTR(kIOBSDNameKey), kCFAllocatorDefault, 0);
if (BSDNameStrRef)
AssertFailed();
return rc;
static void drvHostBaseDADoneCallback(DADiskRef DiskRef, DADissenterRef DissenterRef, void *pvContext)
if (!DissenterRef)
*prc = 0;
SCSI_PREVENT_ALLOW_MEDIUM_REMOVAL, 0, 0, 0, false, 0,
return VINF_SUCCESS;
return VERR_DRIVE_LOCKED;
Log(("%s-%d: calling DADiskClaim on '%s'.\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, szName));
DADiskClaim(pThis->pDADisk, kDADiskClaimOptionDefault, NULL, NULL, drvHostBaseDADoneCallback, &rcDA);
&& !rcDA)
Log(("%s-%d: calling DADiskUnmount on '%s'.\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, szName));
&& !rcDA)
Log(("%s-%d: umount => rc32=%d & rcDA=%#x\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, rc32, rcDA));
Log(("%s-%d: claim => rc32=%d & rcDA=%#x\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, rc32, rcDA));
Log(("%s-%d: failed to open disk '%s'!\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, szName));
#ifdef RT_OS_DARWIN
* (This enumeration must be identical to the one performed in DrvHostBase.cpp.)
kern_return_t krc = IORegistryEntryCreateCFProperties(DVDService, &PropsRef, kCFAllocatorDefault, kNilOptions);
CFDictionaryRef DevCharRef = (CFDictionaryRef)CFDictionaryGetValue(PropsRef, CFSTR(kIOPropertyDeviceCharacteristicsKey));
if (DevCharRef)
if ( ValueRef
if ( ValueRef
krc = IOCreatePlugInInterfaceForService(DVDService, kIOMMCDeviceUserClientTypeID, kIOCFPlugInInterfaceID,
return rc;
int FileDevice = open(pThis->pszDeviceOpen, (pThis->fReadOnlyConfig ? O_RDONLY : O_RDWR) | O_NONBLOCK);
if (FileDevice < 0)
return VINF_SUCCESS;
LogFlow(("%s-%d: drvHostBaseReopen: '%s'\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, pThis->pszDeviceOpen));
LogFlow(("%s-%d: drvHostBaseReopen: '%s' - retry readonly (%Vrc)\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, pThis->pszDeviceOpen, rc));
return rc;
return VINF_SUCCESS;
#ifdef RT_OS_DARWIN
} Buf = {0, 0};
SCSI_READ_CAPACITY, 0, 0, 0, 0, 0, 0,
// Buf.cbBlock = 2048;
return rc;
if (rcNt >= 0)
return VINF_SUCCESS;
switch (rcNt)
return rc;
#ifdef RT_OS_DARWIN
DECLCALLBACK(int) DRVHostBaseScsiCmd(PDRVHOSTBASE pThis, const uint8_t *pbCmd, size_t cbCmd, PDMBLOCKTXDIR enmTxDir,
Assert(enmTxDir == PDMBLOCKTXDIR_NONE || enmTxDir == PDMBLOCKTXDIR_FROM_DEVICE || enmTxDir == PDMBLOCKTXDIR_TO_DEVICE);
if (pcbBuf)
*pcbBuf = 0;
# ifdef RT_OS_DARWIN
if (!ppScsiTaskI)
return VERR_NO_MEMORY;
irc = (*ppScsiTaskI)->SetScatterGatherEntries(ppScsiTaskI, NULL, 0, 0, kSCSIDataTransfer_NoDataTransfer);
irc = (*ppScsiTaskI)->SetTimeoutDuration(ppScsiTaskI, cTimeoutMillies ? cTimeoutMillies : 30000 /*ms*/);
if (pcbBuf)
&& pbSense)
return rc;
return rc;
return rc;
return VINF_SUCCESS;
#ifdef RT_OS_WINDOWS
if (pThis)
PostQuitMessage(0);
switch (wParam)
case DBT_DEVICEARRIVAL:
case DBT_DEVICEREMOVECOMPLETE:
return TRUE;
#ifdef RT_OS_WINDOWS
if (s_hAtomDeviceChange == 0)
HWND hwnd = CreateWindow((LPCTSTR)s_hAtomDeviceChange, "", WS_POPUP, 0, 0, 0, 0, 0, 0, s_classDeviceChange.hInstance, 0);
if (!hwnd)
LogFlow(("%s-%d: drvHostBaseMediaThread: returns VERR_GENERAL_FAILURE\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance));
return VERR_GENERAL_FAILURE;
LogFlow(("%s-%d: drvHostBaseMediaThread: Created hwndDeviceChange=%p\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, hwnd));
bool fFirst = true;
&& cRetries-- > 0)
if (fFirst)
fFirst = false;
return rc;
LogFlow(("%s-%d: drvHostBaseMediaThread: returns VINF_SUCCESS\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance));
return VINF_SUCCESS;
LogFlow(("%s-%d: drvHostBaseMediaThread:\n", pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance));
return VINF_SUCCESS;
LogFlow(("%s-%d: drvHostBaseDestruct: iInstance=%d\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, pDrvIns->iInstance));
int rc;
#ifdef RT_OS_WINDOWS
PostMessage(pThis->hwndDeviceChange, WM_CLOSE, 0, 0); /* default win proc will destroy the window */
if (!rc)
#ifdef RT_OS_DARWIN
* (We're currently not unlocking the device after use. See todo in DevATA.cpp.) */
#ifdef RT_OS_WINDOWS
PostMessage(pThis->hwndDeviceChange, WM_CLOSE, 0, 0); /* default win proc will destroy the window */
#ifdef RT_OS_DARWIN
LogFlow(("%s-%d: releasing exclusive scsi access!\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance));
LogFlow(("%s-%d: releasing the MMC object!\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance));
LogFlow(("%s-%d: releasing the DA session!\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance));
LogFlow(("%s-%d: drvHostBaseDestruct completed\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance));
LogFlow(("%s-%d: DRVHostBaseInitData: iInstance=%d\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, pDrvIns->iInstance));
#ifdef RT_OS_DARWIN
pThis->pDrvBlockPort = (PPDMIBLOCKPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_BLOCK_PORT);
return VERR_PDM_MISSING_INTERFACE_ABOVE;
pThis->pDrvMountNotify = (PPDMIMOUNTNOTIFY)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_MOUNT_NOTIFY);
return rc;
return rc;
pThis->fReadOnlyConfig = enmType == PDMBLOCKTYPE_DVD || enmType == PDMBLOCKTYPE_CDROM ? true : false;
return rc;
return rc;
return rc;
char *psz;
return rc;
return rc;
bool fAttachFailError;
fAttachFailError = true;
#ifdef RT_OS_WINDOWS
return VERR_INVALID_PARAMETER;
return VERR_NO_MEMORY;
return VINF_SUCCESS;
Log(("%s-%d: pszDevice='%s' (%s) cMilliesPoller=%d fReadOnlyConfig=%d fLocked=%d fBIOSVisible=%d Uuid=%Vuuid\n",
pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, pThis->pszDevice, pThis->pszDeviceOpen, pThis->cMilliesPoller,
return VERR_PDM_DRVINS_NO_ATTACH;
rc = pDrvIns->pDrvHlp->pfnSSMRegister(pDrvIns, pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, 1, 0,
return rc;
#ifdef RT_OS_WINDOWS
case PDMBLOCKTYPE_FLOPPY_360:
case PDMBLOCKTYPE_FLOPPY_720:
case PDMBLOCKTYPE_FLOPPY_1_20:
case PDMBLOCKTYPE_FLOPPY_1_44:
case PDMBLOCKTYPE_FLOPPY_2_88:
return VERR_INVALID_PARAMETER;
case PDMBLOCKTYPE_CDROM:
case PDMBLOCKTYPE_DVD:
return VERR_INVALID_PARAMETER;
case PDMBLOCKTYPE_HARD_DISK:
return VERR_INVALID_PARAMETER;
#ifdef RT_OS_DARWIN
#ifndef RT_OS_DARWIN
switch (rc)
case VERR_ACCESS_DENIED:
#ifdef RT_OS_LINUX
return rc;
#ifdef RT_OS_WINDOWS
return rc;
#ifndef RT_OS_WINDOWS
return rc;
return rc;
return rc;
#ifdef RT_OS_WINDOWS
return VERR_GENERAL_FAILURE;
return src;
return rc;