VBoxGuestR0LibSharedFolders.c revision 2c8aed3abc13f4e22f66eda0e135c6197eea8003
/* $Revision$ */
/** @file
* VBoxGuestR0LibSharedFolders - Ring 0 Shared Folders calls.
*/
/*
* Copyright (C) 2006-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/* Entire file is ifdef'ed with !VBGL_VBOXGUEST */
#ifndef VBGL_VBOXGUEST
#ifdef RT_OS_LINUX
# include "VBoxGuestR0LibSharedFolders.h"
# define DbgPrint RTAssertMsg2Weak
#else
# include "VBoxGuestR0LibSharedFolders.h"
#endif
#define SHFL_CPARMS_SET_UTF8 0
#define SHFL_CPARMS_SET_SYMLINKS 0
#define VBOX_INIT_CALL(a, b, c) \
(a)->result = VINF_SUCCESS; \
(a)->u32ClientID = (c)->ulClientID; \
(a)->u32Function = SHFL_FN_##b; \
(a)->cParms = SHFL_CPARMS_##b
#ifndef RT_OS_WINDOWS
# define RtlZeroMemory(a, b) memset (a, 0, b)
#endif
{
int rc = VINF_SUCCESS;
return rc;
}
DECLVBGL(void) vboxUninit (void)
{
VbglTerminate ();
}
{
int rc = VINF_SUCCESS;
/* Log(("VBOXSF: VBoxSF::vboxConnect: VbglHGCMConnect rc = %#x, result = %#x\n",
rc, data.result));
*/
if (RT_SUCCESS (rc))
{
}
if (RT_SUCCESS (rc))
{
}
return rc;
}
{
int rc;
return; /* not connected */
/* Log(("VBOXSF: VBoxSF::vboxDisconnect: "
"VbglHGCMDisconnect rc = %#x, result = %#x\n", rc, data.result));
*/
return;
}
{
int rc = VINF_SUCCESS;
/* Log(("VBOXSF: in ifs difference %d\n",
(char *)&data.flags.type - (char *)&data.callInfo.cParms));
*/
/*
Log(("VBOXSF: VBoxSF::vboxCallQueryMappings: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
if (RT_SUCCESS (rc))
{
}
return rc;
}
DECLVBGL(int) vboxCallQueryMapName (PVBSFCLIENT pClient, SHFLROOT root, SHFLSTRING *pString, uint32_t size)
{
int rc = VINF_SUCCESS;
/* Log(("VBOXSF: VBoxSF::vboxCallQueryMapName: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
return rc;
}
{
int rc = VINF_SUCCESS;
#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
#else
#endif
/* Log(("VBOXSF: VBoxSF::vboxCallMapFolder: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
else if (rc == VERR_NOT_IMPLEMENTED)
{
/* try the legacy interface too; temporary to assure backwards compatibility */
if (RT_SUCCESS (rc))
{
}
}
return rc;
}
{
int rc = VINF_SUCCESS;
/* Log(("VBOXSF: VBoxSF::vboxCallUnmapFolder: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
return rc;
}
{
/** @todo copy buffers to physical or mapped memory. */
int rc = VINF_SUCCESS;
/* Log(("VBOXSF: VBoxSF::vboxCallCreate: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
return rc;
}
{
int rc = VINF_SUCCESS;
/* Log(("VBOXSF: VBoxSF::vboxCallClose: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
return rc;
}
{
int rc = VINF_SUCCESS;
/* Log(("VBOXSF: VBoxSF::vboxCallRemove: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
return rc;
}
{
int rc = VINF_SUCCESS;
/* Log(("VBOXSF: VBoxSF::vboxCallRename: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
return rc;
}
{
int rc = VINF_SUCCESS;
data.buffer.type = (fLocked) ? VMMDevHGCMParmType_LinAddr_Locked_Out : VMMDevHGCMParmType_LinAddr_Out;
/* Log(("VBOXSF: VBoxSF::vboxCallRead: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
return rc;
}
{
int rc = VINF_SUCCESS;
data.buffer.type = (fLocked) ? VMMDevHGCMParmType_LinAddr_Locked_In : VMMDevHGCMParmType_LinAddr_In;
/* Log(("VBOXSF: VBoxSF::vboxCallWrite: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
return rc;
}
DECLVBGL(int) VbglR0SfWritePhysCont(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, RTCCPHYS PhysBuffer)
{
uint32_t cPages = RT_ALIGN_32((PhysBuffer & PAGE_OFFSET_MASK) + cbToWrite, PAGE_SIZE) >> PAGE_SHIFT;
int rc;
if (RT_UNLIKELY(!pData))
return VERR_NO_TMP_MEMORY;
if (RT_SUCCESS (rc))
{
}
return rc;
}
{
int rc = VINF_SUCCESS;
/* Log(("VBOXSF: VBoxSF::vboxCallFlush: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
return rc;
}
DECLVBGL(int) vboxCallDirInfo (
{
int rc = VINF_SUCCESS;
/* Log(("VBOXSF: VBoxSF::vboxCallDirInfo: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
return rc;
}
{
int rc = VINF_SUCCESS;
/* Log(("VBOXSF: VBoxSF::vboxCallFileInfo: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
return rc;
}
{
int rc = VINF_SUCCESS;
/* Log(("VBOXSF: VBoxSF::vboxCallLock: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
return rc;
}
{
int rc = VINF_SUCCESS;
if (RT_SUCCESS (rc))
{
}
return rc;
}
{
int rc = VINF_SUCCESS;
/* Log(("VBOXSF: VBoxSF::vboxCallReadline: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
return rc;
}
DECLVBGL(int) vboxCallSymlink (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pNewPath, PSHFLSTRING pOldPath,
{
int rc = VINF_SUCCESS;
/* Log(("VBOXSF: VBoxSF::vboxCallSymlink: "
"VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
*/
if (RT_SUCCESS (rc))
{
}
return rc;
}
{
int rc = VINF_SUCCESS;
if (RT_SUCCESS (rc))
{
}
return rc;
}
#endif /* !VBGL_VBOXGUEST */