VirtualBox

source: vbox/trunk/src/VBox/Additions/common/VBoxGuestLib/VBGLR3Internal.h@ 27433

Last change on this file since 27433 was 26425, checked in by vboxsync, 15 years ago

alternative license for VBoxGuestLib is CDDL

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 KB
Line 
1/* $Id: VBGLR3Internal.h 26425 2010-02-11 11:37:08Z vboxsync $ */
2/** @file
3 * VBoxGuestR3Lib - Ring-3 support library for the guest additions, Internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 *
26 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
27 * Clara, CA 95054 USA or visit http://www.sun.com if you need
28 * additional information or have any questions.
29 */
30
31#ifndef ___VBGLR3Internal_h
32#define ___VBGLR3Internal_h
33
34#if defined(RT_OS_WINDOWS) /** @todo explain why this is here. */
35# include <Windows.h>
36#endif
37#include <VBox/VMMDev.h>
38#include <VBox/VBoxGuest.h>
39#include <VBox/VBoxGuestLib.h>
40
41RT_C_DECLS_BEGIN
42
43int vbglR3DoIOCtl(unsigned iFunction, void *pvData, size_t cbData);
44int vbglR3GRAlloc(VMMDevRequestHeader **ppReq, uint32_t cb, VMMDevRequestType enmReqType);
45int vbglR3GRPerform(VMMDevRequestHeader *pReq);
46void vbglR3GRFree(VMMDevRequestHeader *pReq);
47
48
49
50DECLINLINE(void) VbglHGCMParmUInt32Set(HGCMFunctionParameter *pParm, uint32_t u32)
51{
52 pParm->type = VMMDevHGCMParmType_32bit;
53 pParm->u.value64 = 0; /* init unused bits to 0 */
54 pParm->u.value32 = u32;
55}
56
57
58DECLINLINE(int) VbglHGCMParmUInt32Get(HGCMFunctionParameter *pParm, uint32_t *pu32)
59{
60 if (pParm->type == VMMDevHGCMParmType_32bit)
61 {
62 *pu32 = pParm->u.value32;
63 return VINF_SUCCESS;
64 }
65 return VERR_INVALID_PARAMETER;
66}
67
68
69DECLINLINE(void) VbglHGCMParmUInt64Set(HGCMFunctionParameter *pParm, uint64_t u64)
70{
71 pParm->type = VMMDevHGCMParmType_64bit;
72 pParm->u.value64 = u64;
73}
74
75
76DECLINLINE(int) VbglHGCMParmUInt64Get(HGCMFunctionParameter *pParm, uint64_t *pu64)
77{
78 if (pParm->type == VMMDevHGCMParmType_64bit)
79 {
80 *pu64 = pParm->u.value64;
81 return VINF_SUCCESS;
82 }
83 return VERR_INVALID_PARAMETER;
84}
85
86
87DECLINLINE(void) VbglHGCMParmPtrSet(HGCMFunctionParameter *pParm, void *pv, uint32_t cb)
88{
89 pParm->type = VMMDevHGCMParmType_LinAddr;
90 pParm->u.Pointer.size = cb;
91 pParm->u.Pointer.u.linearAddr = (uintptr_t)pv;
92}
93
94
95#ifdef ___iprt_string_h
96
97DECLINLINE(void) VbglHGCMParmPtrSetString(HGCMFunctionParameter *pParm, const char *psz)
98{
99 pParm->type = VMMDevHGCMParmType_LinAddr_In;
100 pParm->u.Pointer.size = (uint32_t)strlen(psz) + 1;
101 pParm->u.Pointer.u.linearAddr = (uintptr_t)psz;
102}
103
104#endif /* ___iprt_string_h */
105
106RT_C_DECLS_END
107
108#endif
109
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette